From 6be913b039fd9319efb59efa9e7f2bd7eef18de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 16 Dec 2025 12:16:00 +0800 Subject: [PATCH] =?UTF-8?q?build(boards):=20xpython=E6=9D=BF=E5=8D=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=20`npm=20run=20build:prod`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../micropython_k210_mixgoai/config.json | 27 + .../micropython_k210_mixgoai/index.xml | 2 +- .../main.bundle.3404de6d.js | 21 - boards/default/python_pyodide/index.xml | 2 +- ...le.bce541eb.js => main.bundle.2509889c.js} | 1044 ++++++++--------- 5 files changed, 551 insertions(+), 545 deletions(-) delete mode 100644 boards/default/micropython_k210_mixgoai/main.bundle.3404de6d.js rename boards/default/python_pyodide/{main.bundle.bce541eb.js => main.bundle.2509889c.js} (83%) diff --git a/boards/default/micropython_k210_mixgoai/config.json b/boards/default/micropython_k210_mixgoai/config.json index 814d0f9e..9420b8e5 100644 --- a/boards/default/micropython_k210_mixgoai/config.json +++ b/boards/default/micropython_k210_mixgoai/config.json @@ -50,6 +50,33 @@ "hid": false, "usb": false }, + "burn": { + "erase": true, + "MixGo AI": { + "binFile": [ + { + "offset": "0x0000", + "path": "./build/MixGo_AI-ASR_V2.0.kfpkg" + } + ] + }, + "MixGo AI sensor": { + "binFile": [ + { + "offset": "0x0000", + "path": "./build/MixGo_AI-Sensor_V1.0.kfpkg" + } + ] + }, + "MixGo AI sensor2": { + "binFile": [ + { + "offset": "0x0000", + "path": "./build/MixGo_AI-Sensor_V1.2.kfpkg" + } + ] + } + }, "upload": { "reset": [] } diff --git a/boards/default/micropython_k210_mixgoai/index.xml b/boards/default/micropython_k210_mixgoai/index.xml index e0b053bc..73eac333 100644 --- a/boards/default/micropython_k210_mixgoai/index.xml +++ b/boards/default/micropython_k210_mixgoai/index.xml @@ -1 +1 @@ -666610006506irp_funcirp_func610510,1,2,3051itestThreadtestThreadWHILETRUEHello Mixly from Thread!ms101000tim_callbacktim_callback5000#ff000090151100a10.998124.82110010101000110050110011000110x2x0,1,2,30,1,2,30,1,2,3xMixlyMixlyHelloMixly12365a0MixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixPYI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')mylist1,2,3,4,5mylist0mylist02mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistxmytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xfilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtff0MixlyMixlyMixly,HelloMixlyprompt67MixlyMixly0XFF00FFcode6i2c67400000i2ci2c00i2c00i2ci2cspi20000010045spi200000buf50spi10spi100xffspibufspibuf0xffspi12345spi12345bufow12owowow12345ow12345ow89MixGo AI12345MixGo AI123455socksockmixly.orgsock192.168.0.180sock5sockdatasock1024sockRGB312RGB0000RGB660Motori2cMotor100Motor10241024PID0.400PID01SPK8910MIC8910/sd/MixGo.wavSPK80/sd/MixGo.wavMIC10/sd/MixGo.aviSPK80/sd/MixGo.aviMIC10sensor.B240X240100224224150000000x0000#000000img0x0000#00000000MixGo AI0XFFFF#FFFFFF0X0000#00000089MixGo AI12345mixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012mixio.xbed.cnKPU/sd/MixGoAI.kmodelKPU0.50.35anchorKPUimgKPUimgyolo2calss5MixGo.aiMixGo.aicalssimgASRni-haoASR0.1ASRASRimgimgMixGo.jpgimgimgMixGo.jpgimg0,00xFFFF#FFFFFFimg0,0img0,0,240,240img20imgimgimg00你好,米思齐0xFFFF#FFFFFF12img00MixGo AI0xFFFF#FFFFFF1img160,1201.01.0img10,20,30,400xFFFF#FFFFFF1img10,20,30,400xFFFF#FFFFFF1img10,200xFFFF#FFFFFF130img40,30,200xFFFF#FFFFFF1img10,20,30,400xFFFF#FFFFFF1img1.01.0img3img15img0.050.05img110img110img160,1200xFFFF#FFFFFF0.050.05imgimgimg71,95,-60,-41,-128,12700img1-1,-1,-1, -1,8,-1, -1,-1,-1linecirclerectimg0,0,240,24010002525img0,0,240,2401015img0,0,240,240200021002101010img0,0,240,24010000img71,95,-60,-41,-128,1270,0,240,2400,0,00,0,00,0,0255blobhistogram0.5img71,95,-60,-41,-128,1270,0,240,24020020010img0,0,240,240barcodeqrcodeapriltagimg0,0,240,240img0,0,240,240img0,0,240,240responsehttp://mixio.mixly.cnresponsehttp://mixio.mixly.cnresponse \ No newline at end of file +666610006506irp_funcirp_func610510,1,2,3051itestThreadtestThreadWHILETRUEHello Mixly from Thread!ms101000tim_callbacktim_callback5000#ff000090151100a10.998124.82110010101000110050110011000110x2x0,1,2,30,1,2,30,1,2,3xMixlyMixlyHelloMixly12365a0MixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixPYI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')mylist1,2,3,4,5mylist0mylist02mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistxmytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xfilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtff0MixlyMixlyMixly,HelloMixlyprompt67MixlyMixly0XFF00FFcode6i2c67400000i2ci2c00i2c00i2ci2cspi20000010045spi200000buf50spi10spi100xffspibufspibuf0xffspi12345spi12345bufow12owowow12345ow12345ow89MixGo AI12345MixGo AI123455socksockmixly.cnsock192.168.0.180sock5sockdatasock1024sockRGB312RGB0000RGB660Motori2cMotor100Motor10241024PID0.400PID01SPK8910MIC8910/sd/MixGo.wavSPK80/sd/MixGo.wavMIC10/sd/MixGo.aviSPK80/sd/MixGo.aviMIC10sensor.B240X240100224224150000000x0000#000000img0x0000#00000000MixGo AI0XFFFF#FFFFFF0X0000#00000089MixGo AI12345mixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012mixio.xbed.cnKPU/sd/MixGoAI.kmodelKPU0.50.35anchorKPUimgKPUimgyolo2calss5MixGo.aiMixGo.aicalssimgASRni-haoASR0.1ASRASRimgimgMixGo.jpgimgimgMixGo.jpgimg0,00xFFFF#FFFFFFimg0,0img0,0,240,240img20imgimgimg00你好,米思齐0xFFFF#FFFFFF12img00MixGo AI0xFFFF#FFFFFF1img160,1201.01.0img10,20,30,400xFFFF#FFFFFF1img10,20,30,400xFFFF#FFFFFF1img10,200xFFFF#FFFFFF130img40,30,200xFFFF#FFFFFF1img10,20,30,400xFFFF#FFFFFF1img1.01.0img3img15img0.050.05img110img110img160,1200xFFFF#FFFFFF0.050.05imgimgimg71,95,-60,-41,-128,12700img1-1,-1,-1, -1,8,-1, -1,-1,-1linecirclerectimg0,0,240,24010002525img0,0,240,2401015img0,0,240,240200021002101010img0,0,240,24010000img71,95,-60,-41,-128,1270,0,240,2400,0,00,0,00,0,0255blobhistogram0.5img71,95,-60,-41,-128,1270,0,240,24020020010img0,0,240,240barcodeqrcodeapriltagimg0,0,240,240img0,0,240,240img0,0,240,240responsehttp://mixio.mixly.cnresponsehttp://mixio.mixly.cnresponse \ No newline at end of file diff --git a/boards/default/micropython_k210_mixgoai/main.bundle.3404de6d.js b/boards/default/micropython_k210_mixgoai/main.bundle.3404de6d.js deleted file mode 100644 index ca2d4b81..00000000 --- a/boards/default/micropython_k210_mixgoai/main.bundle.3404de6d.js +++ /dev/null @@ -1,21 +0,0 @@ -(()=>{"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:()=>Ft,controls_typeLists:()=>vt,lists_zip:()=>Pt,lists_zip_container:()=>Vt,lists_zip_item:()=>yt,unpack_iterable_object:()=>Yt,variables_change:()=>Nt,variables_get:()=>Dt,variables_global:()=>ft,variables_set:()=>Lt});var i={};t.r(i),t.d(i,{base_setup:()=>Xt,controls_delay:()=>Gt,controls_end_program:()=>xt,controls_except:()=>$t,controls_finally:()=>te,controls_flow_statements:()=>Kt,controls_for:()=>Qt,controls_forEach:()=>Bt,controls_for_range:()=>jt,controls_if:()=>Ut,controls_if_else:()=>zt,controls_if_elseif:()=>Jt,controls_if_if:()=>qt,controls_lambda:()=>ie,controls_main:()=>kt,controls_pass:()=>ne,controls_range:()=>Ht,controls_repeat_ext:()=>ee,controls_thread:()=>se,controls_try:()=>Zt,controls_try_finally:()=>Wt,controls_whileUntil:()=>wt,datetime_fromtimestamp:()=>_e,do_while:()=>oe,garbage_collection:()=>pe,gene_unique_identifier:()=>re,get_mem_alloc:()=>ue,get_mem_free:()=>ae,get_unique_identifier:()=>le});var n={};t.r(n),t.d(n,{base_map:()=>Pe,generate_cartesian_product:()=>ye,math_arithmetic:()=>me,math_bit:()=>ce,math_constant:()=>Te,math_constant_mp:()=>he,math_constrain:()=>Se,math_dec:()=>Me,math_degree_to_radian:()=>be,math_indexer_number:()=>Le,math_map:()=>De,math_max_min:()=>Ce,math_number:()=>Ie,math_number_base_conversion:()=>Ae,math_radian_to_degree:()=>Ye,math_random:()=>ge,math_random_seed:()=>Ne,math_round:()=>fe,math_selfcalcu:()=>Oe,math_to_int:()=>Ee,math_trig:()=>Re,text_to_number:()=>Fe,text_to_number_skulpt:()=>ve,turn_to_int:()=>Ve});var s={};t.r(s),t.d(s,{ascii_to_char:()=>Be,char_to_ascii:()=>we,number_to_text:()=>We,os_system:()=>mi,text:()=>Xe,text_bytes:()=>xe,text_capital:()=>ti,text_center:()=>ei,text_char:()=>Ue,text_char_at:()=>je,text_char_at2:()=>Qe,text_char_at3:()=>di,text_compareTo:()=>ri,text_compare_to:()=>$e,text_create_with_container:()=>ai,text_create_with_item:()=>li,text_encode:()=>Ti,text_equals_starts_ends:()=>Ze,text_eval:()=>hi,text_find:()=>ii,text_format:()=>ui,text_format_noreturn:()=>Ii,text_join:()=>He,text_join_seq:()=>ni,text_length:()=>Ke,text_random_char:()=>qe,text_replace:()=>si,text_split:()=>oi,text_strip:()=>pi,text_substring:()=>ze,text_substring2:()=>Je,text_substring3:()=>_i,text_textarea:()=>Ge});var o={};t.r(o),t.d(o,{ENUMERATE:()=>Zi,content_in_lists:()=>tn,enumerate:()=>$i,list_many_input:()=>Gi,list_tolist:()=>Bi,list_tolist2:()=>zi,list_trig:()=>bi,lists_2d_get_col_row_data:()=>Ei,lists_2d_get_data_with_col_row:()=>Mi,lists_append_extend:()=>Li,lists_change_to:()=>Xi,lists_change_to_general:()=>Ui,lists_clear:()=>Pi,lists_create_with:()=>Ci,lists_create_with2:()=>wi,lists_create_with_container:()=>gi,lists_create_with_item:()=>Si,lists_create_with_noreturn:()=>xi,lists_create_with_text:()=>Ai,lists_create_with_text2:()=>Wi,lists_del_general:()=>Hi,lists_find:()=>Yi,lists_getIndex3:()=>Ki,lists_getSublist3:()=>Qi,lists_get_index:()=>ci,lists_get_random_item:()=>Ni,lists_get_random_sublist:()=>fi,lists_get_sublist:()=>Ri,lists_insert_value:()=>Fi,lists_insert_value2:()=>qi,lists_pop:()=>yi,lists_remove_at:()=>Vi,lists_remove_at2:()=>Ji,lists_reverse:()=>vi,lists_setIndex3:()=>ji,lists_set_index:()=>Di,lists_sort:()=>ki});var p={};t.r(p),t.d(p,{dicts_add_change_del:()=>On,dicts_add_or_change:()=>ln,dicts_clear:()=>dn,dicts_create_with:()=>nn,dicts_create_with_container:()=>sn,dicts_create_with_item:()=>on,dicts_create_with_noreturn:()=>Mn,dicts_deldict:()=>mn,dicts_delete:()=>_n,dicts_get:()=>un,dicts_get_default:()=>an,dicts_items:()=>In,dicts_keys:()=>pn,dicts_length:()=>hn,dicts_pop:()=>cn,dicts_setdefault:()=>Rn,dicts_to_json:()=>Cn,dicts_to_json2:()=>Sn,dicts_to_to:()=>gn,dicts_todict:()=>En,dicts_update:()=>rn,dicts_values:()=>Tn,json_to_dicts:()=>An});var u={};t.r(u),t.d(u,{logic_boolean:()=>vn,logic_compare:()=>Ln,logic_compare_continous:()=>Nn,logic_is:()=>Yn,logic_is_in:()=>yn,logic_negate:()=>Fn,logic_null:()=>Pn,logic_operation:()=>fn,logic_tobool:()=>bn,logic_true_or_false:()=>Vn});var a={};t.r(a),t.d(a,{sdcard_mount:()=>os,sdcard_use_spi_init:()=>ss,storage_can_write_ornot:()=>Wn,storage_change_dir:()=>is,storage_close_file:()=>Qn,storage_delete_file:()=>qn,storage_file_seek:()=>Zn,storage_file_tell:()=>zn,storage_file_write:()=>Un,storage_fileopen:()=>Xn,storage_fileopen_new:()=>Gn,storage_fileopen_new_encoding:()=>xn,storage_get_a_line:()=>wn,storage_get_contents:()=>Bn,storage_get_contents_without_para:()=>Hn,storage_get_current_dir:()=>$n,storage_get_file_size:()=>Jn,storage_get_filename:()=>Kn,storage_is_file:()=>ns,storage_list_all_files:()=>jn,storage_make_dir:()=>ts,storage_open_file_with_os:()=>kn,storage_rename:()=>es});var l={};t.r(l),t.d(l,{procedures_callnoreturn:()=>_s,procedures_callreturn:()=>rs,procedures_defnoreturn:()=>ps,procedures_defreturn:()=>us,procedures_ifreturn:()=>ds,procedures_mutatorarg:()=>ls,procedures_mutatorcontainer:()=>as,procedures_return:()=>Is});var _={};t.r(_),t.d(_,{tuple_change_to:()=>Ss,tuple_create_llm_params:()=>ys,tuple_create_with:()=>hs,tuple_create_with_container:()=>ms,tuple_create_with_item:()=>Os,tuple_create_with_noreturn:()=>fs,tuple_create_with_text2:()=>cs,tuple_create_with_text_return:()=>Rs,tuple_del:()=>Cs,tuple_find:()=>Ds,tuple_getIndex:()=>Ms,tuple_getSublist:()=>Ns,tuple_get_random_item:()=>vs,tuple_get_sublist:()=>Fs,tuple_input:()=>Vs,tuple_join:()=>As,tuple_length:()=>Es,tuple_max:()=>gs,tuple_totuple:()=>Ps,tuple_trig:()=>Ls});var r={};t.r(r),t.d(r,{set_add_discard:()=>ws,set_clear:()=>Us,set_create_with:()=>bs,set_create_with_container:()=>ks,set_create_with_item:()=>Xs,set_create_with_text_return:()=>Qs,set_length:()=>Gs,set_operate:()=>Hs,set_operate_update:()=>Bs,set_pop:()=>xs,set_sub:()=>Ws,set_toset:()=>js,set_update:()=>Ks});var d={};t.r(d),t.d(d,{html_content:()=>$s,html_content_more:()=>to,html_document:()=>Js,html_form:()=>io,html_head_body:()=>Zs,html_style:()=>eo,html_style_color:()=>so,html_style_content:()=>no,html_text:()=>oo,html_title:()=>zs});var I={};t.r(I),t.d(I,{attribute_access:()=>Mo,function_call:()=>Oo,function_call_container:()=>co,function_call_item:()=>Ro,raw_block:()=>ao,raw_empty:()=>_o,raw_expression:()=>lo,raw_table:()=>uo,text_comment:()=>ro,text_print_multiple:()=>To,text_print_multiple_container:()=>ho,text_print_multiple_item:()=>mo,type_check:()=>Io});var T={};t.r(T),t.d(T,{controls_type:()=>So,controls_typeLists:()=>Do,lists_zip:()=>Lo,unpack_iterable_object:()=>No,variables_change:()=>Ao,variables_get:()=>Eo,variables_global:()=>go,variables_set:()=>Co});var h={};t.r(h),t.d(h,{Panic_with_status_code:()=>Xo,base_setup:()=>Fo,controls_delay:()=>ko,controls_flow_statements:()=>bo,controls_for:()=>Vo,controls_forEach:()=>Bo,controls_for_range:()=>yo,controls_if:()=>vo,controls_interrupts:()=>Uo,controls_lambda:()=>Wo,controls_main:()=>fo,controls_millis:()=>Go,controls_nointerrupts:()=>Ho,controls_pass:()=>Qo,controls_range:()=>wo,controls_repeat:()=>ep,controls_repeat_ext:()=>Jo,controls_thread:()=>jo,controls_try_finally:()=>Po,controls_whileUntil:()=>Yo,datetime_fromtimestamp:()=>ip,do_while:()=>qo,garbage_collection:()=>zo,gene_unique_identifier:()=>np,get_mem_alloc:()=>Zo,get_mem_free:()=>$o,get_unique_identifier:()=>tp,reset:()=>xo,time_sleep:()=>Ko});var m={};t.r(m),t.d(m,{base_map:()=>gp,generate_cartesian_product:()=>Dp,math_arithmetic:()=>ap,math_bit:()=>up,math_constant:()=>op,math_constant_mp:()=>pp,math_constrain:()=>Op,math_dec:()=>dp,math_degree_to_radian:()=>Np,math_indexer_number:()=>Mp,math_map:()=>mp,math_max_min:()=>Tp,math_number:()=>sp,math_number_base_conversion:()=>cp,math_radian_to_degree:()=>Lp,math_random:()=>hp,math_random_seed:()=>Rp,math_round:()=>Ep,math_selfcalcu:()=>lp,math_single:()=>_p,math_to_int:()=>Ip,math_trig:()=>rp,text_to_number:()=>Cp,text_to_number_skulpt:()=>Ap,turn_to_int:()=>Sp});var O={};t.r(O),t.d(O,{ascii_to_char:()=>yp,char_to_ascii:()=>Yp,number_to_text:()=>bp,os_system:()=>ou,text:()=>fp,text_bytes:()=>vp,text_capital:()=>Wp,text_center:()=>Kp,text_char:()=>Pp,text_char_at:()=>Gp,text_char_at2:()=>Xp,text_char_at3:()=>iu,text_compareTo:()=>eu,text_compare_to:()=>Hp,text_encode:()=>nu,text_equals_starts_ends:()=>Up,text_eval:()=>su,text_find:()=>Qp,text_format:()=>Zp,text_format_noreturn:()=>$p,text_join:()=>Vp,text_join_seq:()=>jp,text_length:()=>kp,text_random_char:()=>xp,text_replace:()=>qp,text_split:()=>Jp,text_strip:()=>zp,text_substring:()=>wp,text_substring2:()=>Bp,text_substring3:()=>tu,text_textarea:()=>Fp});var c={};t.r(c),t.d(c,{content_in_lists:()=>Gu,enumerate:()=>Xu,list_many_input:()=>Su,list_tolist:()=>bu,list_tolist2:()=>ku,list_trig:()=>Cu,lists_2d_get_col_row_data:()=>au,lists_2d_get_data_with_col_row:()=>uu,lists_append_extend:()=>Iu,lists_change_to:()=>gu,lists_change_to_general:()=>Lu,lists_clear:()=>cu,lists_create_with:()=>lu,lists_create_with2:()=>fu,lists_create_with_noreturn:()=>Du,lists_create_with_text:()=>_u,lists_create_with_text2:()=>Fu,lists_del_general:()=>Nu,lists_find:()=>Ru,lists_getIndex3:()=>vu,lists_getSublist3:()=>Pu,lists_get_index:()=>ru,lists_get_random_item:()=>Tu,lists_get_random_sublist:()=>hu,lists_get_sublist:()=>pu,lists_insert_value:()=>mu,lists_insert_value2:()=>yu,lists_pop:()=>Eu,lists_remove_at:()=>Mu,lists_remove_at2:()=>Yu,lists_reverse:()=>Ou,lists_setIndex3:()=>Vu,lists_set_index:()=>du,lists_sort:()=>Au});var R={};t.r(R),t.d(R,{dicts_add_change_del:()=>Zu,dicts_add_or_change:()=>wu,dicts_clear:()=>Qu,dicts_create_with:()=>xu,dicts_create_with_noreturn:()=>ea,dicts_deldict:()=>zu,dicts_delete:()=>Wu,dicts_get:()=>Hu,dicts_get_default:()=>Bu,dicts_items:()=>ju,dicts_keys:()=>Uu,dicts_length:()=>Ju,dicts_pop:()=>$u,dicts_setdefault:()=>ta,dicts_to_json:()=>na,dicts_to_json2:()=>pa,dicts_to_to:()=>oa,dicts_todict:()=>ia,dicts_update:()=>Ku,dicts_values:()=>qu,json_to_dicts:()=>sa});var M={};t.r(M),t.d(M,{logic_boolean:()=>ra,logic_compare:()=>ua,logic_compare_continous:()=>aa,logic_is:()=>ha,logic_is_in:()=>Ta,logic_negate:()=>_a,logic_null:()=>da,logic_operation:()=>la,logic_tobool:()=>ma,logic_true_or_false:()=>Ia});var E={};t.r(E),t.d(E,{sdcard_mount:()=>Ga,sdcard_use_spi_init:()=>Xa,storage_can_write_ornot:()=>Sa,storage_change_dir:()=>Va,storage_close_file:()=>La,storage_delete_file:()=>fa,storage_file_seek:()=>Pa,storage_file_tell:()=>va,storage_file_write:()=>Ea,storage_fileopen:()=>ca,storage_fileopen_new:()=>Ra,storage_fileopen_new_encoding:()=>Ma,storage_get_a_line:()=>ga,storage_get_contents:()=>Aa,storage_get_contents_without_para:()=>Ca,storage_get_current_dir:()=>ya,storage_get_file_size:()=>Fa,storage_get_filename:()=>Da,storage_is_file:()=>ka,storage_list_all_files:()=>Na,storage_make_dir:()=>Ya,storage_open_file_with_os:()=>Oa,storage_rename:()=>ba});var C={};t.r(C),t.d(C,{procedures_callnoreturn:()=>Ba,procedures_callreturn:()=>Ha,procedures_defnoreturn:()=>Ua,procedures_defreturn:()=>xa,procedures_ifreturn:()=>wa,procedures_return:()=>Wa});var A={};t.r(A),t.d(A,{tuple_change_to:()=>tl,tuple_create_llm_params:()=>ll,tuple_create_with:()=>Ka,tuple_create_with_noreturn:()=>sl,tuple_create_with_text2:()=>Qa,tuple_create_with_text_return:()=>ja,tuple_del:()=>za,tuple_find:()=>el,tuple_getIndex:()=>qa,tuple_getSublist:()=>nl,tuple_get_random_item:()=>pl,tuple_get_sublist:()=>ol,tuple_input:()=>al,tuple_join:()=>Za,tuple_length:()=>Ja,tuple_max:()=>$a,tuple_totuple:()=>ul,tuple_trig:()=>il});var g={};t.r(g),t.d(g,{set_add_discard:()=>ml,set_clear:()=>Il,set_create_with:()=>_l,set_create_with_text_return:()=>Rl,set_length:()=>rl,set_operate:()=>Tl,set_operate_update:()=>hl,set_pop:()=>dl,set_sub:()=>Ol,set_toset:()=>Ml,set_update:()=>cl});var S={};t.r(S),t.d(S,{html_content:()=>gl,html_content_more:()=>Sl,html_document:()=>El,html_form:()=>Ll,html_head_body:()=>Al,html_style:()=>Dl,html_style_content:()=>Nl,html_text:()=>fl,html_title:()=>Cl});var D={};t.r(D),t.d(D,{attribute_access:()=>bl,function_call:()=>Yl,raw_block:()=>Fl,raw_empty:()=>Pl,raw_expression:()=>vl,raw_table:()=>Vl,type_check:()=>yl});var L={};t.r(L),t.d(L,{actuator_extern_get_led_bright:()=>Wl,actuator_extern_led_bright:()=>wl,actuator_extern_led_brightness:()=>Kl,actuator_get_led_bright:()=>jl,actuator_led_bright:()=>Ql,actuator_led_brightness:()=>ql,actuator_neopixel_init:()=>a_,actuator_neopixel_rgb:()=>l_,actuator_neopixel_write:()=>__,actuator_onboard_neopixel_rgb:()=>r_,actuator_onboard_neopixel_rgb_all:()=>d_,actuator_onboard_neopixel_write:()=>I_,esp32_mixgo_music_play_list_show:()=>u_,esp32_music_get_tempo:()=>t_,esp32_music_pitch:()=>Jl,esp32_music_pitch_with_time:()=>zl,esp32_music_play_list:()=>p_,esp32_music_reset:()=>e_,esp32_music_set_tempo:()=>$l,esp32_music_stop:()=>Zl,esp32_onboard_music_pitch:()=>i_,esp32_onboard_music_pitch_with_time:()=>n_,esp32_onboard_music_play_list:()=>o_,esp32_onboard_music_stop:()=>s_,get_led_bright:()=>h_,led_brightness:()=>m_,led_light:()=>T_,ledswitch:()=>Bl,number:()=>Hl,servo_move:()=>Ul});var N={};t.r(N),t.d(N,{mpython_blynk_app_data:()=>v_,mpython_blynk_app_notify:()=>g_,mpython_blynk_email:()=>L_,mpython_blynk_get_timers:()=>N_,mpython_blynk_on_connected:()=>E_,mpython_blynk_on_disconnected:()=>M_,mpython_blynk_run:()=>A_,mpython_blynk_sensor_data_to_app:()=>F_,mpython_blynk_set_property:()=>D_,mpython_blynk_setup:()=>P_,mpython_blynk_stop_timers:()=>S_,mpython_blynk_sync_virtual:()=>R_,mpython_blynk_terminal_widget_vpin:()=>c_,mpython_blynktimer:()=>f_,mpython_blynktimer_run:()=>C_});var f={};t.r(f),t.d(f,{display_animate:()=>Wr,display_blink_rate:()=>Vr,display_bright_point:()=>sr,display_bright_screen:()=>Pr,display_circle:()=>Kr,display_clear:()=>ir,display_draw_4strings:()=>Sr,display_fill:()=>xr,display_get_pixel:()=>nr,display_get_screen_image:()=>vr,display_get_screen_pixel:()=>Fr,display_help:()=>jr,display_image_builtins:()=>hr,display_image_create:()=>mr,display_image_size:()=>Dr,display_line:()=>Nr,display_line_arbitrarily:()=>fr,display_matrix_use_i2c_init:()=>zr,display_oled_drawPixel:()=>Jr,display_oled_showBitmap:()=>qr,display_onoff:()=>Gr,display_rect:()=>Lr,display_rgb_color:()=>yr,display_scroll_string:()=>br,display_scroll_string_delay:()=>Xr,display_scroll_string_extern:()=>$r,display_show_image:()=>Zr,display_show_image_or_string:()=>Yr,display_show_image_or_string_delay:()=>kr,display_show_static:()=>ur,display_tm1650_power:()=>Hr,display_tm1650_show_dot:()=>wr,display_tm1650_show_num:()=>Br,display_tm_use_i2c_init:()=>Ur,display_triangle:()=>Qr,display_use_i2c_init:()=>gr,esp32_display_is_on:()=>Tr,esp32_display_off:()=>Ir,esp32_display_on:()=>dr,esp32_display_scroll:()=>rr,esp32_display_show_animation:()=>_r,esp32_display_show_default_image:()=>lr,esp32_display_show_string:()=>Rr,group_lcd_init:()=>Er,group_lcd_power:()=>Ar,group_lcd_print:()=>Mr,group_lcd_print2:()=>Cr,image_arithmetic:()=>cr,image_shift:()=>Or,microbit_display_show_image:()=>ar,monitor_show_scroll_string:()=>pr,monitor_show_string:()=>or});var F={};t.r(F),t.d(F,{IOT_CONNECT_OLLAMA:()=>kd,IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>gd,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Ad,IOT_EMQX_PING:()=>Ed,IOT_FORMATTING:()=>Rd,IOT_FORMAT_STRING:()=>Md,IOT_MIXIO_NTP:()=>Cd,IOT_MIXIO_PUBLISH:()=>rd,IOT_MIXIO_PUBLISHEX:()=>dd,IOT_MIXIO_SUBSCRIBE:()=>Id,iot_checkonenet:()=>yd,iot_client_onboard:()=>Dd,iot_connect_ollama:()=>bd,iot_connect_openai:()=>Xd,iot_create_with_item:()=>ld,iot_http_client:()=>Ld,iot_http_data:()=>Nd,iot_mixio_check:()=>md,iot_mixio_connect:()=>_d,iot_mixio_connect_only:()=>hd,iot_mixio_disconnect:()=>Td,iot_mixio_format_msg:()=>cd,iot_mixio_format_topic:()=>Od,iot_mixly_key:()=>Sd,iot_mqtt_client:()=>fd,iot_mqtt_data:()=>Fd,iot_onenet_check:()=>sd,iot_onenet_connect:()=>id,iot_onenet_disconnect:()=>nd,iot_onenet_publish:()=>pd,iot_onenet_publish_dict:()=>od,iot_onenetconnect:()=>Pd,iot_onenetdisconnect:()=>Vd,iot_publish:()=>Yd,iot_publish_container:()=>ud,iot_publish_item:()=>ad,iot_tiny_web_db_count:()=>Kd,iot_tiny_web_db_delete:()=>jd,iot_tiny_web_db_get:()=>Wd,iot_tiny_web_db_init:()=>Hd,iot_tiny_web_db_init_with_mqtt:()=>Bd,iot_tiny_web_db_search:()=>Qd,iot_tiny_web_db_update:()=>wd,iot_wifi_connect:()=>ed,iot_wificonnect:()=>vd,ollama_empty_history:()=>Ud,use_ollama_llm_to_chat:()=>Gd,use_ollama_llm_to_chat_return:()=>xd});var v={};t.r(v),t.d(v,{actuator_extern_get_led_bright:()=>EI,actuator_extern_led_bright:()=>MI,actuator_extern_led_brightness:()=>CI,actuator_get_led_bright:()=>gI,actuator_led_bright:()=>AI,actuator_led_brightness:()=>SI,actuator_neopixel_init:()=>DI,actuator_neopixel_rgb:()=>NI,actuator_neopixel_write:()=>LI,actuator_onboard_neopixel_rgb:()=>FI,actuator_onboard_neopixel_rgb_all:()=>vI,actuator_onboard_neopixel_write:()=>fI,esp32_mixgo_music_play_list_show:()=>hI,esp32_music_get_tempo:()=>lI,esp32_music_pitch:()=>oI,esp32_music_pitch_with_time:()=>pI,esp32_music_play_list:()=>TI,esp32_music_reset:()=>mI,esp32_music_set_tempo:()=>aI,esp32_music_stop:()=>uI,esp32_onboard_music_pitch:()=>_I,esp32_onboard_music_pitch_with_time:()=>rI,esp32_onboard_music_play_list:()=>II,esp32_onboard_music_stop:()=>dI,get_led_bright:()=>VI,led_brightness:()=>yI,led_light:()=>PI,ledswitch:()=>RI,number:()=>cI,servo_move:()=>OI});var P={};t.r(P),t.d(P,{mpython_blynk_app_data:()=>KI,mpython_blynk_app_notify:()=>UI,mpython_blynk_email:()=>QI,mpython_blynk_get_timers:()=>BI,mpython_blynk_on_connected:()=>XI,mpython_blynk_on_disconnected:()=>kI,mpython_blynk_run:()=>xI,mpython_blynk_sensor_data_to_app:()=>WI,mpython_blynk_set_property:()=>jI,mpython_blynk_setup:()=>qI,mpython_blynk_stop_timers:()=>HI,mpython_blynk_sync_virtual:()=>bI,mpython_blynk_terminal_widget_vpin:()=>YI,mpython_blynktimer:()=>wI,mpython_blynktimer_run:()=>GI});var V={};t.r(V),t.d(V,{display_animate:()=>AT,display_blink_rate:()=>aT,display_bright_point:()=>sT,display_bright_screen:()=>uT,display_circle:()=>gT,display_clear:()=>lT,display_draw_4strings:()=>rT,display_fill:()=>cT,display_get_pixel:()=>nT,display_get_screen_image:()=>pT,display_get_screen_pixel:()=>oT,display_image_builtins:()=>iT,display_image_create:()=>eT,display_line:()=>hT,display_line_arbitrarily:()=>dT,display_matrix_use_i2c_init:()=>NT,display_oled_drawPixel:()=>LT,display_oled_showBitmap:()=>DT,display_onoff:()=>mT,display_rect:()=>IT,display_scroll_string:()=>zI,display_scroll_string_delay:()=>tT,display_scroll_string_extern:()=>FT,display_show_image:()=>fT,display_show_image_or_string:()=>JI,display_show_image_or_string_delay:()=>$I,display_show_static:()=>ZI,display_tm1650_power:()=>MT,display_tm1650_show_dot:()=>CT,display_tm1650_show_num:()=>ET,display_tm_use_i2c_init:()=>RT,display_triangle:()=>ST,display_use_i2c_init:()=>_T,image_arithmetic:()=>TT,image_shift:()=>OT});var y={};t.r(y),t.d(y,{IOT_CONNECT_OLLAMA:()=>oh,IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>JT,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>jT,IOT_EMQX_PING:()=>zT,IOT_FORMATTING:()=>KT,IOT_FORMAT_STRING:()=>QT,IOT_MIXIO_NTP:()=>ZT,IOT_MIXIO_PUBLISH:()=>XT,IOT_MIXIO_PUBLISHEX:()=>GT,IOT_MIXIO_SUBSCRIBE:()=>xT,iot_client_onboard:()=>$T,iot_connect_ollama:()=>sh,iot_connect_openai:()=>ph,iot_http_client:()=>th,iot_http_data:()=>eh,iot_mixio_check:()=>BT,iot_mixio_connect:()=>kT,iot_mixio_connect_only:()=>HT,iot_mixio_disconnect:()=>UT,iot_mixio_format_msg:()=>WT,iot_mixio_format_topic:()=>wT,iot_mixly_key:()=>qT,iot_mqtt_client:()=>ih,iot_mqtt_data:()=>nh,iot_onenet_check:()=>YT,iot_onenet_connect:()=>PT,iot_onenet_disconnect:()=>VT,iot_onenet_publish:()=>bT,iot_onenet_publish_dict:()=>yT,iot_tiny_web_db_count:()=>Th,iot_tiny_web_db_delete:()=>mh,iot_tiny_web_db_get:()=>Ih,iot_tiny_web_db_init:()=>_h,iot_tiny_web_db_init_with_mqtt:()=>rh,iot_tiny_web_db_search:()=>hh,iot_tiny_web_db_update:()=>dh,iot_wifi_connect:()=>vT,ollama_empty_history:()=>lh,use_ollama_llm_to_chat:()=>uh,use_ollama_llm_to_chat_return:()=>ah});var Y={};t.r(Y),t.d(Y,{PID_get_pid:()=>bh,PID_init:()=>Yh,actuator_PAC9685_Servo:()=>Nh,actuator_PAC9685_init:()=>Lh,actuator_Servo:()=>Dh,actuator_Servo_init:()=>Sh,actuator_ms32006_dcmotor:()=>Vh,actuator_ms32006_init:()=>Ph,actuator_ms32006_stepper:()=>yh,actuator_rgb_display:()=>vh,actuator_rgb_init:()=>fh,actuator_rgb_set:()=>Fh});var b={};t.r(b),t.d(b,{KPU_analysis:()=>Wh,KPU_forward:()=>wh,KPU_init_yolo2:()=>Hh,KPU_load:()=>xh,KPU_load1:()=>Uh,KPU_run_yolo2:()=>Bh,ai_face_info:()=>tm,ai_face_init:()=>Zh,ai_face_train:()=>$h,ailocal_loading:()=>Jh,ailocal_predict:()=>zh,ailocal_training:()=>qh,aionenet_API:()=>jh,aionenet_nic_init:()=>Kh,aionenet_token:()=>Qh,tuple_anchor:()=>Xh,tuple_calss:()=>Gh});var k={};t.r(k),t.d(k,{audio_play:()=>sm,audio_record:()=>om,mic_init:()=>nm,spk_init:()=>im,video_play:()=>pm,video_record:()=>um});var X={};t.r(X),t.d(X,{camera_getinfo:()=>Cm,camera_init:()=>rm,camera_reset:()=>dm,camera_run:()=>hm,camera_set_colorbar:()=>Em,camera_set_framesize:()=>Tm,camera_set_hmirror:()=>Rm,camera_set_pixformat:()=>Im,camera_set_vflip:()=>Mm,camera_set_windowing:()=>gm,camera_setmun:()=>Am,camera_shutdown:()=>cm,camera_skip_frames:()=>mm,camera_snapshot:()=>Om,mode:()=>lm,size:()=>_m});var G={};t.r(G),t.d(G,{communicate_i2c_available:()=>Hm,communicate_i2c_init:()=>Lm,communicate_i2c_master_read:()=>Um,communicate_i2c_read:()=>fm,communicate_i2c_scan:()=>vm,communicate_i2c_write:()=>Fm,communicate_i2s_init:()=>Nm,communicate_ir_recv:()=>Dm,communicate_ow_init:()=>wm,communicate_ow_read:()=>Km,communicate_ow_reset:()=>qm,communicate_ow_scan:()=>Wm,communicate_ow_select:()=>jm,communicate_ow_write:()=>Qm,communicate_spi_buffer:()=>ym,communicate_spi_init:()=>Pm,communicate_spi_read:()=>Ym,communicate_spi_read_output:()=>bm,communicate_spi_readinto:()=>km,communicate_spi_readinto_output:()=>Xm,communicate_spi_set:()=>Vm,communicate_spi_write:()=>Gm,communicate_spi_write_readinto:()=>xm,i2c_available:()=>_O,i2c_init:()=>Jm,i2c_master_reader2:()=>lO,i2c_read:()=>zm,i2c_scan:()=>$m,i2c_slave_onreceive:()=>Bm,i2c_write:()=>Zm,spi_buffer:()=>iO,spi_init:()=>tO,spi_read:()=>nO,spi_read_output:()=>sO,spi_readinto:()=>oO,spi_readinto_output:()=>pO,spi_set:()=>eO,spi_write:()=>uO,spi_write_readinto:()=>aO});var x={};t.r(x),t.d(x,{angle:()=>dO,lcd_clear:()=>RO,lcd_color:()=>IO,lcd_colour:()=>OO,lcd_display:()=>cO,lcd_draw_string:()=>CO,lcd_init:()=>hO,lcd_mirror:()=>EO,lcd_rotation:()=>MO,lcd_width:()=>mO,on_off:()=>TO,touch_calibrate:()=>gO,touch_info:()=>DO,touch_init:()=>AO,touch_read:()=>SO});var U={};t.r(U),t.d(U,{factory_block:()=>kO,factory_block_notes:()=>UO,factory_block_return:()=>XO,factory_block_return_with_textarea:()=>xO,factory_block_with_textarea:()=>GO,factory_callMethod_noreturn:()=>YO,factory_callMethod_return:()=>bO,factory_create_with_container:()=>vO,factory_create_with_item:()=>PO,factory_declare:()=>yO,factory_from_import:()=>NO,factory_function_noreturn:()=>FO,factory_function_return:()=>VO,factory_import:()=>fO});var H={};t.r(H),t.d(H,{asrloca_config:()=>wO,asrloca_del:()=>KO,asrloca_init:()=>BO,asrloca_recognize:()=>WO});var B={};t.r(B),t.d(B,{image_Histogram:()=>Kc,image_Image:()=>qO,image_Image1:()=>JO,image_RGB:()=>tc,image_apriltag:()=>Hc,image_barcode:()=>Uc,image_binary:()=>Yc,image_blob:()=>Wc,image_cartoon:()=>Nc,image_circle:()=>gc,image_clear:()=>ic,image_compress:()=>ec,image_copy:()=>$O,image_dilate:()=>Fc,image_draw_arrow:()=>dc,image_draw_circle:()=>Tc,image_draw_cross:()=>Ic,image_draw_image:()=>Oc,image_draw_keypoints:()=>mc,image_draw_line:()=>rc,image_draw_rectangle:()=>hc,image_draw_string:()=>_c,image_draw_string_UTF:()=>lc,image_draw_string_flash:()=>ac,image_erode:()=>fc,image_find_apriltags:()=>Gc,image_find_barcodes:()=>kc,image_find_blobs:()=>Bc,image_find_circles:()=>Mc,image_find_hog:()=>$c,image_find_keypoints:()=>tR,image_find_line_segments:()=>Rc,image_find_lines:()=>cc,image_find_qrcodes:()=>Xc,image_find_rects:()=>Ec,image_flood_fill:()=>vc,image_font_free:()=>uc,image_font_load:()=>pc,image_get_histogram:()=>wc,image_get_pixel:()=>oc,image_get_regression:()=>Cc,image_getinfo:()=>zO,image_grayscale_to_rgb:()=>Zc,image_histeq:()=>Dc,image_invert:()=>Vc,image_kptmatch:()=>iR,image_lab_to_rgb:()=>qc,image_lens_corr:()=>yc,image_line:()=>Ac,image_linpolar:()=>Pc,image_match_descriptor:()=>eR,image_mean:()=>Lc,image_morph:()=>bc,image_percentile:()=>Qc,image_qrcode:()=>xc,image_rect:()=>Sc,image_rgb_to_grayscale:()=>zc,image_rgb_to_lab:()=>Jc,image_save:()=>ZO,image_set_pixel:()=>sc,image_threshold:()=>jc,image_tonew:()=>nc,true_false:()=>jO});var w={};t.r(w),t.d(w,{inout_digital_init:()=>oR,inout_digital_read:()=>uR,inout_digital_write:()=>pR,inout_highlow:()=>sR,inout_pin_attachInterrupt:()=>_R,inout_pin_disirq:()=>rR,inout_pwm_init:()=>aR,inout_pwm_write:()=>lR});var W={};t.r(W),t.d(W,{iot_checkonenet:()=>SR,iot_create_with_item:()=>ER,iot_onenet_check:()=>mR,iot_onenet_connect:()=>TR,iot_onenet_disconnect:()=>hR,iot_onenet_publish:()=>cR,iot_onenet_publish_dict:()=>OR,iot_onenetconnect:()=>AR,iot_onenetdisconnect:()=>gR,iot_publish:()=>DR,iot_publish_container:()=>RR,iot_publish_item:()=>MR,iot_wifi_connect:()=>IR,iot_wificonnect:()=>CR});var K={};t.r(K),t.d(K,{base_map:()=>BR,math_arithmetic:()=>FR,math_bit:()=>PR,math_constant:()=>fR,math_constrain:()=>GR,math_indexer_number:()=>UR,math_map:()=>xR,math_max_min:()=>YR,math_max_min1:()=>bR,math_number:()=>NR,math_number_base_conversion:()=>kR,math_random:()=>XR,math_random_seed:()=>HR,math_selfcalcu:()=>vR,math_to_int:()=>yR,math_trig:()=>VR});var Q={};t.r(Q),t.d(Q,{nes_joystick_init:()=>WR,nes_keyboard_init:()=>KR,nes_run:()=>QR});var j={};t.r(j),t.d(j,{network_connect:()=>zR,network_disable_ap:()=>eM,network_disconnect:()=>$R,network_enable_ap:()=>tM,network_ifconfig:()=>ZR,network_init:()=>qR,network_scan:()=>JR,network_socket_close:()=>aM,network_socket_connect:()=>sM,network_socket_getaddrinfo:()=>nM,network_socket_init:()=>iM,network_socket_receive:()=>uM,network_socket_send:()=>pM,network_socket_settimeout:()=>oM});var q={};t.r(q),t.d(q,{pins_analog:()=>dM,pins_analog_pin:()=>IM,pins_axis:()=>LM,pins_brightness:()=>NM,pins_builtinimg:()=>CM,pins_button:()=>mM,pins_dac:()=>TM,pins_dac_pin:()=>hM,pins_digital:()=>_M,pins_digital_dot:()=>VM,pins_digital_pin:()=>rM,pins_exlcdh:()=>SM,pins_exlcdv:()=>DM,pins_imglist:()=>AM,pins_one_more:()=>PM,pins_playlist:()=>gM,pins_pwm:()=>OM,pins_pwm_pin:()=>cM,pins_radio_datarate:()=>vM,pins_radio_power:()=>FM,pins_serial:()=>EM,pins_tone_notes:()=>fM,pins_touch:()=>MM,pins_touch_pin:()=>RM});var J={};t.r(J),t.d(J,{HCSR04:()=>GM,KEY_SELET:()=>YM,sensor_adxl345_get_acceleration:()=>QM,sensor_bmp:()=>HM,sensor_button_init:()=>bM,sensor_button_read:()=>kM,sensor_dht11:()=>XM,sensor_mpu9250_get_acceleration:()=>xM,sensor_mpu9250_get_gyro:()=>WM,sensor_mpu9250_get_magnetic:()=>wM,sensor_mpu9250_temperature:()=>KM,sensor_sht:()=>BM,sensor_use_i2c_init:()=>UM});var z={};t.r(z),t.d(z,{serial_any:()=>tE,serial_print:()=>qM,serial_print_hex:()=>zM,serial_println:()=>JM,serial_read_from_mixgoce:()=>dE,serial_readline:()=>eE,serial_readstr:()=>$M,serial_readstr_until:()=>iE,serial_receive_data_event:()=>ZM,serial_send_to_mixgoce:()=>rE,serial_softserial1:()=>nE,system_input:()=>sE,system_print:()=>oE,system_print_container:()=>lE,system_print_end:()=>uE,system_print_inline:()=>pE,system_print_item:()=>_E,system_print_many:()=>aE});var Z={};t.r(Z),t.d(Z,{Panic_with_status_code:()=>mE,TIM_SELET:()=>TE,Timer_init:()=>SE,base_delay:()=>NE,controls_delay:()=>hE,controls_millis:()=>OE,controls_uname:()=>RE,raw_block:()=>cE,system_gc_collect:()=>CE,system_reset:()=>EE,system_ticks_diff:()=>AE,system_timer:()=>ME,system_timer_init:()=>gE,time_ticks_diff:()=>LE,timer2:()=>DE});var $={};t.r($),t.d($,{LCD_color_seclet:()=>PE,lists_create_with_text1:()=>FE,tuple_create_with_text3:()=>vE});var tt={};t.r(tt),t.d(tt,{PID_get_pid:()=>wE,PID_init:()=>BE,actuator_PAC9685_Servo:()=>bE,actuator_PAC9685_init:()=>YE,actuator_Servo:()=>yE,actuator_Servo_init:()=>VE,actuator_ms32006_dcmotor:()=>UE,actuator_ms32006_init:()=>xE,actuator_ms32006_stepper:()=>HE,actuator_rgb_display:()=>GE,actuator_rgb_init:()=>kE,actuator_rgb_set:()=>XE});var et={};t.r(et),t.d(et,{KPU_analysis:()=>ZE,KPU_forward:()=>zE,KPU_init_yolo2:()=>qE,KPU_load:()=>QE,KPU_load1:()=>jE,KPU_run_yolo2:()=>JE,ai_face_info:()=>uC,ai_face_init:()=>oC,ai_face_train:()=>pC,ailocal_loading:()=>nC,ailocal_predict:()=>sC,ailocal_training:()=>iC,aionenet_API:()=>eC,aionenet_nic_init:()=>$E,aionenet_token:()=>tC,tuple_anchor:()=>WE,tuple_calss:()=>KE});var it={};t.r(it),t.d(it,{audio_play:()=>_C,audio_record:()=>rC,mic_init:()=>lC,spk_init:()=>aC,video_play:()=>dC,video_record:()=>IC});var nt={};t.r(nt),t.d(nt,{camera_getinfo:()=>LC,camera_init:()=>mC,camera_reset:()=>OC,camera_run:()=>MC,camera_set_colorbar:()=>DC,camera_set_framesize:()=>RC,camera_set_hmirror:()=>gC,camera_set_pixformat:()=>cC,camera_set_vflip:()=>SC,camera_set_windowing:()=>fC,camera_setmun:()=>NC,camera_shutdown:()=>AC,camera_skip_frames:()=>EC,camera_snapshot:()=>CC,mode:()=>TC,size:()=>hC});var st={};t.r(st),t.d(st,{communicate_i2c_available:()=>kC,communicate_i2c_init:()=>vC,communicate_i2c_master_read:()=>bC,communicate_i2c_read:()=>VC,communicate_i2c_scan:()=>YC,communicate_i2c_write:()=>yC,communicate_i2s_init:()=>PC,communicate_ir_recv:()=>FC,communicate_ow_init:()=>jC,communicate_ow_read:()=>zC,communicate_ow_reset:()=>JC,communicate_ow_scan:()=>qC,communicate_ow_select:()=>$C,communicate_ow_write:()=>ZC,communicate_spi_buffer:()=>UC,communicate_spi_init:()=>GC,communicate_spi_read:()=>HC,communicate_spi_read_output:()=>BC,communicate_spi_readinto:()=>wC,communicate_spi_readinto_output:()=>WC,communicate_spi_set:()=>xC,communicate_spi_write:()=>KC,communicate_spi_write_readinto:()=>QC,i2c_slave_onreceive:()=>XC});var ot={};t.r(ot),t.d(ot,{angle:()=>tA,lcd_clear:()=>uA,lcd_color:()=>eA,lcd_colour:()=>sA,lcd_display:()=>pA,lcd_draw_string:()=>_A,lcd_init:()=>nA,lcd_mirror:()=>lA,lcd_rotation:()=>aA,lcd_width:()=>oA,on_off:()=>iA,touch_calibrate:()=>dA,touch_info:()=>TA,touch_init:()=>rA,touch_read:()=>IA});var pt={};t.r(pt),t.d(pt,{factory_block:()=>CA,factory_block_notes:()=>DA,factory_block_return:()=>AA,factory_block_return_with_textarea:()=>SA,factory_block_with_textarea:()=>gA,factory_callMethod_noreturn:()=>MA,factory_callMethod_return:()=>EA,factory_declare:()=>RA,factory_from_import:()=>hA,factory_function_noreturn:()=>OA,factory_function_return:()=>cA,factory_import:()=>mA});var ut={};t.r(ut),t.d(ut,{asrloca_config:()=>NA,asrloca_del:()=>FA,asrloca_init:()=>LA,asrloca_recognize:()=>fA});var at={};t.r(at),t.d(at,{image_Histogram:()=>fg,image_Image:()=>VA,image_Image1:()=>yA,image_RGB:()=>PA,image_apriltag:()=>Sg,image_barcode:()=>Ag,image_binary:()=>cg,image_blob:()=>Ng,image_cartoon:()=>rg,image_circle:()=>ug,image_clear:()=>wA,image_compress:()=>BA,image_copy:()=>HA,image_dilate:()=>Ig,image_draw_arrow:()=>qA,image_draw_circle:()=>zA,image_draw_cross:()=>JA,image_draw_image:()=>tg,image_draw_keypoints:()=>$A,image_draw_line:()=>jA,image_draw_rectangle:()=>ZA,image_draw_string:()=>UA,image_draw_string_UTF:()=>xA,image_draw_string_flash:()=>GA,image_erode:()=>dg,image_find_apriltags:()=>Cg,image_find_barcodes:()=>Mg,image_find_blobs:()=>Dg,image_find_circles:()=>ng,image_find_hog:()=>bg,image_find_keypoints:()=>kg,image_find_line_segments:()=>ig,image_find_lines:()=>eg,image_find_qrcodes:()=>Eg,image_find_rects:()=>sg,image_flood_fill:()=>Tg,image_font_free:()=>kA,image_font_load:()=>XA,image_get_histogram:()=>Lg,image_get_pixel:()=>QA,image_get_regression:()=>og,image_getinfo:()=>YA,image_grayscale_to_rgb:()=>Yg,image_histeq:()=>lg,image_invert:()=>mg,image_kptmatch:()=>Gg,image_lab_to_rgb:()=>Pg,image_lens_corr:()=>Og,image_line:()=>pg,image_linpolar:()=>hg,image_match_descriptor:()=>Xg,image_mean:()=>_g,image_morph:()=>Rg,image_percentile:()=>Fg,image_qrcode:()=>gg,image_rect:()=>ag,image_rgb_to_grayscale:()=>yg,image_rgb_to_lab:()=>Vg,image_save:()=>bA,image_set_pixel:()=>KA,image_threshold:()=>vg,image_tonew:()=>WA,true_false:()=>vA});var lt={};t.r(lt),t.d(lt,{PGA_SELET:()=>xg,inout_adc_Vread:()=>qg,inout_adc_init:()=>Qg,inout_adc_read:()=>jg,inout_digital_init:()=>Hg,inout_digital_read:()=>wg,inout_digital_write:()=>Bg,inout_highlow:()=>Ug,inout_pin_attachInterrupt:()=>Jg,inout_pin_disirq:()=>zg,inout_pwm_init:()=>Wg,inout_pwm_write:()=>Kg});var _t={};t.r(_t),t.d(_t,{iot_onenet_check:()=>iS,iot_onenet_connect:()=>$g,iot_onenet_disconnect:()=>tS,iot_onenet_publish:()=>nS,iot_onenet_publish_dict:()=>eS,iot_wifi_connect:()=>Zg});var rt={};t.r(rt),t.d(rt,{base_map:()=>MS,math_arithmetic:()=>uS,math_bit:()=>pS,math_constant:()=>oS,math_constrain:()=>mS,math_indexer_number:()=>RS,math_map:()=>hS,math_max_min:()=>dS,math_max_min1:()=>IS,math_number:()=>sS,math_number_base_conversion:()=>OS,math_random:()=>TS,math_random_seed:()=>cS,math_selfcalcu:()=>aS,math_single:()=>lS,math_to_int:()=>rS,math_trig:()=>_S});var dt={};t.r(dt),t.d(dt,{nes_joystick_init:()=>ES,nes_keyboard_init:()=>CS,nes_run:()=>AS});var It={};t.r(It),t.d(It,{network_connect:()=>DS,network_disable_ap:()=>FS,network_disconnect:()=>NS,network_enable_ap:()=>fS,network_ifconfig:()=>LS,network_init:()=>gS,network_scan:()=>SS,network_server:()=>vS,network_socket_close:()=>XS,network_socket_connect:()=>yS,network_socket_getaddrinfo:()=>VS,network_socket_init:()=>PS,network_socket_receive:()=>bS,network_socket_send:()=>kS,network_socket_settimeout:()=>YS});var Tt={};t.r(Tt),t.d(Tt,{pins_analog:()=>BS,pins_analog_pin:()=>HS,pins_axis:()=>eD,pins_brightness:()=>sD,pins_builtinimg:()=>ZS,pins_button:()=>xS,pins_dac:()=>QS,pins_dac_pin:()=>KS,pins_digital:()=>GS,pins_digital_dot:()=>lD,pins_digital_pin:()=>US,pins_exlcdh:()=>iD,pins_exlcdv:()=>nD,pins_imglist:()=>$S,pins_interrupt:()=>JS,pins_one_more:()=>aD,pins_playlist:()=>tD,pins_pwm:()=>WS,pins_pwm_pin:()=>wS,pins_radio_datarate:()=>uD,pins_radio_power:()=>pD,pins_serial:()=>zS,pins_tone_notes:()=>oD,pins_touch:()=>qS,pins_touch_pin:()=>jS});var ht={};t.r(ht),t.d(ht,{HCSR04:()=>TD,KEY_SELET:()=>_D,sensor_adxl345_get_acceleration:()=>cD,sensor_bmp:()=>DD,sensor_button_init:()=>rD,sensor_button_read:()=>dD,sensor_compass_reset:()=>gD,sensor_dht11:()=>ID,sensor_mpu9250_attachGestureInterrupt:()=>hD,sensor_mpu9250_calibrate_compass:()=>ED,sensor_mpu9250_field_strength:()=>AD,sensor_mpu9250_gesture:()=>mD,sensor_mpu9250_get_acceleration:()=>OD,sensor_mpu9250_get_gyro:()=>MD,sensor_mpu9250_get_magnetic:()=>RD,sensor_mpu9250_temperature:()=>CD,sensor_sht:()=>LD,sensor_use_i2c_init:()=>SD});var mt={};t.r(mt),t.d(mt,{UART_SELET:()=>ND,serial_any:()=>PD,serial_print:()=>fD,serial_print_hex:()=>vD,serial_println:()=>FD,serial_read_from_mixgoce:()=>HD,serial_readline:()=>yD,serial_readstr:()=>VD,serial_send_to_mixgoce:()=>UD,serial_softserial1:()=>YD,system_input:()=>bD,system_print:()=>kD,system_print_end:()=>GD,system_print_inline:()=>XD,system_print_many:()=>xD});var Ot={};t.r(Ot),t.d(Ot,{Panic_with_status_code:()=>tL,TIM_SELET:()=>BD,Timer_init:()=>rL,base_delay:()=>TL,controls_delay:()=>uL,controls_end_program:()=>iL,controls_millis:()=>eL,controls_uname:()=>pL,reset:()=>nL,system_device_name:()=>ZD,system_device_serial_number:()=>$D,system_event_bus_source:()=>JD,system_event_bus_value:()=>zD,system_gc_collect:()=>oL,system_on_event:()=>QD,system_raise_event:()=>KD,system_reset:()=>sL,system_run_in_background:()=>wD,system_ticks_diff:()=>lL,system_timer:()=>aL,system_timer_init:()=>_L,system_timestamp:()=>jD,system_value:()=>qD,system_wait:()=>WD,time_ticks_diff:()=>IL,timer2:()=>dL});var ct={};t.r(ct),t.d(ct,{LCD_color_seclet:()=>cL,LCD_color_seclet1:()=>OL,lists_create_with_text1:()=>hL,tuple_create_with_text3:()=>mL});const Rt=Blockly,Mt=Mixly,Et={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;n1&&(p+=n)):i=p}else i="i";return i}},Ct=Et; -/** - * @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 At{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var i=t.split(","),n=0;n0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ht={init:function(){this.setColour(bt),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.PYTHON_RANGE).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Bt={init:function(){this.setColour(bt),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Rt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Rt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},wt={init:function(){this.setColour(bt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Rt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Rt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Wt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Rt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Kt={init:function(){this.setColour(bt);var t=new Rt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Qt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Rt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},jt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Rt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};wt.OPERATORS=[[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],Kt.OPERATORS=[[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const qt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Jt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},zt={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Rt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Zt={init:function(){this.setColour(bt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},$t={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},te={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Rt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},ee={init:function(){this.jsonInit({message0:Rt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:bt,tooltip:Rt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Rt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ie={init:function(){this.setColour(bt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_STAT),this.setOutput(!0)}},ne={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},se={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},oe={init:function(){this.appendDummyInput().appendField(Rt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Rt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Rt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Rt.FieldDropdown([[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(bt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},pe={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ue={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},ae={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},le={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET+Rt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_GET_UNIQUE_IDEN)}},_e={init:function(){this.setColour(bt),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},re={init:function(){this.setColour(bt),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},de=230;Rt.FieldTextInput.math_number_validator=function(t){return String(t)},Rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Ie={init:function(){this.setColour(de),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},Te={init:function(){this.setColour(de);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},he={init:function(){this.setColour(de);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},me={init:function(){this.setColour(de),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Oe={init:function(){this.setColour(de),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ce={init:function(){this.setColour(de),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Re={init:function(){this.setColour(de),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Me={init:function(){var t=[[Rt.Msg.MATH_BIN,"bin"],[Rt.Msg.MATH_OCT,"oct"],[Rt.Msg.MATH_HEX,"hex"]];this.setColour(de),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Rt.Msg.MATH_DEC_TOOLTIP_BIN,oct:Rt.Msg.MATH_DEC_TOOLTIP_OCT,hex:Rt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ee={init:function(){var t=[[Rt.Msg.LANG_MATH_TO_ROUND,"round"],[Rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[Rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[Rt.Msg.MATH_ABS,"fabs"],[Rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(de),this.appendValueInput("A").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Ce={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(de),this.appendValueInput("A").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Ae={init:function(){var t=[[Rt.Msg.MATH_TWO,"two"],[Rt.Msg.MATH_EIGHT,"eight"],[Rt.Msg.MATH_TEN,"ten"],[Rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(de),this.appendDummyInput("").appendField(Rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Rt.FieldDropdown(t),"OP").appendField(Rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MATH_ZHW).appendField(new Rt.FieldDropdown(t),"OP2").appendField(Rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Rt.Msg.MATH_Before_two,eight:Rt.Msg.MATH_Before_eight,ten:Rt.Msg.MATH_Before_ten,sixteen:Rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Rt.Msg.MATH_Behind_two,eight:Rt.Msg.MATH_Behind_eight,ten:Rt.Msg.MATH_Behind_ten,sixteen:Rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},ge={init:function(){var t=[[Rt.Msg.LANG_MATH_INT,"int"],[Rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(de),this.setOutput(!0,Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Rt.Msg.LANG_MATH_INT,float:Rt.Msg.LANG_MATH_FLOAT_RANDOM};return Rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Se={init:function(){this.setColour(de),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},De={init:function(){this.setColour(de),this.appendValueInput("NUM",Number).appendField(Rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Le={init:function(){this.setColour(de),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},Ne={init:function(){this.setColour(de),this.appendValueInput("NUM").setCheck(Number).appendField(Rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},fe={init:function(){this.setColour(de),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Rt.Msg.MATH_ROUND).appendField(Rt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Rt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Fe={init:function(){var t=[[Rt.Msg.MIXLY_TO_INT,"int"],[Rt.Msg.MIXLY_TO_FLOAT,"float"],[Rt.Msg.MIXLY_TO_BITES,"b"],[Rt.Msg.LANG_MATH_BYTE+Rt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(de),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},ve={init:function(){var t=[[Rt.Msg.MIXLY_TO_INT,"int"],[Rt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(de),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Rt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Pe=De,Ve={init:function(){this.setColour(de),this.appendValueInput("VAR").appendField(Rt.Msg.LANG_MATH_BYTE+Rt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},ye={init:function(){this.setColour(de),this.itemCount_=1,this.setMutator(new Rt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Rt.Msg.MIXLY_PRODUCT+Rt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Rt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Rt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Rt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ue={init:function(){this.setColour(ke),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Rt.FieldTextInput("",Rt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Rt.FieldImage(e,7,12,'"')}},He={init:function(){this.setColour(ke),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Rt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Be={init:function(){this.setColour(ke),this.appendValueInput("VAR").setCheck(Number).appendField(Rt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},we={init:function(){this.setColour(ke),this.appendValueInput("VAR").setCheck(String).appendField(Rt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},We={init:function(){this.setColour(ke),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},Ke={init:function(){this.setColour(ke),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},Qe={init:function(){this.WHERE_OPTIONS=[[Rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Rt.Msg.TEXT_GET_INDEX_RANDOM+1+Rt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ke),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.LISTS_GET_INDEX_GET,"MODE"),Rt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Rt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=Rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+Rt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Rt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:Rt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Rt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Rt.Msg.TEXT_GET_INDEX_RANDOM};return Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+Rt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Rt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Rt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Rt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},je={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ke),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Rt.Msg.LISTS_GET_INDEX_GET+" "+Rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Rt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Rt.Msg.PROCEDURES_DEFRETURN_RETURN+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+Rt.Msg.LISTS_GET_INDEX_FROM_START+"n"+Rt.Msg.TEXT_CHARAT2)}},qe={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ke),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Rt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Rt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Je={init:function(){this.WHERE_OPTIONS_1=[[Rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Rt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Rt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Rt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Rt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ke),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Rt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==Rt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new Rt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},ze={init:function(){this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ke),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Rt.Msg.LISTS_GET_INDEX_GET+" "+Rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Rt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Rt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ze={init:function(){var t=[[Rt.Msg.MIXLY_EQUALS,"==="],[Rt.Msg.MIXLY_STARTSWITH,"startswith"],[Rt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ke),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Rt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},$e={init:function(){this.setColour(ke),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Rt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_COMPARETO_HELP)}},ti={init:function(){var t=[[Rt.Msg.TEXT_UPPER,"upper"],[Rt.Msg.TEXT_TITLE,"title"],[Rt.Msg.TEXT_CAPITALIZE,"capitalize"],[Rt.Msg.TEXT_SWAPCASE,"swapcase"],[Rt.Msg.TEXT_LOWER,"lower"]];this.setColour(ke),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Rt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Rt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Rt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Rt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Rt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Rt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},ei={init:function(){var t=[[Rt.Msg.TEXT_LJUST,"ljust"],[Rt.Msg.TEXT_CENTER,"center"],[Rt.Msg.TEXT_RJUST,"rjust"]];this.setColour(ke),this.appendValueInput("VAR").appendField(new Rt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Rt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ii={init:function(){this.setColour(ke),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Rt.Msg.MIXLY_MID+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Rt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},ni={init:function(){this.setColour(ke),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},si={init:function(){this.setColour(ke),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Rt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Rt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},oi={init:function(){this.setColour(ke),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Rt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Rt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},pi={init:function(){var t=[[Rt.Msg.TEXT_TRIM_BOTH,"strip"],[Rt.Msg.TEXT_TRIM_LEFT,"lstrip"],[Rt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ke),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Rt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Rt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Rt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Rt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Rt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ui={init:function(){this.setColour(ke),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Rt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Rt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},sn={init:function(){this.setColour(en),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},on={init:function(){this.setColour(en),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},pn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_KEYS),this.setTooltip(Rt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},un={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Rt.Msg.DICTS_GET_TOOLTIP)}},an={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Rt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Rt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},ln={init:function(){this.setColour(en),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},_n={init:function(){this.setColour(en),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Rt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_DELETE_TOOLTIP)}},rn={init:function(){this.setColour(en),this.appendValueInput("DICT2").setCheck("Dict").appendField(Rt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Rt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MID),this.setTooltip(Rt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_CLEAR),this.setTooltip(Rt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},In={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_ITEMS),this.setTooltip(Rt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Tn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_VALUES),this.setTooltip(Rt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},hn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_LENGTH),this.setTooltip(Rt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},mn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.DICT_DELDICT),this.setTooltip(Rt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},On={init:function(){this.MODE=[[Rt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Rt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Rt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Rt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Rt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Rt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Rt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},cn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Rt.Msg.DICTS_ADD_VALUE),this.setTooltip(Rt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Rn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Rt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Rt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Mn={init:function(){this.setColour(en),this.appendDummyInput("").appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Rt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},En={init:function(){this.setColour(en),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Cn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},An={init:function(){this.setColour(en),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},gn={init:function(){this.setColour(en),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Sn={init:function(){this.setColour(en),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_TO_JSON),this.setTooltip(Rt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Dn=210,Ln={init:function(){var t=Rt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Dn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Rt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Rt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Rt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Rt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Rt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Rt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Nn={init:function(){var t=Rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Dn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Rt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},fn={init:function(){var t=[[Rt.Msg.LOGIC_OPERATION_AND,"AND"],[Rt.Msg.LOGIC_OPERATION_OR,"OR"],[Rt.Msg.LOGIC_OPERATION_NOR,"NOR"],[Rt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Dn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Rt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Rt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Fn={init:function(){this.setColour(Dn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Rt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Rt.Msg.LOGIC_NEGATE_TOOLTIP)}},vn={init:function(){var t=[[Rt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Rt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Dn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Rt.FieldDropdown(t),"BOOL"),this.setTooltip(Rt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Pn={init:function(){this.setColour(Dn),this.setOutput(!0),this.appendDummyInput().appendField(Rt.Msg.LOGIC_NULL),this.setTooltip(Rt.Msg.LOGIC_NULL_TOOLTIP)}},Vn={init:function(){this.setColour(Dn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Rt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Rt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},yn={init:function(){var t=[[Rt.Msg.TEXT_APPEND_TO,"in"],[Rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Dn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Rt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Rt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Rt.Msg.IN)}},Yn={init:function(){var t=[[Rt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Dn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},bn={init:function(){this.setColour(Dn),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},kn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Rt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"],[Rt.Msg.MIXLY_ADD,"a"],[Rt.Msg.MATH_BIN+Rt.Msg.MIXLY_ADD,"ab"],[Rt.Msg.MIXLY_R_W,"r+"],[Rt.Msg.MATH_BIN+Rt.Msg.MIXLY_R_W,"rb+"],[Rt.Msg.MIXLY_W_R,"w+"],[Rt.Msg.MATH_BIN+Rt.Msg.MIXLY_W_R,"wb+"],[Rt.Msg.MIXLY_A_R,"a+"],[Rt.Msg.MATH_BIN+Rt.Msg.MIXLY_A_R,"ab+"]]),"MODE"),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Gn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG,p=Rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+p}))}},xn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Rt.Msg.MIXPY_TEXT_ENCODE).appendField(new Rt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_USE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=Rt.Msg.MIXLY_BELONG,p=Rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+p}))}},Un={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Hn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MICROBIT_PYTHON_TYPE)}},Wn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.HTML_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},jn={init:function(){this.setColour(0),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const qn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},zn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Zn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},$n={init:function(){this.setColour(0),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},ts={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Rt.Msg.MIXLY_ESP32_SET+{mkdir:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},es={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Rt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},is={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},ns={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.HTML_FILE,"isfile"],[Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},ss={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Rt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},os={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Rt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},ps={init:function(){var t=Rt.Procedures.findLegalName("",this),e=new Rt.FieldTextInput(t,Rt.Procedures.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new Rt.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Rt.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Rt.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Rt.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Rt.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(Rt.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=Rt.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Rt.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{Rt.Events.enable()}},mutationToDom:function(t){var e=Rt.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(Rt.Msg.MIXLY_AIP_ATTR).setAlign(Rt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eo={init:function(){this.setColour(qs),this.appendDummyInput().appendField(Rt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},io={init:function(){this.setColour(qs),this.appendDummyInput().appendField(Rt.Msg.HTML_FORM_CONTENT).appendField(new Rt.FieldDropdown([[Rt.Msg.HTML_TEXT,"text"],[Rt.Msg.HTML_EMAIL,"email"],[Rt.Msg.HTML_NUMBER,"number"],[Rt.Msg.HTML_PASSWORD,"password"],[Rt.Msg.HTML_CHECKBOX,"checkbox"],[Rt.Msg.HTML_RADIOBUTTON,"radiobutton"],[Rt.Msg.HTML_BUTTON,"button"],[Rt.Msg.HTML_COLOUR,"colour"],[Rt.Msg.HTML_DATE,"date"],[Rt.Msg.HTML_LOCALTIME,"local time"],[Rt.Msg.HTML_FILE,"file"],[Rt.Msg.HTML_HIDDEN,"hidden"],[Rt.Msg.HTML_IMAGE,"image"],[Rt.Msg.HTML_MONTH,"month"],[Rt.Msg.HTML_RANGE,"range"],[Rt.Msg.HTML_RESET,"reset"],[Rt.Msg.HTML_SEARCH,"search"],[Rt.Msg.HTML_SUBMIT,"submit"],[Rt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Rt.Msg.HTML_TIME,"time"],[Rt.Msg.HTML_URL,"url"],[Rt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Rt.Msg.HTML_NAME).appendField(new Rt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Rt.Msg.HTML_VALUE).appendField(new Rt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Rt.Msg.MIXLY_AIP_ATTR).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},no={init:function(){this.setColour(qs),this.appendDummyInput().appendField(new Rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new Rt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},so={init:function(){this.setColour(qs),this.appendDummyInput().appendField(new Rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new Rt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},oo={init:function(){this.setColour(qs),this.appendDummyInput().appendField(Rt.Msg.HTML_TEXT).appendField(new Rt.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},po=160,uo={init:function(){this.setColour(po),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Rt.FieldTable(""),"TEXT")}},ao={init:function(){this.setColour(po),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Rt.FieldMultilineInput(""),"TEXT")}},lo={init:function(){this.setColour(po),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Rt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},_o={init:function(){this.setColour(po),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},ro={init:function(){this.setColour(po),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Rt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Io={init:function(){this.setColour(po),this.appendValueInput("VALUE").appendField(Rt.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},To={init:function(){this.setColour(po),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Rt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+l()+"("+t+", "+e+", "+i+")"},Rt.isNumber(n)&&Rt.isNumber(s)&&Rt.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const la=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var p=s+" and "+o;else if("OR"==i)p=s+" or "+o;else if("NOR"==i)p="not("+s+"^"+o+")";else p=s+"^"+o;return[p,n]},_a=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},ra=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},da=function(t,e){return["None",e.ORDER_ATOMIC]},Ia=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Ta=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},ha=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]},ma=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Oa=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},ca=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Ra=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Ma=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},Ea=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Ca=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Aa=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]},ga=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Sa=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Da=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},La=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Na=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},fa=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Fa=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},va=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Pa=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"},Va=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ya=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ya=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ba=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"},ka=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]},Xa=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"},Ga=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"},xa=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),Rt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],p=0;p\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Cl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},Al=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},gl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Sl=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Dl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Ll=function(t,e){return'"},Nl=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},fl=function(){return this.getFieldValue("TEXT")+"\n"},Fl=function(t){return t.getFieldValue("TEXT")+"\n"},vl=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},Pl=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Vl=function(){return""},yl=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Yl=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+i.join("\n")+n.join("\n")+p.join("\n")+u.join("")+t+"while True:\n"+a.join("")+l.join("\n"):e.join("\n")+i.join("\n")+n.join("\n")+p.join("\n")+u.join("")+t+l.join("\n")},Gl.scrubNakedValue=function(t){return t+"\n"},Gl.quote_=function(t){var e="'";return-1!==t.indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Gl.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Gl.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=Rt.utils.string.wrap(o,Gl.COMMENT_WRAP-3),n+=Gl.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const xl=100,Ul={init:function(){this.setColour(xl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_SERVO).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("DEGREE",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DEGREE_0_180),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SERVO_MOVE)}},Hl={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["1","1"],["2","2"]]),"op"),this.setOutput(!0)}},Bl={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ESP32_ON,"1"],[Rt.Msg.MIXLY_ESP32_OFF,"0"],[Rt.Msg.MIXLY_ESP32_TOGGLE,"-1"]]),"flag"),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},wl={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_SETONOFF)}},Wl={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_GETONOFF)}},Kl={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING).appendField(Rt.Msg.MIXLY_EXTERN_LED),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_EXTERN_LED_SETBRIGHT)}},Ql={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_SETONOFF)}},jl={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendDummyInput().appendField(Rt.Msg.MIXLY_PULSEIN_STAT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_GETONOFF)}},ql={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SETTING),this.appendValueInput("led").appendField(Rt.Msg.MIXLY_BUILDIN_LED),this.appendValueInput("bright").appendField(Rt.Msg.MIXLY_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_LED_SETBRIGHT)}},Jl={init:function(){this.setColour(xl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_TONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},zl={init:function(){this.setColour(xl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_TONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},Zl={init:function(){this.setColour(xl),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_NOTONE).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$l={init:function(){this.setColour(xl),this.appendValueInput("TICKS").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_SET_TEMPO).appendField(Rt.Msg.MICROBIT_ACTUATOR_ticks),this.appendValueInput("BPM").setCheck(Number).appendField(Rt.Msg.MIXLY_SPEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_SET_TEMPO)}},t_={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Get_current_tempo),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_GET_TEMPO)}},e_={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Reset_music),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_RESET)}},i_={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE)}},n_={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TONE),this.appendValueInput("pitch").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DURATION),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_TONE2)}},s_={init:function(){this.setColour(xl),this.appendDummyInput().appendField(Rt.Msg.MIXLY_NOTONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},o_={init:function(){this.setColour(xl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},p_={init:function(){this.setColour(xl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.appendValueInput("PIN").setCheck(Number).appendField(Rt.Msg.MIXLY_PIN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS)}},u_={init:function(){this.setColour(xl),this.appendValueInput("LIST").appendField(Rt.Msg.MIXLY_ESP32_MUSIC_PLAY_LISTS),this.appendValueInput("PIN").setCheck(Number).appendField(Rt.Msg.MIXLY_PIN),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_MIXGO_MUSIC_PLAY_TONE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_PLAYSHOW)}},a_={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("PIN",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_PIN),this.appendValueInput("LEDCOUNT").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_COUNT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_RGB_PIN_COUNT)}},l_={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},__={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_WRI)}},r_={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},d_={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("RVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_R),this.appendValueInput("GVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_G),this.appendValueInput("BVALUE").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_B),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},I_={init:function(){this.setColour(xl),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_RGB_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_WRI)}},T_=Ql,h_=jl,m_=ql,O_="#2FAD7A",c_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_TERMINAL_WIDGET_VPIN_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"}]})}},R_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SYNC_VIRTUAL_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"}]})}},M_={init:function(){this.jsonInit({inputsInline:!0,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_ON_DISCONNECTED_MESSAGE0}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},E_={init:function(){this.jsonInit({inputsInline:!0,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_ON_CONNECTED_MESSAGE0}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},C_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNKTIMER_RUN_MESSAGE0})}},A_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_RUN_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_RUN_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_RUN_MESSAGE0})}},g_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_APP_NOTIFY_MESSAGE0,args0:[{check:String,type:"input_value",name:"notification"}]})}},S_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_STOP_TIMERS_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_STOP_TIMERS_MESSAGE0,args0:[{check:Number,type:"input_value",name:"timer_num"}]})}},D_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SET_PROPERTY_MESSAGE0,args0:[{check:String,type:"input_value",name:"attribute_name"},{type:"input_value",name:"attribute_value"}]})}},L_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_EMAIL_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_EMAIL_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_EMAIL_MESSAGE0,args0:[{check:String,type:"input_value",name:"TargetEmail"},{check:String,type:"input_value",name:"subject"},{check:String,type:"input_value",name:"body"}]})}},N_={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_GET_TIMERS_MESSAGE0})}},f_={init:function(){this.jsonInit({message0:Rt.Msg.MPYTHON_BLYNKTIMER_MESSAGE0,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNKTIMER_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNKTIMER_TOOLTIP,args0:[{check:Number,type:"input_value",name:"Num"},{options:[[Rt.Msg.MIXLY_PYTHON_PERIODIC,"False"],[Rt.Msg.MIXLY_PYTHON_ONE_SHOT,"True"]],type:"field_dropdown",name:"Timer_mode"},{check:Number,type:"input_value",name:"period"}]}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},F_={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_MESSAGE0,args0:[{type:"input_value",name:"sensor_data"},{check:Number,type:"input_value",name:"virtual_pin"}]})}},v_={init:function(){this.jsonInit({inputsInline:!0,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_APP_DATA_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_APP_DATA_MESSAGE0,args0:[{check:Number,type:"input_value",name:"virtual_pin"},{type:"input_value",name:"virtual_pin_val"}]}),this.appendStatementInput("DO").appendField(Rt.CONTROLS_REPEAT_INPUT_DO)}},P_={init:function(){this.jsonInit({nextStatement:null,previousStatement:null,colour:O_,helpUrl:Rt.Msg.MPYTHON_BLYNK_SETUP_HELPURL,tooltip:Rt.Msg.MPYTHON_BLYNK_SETUP_TOOLTIP,message0:Rt.Msg.MPYTHON_BLYNK_SETUP_MESSAGE0,args0:[{type:"input_dummy"},{check:String,type:"input_value",name:"server"},{check:Number,type:"input_value",name:"port"},{check:String,type:"input_value",name:"auth"}]})}},V_=120,y_={init:function(){this.setColour(V_),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT).appendField(new Rt.FieldDropdown(y_.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))},OPERATORS:[[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]]},Y_={init:function(){this.setColour(V_);var t=new Rt.FieldDropdown(Y_.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}},OPERATORS:[[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]]},b_="5BA5A5",k_={init:function(){this.appendValueInput("SUB").setCheck("var"),this.setColour(b_),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET2).appendField(new Rt.FieldDropdown(k_.OPERATORS),"OP"),this.appendValueInput("val").appendField(Rt.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_UNIT);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),i=Rt.Msg.DISPLAY_IMAGE_LET,n=Rt.Msg.DISPLAY_IMAGE_LET2,s=Rt.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:Rt.Msg.MIXLY_UP,down:Rt.Msg.MIXLY_DOWN,left:Rt.Msg.MIXLY_LEFT,right:Rt.Msg.MIXLY_RIGHT}[e]+s}))},OPERATORS:[[Rt.Msg.MIXLY_UP,"shift_up"],[Rt.Msg.MIXLY_DOWN,"shift_down"],[Rt.Msg.MIXLY_LEFT,"shift_left"],[Rt.Msg.MIXLY_RIGHT,"shift_right"]]},X_={init:function(){this.appendValueInput("SUB").setCheck("var"),this.setColour(b_),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(Rt.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new Rt.FieldDropdown(X_.OPERATORS),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{"+":Rt.Msg.MIXLY_MICROBIT_image_add,"-":Rt.Msg.MIXLY_MICROBIT_image_reduce}[e]}))},OPERATORS:[[Rt.Msg.MICROBIT_DISPLAY_UNION,"add"],[Rt.Msg.MICROBIT_DISPLAY_MINUS,"sub"]]},G_={init:function(){this.setColour(b_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("esp32_image"),this.appendDummyInput("").appendField(new Rt.FieldDropdown(G_.OPERATORS),"OP"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE+{height:Rt.Msg.MIXLY_HEIGHT,width:Rt.Msg.MIXLY_WIDTH}[e]}))},OPERATORS:[[Rt.Msg.MIXLY_HEIGHT,"height"],[Rt.Msg.MIXLY_WIDTH,"width"]]},x_={init:function(){this.setColour(b_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RECT).appendField(new Rt.FieldDropdown(x_.STATUS),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_RECT,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"width"},{check:Number,type:"input_value",name:"height"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_OLED_RECT)},STATUS:[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},U_={init:function(){this.setColour(b_),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(new Rt.FieldDropdown(U_.STATUS),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_CIRCLE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"r"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)},STATUS:[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},H_={init:function(){this.setColour(b_),this.appendValueInput("SUB").setCheck("var").appendField(Rt.Msg.MSG.catOLED),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET2).appendField(new Rt.FieldDropdown(H_.OPERATORS),"OP"),this.appendValueInput("val").appendField(Rt.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_UNIT);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),i=Rt.Msg.DISPLAY_IMAGE_LET,n=Rt.Msg.DISPLAY_IMAGE_LET2,s=Rt.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:Rt.Msg.MIXLY_UP,down:Rt.Msg.MIXLY_DOWN,left:Rt.Msg.MIXLY_LEFT,right:Rt.Msg.MIXLY_RIGHT}[e]+s}))},OPERATORS:[[Rt.Msg.MIXLY_UP,"shift_up"],[Rt.Msg.MIXLY_DOWN,"shift_down"],[Rt.Msg.MIXLY_LEFT,"shift_left"],[Rt.Msg.MIXLY_RIGHT,"shift_right"]]},B_="#569A98",w_={init:function(){this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(Rt.inputs.Align.CENTRE).appendField(new Rt.FieldBitmap(w_.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(B_),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:12},(()=>new Array(32).fill(0)))},W_={init:function(){this.setColour(B_),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(Rt.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new Rt.FieldDropdown(W_.OPERATORS),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{"+":Rt.Msg.MIXLY_MICROBIT_image_add,"-":Rt.Msg.MIXLY_MICROBIT_image_reduce}[e]}))},OPERATORS:[[Rt.Msg.MICROBIT_DISPLAY_UNION,"add"],[Rt.Msg.MICROBIT_DISPLAY_MINUS,"sub"]]},K_={init:function(){this.setColour(B_),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET2).appendField(new Rt.FieldDropdown(K_.OPERATORS),"OP"),this.appendValueInput("val").appendField(Rt.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_UNIT);Mt.Boards.getSelectedBoardKey();"Python ESP32-S3"===Mt.JSFuncs.getPlatform()&&this.appendValueInput("boolean").appendField(Rt.Msg.MIXLY_synchronize+":");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),i=Rt.Msg.DISPLAY_IMAGE_LET,n=Rt.Msg.DISPLAY_IMAGE_LET2,s=Rt.Msg.DISPLAY_IMAGE_LET3;return i+n+{shift_up:Rt.Msg.MIXLY_UP,shift_down:Rt.Msg.MIXLY_DOWN,shift_left:Rt.Msg.MIXLY_LEFT,shift_right:Rt.Msg.MIXLY_RIGHT}[e]+s}))},OPERATORS:[[Rt.Msg.MIXLY_UP,"shift_up"],[Rt.Msg.MIXLY_DOWN,"shift_down"],[Rt.Msg.MIXLY_LEFT,"shift_left"],[Rt.Msg.MIXLY_RIGHT,"shift_right"]]},Q_={init:function(){this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(Rt.inputs.Align.CENTRE).appendField(new Rt.FieldBitmap(Q_.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(B_),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:5},(()=>new Array(8).fill(0)))},j_={init:function(){this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(Rt.inputs.Align.CENTRE).appendField(new Rt.FieldBitmap(j_.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(B_),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:8},(()=>new Array(12).fill(0)))},q_={init:function(){this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(Rt.inputs.Align.CENTRE).appendField(new Rt.FieldBitmap(q_.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(B_),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:8},(()=>new Array(16).fill(0)))},J_={init:function(){this.setColour(B_),this.appendDummyInput().appendField(Rt.Msg.OLED_SET_FONT).appendField(new Rt.FieldDropdown(J_.OPERATORS),"OP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)},OPERATORS:[["4x5"+Rt.Msg.MIXGO_ME_DISPLAY_HORIZONTAL,"'4x5'"],["5x5"+Rt.Msg.MIXGO_ME_DISPLAY_HORIZONTAL,"'5x5'"],["5x8"+Rt.Msg.MIXGO_ME_DISPLAY_VERTICAL,"'5x8'"]]},z_={init:function(){this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(Rt.inputs.Align.CENTRE).appendField(new Rt.FieldBitmap(z_.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(B_),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:5},(()=>new Array(5).fill(0)))},Z_={init:function(){this.setColour(B_),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MIXBOT_SCREEN_ROTATE).appendField(new Rt.FieldDropdown(Z_.OPERATORS),"OP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)},OPERATORS:[[Rt.Msg.mixpy_PL_PIE_SHADOW_N,"0"],[Rt.Msg.CLOCKWISE+"90"+Rt.Msg.blockpy_setheading_degree,"1"],[Rt.Msg.CLOCKWISE+"180"+Rt.Msg.blockpy_setheading_degree,"2"],[Rt.Msg.CLOCKWISE+"270"+Rt.Msg.blockpy_setheading_degree,"3"]]},$_={init:function(){this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_CREATE_IMAGE),this.appendDummyInput("").setAlign(Rt.inputs.Align.CENTRE).appendField(new Rt.FieldBitmap($_.BITMAP,null,{filledColor:"#000",emptyColor:"#5ba5a5",bgColor:"#e5e7f1"}),"BITMAP"),this.setOutput(!0),this.setColour(B_),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)},BITMAP:Array.from({length:12},(()=>new Array(12).fill(0)))},tr=180,er={colourOptions:["#f00","#000"],columns:2},ir={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.clear",message0:Rt.Msg.MIXLY_MICROBIT_Clear_display}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Clear_display)}},nr={init:function(){this.setColour(tr),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_POINT),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_BRIGHTNESS)}},sr={init:function(){this.setColour(tr),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BRIGHTNESS).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_GET_POINT_X),this.appendValueInput("y").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_PLOT_POINT_Y),this.appendValueInput("STAT").setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_DISPLAY_SETPIXEL)}},or={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck(String).appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_ESP32_MONITOR_SCROLL,"scroll"]]),"MODE").appendField(Rt.Msg.OLED_DRAWSTR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},pr={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck(String).appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_ESP32_MONITOR_SCROLL,"scroll"]]),"MODE").appendField(Rt.Msg.OLED_DRAWSTR),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_DELAY),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},ur={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_MONITOR_SHOW_STATIC),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_MUSIC_SHOW_STATIC)}},ar={init:function(){this.setColour(tr),this.appendValueInput("PIN",String).setCheck("esp32_image").appendField(Rt.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP)}},lr={init:function(){this.jsonInit({colour:tr,InputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Show the referenced image on the display.",message0:Rt.Msg.OLED_BITMAP,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SAD","SAD"],["SMILE","SMILE"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["SURPRISED","SURPRISED"],["ASLEEP","ASLEEP"],["ANGRY","ANGRY"],["CONFUSED","CONFUSED"],["NO","NO"],["YES","YES"],["LEFT_ARROW","LEFT_ARROW"],["RIGHT_ARROW","RIGHT_ARROW"],["DRESS","DRESS"],["TRANSFORMERS","TRANSFORMERS"],["SCISSORS","SCISSORS"],["EXIT","EXIT"],["TREE","TREE"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["PITCHFORK","PITCHFORK"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["COW","COW"],["RABBIT","RABBIT"],["SQUARE_SMALL","SQUARE_SMALL"],["SQUARE","SQUARE"],["DIAMOND_SMALL","DIAMOND_SMALL"],["DIAMOND","DIAMOND"],["CHESSBOARD","CHESSBOARD"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["TRIANGLE","TRIANGLE"],["SNAKE","SNAKE"],["UMBRELLA","UMBRELLA"],["SKULL","SKULL"],["GIRAFFE","GIRAFFE"],["SWORD","SWORD"]],type:"field_dropdown"}]})}},_r={init:function(){this.jsonInit({colour:tr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",message0:Rt.Msg.MIXLY_MICROBIT_Animate_images,args0:[{check:"List",type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+Rt.Msg.MIXLY_MICROBIT_Animate_images1)}},rr={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.scroll",tooltip:"Scroll the referenced text across the display.",message0:Rt.Msg.MIXLY_MICROBIT_Scroll_message,args0:[{check:"String",type:"input_value",name:"message"}]})}},dr={init:function(){this.setColour(tr),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_MICROBIT_Turn_on_display,"on"],[Rt.Msg.MIXLY_MICROBIT_Turn_off_display,"off"]]),"on_off").appendField(Rt.Msg.MIXLY_MICROBIT_monitor),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("on_off"),i=Rt.Msg.MIXLY_MICROBIT_monitor;return{on:Rt.Msg.MIXLY_MICROBIT_Turn_on_display,off:Rt.Msg.MIXLY_MICROBIT_Turn_off_display}[e]+i}))}},Ir={init:function(){this.jsonInit({colour:tr,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off",tooltip:"Turn off the display.",message0:Rt.Msg.MIXLY_MICROBIT_Turn_off_display})}},Tr={init:function(){this.jsonInit({colour:tr,output:"Boolean",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.is_on",message0:Rt.Msg.MIXLY_MICROBIT_Display_is_on}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Display_is_on1)}},hr={init:function(){this.jsonInit({colour:tr,args0:[{name:"image",options:[["HEART","HEART"],["HEART_SMALL","HEART_SMALL"],["HAPPY","HAPPY"],["SAD","SAD"],["SMILE","SMILE"],["SILLY","SILLY"],["FABULOUS","FABULOUS"],["SURPRISED","SURPRISED"],["ASLEEP","ASLEEP"],["ANGRY","ANGRY"],["CONFUSED","CONFUSED"],["NO","NO"],["YES","YES"],["LEFT_ARROW","LEFT_ARROW"],["RIGHT_ARROW","RIGHT_ARROW"],["DRESS","DRESS"],["TRANSFORMERS","TRANSFORMERS"],["SCISSORS","SCISSORS"],["EXIT","EXIT"],["TREE","TREE"],["PACMAN","PACMAN"],["TARGET","TARGET"],["TSHIRT","TSHIRT"],["ROLLERSKATE","ROLLERSKATE"],["DUCK","DUCK"],["HOUSE","HOUSE"],["TORTOISE","TORTOISE"],["BUTTERFLY","BUTTERFLY"],["STICKFIGURE","STICKFIGURE"],["GHOST","GHOST"],["PITCHFORK","PITCHFORK"],["MUSIC_QUAVERS","MUSIC_QUAVERS"],["MUSIC_QUAVER","MUSIC_QUAVER"],["MUSIC_CROTCHET","MUSIC_CROTCHET"],["COW","COW"],["RABBIT","RABBIT"],["SQUARE_SMALL","SQUARE_SMALL"],["SQUARE","SQUARE"],["DIAMOND_SMALL","DIAMOND_SMALL"],["DIAMOND","DIAMOND"],["CHESSBOARD","CHESSBOARD"],["TRIANGLE_LEFT","TRIANGLE_LEFT"],["TRIANGLE","TRIANGLE"],["SNAKE","SNAKE"],["UMBRELLA","UMBRELLA"],["SKULL","SKULL"],["GIRAFFE","GIRAFFE"],["SWORD","SWORD"]],type:"field_dropdown"}],output:["esp32_image","List"],helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#attributes",tooltip:Rt.Msg.MIXLY_MICROBIT_Built_in_image1,message0:Rt.Msg.MIXLY_MICROBIT_Built_in_image})}},mr={init:function(){this.jsonInit({colour:tr,args0:[{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"00"},{colour:"#000000",type:"field_colour",name:"01"},{colour:"#000000",type:"field_colour",name:"02"},{colour:"#000000",type:"field_colour",name:"03"},{colour:"#000000",type:"field_colour",name:"04"},{colour:"#000000",type:"field_colour",name:"05"},{colour:"#000000",type:"field_colour",name:"06"},{colour:"#000000",type:"field_colour",name:"07"},{colour:"#000000",type:"field_colour",name:"08"},{colour:"#000000",type:"field_colour",name:"09"},{colour:"#000000",type:"field_colour",name:"0a"},{colour:"#000000",type:"field_colour",name:"0b"},{colour:"#000000",type:"field_colour",name:"0c"},{colour:"#000000",type:"field_colour",name:"0d"},{colour:"#000000",type:"field_colour",name:"0e"},{colour:"#000000",type:"field_colour",name:"0f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"10"},{colour:"#000000",type:"field_colour",name:"11"},{colour:"#000000",type:"field_colour",name:"12"},{colour:"#000000",type:"field_colour",name:"13"},{colour:"#000000",type:"field_colour",name:"14"},{colour:"#000000",type:"field_colour",name:"15"},{colour:"#000000",type:"field_colour",name:"16"},{colour:"#000000",type:"field_colour",name:"17"},{colour:"#000000",type:"field_colour",name:"18"},{colour:"#000000",type:"field_colour",name:"19"},{colour:"#000000",type:"field_colour",name:"1a"},{colour:"#000000",type:"field_colour",name:"1b"},{colour:"#000000",type:"field_colour",name:"1c"},{colour:"#000000",type:"field_colour",name:"1d"},{colour:"#000000",type:"field_colour",name:"1e"},{colour:"#000000",type:"field_colour",name:"1f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"20"},{colour:"#000000",type:"field_colour",name:"21"},{colour:"#000000",type:"field_colour",name:"22"},{colour:"#000000",type:"field_colour",name:"23"},{colour:"#000000",type:"field_colour",name:"24"},{colour:"#000000",type:"field_colour",name:"25"},{colour:"#000000",type:"field_colour",name:"26"},{colour:"#000000",type:"field_colour",name:"27"},{colour:"#000000",type:"field_colour",name:"28"},{colour:"#000000",type:"field_colour",name:"29"},{colour:"#000000",type:"field_colour",name:"2a"},{colour:"#000000",type:"field_colour",name:"2b"},{colour:"#000000",type:"field_colour",name:"2c"},{colour:"#000000",type:"field_colour",name:"2d"},{colour:"#000000",type:"field_colour",name:"2e"},{colour:"#000000",type:"field_colour",name:"2f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"30"},{colour:"#000000",type:"field_colour",name:"31"},{colour:"#000000",type:"field_colour",name:"32"},{colour:"#000000",type:"field_colour",name:"33"},{colour:"#000000",type:"field_colour",name:"34"},{colour:"#000000",type:"field_colour",name:"35"},{colour:"#000000",type:"field_colour",name:"36"},{colour:"#000000",type:"field_colour",name:"37"},{colour:"#000000",type:"field_colour",name:"38"},{colour:"#000000",type:"field_colour",name:"39"},{colour:"#000000",type:"field_colour",name:"3a"},{colour:"#000000",type:"field_colour",name:"3b"},{colour:"#000000",type:"field_colour",name:"3c"},{colour:"#000000",type:"field_colour",name:"3d"},{colour:"#000000",type:"field_colour",name:"3e"},{colour:"#000000",type:"field_colour",name:"3f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"40"},{colour:"#000000",type:"field_colour",name:"41"},{colour:"#000000",type:"field_colour",name:"42"},{colour:"#000000",type:"field_colour",name:"43"},{colour:"#000000",type:"field_colour",name:"44"},{colour:"#000000",type:"field_colour",name:"45"},{colour:"#000000",type:"field_colour",name:"46"},{colour:"#000000",type:"field_colour",name:"47"},{colour:"#000000",type:"field_colour",name:"48"},{colour:"#000000",type:"field_colour",name:"49"},{colour:"#000000",type:"field_colour",name:"4a"},{colour:"#000000",type:"field_colour",name:"4b"},{colour:"#000000",type:"field_colour",name:"4c"},{colour:"#000000",type:"field_colour",name:"4d"},{colour:"#000000",type:"field_colour",name:"4e"},{colour:"#000000",type:"field_colour",name:"4f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"50"},{colour:"#000000",type:"field_colour",name:"51"},{colour:"#000000",type:"field_colour",name:"52"},{colour:"#000000",type:"field_colour",name:"53"},{colour:"#000000",type:"field_colour",name:"54"},{colour:"#000000",type:"field_colour",name:"55"},{colour:"#000000",type:"field_colour",name:"56"},{colour:"#000000",type:"field_colour",name:"57"},{colour:"#000000",type:"field_colour",name:"58"},{colour:"#000000",type:"field_colour",name:"59"},{colour:"#000000",type:"field_colour",name:"5a"},{colour:"#000000",type:"field_colour",name:"5b"},{colour:"#000000",type:"field_colour",name:"5c"},{colour:"#000000",type:"field_colour",name:"5d"},{colour:"#000000",type:"field_colour",name:"5e"},{colour:"#000000",type:"field_colour",name:"5f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"60"},{colour:"#000000",type:"field_colour",name:"61"},{colour:"#000000",type:"field_colour",name:"62"},{colour:"#000000",type:"field_colour",name:"63"},{colour:"#000000",type:"field_colour",name:"64"},{colour:"#000000",type:"field_colour",name:"65"},{colour:"#000000",type:"field_colour",name:"66"},{colour:"#000000",type:"field_colour",name:"67"},{colour:"#000000",type:"field_colour",name:"68"},{colour:"#000000",type:"field_colour",name:"69"},{colour:"#000000",type:"field_colour",name:"6a"},{colour:"#000000",type:"field_colour",name:"6b"},{colour:"#000000",type:"field_colour",name:"6c"},{colour:"#000000",type:"field_colour",name:"6d"},{colour:"#000000",type:"field_colour",name:"6e"},{colour:"#000000",type:"field_colour",name:"6f"},{type:"input_dummy"},{colour:"#000000",type:"field_colour",name:"70"},{colour:"#000000",type:"field_colour",name:"71"},{colour:"#000000",type:"field_colour",name:"72"},{colour:"#000000",type:"field_colour",name:"73"},{colour:"#000000",type:"field_colour",name:"74"},{colour:"#000000",type:"field_colour",name:"75"},{colour:"#000000",type:"field_colour",name:"76"},{colour:"#000000",type:"field_colour",name:"77"},{colour:"#000000",type:"field_colour",name:"78"},{colour:"#000000",type:"field_colour",name:"79"},{colour:"#000000",type:"field_colour",name:"7a"},{colour:"#000000",type:"field_colour",name:"7b"},{colour:"#000000",type:"field_colour",name:"7c"},{colour:"#000000",type:"field_colour",name:"7d"},{colour:"#000000",type:"field_colour",name:"7e"},{colour:"#000000",type:"field_colour",name:"7f"}],output:"esp32_image",helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/image.html#microbit.Image",message0:Rt.Msg.MIXLY_ESP32_Create_image}),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_Create_image1)}},Or={init:function(){this.setColour(tr),this.setOutput(!0),this.setInputsInline(!0),this.appendValueInput("img").appendField(Rt.Msg.DISPLAY_IMAGE_LET).setCheck(["esp32_image","List",String]),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_LET2).appendField(new Rt.FieldDropdown(Or.OPERATORS),"OP"),this.appendValueInput("val").appendField(Rt.Msg.DISPLAY_IMAGE_SHIFT).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.DISPLAY_IMAGE_UNIT);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),i=Rt.Msg.DISPLAY_IMAGE_LET,n=Rt.Msg.DISPLAY_IMAGE_LET2,s=Rt.Msg.DISPLAY_IMAGE_LET3;return i+n+{up:Rt.Msg.MIXLY_UP,down:Rt.Msg.MIXLY_DOWN,left:Rt.Msg.MIXLY_LEFT,right:Rt.Msg.MIXLY_RIGHT}[e]+s}))},OPERATORS:[[Rt.Msg.MIXLY_UP,"up"],[Rt.Msg.MIXLY_DOWN,"down"],[Rt.Msg.MIXLY_LEFT,"left"],[Rt.Msg.MIXLY_RIGHT,"right"]]},cr={init:function(){this.setColour(tr),this.setOutput(!0,"esp32_image"),this.appendValueInput("A").appendField(Rt.Msg.MICROBIT_DISPLAY_MERGE_SHAPE),this.appendValueInput("B").appendField(new Rt.FieldDropdown(cr.OPERATORS),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{"+":Rt.Msg.MIXLY_MICROBIT_image_add,"-":Rt.Msg.MIXLY_MICROBIT_image_reduce}[e]}))},OPERATORS:[[Rt.Msg.MICROBIT_DISPLAY_UNION,"+"],[Rt.Msg.MICROBIT_DISPLAY_MINUS,"-"]]},Rr={init:function(){this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,"show"],[Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING,"scroll"]]),"MODE"),this.jsonInit({colour:tr,inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:"https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.show",tooltip:"Display the list of images as an animation with a certain delay between each frame. Indicate if you need to wait before continuing, continuously loop the animation and clear the display when finished.",message0:Rt.Msg.MIXLY_MICROBIT_SHOW_STRING,args0:[{check:String,type:"input_value",name:"images"},{type:"input_value",name:"delay"},{type:"input_dummy"},{checked:!0,type:"field_checkbox",name:"wait"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"loop"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"clear"}]}),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=Rt.Msg.OLED_DRAWSTR;return Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_delay+{show:Rt.Msg.OLED_DRAWSTR_ONE_BY_ONE,scroll:Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING}[e]+i}))}},Mr={init:function(){this.setColour(tr),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_PRINT1),this.appendValueInput("TEXT2",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_PRINT2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_LCD_PRINT4_TOOLTIP)}},Er={init:function(){this.setColour(tr),this.appendValueInput("device").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_SETUP).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("1602").appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_ADDRESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_SETUP+Rt.Msg.MIXLY_DF_LCD+Rt.Msg.MIXLY_LCD_ADDRESS)}},Cr={init:function(){this.setColour(tr),this.appendValueInput("row",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(Rt.Msg.MIXLY_LCD_ROW),this.appendValueInput("column",Number).setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_COLUMN),this.appendValueInput("TEXT",String).setCheck([String,Number]).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_LCD_PRINT),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_LCD_PRINT3_TOOLTIP)}},Ar={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_DF_LCD).appendField("mylcd").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ON,"on()"],[Rt.Msg.MIXLY_OFF,"off()"],[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"clear()"],[Rt.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(off)"],[Rt.Msg.MIXLY_LCD_BACKLIGHT,"backlight(on)"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("STAT");return Rt.Msg.LISTS_SET_INDEX_SET+Rt.Msg.MIXLY_DF_LCD+{"on()":Rt.Msg.MIXLY_ON,"off()":Rt.Msg.MIXLY_OFF,"clear()":Rt.Msg.MIXLY_LCD_STAT_CLEAR,"backlight(off)":Rt.Msg.MIXLY_LCD_NOBACKLIGHT,"backlight(on)":Rt.Msg.MIXLY_LCD_BACKLIGHT}[e]}))}},gr={init:function(){this.setColour(tr),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendValueInput("row").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO+"OLED").setCheck(Number),this.appendValueInput("column").appendField("X").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip()}},Sr={init:function(){this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendValueInput("Text_line1","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.OLEDDISPLAY+Rt.Msg.line1),this.appendValueInput("Text_line2","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line2),this.appendValueInput("Text_line3","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line3),this.appendValueInput("Text_line4","String").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.line4),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(tr),this.setTooltip(Rt.Msg.MIXLY_DF_LCD+Rt.Msg.OLEDDISPLAY+Rt.Msg.MIXLY_MICROBIT_TYPE_STRING)}},Dr={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("VAR").setCheck("esp32_image"),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Dr.OPERATORS),"OP"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_MICROBIT_IMAGE+{height:Rt.Msg.MIXLY_HEIGHT,width:Rt.Msg.MIXLY_WIDTH}[e]}))},OPERATORS:[[Rt.Msg.MIXLY_HEIGHT,"height"],[Rt.Msg.MIXLY_WIDTH,"width"]]},Lr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RECT).appendField(new Rt.FieldDropdown(Lr.STATUS),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_RECT,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"width"},{check:Number,type:"input_value",name:"height"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_OLED_RECT)},STATUS:[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},Nr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_DISPLAY_DRAW).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_DISPLAY_RLINE,"hline"],[Rt.Msg.MIXLY_DISPLAY_VLINE,"vline"]]),"direction"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_LINE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"length"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_OLED_LINE)}},fr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.jsonInit({message0:Rt.Msg.MIXLY_MICROBIT_SHOW_LINE_ARBITRARILY,args0:[{check:Number,type:"input_value",name:"x1"},{check:Number,type:"input_value",name:"y1"},{check:Number,type:"input_value",name:"x2"},{check:Number,type:"input_value",name:"y2"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_OLED_LINE_ARBIT)}},Fr={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_SCREEN_BRIGHTNESS),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_GET_SCREEN_BRIGHTNESS)}},vr={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_MONITOR_GET_SCREEN_IMAGE),this.setInputsInline(!0),this.setOutput(!0,"esp32_image"),this.setTooltip(Rt.Msg.MIXLY_ESP32_MONITOR_GET_SCREEN_IMAGE_TOOLTIP)}},Pr={init:function(){this.setColour(tr),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_SCREEN_BRIGHTNESS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_SCREEN_BRIGHTNESS)}},Vr={init:function(){this.setColour(tr),this.appendValueInput("x").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_JS_MONITOR_SET_BLINK_RATE)}},yr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_RGB),this.appendValueInput("_LED_").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_RGB_NUM),this.appendDummyInput("").appendField(Rt.Msg.LISTS_SET_INDEX_SET+Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS).appendField(new Rt.FieldColour("#f00",null,er),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_RGB_NUM_R_G_B)}},Yr={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_OR_ANIMATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP_OR_STRING)}},br={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},kr={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_OR_ANIMATION),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SHOW_IMAGE_OR_STRING_DELAY)}},Xr={init:function(){this.setColour(tr),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.appendValueInput("time").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SCROLL_IMAGE_OR_STRING_DELAY)}},Gr={init:function(){this.setColour(tr),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ESP32_ON,"ON"],[Rt.Msg.MIXLY_ESP32_OFF,"OFF"]]),"ONOFF"),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},xr={init:function(){this.setColour(tr),this.appendValueInput("SUB"),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"0"],[Rt.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL,"1"]]),"key"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i={0:Rt.Msg.MIXLY_LCD_STAT_CLEAR,1:Rt.Msg.MIXLY_HANDBIT_DISLPAY_OLED_FILL};return Rt.Msg.MIXLY_DF_LCD+i[e]}))}},Ur={init:function(){this.setColour(tr),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["TM1650","TM1650"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return Rt.Msg.MIXLY_ESP32_SENSOR_USE_I2C_TOOLTIP+{TM1650:"TM1650"}[e]}))}},Hr={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendDummyInput().appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_ON,"_on"],[Rt.Msg.MIXLY_OFF,"_off"],[Rt.Msg.MIXLY_LCD_STAT_CLEAR,"_clear"]]),"STAT"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_4digitdisplay_power)}},Br={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendValueInput("VALUE").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SHOW_NUMBER),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},wr={init:function(){this.setColour(tr),this.appendDummyInput().appendField(Rt.Msg.MIXLY_4DIGITDISPLAY).appendField(new Rt.FieldDropdown([["TM1650","tm1650"]]),"TYPE"),this.appendValueInput("VAR"),this.appendValueInput("NO").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER1),this.appendValueInput("STAT").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER2+Rt.Msg.MIXLY_4DIGITDISPLAY_DOT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_4digitdisplay_showDot)}},Wr={init:function(){this.setColour(tr),this.setOutput(!0,"Tuple"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISPLAY_ANIMATE).appendField(new Rt.FieldDropdown(Wr.ANIMATE),"ANIMATION")},ANIMATE:[["ALL_CLOCKS","ALL_CLOCKS"],["ALL_ARROWS","ALL_ARROWS"]]},Kr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(new Rt.FieldDropdown(Kr.STATUS),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_CIRCLE,args0:[{check:Number,type:"input_value",name:"x"},{check:Number,type:"input_value",name:"y"},{check:Number,type:"input_value",name:"r"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)},STATUS:[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},Qr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_DISPLAY_DRAW+Rt.Msg.MIXLY_HANBIT_DRAW_TRIANGLE).appendField(new Rt.FieldDropdown(Qr.STATUS),"OP"),this.jsonInit({message0:Rt.Msg.MIXLY_HANBIT_SHOW_triangle,args0:[{check:Number,type:"input_value",name:"x0"},{check:Number,type:"input_value",name:"y0"},{check:Number,type:"input_value",name:"x1"},{check:Number,type:"input_value",name:"y1"},{check:Number,type:"input_value",name:"x2"},{check:Number,type:"input_value",name:"y2"},{type:"input_dummy"},{checked:!1,type:"field_checkbox",name:"fill"}]}),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setTooltip(Rt.Msg.MIXLY_DISPLAY_DRAW+Rt.Msg.MIXLY_HANBIT_DRAW_TRIANGLE)},STATUS:[[Rt.Msg.MIXLY_4DIGITDISPLAY_ON,"1"],[Rt.Msg.MIXLY_4DIGITDISPLAY_OFF,"0"]]},jr={init:function(){this.setColour("#555555"),this.appendDummyInput("").appendField(Rt.Msg.MIXGO_ONBOARDDISPLAY_HELP),this.setInputsInline(!0),this.setTooltip("")}},qr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.OLED_BITMAP),this.appendValueInput("START_X",Number).appendField(Rt.Msg.OLED_START_X).setCheck(Number),this.appendValueInput("START_Y",Number).appendField(Rt.Msg.OLED_START_Y).setCheck(Number),this.appendValueInput("bitmap_name",String).appendField(Rt.Msg.OLED_BITMAP_NAME),this.appendValueInput("WIDTH",Number).appendField(Rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("HEIGHT",Number).appendField(Rt.Msg.MIXLY_HEIGHT).setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.OLED_SHOW_BMP_TOOLTIP)}},Jr={init:function(){this.setColour(tr),this.appendValueInput("VAR").appendField(Rt.Msg.OLED),this.appendDummyInput("").appendField(Rt.Msg.OLED_DRAWPIXEL),this.appendValueInput("POS_X").appendField(Rt.Msg.OLED_POSX),this.appendValueInput("POS_Y").appendField(Rt.Msg.OLED_POSY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.OLED_DRAW_PIXE_TOOLTIP)}},zr={init:function(){this.setColour(tr),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["32x12 Matrix","32x12 Matrix"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zr={init:function(){this.setColour(tr),this.appendValueInput("SUB"),this.appendValueInput("data").setCheck([String,"esp32_image","List","Tuple"]).appendField(Rt.Msg.OLED_BITMAP),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.OLED_BITMAP_OR_STRING)}},$r={init:function(){this.setColour(tr),this.appendValueInput("SUB"),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_STRING),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0)}},td="#526FC3",ed={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_CONNECT_WIFI),this.appendValueInput("WIFINAME").setCheck(String).appendField(Rt.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.HTML_PASSWORD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},id={init:function(){this.setColour(td),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},nd={init:function(){this.setColour(td),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},sd={init:function(){this.setColour(td),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},od={init:function(){this.setColour(td),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},pd={init:function(){this.setColour(td),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["iot_publish_item"],this)),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ud={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ad={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},ld={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},_d={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Rt.Msg.MIXLY_WIFI_USERNAME).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.MIXLY_IOT_PASSWORD).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Rt.Msg.MIXLY_EMQX_PROJECT).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Rt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},dd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Rt.Msg.HTML_BODY),this.appendDummyInput().appendField(Rt.Msg.MIXLY_Service_quality_display).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_AT_MOST_ONCE,"0"],[Rt.Msg.MIXLY_AT_LEAST_ONCE,"1"]]),"quality"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Id={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_EMQX_SUBSCRIBE+Rt.Msg.MIXLY_MICROBIT_MSG).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Rt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Td={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},md={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Od={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Rt.Msg.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},cd={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Rt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Rd={init:function(){this.setColour(td),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Md={init:function(){this.setColour(td),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Ed={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Cd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO").appendField(Rt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Rt.Msg.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Ad={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+Rt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gd={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sd={init:function(){this.VISITOR_ID=Mt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(td),this.appendDummyInput("").appendField(new Rt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Dd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MixIO").appendField(Rt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Ld={init:function(){this.setColour(td),this.appendDummyInput().appendField("HTTP"+Rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Rt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Rt.Msg.MIXLY_REQUESTS_GET).appendField(Rt.Msg.MIXLY_GET_CURRENT_TIME).appendField(Rt.Msg.MIXLY_OPEN_DEBUG).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nd={init:function(){this.setColour(td),this.appendDummyInput().appendField("HTTP"+Rt.Msg.MIXLY_Client).appendField(Rt.Msg.MIXLY_GET).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Rt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},fd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MQTT"+Rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Rt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Rt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Rt.Msg.MQTT_Topic).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Rt.Msg.MIXLY_OPEN_DEBUG).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fd={init:function(){this.setColour(td),this.appendDummyInput().appendField("MQTT"+Rt.Msg.MIXLY_Client).appendField(Rt.Msg.MIXLY_GET).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Rt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},vd=ed,Pd=id,Vd=nd,yd=sd,Yd=pd,bd={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CONNECT_OLLAMA),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("NAME").appendField(Rt.Msg.MODEL_NAME).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("NUMBER").appendField(Rt.Msg.MIXLY_SET_MAXIMUM_HISTORICAL_SESSIONS_NUM),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},kd=bd,Xd={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_CONNECT_OPENAI),this.appendValueInput("SERVER").appendField(Rt.Msg.MIXLY_EMQX_SERVER).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Rt.Msg.MIXLY_API_PRIVATE_KEY).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("NAME").appendField(Rt.Msg.MODEL_NAME).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("NUMBER").appendField(Rt.Msg.MIXLY_SET_MAXIMUM_HISTORICAL_SESSIONS_NUM),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gd={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_LLM_CHAT),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_MIXGO_ESPNOW_SEND),this.appendValueInput("METHOD").appendField(Rt.Msg.MIXLY_LLM_CONTENT_CALLBACK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xd={init:function(){this.setColour(td),this.appendDummyInput().appendField(Rt.Msg.MIXLY_LLM_CHAT),this.appendValueInput("TOPIC").appendField(Rt.Msg.MIXLY_MIXGO_ESPNOW_SEND),this.appendDummyInput().appendField(Rt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0)}},Ud={init:function(){this.setColour(td),this.appendDummyInput().appendField("Ollama "+Rt.Msg.MIXLY_EMPTY_HISTORY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hd={init:function(){this.setColour(0),this.appendDummyInput().appendField(`${Rt.Msg.MIXLY_SETUP} TinyWebDB`),this.appendValueInput("ADDR").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_EMQX_SERVER),this.appendValueInput("USERNAME").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_EMQX_USERNAME),this.appendValueInput("PASSWORD").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_IOT_PASSWORD),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bd={init:function(){this.setColour(0),this.appendDummyInput().appendField(`${Rt.Msg.MIXLY_SETUP} TinyWebDB`),this.appendValueInput("MQTT").setAlign(Rt.inputs.Align.RIGHT).appendField(`MixIO ${Rt.Msg.MIXLY_Client}`),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wd={init:function(){this.setColour(0),this.appendDummyInput().appendField("TinyWebDB"),this.appendValueInput("TAG").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_TINY_WEB_DB_UPDATE_VARIABLE),this.appendValueInput("VALUE").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wd={init:function(){this.setColour(0),this.appendDummyInput().appendField("TinyWebDB"),this.appendValueInput("TAG").appendField(Rt.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLE),this.appendDummyInput().appendField(Rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setOutput(!0)}},Kd={init:function(){this.setColour(0),this.appendDummyInput().appendField("TinyWebDB"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_NUM),this.setInputsInline(!0),this.setOutput(!0)}},Qd={init:function(){this.setColour(0),this.appendDummyInput().appendField("TinyWebDB").appendField(Rt.Msg.MIXLY_TINY_WEB_DB_SEARCH_VARIABLES),this.appendValueInput("NO").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_TINY_WEB_DB_START_NUMBER),this.appendValueInput("COUNT").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_TINY_WEB_DB_VARIABLE_NUMBER),this.appendValueInput("TAG").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_TINY_WEB_DB_SEARCH_VARS),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_ALL,"both"],[Rt.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_TAG,"tag"],[Rt.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_VALUE,"value"]]),"DTYPE"),this.setInputsInline(!1),this.setOutput(!0)}},jd={init:function(){this.setColour(0),this.appendDummyInput().appendField("TinyWebDB"),this.appendValueInput("TAG").appendField(Rt.Msg.MIXLY_TINY_WEB_DB_DELETE_VARIABLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qd=225,Jd={init:function(){this.appendValueInput("VAL"),this.setColour(qd),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Rt.FieldDropdown(Jd.ATTR),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:Rt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:Rt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:Rt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))},ATTR:[[Rt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Rt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Rt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[Rt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"]]},zd="#3288dd",Zd={init:function(){this.appendValueInput("VAL"),this.setColour(zd),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Rt.FieldDropdown(Zd.ATTR),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)},ATTR:[[Rt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Rt.Msg.blockpy_REQUESTS_GET_ATTR_JSON,"json()"],[Rt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Rt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[Rt.Msg.MIXPY_TEXT_ENCODE,"encoding"]]},$d="#A58C5B",tI={init:function(){this.setColour($d),this.appendValueInput("PIN",Number).appendField(new Rt.FieldDropdown([["DHT11","DHT11"],["DHT22","DHT22"]]),"TYPE").appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new Rt.FieldDropdown(tI.METHOD),"WHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHAT");return{temperature:Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[e]}))},METHOD:[[Rt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Rt.Msg.MIXLY_GETHUMIDITY,"humidity"]]},eI=(Rt.Msg.PS2_TRIANGLE,Rt.Msg.PS2_CIRCLE,Rt.Msg.PS2_CROSS,Rt.Msg.PS2_SQUARE,Rt.Msg.PS2_L1,Rt.Msg.PS2_L2,Rt.Msg.PS2_R1,Rt.Msg.PS2_R2,Rt.Msg.PS2_UP,Rt.Msg.PS2_RIGHT,Rt.Msg.PS2_DOWN,Rt.Msg.PS2_LEFT,Rt.Msg.PS2_SELECT,Rt.Msg.PS2_START,{init:function(){this.setColour($d),this.appendDummyInput("").appendField(Rt.Msg.PS2_stick).appendField(new Rt.FieldDropdown(eI.PSSTK),"psstk"),this.setOutput(!0,Number),this.setTooltip("")},PSSTK:[[Rt.Msg.PS2_RX,"0"],[Rt.Msg.PS2_RY,"1"],[Rt.Msg.PS2_LX,"2"],[Rt.Msg.PS2_LY,"3"]]}),iI={init:function(){this.setColour($d),this.appendValueInput("SUB").appendField(Rt.Msg.PS2),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_JOYSTICK).appendField(new Rt.FieldDropdown(iI.PSSTK),"psstk"),this.setOutput(!0,Number),this.setTooltip("")},PSSTK:[[Rt.Msg.PS2_RX,"RX"],[Rt.Msg.PS2_RY,"RY"],[Rt.Msg.PS2_LX,"LX"],[Rt.Msg.PS2_LY,"LY"]]},nI=40,sI={init:function(){this.setColour(nI),this.appendValueInput("PIN",Number).appendField(new Rt.FieldDropdown([["DHT11","dht11"],["DHT22","dht22"]]),"TYPE").appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField(new Rt.FieldDropdown(sI.METHOD),"WHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHAT");return{temperature:Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM,relative_humidity:Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_HUM,tempandhum:Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_GET_TEM_HUM}[e]}))},METHOD:[[Rt.Msg.MIXLY_GETTEMPERATUE,"temperature"],[Rt.Msg.MIXLY_GETHUMIDITY,"relative_humidity"],[Rt.Msg.MIXLY_DHT11_T_H,"tempandhum"]]},oI=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"pitch",e.ORDER_ATOMIC);return"music.pitch("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+i+")\n"},pI=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"pitch",e.ORDER_ATOMIC),n=e.valueToCode(this,"time",e.ORDER_ATOMIC);return"music.pitch_time("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+i+", "+n+")\n"},uI=function(t,e){return e.definitions_.import_music="import music","music.stop("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")\n"},aI=function(t,e){e.definitions_.import_music="import music";var i=e.valueToCode(this,"BPM",e.ORDER_ASSIGNMENT);return"music.set_tempo("+e.valueToCode(this,"TICKS",e.ORDER_ASSIGNMENT)+", "+i+")\n"},lI=function(t,e){e.definitions_.import_music="import music";return["music.get_tempo()",e.ORDER_ATOMIC]},_I=function(t,e){return e.definitions_.import_music="import music","music.pitch("+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+")\n"},rI=function(t,e){return e.definitions_.import_music="import music","music.pitch_time("+e.valueToCode(this,"pitch",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"time",e.ORDER_ATOMIC)+")\n"},dI=function(t,e){e.definitions_.import_music="import music";return"music.stop()\n"},II=function(t,e){return e.definitions_.import_music="import music","music.play("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+")\n"},TI=function(t,e){return e.definitions_.import_music="import music","music.play("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN",e.ORDER_ASSIGNMENT)+")\n"},hI=function(t,e){return e.definitions_.import_music="import music",e.definitions_.import_matrix="import matrix","music.play_show("+e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"PIN",e.ORDER_ASSIGNMENT)+")\n"},mI=function(t,e){return e.definitions_.import_music="import music","music.reset()\n"},OI=function(t,e){return e.definitions_.import_servo="import servo",e.definitions_.import_machine="import machine","servo.servo_write_angle("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"DEGREE",e.ORDER_ATOMIC)+")\n"},cI=function(t,e){return[this.getFieldValue("op"),e.ORDER_ATOMIC]},RI=function(t,e){return[this.getFieldValue("flag"),e.ORDER_ATOMIC]},MI=function(t,e){e.definitions_.import_mixgo="import mixgo";var i=e.valueToCode(this,"bright",e.ORDER_ATOMIC);return"mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").setonoff("+i+")\n"},EI=function(t,e){return e.definitions_.import_mixgo="import mixgo",["mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").getonoff()",e.ORDER_ATOMIC]},CI=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+").setbrightness("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},AI=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".setonoff("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},gI=function(t,e){return e.definitions_.import_mixgo="import mixgo",["mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".getonoff()",e.ORDER_ATOMIC]},SI=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.led"+e.valueToCode(this,"led",e.ORDER_ATOMIC)+".setbrightness("+e.valueToCode(this,"bright",e.ORDER_ATOMIC)+")\n"},DI=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"PIN",e.ORDER_ATOMIC),s=e.valueToCode(this,"LEDCOUNT",e.ORDER_ATOMIC);return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",i+" = neopixel.NeoPixel(machine.Pin("+n+"), "+s+", timing=True)\n"},LI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".write()\n"},NI=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_neopixel="import neopixel",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+"["+e.valueToCode(this,"_LED_",e.ORDER_ATOMIC)+"] = ("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+")\n"},fI=function(t,e){e.definitions_.import_mixgo="import mixgo";return"mixgo.rgb.write()\n"},FI=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.rgb["+e.valueToCode(this,"_LED_",e.ORDER_ATOMIC)+"] = ("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+")\n"},vI=function(t,e){return e.definitions_.import_mixgo="import mixgo","mixgo.rgb.fill(("+e.valueToCode(this,"RVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"GVALUE",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"BVALUE",e.ORDER_ATOMIC)+"))\n"},PI=AI,VI=gI,yI=SI,YI=function(t,e){var i=e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC);e.functions_["terminal_widget_vpin_"+i]=`\nALLOWED_COMMANDS_LIST = ['ls', 'lsusb', 'ip a', 'ip abc']\n\n@blynk.handle_event('write V${i}')\ndef write_handler(pin, _values):\n header = ''\n result = ''\n delimiter = '{}\\n'.format('=' * 30)\n if _values and _values[0] in ALLOWED_COMMANDS_LIST:\n cmd_params = _values[0].split(' ')\n try:\n result = subprocess.check_output(cmd_params).decode('utf-8')\n header = '[output]\\n'\n except subprocess.CalledProcessError as exe_err:\n header = '[error]\\n'\n result = 'Return Code: {}\\n'.format(exe_err.returncode)\n except Exception as g_err:\n print("Command caused '{}'".format(g_err))\n elif _values and _values[0] == 'help':\n header = '[help -> allowed commands]\\n'\n result = '{}\\n'.format('\\n'.join(ALLOWED_COMMANDS_LIST))\n\n # communicate with terminal if help or some allowed command\n if result:\n output = '{}{}{}{}'.format(header, delimiter, result, delimiter)\n print(output)\n blynk.virtual_write(pin, output)\n blynk.virtual_write(pin, '\\n')\n`;return""},bI=function(t,e){return"blynk.virtual_sync("+e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC)+")\n"},kI=function(t,e){var i=e.statementToCode(this,"DO");return i=e.addLoopTrap(i,this.id)||e.PASS,e.definitions_.blynk_on_disconnected="@blynk.handle_event(\"disconnect\")\ndef connect_handler():\n print('Blynk disconnected')\n"+i,""},XI=function(t,e){var i=e.statementToCode(this,"DO");return i=e.addLoopTrap(i,this.id)||e.PASS,e.definitions_.blynk_on_connected="@blynk.handle_event(\"connect\")\ndef connect_handler():\n print('Blynk connected')\n"+i,""},GI=function(){return"blynk_timer.run()\n"},xI=function(){return"blynk.run()\n"},UI=function(t,e){return"blynk.notify("+e.valueToCode(this,"notification",e.ORDER_ATOMIC)+")\n"},HI=function(t,e){e.definitions_.import_blynktimer="import blynktimer",e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)";var i=e.valueToCode(this,"timer_num",e.ORDER_ATOMIC);return`blynk_timer.stop('${i}_blynk_timer${i}')\n`},BI=function(t,e){e.definitions_.import_blynktimer="import blynktimer",e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)";return["blynk_timer.get_timers()",e.ORDER_ATOMIC]},wI=function(t,e){e.definitions_.import_blynktimer="import blynktimer";var i=e.valueToCode(this,"Num",e.ORDER_ATOMIC),n=e.valueToCode(this,"period",e.ORDER_ATOMIC),s=this.getFieldValue("Timer_mode"),o=e.statementToCode(this,"DO");return o=e.addLoopTrap(o,this.id)||e.PASS,e.definitions_.def_blynktimer="blynk_timer = blynktimer.Timer(no_timers_err=False)",e.definitions_["blynktimer_event"+i]=`\n@blynk_timer.register(interval=${n}, run_once=${s})\ndef blynk_timer${i}():\n`+o,""},WI=function(t,e){var i=e.valueToCode(this,"sensor_data",e.ORDER_ATOMIC);return"blynk.virtual_write("+e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC)+", "+i+")\n"},KI=function(t,e){var i=e.valueToCode(this,"virtual_pin",e.ORDER_ATOMIC),n=e.statementToCode(this,"DO");return n=e.addLoopTrap(n,this.id)||e.PASS,e.definitions_["blynk_VIRTUAL_WRITE_"+i]="@blynk.handle_event('write V"+i+"')\ndef write_virtual_pin_handler(pin, _value):\n for i in range(0, len(_value)):\n try: _value[i] = eval(_value[i])\n except: pass\n if len(_value) == 1: _value = _value[0]\n"+n,""},QI=function(t,e){var i=e.valueToCode(this,"body",e.ORDER_ATOMIC),n=e.valueToCode(this,"subject",e.ORDER_ATOMIC);return`blynk.email(${e.valueToCode(this,"TargetEmail",e.ORDER_ATOMIC)}, ${n}, ${i})\n`},jI=function(t,e){var i=e.valueToCode(this,"attribute_value",e.ORDER_ATOMIC);return`blynk.set_property(pin, ${e.valueToCode(this,"attribute_name",e.ORDER_ATOMIC)}, ${i})\n`},qI=function(t,e){e.definitions_.import_BlynkLib="import blynklib";var i=e.valueToCode(this,"server",e.ORDER_ATOMIC),n=e.valueToCode(this,"auth",e.ORDER_ATOMIC),s=e.valueToCode(this,"port",e.ORDER_ATOMIC);return e.definitions_.mpython_blynk_setup="blynk = blynklib.Blynk("+n+", server="+i+", port="+s+")",e.definitions_.blynk_on_connected="\n@blynk.handle_event(\"connect\")\ndef connect_handler():\n print('Blynk connected')\n",e.definitions_.blynk_on_disconnected="\n@blynk.handle_event(\"disconnect\")\ndef connect_handler():\n print('Blynk disconnected')\n",""};const JI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},zI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},ZI=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.showstatic("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},$I=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.show("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},tT=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+", "+e.valueToCode(this,"time",e.ORDER_ASSIGNMENT)+")\n"},eT=function(t,e){e.definitions_.import_matrix="import matrix";var i={"#000000":"0","#ff0000":"1"};return['matrix.Image("'+i[t.getFieldValue("00")]+i[t.getFieldValue("01")]+i[t.getFieldValue("02")]+i[t.getFieldValue("03")]+i[t.getFieldValue("04")]+i[t.getFieldValue("05")]+i[t.getFieldValue("06")]+i[t.getFieldValue("07")]+i[t.getFieldValue("08")]+i[t.getFieldValue("09")]+i[t.getFieldValue("0a")]+i[t.getFieldValue("0b")]+i[t.getFieldValue("0c")]+i[t.getFieldValue("0d")]+i[t.getFieldValue("0e")]+i[t.getFieldValue("0f")]+":"+i[t.getFieldValue("10")]+i[t.getFieldValue("11")]+i[t.getFieldValue("12")]+i[t.getFieldValue("13")]+i[t.getFieldValue("14")]+i[t.getFieldValue("15")]+i[t.getFieldValue("16")]+i[t.getFieldValue("17")]+i[t.getFieldValue("18")]+i[t.getFieldValue("19")]+i[t.getFieldValue("1a")]+i[t.getFieldValue("1b")]+i[t.getFieldValue("1c")]+i[t.getFieldValue("1d")]+i[t.getFieldValue("1e")]+i[t.getFieldValue("1f")]+":"+i[t.getFieldValue("20")]+i[t.getFieldValue("21")]+i[t.getFieldValue("22")]+i[t.getFieldValue("23")]+i[t.getFieldValue("24")]+i[t.getFieldValue("25")]+i[t.getFieldValue("26")]+i[t.getFieldValue("27")]+i[t.getFieldValue("28")]+i[t.getFieldValue("29")]+i[t.getFieldValue("2a")]+i[t.getFieldValue("2b")]+i[t.getFieldValue("2c")]+i[t.getFieldValue("2d")]+i[t.getFieldValue("2e")]+i[t.getFieldValue("2f")]+":"+i[t.getFieldValue("30")]+i[t.getFieldValue("31")]+i[t.getFieldValue("32")]+i[t.getFieldValue("33")]+i[t.getFieldValue("34")]+i[t.getFieldValue("35")]+i[t.getFieldValue("36")]+i[t.getFieldValue("37")]+i[t.getFieldValue("38")]+i[t.getFieldValue("39")]+i[t.getFieldValue("3a")]+i[t.getFieldValue("3b")]+i[t.getFieldValue("3c")]+i[t.getFieldValue("3d")]+i[t.getFieldValue("3e")]+i[t.getFieldValue("3f")]+":"+i[t.getFieldValue("40")]+i[t.getFieldValue("41")]+i[t.getFieldValue("42")]+i[t.getFieldValue("43")]+i[t.getFieldValue("44")]+i[t.getFieldValue("45")]+i[t.getFieldValue("46")]+i[t.getFieldValue("47")]+i[t.getFieldValue("48")]+i[t.getFieldValue("49")]+i[t.getFieldValue("4a")]+i[t.getFieldValue("4b")]+i[t.getFieldValue("4c")]+i[t.getFieldValue("4d")]+i[t.getFieldValue("4e")]+i[t.getFieldValue("4f")]+":"+i[t.getFieldValue("50")]+i[t.getFieldValue("51")]+i[t.getFieldValue("52")]+i[t.getFieldValue("53")]+i[t.getFieldValue("54")]+i[t.getFieldValue("55")]+i[t.getFieldValue("56")]+i[t.getFieldValue("57")]+i[t.getFieldValue("58")]+i[t.getFieldValue("59")]+i[t.getFieldValue("5a")]+i[t.getFieldValue("5b")]+i[t.getFieldValue("5c")]+i[t.getFieldValue("5d")]+i[t.getFieldValue("5e")]+i[t.getFieldValue("5f")]+":"+i[t.getFieldValue("60")]+i[t.getFieldValue("61")]+i[t.getFieldValue("62")]+i[t.getFieldValue("63")]+i[t.getFieldValue("64")]+i[t.getFieldValue("65")]+i[t.getFieldValue("66")]+i[t.getFieldValue("67")]+i[t.getFieldValue("68")]+i[t.getFieldValue("69")]+i[t.getFieldValue("6a")]+i[t.getFieldValue("6b")]+i[t.getFieldValue("6c")]+i[t.getFieldValue("6d")]+i[t.getFieldValue("6e")]+i[t.getFieldValue("6f")]+":"+i[t.getFieldValue("70")]+i[t.getFieldValue("71")]+i[t.getFieldValue("72")]+i[t.getFieldValue("73")]+i[t.getFieldValue("74")]+i[t.getFieldValue("75")]+i[t.getFieldValue("76")]+i[t.getFieldValue("77")]+i[t.getFieldValue("78")]+i[t.getFieldValue("79")]+i[t.getFieldValue("7a")]+i[t.getFieldValue("7b")]+i[t.getFieldValue("7c")]+i[t.getFieldValue("7d")]+i[t.getFieldValue("7e")]+i[t.getFieldValue("7f")]+'")',e.ORDER_ATOMIC]},iT=function(t,e){return e.definitions_.import_matrix="import matrix",["matrix.Image."+t.getFieldValue("image"),e.ORDER_ATOMIC]},nT=function(t,e){return e.definitions_.import_matrix="import matrix",["matrix.get_pixel(int("+e.valueToCode(t,"x",e.ORDER_ATOMIC)+"), int("+e.valueToCode(t,"y",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]},sT=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.set_pixel(int("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+"), int("+e.valueToCode(this,"y",e.ORDER_ASSIGNMENT)+"), "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},oT=function(t,e){e.definitions_.import_matrix="import matrix";return["matrix.get_brightness()",e.ORDER_ATOMIC]},pT=function(t,e){e.definitions_.import_matrix="import matrix";return["matrix.get_screenimage()",e.ORDER_ATOMIC]},uT=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.set_brightness("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},aT=function(t,e){return e.definitions_.import_matrix="import matrix","matrix.blink_rate("+e.valueToCode(this,"x",e.ORDER_ASSIGNMENT)+")\n"},lT=function(t,e){e.definitions_.import_matrix="import matrix";return"matrix.clear()\n"},_T=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC);return e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = ssd1306.SSD1306_I2C("+e.valueToCode(this,"row",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"column",e.ORDER_ATOMIC)+", "+i+")\n"},rT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_str("+(e.valueToCode(this,"Text_line1",e.ORDER_ASSIGNMENT)||"''")+", "+(e.valueToCode(this,"Text_line2",e.ORDER_ASSIGNMENT)||"''")+", "+(e.valueToCode(this,"Text_line3",e.ORDER_ASSIGNMENT)||"''")+", "+(e.valueToCode(this,"Text_line4",e.ORDER_ASSIGNMENT)||"''")+")\n"},dT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_line("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+", 1)\n"},IT=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"width",e.ORDER_ATOMIC),p=e.valueToCode(this,"height",e.ORDER_ATOMIC),u="TRUE"==this.getFieldValue("fill")?"True":"False",a=this.getFieldValue("OP"),l="";switch(u){case"True":l=i+".show_fill_rect("+n+", "+s+", "+o+", "+p+", "+a+")\n";break;case"False":l=i+".show_rect("+n+", "+s+", "+o+", "+p+", "+a+")\n"}return l},TT=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP"),n=e.valueToCode(t,"A",e.ORDER_ATOMIC),s=e.valueToCode(t,"B",e.ORDER_ATOMIC);return["INTERSECTION"==i?n+"-("+n+"-"+s+")":n+i+s,e.ORDER_ATOMIC]},hT=function(t,e){e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"length",e.ORDER_ATOMIC);return i+".show_"+this.getFieldValue("direction")+"("+n+", "+s+", "+o+", 1)\n"},mT=function(t,e){return["ON"==this.getFieldValue("ONOFF")?"1":"0",e.ORDER_ATOMIC]},OT=function(t,e){e.definitions_.import_matrix="import matrix";var i=t.getFieldValue("OP");return[e.valueToCode(t,"img",e.ORDER_ATOMIC)+".shift_"+i+"("+e.valueToCode(t,"val",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cT=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_ssd1306="import ssd1306",e.definitions_.import_machine="import machine",i+".show_fill("+this.getFieldValue("key")+")\n"},RT=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"TM1650"==o?(e.definitions_.import_tm1650="import tm1650",i=n+" = tm1650."+o+"("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},MT=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+this.getFieldValue("STAT")+"()\n"},ET=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"_show_num("+e.valueToCode(this,"VALUE",e.ORDER_ATOMIC)+")\n"},CT=function(t,e){var i=this.getFieldValue("TYPE");return e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"_show_dot("+e.valueToCode(this,"NO",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},AT=function(t,e){return["matrix.Image."+this.getFieldValue("ANIMATION"),e.ORDER_ATOMIC]},gT=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x",e.ORDER_ATOMIC),s=e.valueToCode(this,"y",e.ORDER_ATOMIC),o=e.valueToCode(this,"r",e.ORDER_ATOMIC),p="TRUE"==this.getFieldValue("fill")?"True":"False",u=this.getFieldValue("OP"),a="";switch(p){case"True":a=i+".show_fill_circle("+n+", "+s+", "+o+", "+u+")\n";break;case"False":a=i+".show_circle("+n+", "+s+", "+o+", "+u+")\n"}return a},ST=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306";var n=e.valueToCode(this,"x0",e.ORDER_ATOMIC),s=e.valueToCode(this,"y0",e.ORDER_ATOMIC),o=e.valueToCode(this,"x1",e.ORDER_ATOMIC),p=e.valueToCode(this,"y1",e.ORDER_ATOMIC),u=e.valueToCode(this,"x2",e.ORDER_ATOMIC),a=e.valueToCode(this,"y2",e.ORDER_ATOMIC),l="TRUE"==this.getFieldValue("fill")?"True":"False",_=this.getFieldValue("OP"),r="";switch(l){case"True":r=i+".show_fill_triangle("+n+", "+s+", "+o+", "+p+", "+u+", "+a+", "+_+")\n";break;case"False":r=i+".show_triangle("+n+", "+s+", "+o+", "+p+", "+u+", "+a+", "+_+")\n"}return r},DT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_bitmap("+e.valueToCode(this,"START_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"START_Y",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"bitmap_name",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"WIDTH",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"HEIGHT",e.ORDER_ATOMIC)+")\n"},LT=function(t,e){return e.definitions_.import_machine="import machine",e.definitions_.import_ssd1306="import ssd1306",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".show_pixel("+e.valueToCode(this,"POS_X",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"POS_Y",e.ORDER_ATOMIC)+")\n"},NT=function(t,e){var i,n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),s=e.valueToCode(this,"I2CSUB",e.ORDER_ATOMIC),o=this.getFieldValue("key");return"32x12 Matrix"==o?(e.definitions_.import_matrix32x12="import matrix32x12",i=n+" = matrix32x12.Matrix("+s+")\n"):"TM1637"==o&&(e.definitions_.import_tm1637="import tm1637",i=n+" = tm1637."+o+"("+s+")\n"),i},fT=function(t,e){var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return e.definitions_.import_matrix32x12="import matrix32x12",i+".set_buffer("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},FT=function(t,e){return e.definitions_.import_matrix32x12="import matrix32x12",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".scroll("+e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)+")\n"},vT=function(t,e){return e.definitions_.import_mixiot="import mixiot","mixiot.wlan_connect("+e.valueToCode(this,"WIFINAME",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+")\n"},PT=function(t,e){return e.definitions_.import_onenet="import onenet",e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+" = onenet.init_MQTT_client("+e.valueToCode(this,"CLIENT",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SERVER",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"USERNAME",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC)+", "+(e.valueToCode(this,"SUB",e.ORDER_ASSIGNMENT)||"None")+")\n"},VT=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return e.definitions_.import_onenet="import onenet",i+".do_disconnect()\n"},yT=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=e.valueToCode(this,"DICT",e.ORDER_ATOMIC),s="TRUE"==this.getFieldValue("is_print")?"True":"False";return e.definitions_.import_onenet="import onenet",i+".publish("+n+", is_print="+s+")\n"},YT=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return e.definitions_.import_onenet="import onenet",i+".check_msg()\n"},bT=function(t,e){e.definitions_.import_onenet="import onenet";var i=new Array(this.itemCount_),n=new Array(this.itemCount_),s=new Array(this.itemCount_),o=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);for(let t=0;t\r\n
{{-d.title}}
\r\n
\r\n {{# if (d.message) { }}\r\n

\r\n {{-d.message}}\r\n

\r\n {{# } }}\r\n
\r\n',{XML:ch}=Mt,{XML:Rh}=(ch.render(Oh,{title:"烧录速度",message:"要选择烧录速度,请更改“Burn Speed”,此值将用于向设备烧录代码。如果在用较高的烧录速度时出现问题,请尝试减小此值,这可能是由于外部串行到USB芯片的限制。"}),Mt),{XML:Mh}=(Rh.render(Oh,{title:"燒錄速度",message:"要選擇燒錄速度,請更改“Burn Speed”,此值將用於向設備燒錄程式碼。如果在用較高的燒錄速度時出現問題,請嘗試减小此值,這可能是由於外部串列到USB晶片的限制。"}),Mt),Eh=(Mh.render(Oh,{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 Rt.Generator("Python"));Eh.INDENT=" ",Eh.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"),Eh.ORDER_ATOMIC=0,Eh.ORDER_COLLECTION=1,Eh.ORDER_STRING_CONVERSION=1,Eh.ORDER_UNARY_POSTFIX=1,Eh.ORDER_UNARY_PREFIX=2,Eh.ORDER_MEMBER=2.1,Eh.ORDER_FUNCTION_CALL=2.2,Eh.ORDER_EXPONENTIATION=3,Eh.ORDER_UNARY_SIGN=4,Eh.ORDER_BITWISE_NOT=4,Eh.ORDER_MULTIPLICATIVE=5,Eh.ORDER_ADDITIVE=6,Eh.ORDER_BITWISE_SHIFT=7,Eh.ORDER_BITWISE_AND=8,Eh.ORDER_BITWISE_XOR=9,Eh.ORDER_BITWISE_OR=10,Eh.ORDER_RELATIONAL=11,Eh.ORDER_EQUALITY=11,Eh.ORDER_LOGICAL_NOT=12,Eh.ORDER_LOGICAL_AND=13,Eh.ORDER_LOGICAL_OR=14,Eh.ORDER_ASSIGNMENT=14,Eh.ORDER_CONDITIONAL=15,Eh.ORDER_LAMBDA=16,Eh.ORDER_NONE=99,Eh.ORDER_OVERRIDES=[[Eh.ORDER_FUNCTION_CALL,Eh.ORDER_MEMBER],[Eh.ORDER_FUNCTION_CALL,Eh.ORDER_FUNCTION_CALL],[Eh.ORDER_MEMBER,Eh.ORDER_MEMBER],[Eh.ORDER_MEMBER,Eh.ORDER_FUNCTION_CALL]],Eh.init=function(){Eh.PASS=this.INDENT+"pass\n",Eh.definitions_=Object.create(null),Eh.functionNames_=Object.create(null),Eh.setups_=Object.create(null),Eh.loops_=Object.create(null),Eh.codeEnd_=Object.create(null),Eh.variableDB_?Eh.variableDB_.reset():Eh.variableDB_=new gt(Eh.RESERVED_WORDS_)},Eh.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 p=[];for(var s in Eh.functions_)p.push(Eh.functions_[s]);p.length&&p.push("\n");var u=[];for(var s in Eh.setups_)u.push(Eh.setups_[s]);u.length&&u.push("\n");var a=[];for(var s in Eh.loops_)a.push(Eh.loops_[s]);var l=[];for(var s in Eh.codeEnd_)l.push(Eh.codeEnd_[s]);0!==l.length&&l.push("\n");let _="";return _=a.length>0?e.join("\n")+i.join("\n")+n.join("\n")+p.join("\n")+u.join("")+t+"while True:\n"+a.join("")+l.join("\n"):e.join("\n")+i.join("\n")+n.join("\n")+p.join("\n")+u.join("")+t+l.join("\n"),_},Eh.scrubNakedValue=function(t){return t+"\n"},Eh.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},Eh.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Eh.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=Rt.utils.string.wrap(o,Eh.COMMENT_WRAP-3),n+=Eh.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+u+" + "+s+")":s<0?"int("+u+" - "+-s+")":"int("+u+")",n&&(u="-"+u)),u};const Ch={k210:{description:"MicroPython[K210_MixGo AI]",digital_pin:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P17","17"],["P18","18"],["P19","19"],["P20","20"],["P21","21"],["P22","22"],["P23","23"],["P24","24"],["P25","25"]],digital:[["P0","0"],["P1","1"],["P2","2"],["P3","3"],["P6","6"],["P7","7"],["P8","8"],["P9","9"],["P10","10"],["P11","11"],["P12","12"],["P13","13"],["P14","14"],["P15","15"],["P16","16"],["P17","17"],["P18","18"],["P19","19"],["P20","20"],["P21","21"],["P22","22"],["P23","23"],["P24","24"],["P25","25"],["P30","30"],["P31","31"],["P32","32"],["P33","33"],["P34","34"],["P35","35"]],button:[["A","button_a"],["B","button_b"]],axis:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"]],exlcdh:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],exlcdv:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],serial_pin:[["pin0","0"],["pin1","1"],["pin2","2"],["pin8","8"],["pin12","12"],["pin13","13"],["pin14","14"],["pin15","15"],["pin16","16"]],radio_power:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"]],radio_datarate:[["1Mbit","RATE_1MBIT"],["250Kbit","RATE_250KBIT"],["2Mbit","RATE_2MBIT"]],one_more:[["ONE_SHOT","ONE_SHOT"],["PERIODIC","PERIODIC"]]}};Ch["MixGo AI"]=Ch.k210;const Ah=Ch,gh=100,Sh={init:function(){this.setColour(gh),this.appendDummyInput().appendField("初始化"),this.appendDummyInput().appendField("舵机"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.appendValueInput("time").appendField("定时器").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Dh={init:function(){this.setColour(gh),this.appendDummyInput().appendField("设置"),this.appendDummyInput().appendField("舵机"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.appendValueInput("range").appendField("角度").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Lh={init:function(){this.setColour(gh),this.appendDummyInput().appendField("初始化"),this.appendDummyInput().appendField("16路舵机"),this.appendValueInput("address").appendField("地址").setCheck(Number),this.appendValueInput("SUB").setCheck("var").setAlign(Rt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("使用PCA9685驱动16路舵机并备注IIC端口")}},Nh={init:function(){this.setColour(gh),this.appendDummyInput().appendField("设置"),this.appendDummyInput().appendField("16路舵机"),this.appendValueInput("index").appendField("编号").setCheck(Number),this.appendValueInput("range").appendField("角度").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("使用PCA9685驱动16路舵机,输入编号机角度")}},fh={init:function(){this.setColour(gh),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.appendValueInput("num").appendField("灯数").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Fh={init:function(){this.setColour(gh),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendValueInput("num").appendField("灯号").setCheck(Number),this.appendValueInput("R").appendField("R值").setCheck(Number),this.appendValueInput("G").appendField("G值").setCheck(Number),this.appendValueInput("B").appendField("B值").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},vh={init:function(){this.setColour(gh),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("生效"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip()}},Ph={init:function(){this.setColour(gh),this.appendValueInput("SUB").appendField("初始化").setCheck("var"),this.appendDummyInput().appendField("电机驱动"),this.appendDummyInput().appendField("地址").appendField(new Rt.FieldDropdown([["A","ms32006.ADDRESS_A"],["B","ms32006.ADDRESS_B"]]),"mode"),this.appendValueInput("SUB1").setCheck("var").setAlign(Rt.inputs.Align.RIGHT).appendField("通信"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化MS32006电机驱动,使用I2C通信")}},Vh={init:function(){this.setColour(gh),this.appendValueInput("SUB").appendField("直流电机").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Direction).appendField(new Rt.FieldDropdown([[Rt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[Rt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"],[Rt.Msg.MOTOR_N,"ms32006.MOT_N"],[Rt.Msg.MOTOR_P,"ms32006.MOT_P"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_STEPPER_SET_SPEED),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置直流电机的状态及转速(0-100)")}},yh={init:function(){this.setColour(gh),this.appendValueInput("SUB").appendField("步进电机").setCheck("var"),this.appendDummyInput().appendField("选择").appendField(new Rt.FieldDropdown([["A","ms32006.MOT_A"],["B","ms32006.MOT_B"]]),"mode"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_Direction).appendField(new Rt.FieldDropdown([[Rt.Msg.CLOCKWISE,"ms32006.MOT_CW"],[Rt.Msg.ANTI_CLOCKWISE,"ms32006.MOT_CCW"]]),"direction"),this.appendValueInput("speed").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField("转速"),this.appendValueInput("steps").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField("步数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("设置步进电机的状态、转速、步数(0-2047)")}},Yh={init:function(){this.setColour(gh),this.appendValueInput("SUB").setCheck("var").appendField("初始化"),this.appendValueInput("P",Number).appendField("P值").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("I",Number).appendField("I值").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("D",Number).appendField("D值").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("初始化PID算法")}},bh={init:function(){this.setColour(gh),this.appendValueInput("SUB").setCheck("var").appendField(""),this.appendDummyInput().appendField("运算"),this.appendValueInput("error").appendField("偏移量").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("scaler").appendField("定标量").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("根据参数返回运算结果")}},kh="#55839A",Xh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField(new Rt.FieldTextInput("anchor"),"VAR").appendField("锚点参数= (").appendField(new Rt.FieldTextInput("1.889, 2.5245, 2.9465, 3.94056, 3.99987, 5.3658, 5.155437, 6.92275, 6.718375, 9.01025"),"TEXT").appendField(")"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("锚点参数")}},Gh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField(new Rt.FieldTextInput("calss"),"VAR").appendField("物品名称= [").appendField(new Rt.FieldTextInput("'name1', 'name2', 'name3', 'name4'"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("将要识别的物品名称")}},xh={init:function(){this.setColour(kh),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendValueInput("path").appendField("模型加载").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("从flash系统中加载模型")}},Uh={init:function(){this.setColour(kh),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendValueInput("path").appendField("模型路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("从文件系统中加载模型")}},Hh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("yolo2").appendField("初始化"),this.appendValueInput("SUB").setAlign(Rt.inputs.Align.RIGHT).appendField("网络模型").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("概率阈值").setCheck(Number),this.appendValueInput("nms_value").setAlign(Rt.inputs.Align.RIGHT).appendField("box_iou门限").setCheck(Number),this.appendValueInput("anchor_num").setAlign(Rt.inputs.Align.RIGHT).appendField("锚点数").setCheck(Number),this.appendValueInput("anchor").setAlign(Rt.inputs.Align.RIGHT).appendField("锚点参数"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化yolo2网络")}},Bh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("yolo2").appendField("运行网络"),this.appendValueInput("SUB").setAlign(Rt.inputs.Align.RIGHT).appendField("模型").setCheck("var"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("运行yolo2网络")}},wh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("yolo2").appendField("前向运算"),this.appendValueInput("SUB").setAlign(Rt.inputs.Align.RIGHT).appendField("模型").setCheck("var"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("运行网络前向运算")}},Wh={init:function(){this.setColour(kh),this.appendDummyInput().appendField("yolo2").appendField("模型解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-x","x"],["坐标-y","y"],["标识号","classid"],["置信度","value"]]),"key"),this.setOutput(!0),this.setTooltip("对于模型解析,获取模型识别结果的目标坐标、标识好、置信度")}},Kh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_OneNET").appendField("连接WiFi"),this.appendValueInput("account").appendField("名称").setCheck(String),this.appendValueInput("password").appendField("密码").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("AI-Onenet平台 连接WiFi")}},Qh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_OneNET").appendField("获鉴权码"),this.appendValueInput("account").setAlign(Rt.inputs.Align.RIGHT).appendField("账号").setCheck(String),this.appendValueInput("password").setAlign(Rt.inputs.Align.RIGHT).appendField("密码").setCheck(String),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("AI-Onenet平台 需要注册平台才能使用账号获取用户鉴权码,鉴权码一般24小时有效")}},jh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_OneNET").appendField("调取API"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像"),this.appendDummyInput().appendField("识别").appendField(new Rt.FieldDropdown([["人脸检测","FACE_RECO"],["人脸分析","FACE_ATTRIBUTE"],["人体检测","BODY_RECO"],["图像抄表","AMMETER_READ"],["内容测评","IDENTIFY_PORN"],["车牌信息","NUMBER_PLATE_RECOGNITION"],["宠物种类","CAT_DOG_DETECTION"],["火灾检测","FIRE_DETECTION"]]),"api"),this.appendValueInput("token").setAlign(Rt.inputs.Align.RIGHT).appendField("鉴权码").setCheck(String),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("AI-Onenet平台 调用平台API,返回列表识别结果参数")}},qh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_Local").appendField("模型训练"),this.appendValueInput("calss").setAlign(Rt.inputs.Align.RIGHT).appendField("物品"),this.appendValueInput("sample").setAlign(Rt.inputs.Align.RIGHT).appendField("训练量").setCheck(Number),this.appendValueInput("save").setAlign(Rt.inputs.Align.RIGHT).appendField("保存").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("AI-Local本地模型训练 需要识别的物品名称、每个物品训练数量、保存的名称")}},Jh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_Local").appendField("模型加载"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("AI-Local 加载已经训练好的本地模型")}},zh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_Local").appendField("运行模型"),this.appendValueInput("calss").setAlign(Rt.inputs.Align.RIGHT).appendField("物品"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("AI-Local 采集图像运行模型将返回识别的物品名、置信度")}},Zh={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_Face").appendField("初始化 加载"),this.appendValueInput("FD").setAlign(Rt.inputs.Align.RIGHT).appendField("模型FD:").setCheck(String),this.appendValueInput("LD").setAlign(Rt.inputs.Align.RIGHT).appendField("模型LD:").setCheck(String),this.appendValueInput("FE").setAlign(Rt.inputs.Align.RIGHT).appendField("模型FE:").setCheck(String),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("人脸分辨,初始化")}},$h={init:function(){this.setColour(kh),this.appendDummyInput("").appendField("AI_Face").appendField("运行识别"),this.appendValueInput("names").setAlign(Rt.inputs.Align.RIGHT).appendField("人名"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图象"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("人脸分辨,识别到人脸返回True,无人脸返回False")}},tm={init:function(){this.setColour(kh),this.appendDummyInput().appendField("AI_Face").appendField("识别解析"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["识别人名","info_name"],["置信度 %","info_score"],["脸部坐标","info_face"],["三官坐标","info_organs"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("人脸分辨,识别到人物名称,置信度,脸部坐标,三官(眼睛x2、鼻子、嘴巴*2)坐标")}},em="#2CAAD2",im={init:function(){this.setColour(em),this.appendValueInput("SUB").setCheck("var").appendField("初始化"),this.appendValueInput("BCK",Number).appendField("BCK#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("WS",Number).appendField("WS#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("DAT",Number).appendField("DAT#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("初始化配置扬声器,用于语音播放")}},nm={init:function(){this.setColour(em),this.appendValueInput("SUB").setCheck("var").appendField("初始化"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("初始化配置扬声器,用于语音播放")}},sm={init:function(){this.setColour(em),this.appendDummyInput().appendField("Audio 音频播放"),this.appendValueInput("path").appendField("路径").setAlign(Rt.inputs.Align.RIGHT).setCheck(String),this.appendValueInput("SUB").setCheck("var").setAlign(Rt.inputs.Align.RIGHT).appendField("设备"),this.appendValueInput("volume").appendField("音量(%)").setAlign(Rt.inputs.Align.RIGHT).setCheck(Number),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("音频播放")}},om={init:function(){this.setColour(em),this.appendDummyInput().appendField("Audio 音频录制"),this.appendValueInput("path").appendField("路径").setAlign(Rt.inputs.Align.RIGHT).setCheck(String),this.appendValueInput("SUB").setCheck("var").setAlign(Rt.inputs.Align.RIGHT).appendField("设备"),this.appendValueInput("time").appendField("时长(s)").setAlign(Rt.inputs.Align.RIGHT).setCheck(Number),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("音频录制")}},pm={init:function(){this.setColour(em),this.appendDummyInput().appendField("Video 视频播放"),this.appendValueInput("path").appendField("路径").setAlign(Rt.inputs.Align.RIGHT).setCheck(String),this.appendValueInput("SUB").setCheck("var").setAlign(Rt.inputs.Align.RIGHT).appendField("设备"),this.appendValueInput("volume").appendField("音量(%)").setAlign(Rt.inputs.Align.RIGHT).setCheck(Number),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("视频播放")}},um={init:function(){this.setColour(em),this.appendDummyInput().appendField("Video 视频录制"),this.appendValueInput("path").appendField("路径").setAlign(Rt.inputs.Align.RIGHT).setCheck(String),this.appendValueInput("SUB").setCheck("var").setAlign(Rt.inputs.Align.RIGHT).appendField("设备"),this.appendValueInput("time").appendField("时长(s)").setAlign(Rt.inputs.Align.RIGHT).setCheck(Number),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("视频录制")}},am="#bc9705",lm={init:function(){this.setColour(am),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["彩色图(YUV422)","sensor.YUV422"],["彩色图(RGB565)","sensor.RGB565"],["灰度图","sensor.GRAYSCALE"]]),"flag"),this.setOutput(!0),this.setTooltip()}},_m={init:function(){this.setColour(am),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["320x240","sensor.QVGA"],["240x240","sensor.B240X240"],["128x128","sensor.B128X128"],["64x64","sensor.B64X64"]]),"flag"),this.setOutput(!0),this.setTooltip()}},rm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera").appendField("初始化"),this.appendValueInput("key1").setAlign(Rt.inputs.Align.RIGHT).appendField("帧格式"),this.appendValueInput("key2").setAlign(Rt.inputs.Align.RIGHT).appendField("帧大小"),this.appendValueInput("key3").setAlign(Rt.inputs.Align.RIGHT).appendField("图捕捉"),this.appendValueInput("key4").setAlign(Rt.inputs.Align.RIGHT).appendField("跳帧数"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("初始化摄像头,会自动扫描并获取摄像头型号")}},dm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendDummyInput().appendField("初始化"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("初始化摄像头,会自动扫描并获取摄像头型号")}},Im={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("帧格式"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置摄像头输出格式")}},Tm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("帧大小"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置摄像头输出帧大小")}},hm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("图捕捉"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("开启图像捕捉功能")}},mm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("frame").appendField("跳帧数").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("摄像头跳过指定帧数")}},Om={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendDummyInput().appendField("获取图像"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("控制摄像头捕捉图像")}},cm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("设为"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("启动/关闭摄像头")}},Rm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("水平镜像"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置摄像头水平镜像")}},Mm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("垂直镜像"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置摄像头垂直镜像")}},Em={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendValueInput("key").appendField("彩条模式"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("将摄像头设置为彩条模式")}},Cm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["分辨率宽度","width"],["分辨率高度","height"],["当前增益值","get_gain_db"],["帧缓冲图像","get_fb"],["类型型号ID","get_id"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("获取当前摄像头信息")}},Am={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendDummyInput().appendField("设置").appendField(new Rt.FieldDropdown([["对比度","set_contrast"],["亮度值","set_brightness"],["增益值","set_auto_gain"],["饱和度","set_saturation"]]),"key"),this.appendValueInput("num").appendField("值为").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置摄像头对比度、亮度、增益、饱和度")}},gm={init:function(){this.setColour(am),this.appendDummyInput().appendField("Camera"),this.appendDummyInput().appendField("设置窗口"),this.appendValueInput("numa").appendField("宽为").setCheck(Number),this.appendValueInput("numb").appendField("高为").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置摄像头窗口大小")}},Sm=140,Dm={init:function(){this.setColour(Sm),this.appendValueInput("PIN").appendField(Rt.Msg.MIXLY_IR_RECEIVE),this.appendDummyInput().appendField("获取编码"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_I2C_SCAN)}},Lm={init:function(){this.setColour(Sm),this.appendValueInput("SUB").appendField("I2C "+Rt.Msg.MIXLY_SETUP).setCheck("var"),this.appendValueInput("TX",Number).appendField("SCL#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("RX",Number).appendField("SDA#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField("通道").appendField(new Rt.FieldDropdown([["0","I2C0"],["1","I2C1"],["2","I2C2"]]),"mode"),this.appendValueInput("freq").setCheck(Number).appendField(Rt.Msg.MIXLY_FREQUENCY).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_I2C_INIT)}},Nm={init:function(){this.setColour(Sm),this.appendValueInput("SUB").setCheck("var").appendField("I2S 初始化"),this.appendDummyInput().appendField("设备").appendField(new Rt.FieldDropdown([["麦克风","mic"],["扬声器","spk"]]),"mode"),this.appendValueInput("BCK",Number).appendField("BCK#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("WS",Number).appendField("WS#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("DAT",Number).appendField("DAT#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("sample").appendField("采样率").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_I2C_INIT)}},fm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").appendField("I2C").setCheck("var"),this.appendValueInput("address").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_RNUMBER),this.appendValueInput("data").setCheck(Number).appendField(Rt.Msg.LANG_MATH_BYTE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_I2C_READ)}},Fm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").appendField("I2C").setCheck("var"),this.appendValueInput("address").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_WNUMBER),this.appendValueInput("data").setCheck(Number).appendField(Rt.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_I2C_WRITE)}},vm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_ESP32_I2C_SCAN1),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_I2C_SCAN2),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_I2C_SCAN)}},Pm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_ESP32_SPI_INIT),this.appendValueInput("freq").setCheck(Number).appendField(Rt.Msg.MIXLY_SERIAL_BEGIN),this.appendValueInput("polarity").setCheck(Number).appendField("polarity"),this.appendValueInput("phase").setCheck(Number).appendField("phase"),this.appendValueInput("sck").setCheck(Number).appendField("SCK"),this.appendValueInput("mosi").setCheck(Number).appendField("MOSI"),this.appendValueInput("miso").setCheck(Number).appendField("MISO"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_INIT_TOOLTIP)}},Vm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_SETTING+" SPI"),this.appendValueInput("data").setCheck(Number).appendField(Rt.Msg.MIXLY_SERIAL_BEGIN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_SET)}},ym={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_ESP32_SET+"SPI"),this.appendValueInput("data").setCheck(Number).appendField(Rt.Msg.MIXLY_ESP32_SPI_BUFFER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_BUFFER_SET)}},Ym={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("SPI"),this.appendValueInput("data").setCheck(Number).appendField(Rt.Msg.MIXLY_SERIAL_READ),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER2+Rt.Msg.LANG_MATH_BYTE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_READ)}},bm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("SPI"),this.appendValueInput("data").setCheck(Number).appendField(Rt.Msg.MIXLY_SERIAL_READ),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_4DIGITDISPLAY_NOMBER2+Rt.Msg.LANG_MATH_BYTE+","+Rt.Msg.MIXLY_ESP32_SPI_OUTPUT),this.appendValueInput("val").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_READ_OUTPUT)}},km={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("SPI"),this.appendValueInput("data").setCheck("var").appendField(Rt.Msg.MIXLY_SERIAL_READ+Rt.Msg.MIXLY_ESP32_SPI_BUFFER),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_READINTO)}},Xm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("SPI"),this.appendValueInput("data").setCheck("var").appendField(Rt.Msg.MIXLY_SERIAL_READ+Rt.Msg.MIXLY_ESP32_SPI_BUFFER),this.appendValueInput("val").setCheck(Number).appendField(","+Rt.Msg.MIXLY_ESP32_SPI_OUTPUT),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_READINTO_OUTPUT)}},Gm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("SPI"),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_WRITE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_WRITE)}},xm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("SPI"),this.appendValueInput("data").setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_WRITE),this.appendValueInput("val").setCheck("var").appendField(","+Rt.Msg.MIXLY_ESP32_BUFFER_READ),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_SPI_WRITE_READINTO)}},Um={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("I2C"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_READ),this.setOutput(!0,Number)}},Hm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_ESP32_READ+"I2C"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_SUCCESS),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_ESP32_I2C_AVAILABLE)}},Bm={init:function(){this.setColour(Sm),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_I2C_SLAVE_ONRECEIVE).setCheck(Number),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("OneWire"),this.appendValueInput("BUS").setCheck(Number).appendField(Rt.Msg.MIXLY_SETUP+" "+Rt.Msg.MIXLY_PIN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_OW_INIT)}},Wm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("OneWire"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_ONEWIRE_SCAN),this.setOutput(!0,"List"),this.setTooltip(Rt.Msg.MIXLY_ESP32_OW_SCAN)}},Km={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("OneWire"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_ONEWIRE_READ),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_OW_READ)}},Qm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField("OneWire"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_ESP32_WRITE).appendField(new Rt.FieldDropdown([[Rt.Msg.LANG_MATH_STRING,"write"],[Rt.Msg.LANG_MATH_BYTE,"writebyte"]]),"op"),this.appendValueInput("byte").setCheck([Number,String]),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_OW_WRITE)}},jm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_ESP32_ONEWIRE_SELECT),this.appendValueInput("byte").setCheck(String).appendField("ROM"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_OW_SELECT)}},qm={init:function(){this.setColour(Sm),this.appendValueInput("VAR").setCheck("var").appendField(Rt.Msg.MIXLY_ESP32_ONEWIRE_RESET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Rt.Msg.MIXLY_ESP32_OW_RESET)}},Jm=Lm,zm=fm,Zm=Fm,$m=vm,tO=Pm,eO=Vm,iO=ym,nO=Ym,sO=bm,oO=km,pO=Xm,uO=Gm,aO=xm,lO=Um,_O=Hm,rO=180,dO={init:function(){this.setColour(rO),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["0°","0"],["90°","1"],["180°","2"],["270°","3"]]),"flag"),this.setOutput(!0),this.setTooltip()}},IO={init:function(){this.setColour(rO),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["黑色","lcd.BLACK"],["深蓝色","lcd.NAVY"],["蓝色","lcd.BLUE"],["深绿色","lcd.DARKGREEN"],["深青色","lcd.DARKCYAN"],["绿色","lcd.GREEN"],["青色","lcd.CYAN"],["褐红色","lcd.MAROON"],["紫色","lcd.PURPLE"],["橄榄色","lcd.OLIVE"],["深灰色","lcd.DARKGREY"],["绿黄色","lcd.GREENYELLOW"],["浅灰色","lcd.LIGHTGREY"],["红色","lcd.RED"],["洋红色","lcd.MAGENTA"],["粉红色","lcd.PINK"],["橙色","lcd.ORANGE"],["黄色","lcd.YELLOW"],["白色","lcd.WHITE"]]),"flag"),this.setOutput(!0),this.setTooltip()}},TO={init:function(){this.setColour(rO),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["开启","1"],["关闭","0"]]),"flag"),this.setOutput(!0),this.setTooltip()}},hO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 初始化"),this.appendValueInput("freq").setAlign(Rt.inputs.Align.RIGHT).appendField("通信频率").setCheck(Number),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("背景颜色").setCheck(Number),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化LCD屏幕显示")}},mO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 获取 "),this.appendDummyInput().appendField(new Rt.FieldDropdown([["宽度","width"],["高度","height"]]),"key"),this.appendDummyInput().appendField("分辨率"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("获取LCD的宽度/高度(水平分辨率)")}},OO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD"),this.appendValueInput("key").appendField("系统颜色"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("获取LCD的宽度/高度(水平分辨率)")}},cO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 显示图像"),this.appendValueInput("img").appendField(""),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("在液晶屏上显示一张image(GRAYSCALE或RGB565")}},RO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 清屏颜色"),this.appendValueInput("color").appendField("").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("将液晶屏清空为指定的颜色")}},MO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 屏幕旋转"),this.appendValueInput("key").appendField(""),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("设置LCD屏幕方向")}},EO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 镜像显示"),this.appendValueInput("key").appendField(""),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("设置LCD是否镜面显示")}},CO={init:function(){this.setColour(rO),this.appendDummyInput().appendField("LCD 绘制文本"),this.appendValueInput("x").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标X").setCheck(Number),this.appendValueInput("y").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标Y").setCheck(Number),this.appendValueInput("text").setAlign(Rt.inputs.Align.RIGHT).appendField("文本内容").setCheck(String),this.appendValueInput("color_T").setAlign(Rt.inputs.Align.RIGHT).appendField("文本颜色").setCheck(Number),this.appendValueInput("color_S").setAlign(Rt.inputs.Align.RIGHT).appendField("背景颜色").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("在液晶屏上显示文本字符(不支持中文)")}},AO={init:function(){this.setColour(40),this.appendDummyInput().appendField("Touch 初始化"),this.appendValueInput("I2C").appendField("通信").setCheck("var"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化触摸屏")}},gO={init:function(){this.setColour(40),this.appendDummyInput().appendField("Touch 校准"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("校准屏幕,使屏幕显示和触摸屏像素能够对应")}},SO={init:function(){this.setColour(40),this.appendDummyInput().appendField("Touch 获取 "),this.appendDummyInput().appendField(new Rt.FieldDropdown([["状态","[0]"],["坐标x","[1]"],["坐标y","[2]"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("读取当前屏幕的状态以及按下的点的坐标值")}},DO={init:function(){this.setColour(40),this.appendDummyInput().appendField("Touch 状态"),this.appendDummyInput().appendField(new Rt.FieldDropdown([["空闲","ts.STATUS_IDLE"],["不按","ts.STATUS_RELEASE"],["按下","ts.STATUS_PRESS"],["移动","ts.STATUS_MOVE"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("读取当前屏幕的状态以及按下的点的坐标值")}},LO="#777777",NO={init:function(){this.setColour(LO),this.appendDummyInput("").appendField("from ").appendField(new Rt.FieldTextInput("mixno"),"path").appendField(" import ").appendField(new Rt.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fO={init:function(){this.setColour(LO),this.appendDummyInput("").appendField("import ").appendField(new Rt.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},FO={init:function(){this.setColour(LO),this.appendDummyInput("").appendField(new Rt.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;ee?t[e]:"ni-hao"),"KEY"+e).appendField("”:")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},WO={init:function(){this.setColour(HO),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("启动识别 返回结果"),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip("语音识别,获取识别结果")}},KO={init:function(){this.setColour(HO),this.appendValueInput("SUB").appendField("").setCheck("var"),this.appendDummyInput().appendField("注销识别 内存释放"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("语音识别,注销语音识别,释放内存")}},QO="#90A244",jO={init:function(){this.setColour(QO),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["否","0"],["是","1"]]),"flag"),this.setOutput(!0),this.setTooltip()}},qO={init:function(){this.setColour(QO),this.appendValueInput("SUB").setCheck("var"),this.appendValueInput("path").appendField("打开路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("打开一个新的图像对象")}},JO={init:function(){this.setColour(QO),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField("打开空图"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("打开一个空的图像对象")}},zO={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像信息"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["宽度","width"],["高度","height"],["格式","format"],["大小","size"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("获取图像的宽度、高度、格式、大小")}},ZO={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像保存"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("图像的副本保存到文件系统")}},$O={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像截取"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("复制一个图像图像的副本")}},tc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("RGB"),this.appendDummyInput().appendField("["),this.appendValueInput("R").setCheck(Number),this.appendValueInput("G").appendField(",").setCheck(Number),this.appendValueInput("B").appendField(",").setCheck(Number),this.appendDummyInput().appendField("]"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("对图像进行适当压缩")}},ec={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像压缩"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("quality").setAlign(Rt.inputs.Align.RIGHT).appendField("压缩率").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("对图像进行适当压缩")}},ic={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像清除"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("将图像中的所有像素设置为零")}},nc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像转换"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendDummyInput().appendField("转换为").appendField(new Rt.FieldDropdown([["灰度图","to_grayscale"],["彩色图","to_rgb565"],["彩虹图","to_rainbow"],["AI格式","pix_to_ai"],["字节块","to_bytes"]]),"key"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("将图像转换为灰度图、彩色图、彩虹图像")}},sc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("修改点颜色"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("设置图像某点像素值")}},oc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("获取点颜色"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("获取图像某点像素值")}},pc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("字库加载"),this.appendValueInput("path").setAlign(Rt.inputs.Align.RIGHT).appendField("路径").setCheck(String),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("从SD中加载需要显示文字的字库")}},uc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("字库释放"),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("释放字库所占的内存")}},ac={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制文本(中)"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.appendValueInput("x_spacing").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个文本")}},lc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制文本"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.appendValueInput("x_spacing").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个中文文本")}},_c={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制文本(英)"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("x0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-x").setCheck(Number),this.appendValueInput("y0").setAlign(Rt.inputs.Align.RIGHT).appendField("起-y").setCheck(Number),this.appendValueInput("tex").setAlign(Rt.inputs.Align.RIGHT).appendField("内容").setCheck(String),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("scale").setAlign(Rt.inputs.Align.RIGHT).appendField("字号").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上绘制一个字符文本")}},rc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制直线"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyxy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一条从(x0,y0)到(x1,y1)的线")}},dc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制箭头"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyxy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("大小").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个箭头")}},Ic={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制十字"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("延伸").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个十字")}},Tc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制圆形"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xyr"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个圆形")}},hc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制矩形"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xywh"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("图像上绘制一个矩形")}},mc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制特征点"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("keypoints").setAlign(Rt.inputs.Align.RIGHT).appendField("对象"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("大小").setCheck(Number),this.appendValueInput("thi").setAlign(Rt.inputs.Align.RIGHT).appendField("粗细").setCheck(Number),this.appendValueInput("fil").setAlign(Rt.inputs.Align.RIGHT).appendField("填充").setCheck(Number),this.setOutput(!0),this.setTooltip("绘制一个特征点对象的各个点")}},Oc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("绘制图像"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("坐标-xy"),this.appendValueInput("x_scale").setAlign(Rt.inputs.Align.RIGHT).appendField("x缩放").setCheck(Number),this.appendValueInput("y_scale").setAlign(Rt.inputs.Align.RIGHT).appendField("y缩放").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("绘制一个image图像")}},cc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("直线识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("theta_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并角度").setCheck(Number),this.appendValueInput("rho_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并斜率").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别直线,返回image.line对象列表")}},Rc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("线段识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("distance").setAlign(Rt.inputs.Align.RIGHT).appendField("间距").setCheck(Number),this.appendValueInput("difference").setAlign(Rt.inputs.Align.RIGHT).appendField("合并角度").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别线段,返回image.line对象列表")}},Mc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("圆形识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("r_min").setAlign(Rt.inputs.Align.RIGHT).appendField("最小r").setCheck(Number),this.appendValueInput("r_max").setAlign(Rt.inputs.Align.RIGHT).appendField("最大r").setCheck(Number),this.appendValueInput("r_step").setAlign(Rt.inputs.Align.RIGHT).appendField("步长r").setCheck(Number),this.appendValueInput("x_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并x值").setCheck(Number),this.appendValueInput("y_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并y值").setCheck(Number),this.appendValueInput("r_margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并r值").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[circle]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用霍夫变换识别圆形,返回image.cirle对象列表")}},Ec={init:function(){this.setColour(QO),this.appendDummyInput().appendField("矩形识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[rect]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用四元检测识别矩形,返回image.rect对象列表")}},Cc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("线性回归"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值反转"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("robust").setAlign(Rt.inputs.Align.RIGHT).appendField("泰尔指数").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[line]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("计算线性回归,返回image.line对象列表")}},Ac={init:function(){this.setColour(QO),this.appendDummyInput().appendField("直线解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","line"],["x1分量","x1"],["y1分量","y1"],["x2分量","x2"],["y2分量","y2"],["长度","length"],["角度","theta"],["斜率","rho"],["模","magnitude"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.line列表,获取直线信息")}},gc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("圆形解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xyr","circle"],["x分量","x"],["y分量","y"],["r分量","r"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.circle列表,获取圆形信息")}},Sc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("矩形解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.rect列表,获取矩形信息")}},Dc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("直方图均衡"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("自适应"),this.appendValueInput("limit").setAlign(Rt.inputs.Align.RIGHT).appendField("对比度").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单直方图均衡化")}},Lc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("模糊滤波"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("自适应"),this.appendValueInput("offset").setAlign(Rt.inputs.Align.RIGHT).appendField("补偿").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单模糊滤波")}},Nc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("卡通化滤波"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("seed").setAlign(Rt.inputs.Align.RIGHT).appendField("原始差异").setCheck(Number),this.appendValueInput("float").setAlign(Rt.inputs.Align.RIGHT).appendField("相邻差异").setCheck(Number),this.setOutput(!0),this.setTooltip("图像上的简单卡通滤波器")}},fc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像腐蚀"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setTooltip("图像腐蚀,从分割区域的边缘删除像素(白色目标区域)")}},Fc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像膨胀"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.setOutput(!0),this.setTooltip("图像膨胀,将像素添加到分割区域的边缘中(白色目标区域)")}},vc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像填充"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("开始坐标"),this.appendValueInput("color").setAlign(Rt.inputs.Align.RIGHT).appendField("颜色").setCheck(Number),this.appendValueInput("seed").setAlign(Rt.inputs.Align.RIGHT).appendField("原始差异").setCheck(Number),this.appendValueInput("float").setAlign(Rt.inputs.Align.RIGHT).appendField("相邻差异").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("反转"),this.appendValueInput("clear").setAlign(Rt.inputs.Align.RIGHT).appendField("清除"),this.setOutput(!0),this.setTooltip("像洪水一样填充图像中低矮凹陷的地方(洪水填充)")}},Pc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像投影"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("垂直投影"),this.setOutput(!0),this.setTooltip("图像从笛卡尔坐标到线性极坐标重新投影")}},Vc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像反转"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("翻转图像中的所有像素值")}},yc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("校正缩放"),this.appendValueInput("VAR").appendField("图像").setCheck("var"),this.appendValueInput("strength").appendField("校正值").setCheck(Number),this.appendValueInput("zoom").appendField("缩放值").setCheck(Number),this.setOutput(!0),this.setTooltip("翻转图像中的所有像素值")}},Yc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像二值化"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值").setCheck(Number),this.appendValueInput("invert").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值反转"),this.appendValueInput("zero").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值像素为零"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("根据像素是否在阈值列表 thresholds 中的阈值内,将图像中的所有像素设置为黑色或白色。")}},bc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("图像边缘检测"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("卷积核尺寸").setCheck(Number),this.appendValueInput("kernel").setAlign(Rt.inputs.Align.RIGHT).appendField("内核"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("通过过滤器内核对图像进行卷积。")}},kc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("条形码识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[barcode]"),this.setOutput(!0),this.setInputsInline(!1),this.setOutput(!0),this.setTooltip("使用条形码识别,返回image.barcode对象列表")}},Xc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("二维码识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[qrcode]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用二维码识别,返回image.line对象列表")}},Gc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("AprilTag识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[apriltag]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用image.TAG36H11识别,返回image.apriltag对象列表")}},xc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("二维码解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["内容","payload"],["版本","version"],["掩码","mask"],["类型","data_type"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.qrcode列表,获取二维码信息")}},Uc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("条形码解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["内容","payload"],["类型","type"],["角度","rotation"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},Hc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("AprilTag解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["号码","id"],["家族","family"],["弧度","rotation"],["x向距离","x_translation"],["y向距离","y_translation"],["z向距离","z_translation"],["x向弧度","x_rotation"],["y向弧度","y_rotation"],["z向弧度","z_rotation"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.apriltag列表,获取Apriltag信息")}},Bc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("色块追踪"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("LIST").setAlign(Rt.inputs.Align.RIGHT).appendField("阈值LAB"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("area").setAlign(Rt.inputs.Align.RIGHT).appendField("滤掉区域").setCheck(Number),this.appendValueInput("pixel").setAlign(Rt.inputs.Align.RIGHT).appendField("滤掉素数").setCheck(Number),this.appendValueInput("margin").setAlign(Rt.inputs.Align.RIGHT).appendField("合并").setCheck(Number),this.appendValueInput("key").setAlign(Rt.inputs.Align.RIGHT).appendField("重叠"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[blob]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用色块追踪,返回image.blob对象列表")}},wc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("颜色识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[histogram]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用直方图识别颜色,返回image.histogram对象列表")}},Wc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("追踪解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["像素量","pixels"],["弧度","rotation"],["号码数","code"],["合并量","count"],["面积","area"],["密度比","density"]]),"key"),this.setOutput(!0),this.setTooltip("通过image.blob列表,获取追踪色块信息")}},Kc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("色阈浮点"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图浮点列表","bins"],["LAB的L浮点列表","l_bins"],["LAB的A浮点列表","a_bins"],["LAB的B浮点列表","b_bins"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},Qc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("颜色解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendValueInput("percentile").appendField("CDF").setCheck(Number),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图值","value"],["LAB的L值","l_value"],["LAB的A值","a_value"],["LAB的B值","b_value"]]),"key"),this.setOutput(!0),this.setTooltip("通过histogram列表,获取识别颜色信息")}},jc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("色阈解析"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["灰度图值","value"],["LAB的L值","l_value"],["LAB的A值","a_value"],["LAB的B值","b_value"]]),"key"),this.setOutput(!0),this.setTooltip("通过遍历image.barcode列表,获取条形码信息")}},qc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("RGB888值"),this.appendValueInput("LIST").appendField("由LAB"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("LAB转RGB888")}},Jc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("LAB值"),this.appendValueInput("LIST").appendField("由RGB888"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("RGB888转LAB")}},zc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("灰度值"),this.appendValueInput("LIST").appendField("由RGB888"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("RGB888转灰度图")}},Zc={init:function(){this.setColour(QO),this.appendDummyInput().appendField("RGB888"),this.appendValueInput("g_value").appendField("由灰度值").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("灰度图转RGB888")}},$c={init:function(){this.setColour(QO),this.appendDummyInput().appendField("定向梯度图"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("size").setAlign(Rt.inputs.Align.RIGHT).appendField("线长").setCheck(Number),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("用HOG(定向梯度直方图)线替换ROI中的像素,仅支持灰度图像")}},tR={init:function(){this.setColour(QO),this.appendDummyInput().appendField("特征识别"),this.appendValueInput("VAR").setAlign(Rt.inputs.Align.RIGHT).appendField("图像").setCheck("var"),this.appendValueInput("roi").setAlign(Rt.inputs.Align.RIGHT).appendField("区域-xywh"),this.appendValueInput("max_keypoints").setAlign(Rt.inputs.Align.RIGHT).appendField("关键点数").setCheck(Number),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("角点数").setCheck(Number),this.appendValueInput("scale_factor").setAlign(Rt.inputs.Align.RIGHT).appendField("比例因子").setCheck(Number),this.appendValueInput("normalized").setAlign(Rt.inputs.Align.RIGHT).appendField("多比例"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[keypoints]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用特征识别,返回image.keypoints对象列表")}},eR={init:function(){this.setColour(QO),this.appendDummyInput().appendField("特征比较"),this.appendValueInput("VAR1").setAlign(Rt.inputs.Align.RIGHT).appendField("对象1").setCheck("var"),this.appendValueInput("VAR2").setAlign(Rt.inputs.Align.RIGHT).appendField("对象2").setCheck("var"),this.appendValueInput("threshold").setAlign(Rt.inputs.Align.RIGHT).appendField("相似度").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("返回[kptmatch]"),this.setOutput(!0),this.setInputsInline(!1),this.setTooltip("使用特征识别,返回image.keypoints对象列表")}},iR={init:function(){this.setColour(QO),this.appendDummyInput().appendField("特征信息"),this.appendValueInput("VAR").appendField("对象").setCheck("var"),this.appendDummyInput().appendField("获取").appendField(new Rt.FieldDropdown([["坐标-xywh","rect"],["x分量","x"],["y分量","y"],["w分量","w"],["h分量","h"],["中心-x","cx"],["中心-y","cy"],["匹配量","count"],["弧度","theta"],["匹配点-xy","match"]]),"key"),this.setOutput(!0),this.setTooltip("通过image.kptmatch列表,获取追踪特征信息")}},nR=20,sR={init:function(){this.setColour(nR),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_HIGH,"HIGH"],[Rt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP)}},oR={init:function(){this.setColour(nR),this.appendDummyInput().appendField("初始化 "),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_Digital_PINMODEOUT,"GPIO.OUT"],[Rt.Msg.MIXLY_Digital_PINMODEIN,"GPIO.IN"],[Rt.Msg.MIXLY_PINMODEPULLUP,"GPIO.IN, board.GPIO.PULL_UP"],[Rt.Msg.MIXLY_PINMODEPULLDOWN,"GPIO.IN, board.GPIO.PULL_DOWN"]]),"MODE"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP)}},pR={init:function(){this.setColour(nR),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_Digital_PINMODEOUT).setCheck(Number),this.appendValueInput("STAT").appendField(Rt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP)}},uR={init:function(){this.setColour(nR),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Rt.Msg.MIXLY_Digital_PINMODEIN).setCheck(Number),this.appendDummyInput().appendField("值"),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP)}},aR={init:function(){this.setColour(nR),this.appendDummyInput().appendField("初始化 PWM输出"),this.appendValueInput("PIN",Number).appendField("管脚").setCheck(Number),this.appendValueInput("freq").appendField("频率").setCheck(Number),this.appendValueInput("VAR").appendField("定时器").setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化PWM输出设置,需要调用定时器")}},lR={init:function(){this.setColour(nR),this.appendValueInput("PIN",Number).appendField("PWM输出").setCheck(Number),this.appendValueInput("pwm").appendField("占空比").setCheck(Number),this.appendDummyInput().appendField("%"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("PWM输出,值范围为0-100%,可以为小数")}},_R={init:function(){this.setColour(nR),this.appendDummyInput().appendField("硬件中断"),this.appendValueInput("PIN",Number).appendField("管键").setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_MODE).appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_RISING,"GPIO.IRQ_RISING"],[Rt.Msg.MIXLY_FALLING,"GPIO.IRQ_FALLING"],[Rt.Msg.MIXLY_CHANGE,"GPIO.IRQ_BOTH"]]),"mode"),this.appendValueInput("DO").appendField(Rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP)}},rR={init:function(){this.setColour(nR),this.appendDummyInput().appendField("取消中断"),this.appendValueInput("PIN",Number).appendField("管键").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("取消中断")}},dR="#637AAC",IR={init:function(){this.setColour(dR),this.appendDummyInput().appendField("OneNET 连接WiFi"),this.appendValueInput("WIFINAME").setCheck(String).appendField(Rt.Msg.HTML_NAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Rt.Msg.HTML_PASSWORD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_WIFI_CONNECT_TOOLTIP)}},TR={init:function(){this.setColour(dR),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setAlign(Rt.inputs.Align.RIGHT).setCheck(String).appendField(Rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},hR={init:function(){this.setColour(dR),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},mR={init:function(){this.setColour(dR),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},OR={init:function(){this.setColour(dR),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},cR={init:function(){this.setColour(dR),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Rt.FieldLabel(Rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Rt.icons.MutatorIcon(["iot_publish_item"],this)),this.setTooltip(Rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},RR={init:function(){this.setColour(dR),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},MR={init:function(){this.setColour(dR),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},ER={init:function(){this.setColour(dR),this.appendDummyInput().appendField(Rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},CR=IR,AR=TR,gR=hR,SR=mR,DR=cR,LR=230;Rt.FieldTextInput.math_number_validator=function(t){return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null},Rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const NR={init:function(){this.setColour(LR),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},fR={init:function(){this.setColour(LR);this.appendDummyInput("").appendField(Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},FR={init:function(){this.setColour(LR),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},vR={init:function(){this.setColour(LR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},PR={init:function(){this.setColour(LR),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},VR={init:function(){this.setColour(LR),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},yR={init:function(){var t=[[Rt.Msg.LANG_MATH_TO_ROUND,"round"],[Rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[Rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[Rt.Msg.MATH_ABS,"fabs"],[Rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(LR),this.appendValueInput("A").setCheck(Number).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},YR={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(LR),this.appendValueInput("A").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},bR={init:function(){var t=[[Rt.Msg.MIXLY_MAX,"max"],[Rt.Msg.MIXLY_MIN,"min"]];this.setColour(LR),this.appendValueInput("LIST").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(new Rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},kR={init:function(){var t=[[Rt.Msg.MATH_TWO,"two"],[Rt.Msg.MATH_EIGHT,"eight"],[Rt.Msg.MATH_TEN,"ten"],[Rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(LR),this.appendDummyInput("").appendField(Rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Rt.FieldDropdown(t),"OP").appendField(Rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Rt.Msg.MATH_ZHW).appendField(new Rt.FieldDropdown(t),"OP2").appendField(Rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:Rt.Msg.MATH_Before_two,eight:Rt.Msg.MATH_Before_eight,ten:Rt.Msg.MATH_Before_ten,sixteen:Rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:Rt.Msg.MATH_Behind_two,eight:Rt.Msg.MATH_Behind_eight,ten:Rt.Msg.MATH_Behind_ten,sixteen:Rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},XR={init:function(){var t=[[Rt.Msg.LANG_MATH_INT,"int"],[Rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(LR),this.setOutput(!0,Number),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT).appendField(Rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:Rt.Msg.LANG_MATH_INT,float:Rt.Msg.LANG_MATH_FLOAT_RANDOM};return Rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},GR={init:function(){this.setColour(LR),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},xR={init:function(){this.setColour(LR),this.appendValueInput("NUM",Number).appendField(Rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},UR={init:function(){this.setColour(LR),this.appendDummyInput().appendField(new Rt.FieldTextInput("0",Rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Rt.Msg.MATH_NUMBER_TOOLTIP)}},HR={init:function(){this.setColour(LR),this.appendValueInput("NUM").setCheck(Number).appendField(Rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},BR=xR,wR="#2E9883",WR={init:function(){this.setColour(wR),this.appendDummyInput().appendField("NES 初始化"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("PS2手柄"),this.appendValueInput("miso_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("DAT#").setCheck(Number),this.appendValueInput("mosi_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("CMD#").setCheck(Number),this.appendValueInput("cs_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("SEL#").setCheck(Number),this.appendValueInput("clk_pin",Number).setAlign(Rt.inputs.Align.RIGHT).appendField("CLK#").setCheck(Number),this.appendValueInput("vol").setAlign(Rt.inputs.Align.RIGHT).appendField("音量").setCheck(Number),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化NES,使用PS2手柄控制")}},KR={init:function(){this.setColour(wR),this.appendDummyInput().appendField("NES 初始化"),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("UART键盘"),this.appendValueInput("vol").setAlign(Rt.inputs.Align.RIGHT).appendField("音量").setCheck(Number),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("初始化NES,使用串口键盘控制")}},QR={init:function(){this.setColour(wR),this.appendDummyInput().appendField("NES 运行游戏"),this.appendValueInput("path").appendField("路径").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("运行NES游戏ROM")}},jR="#5B6DA5",qR={init:function(){this.setColour(jR),this.appendDummyInput().appendField("ESP-AT 初始化"),this.appendValueInput("RX",Number).appendField("RX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("使用串口连接ESP-AT设备,并初始化配置")}},JR={init:function(){this.setColour(jR),this.appendDummyInput().appendField("WiFi扫描"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("扫描附近可用的WiFi信息-返回多信息列表")}},zR={init:function(){this.setColour(jR),this.appendDummyInput("").appendField("WiFi连接"),this.appendValueInput("account").appendField("名称").setCheck(String),this.appendValueInput("password").appendField("密码").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("配置WiFi名称及密码,连接WiFi上网")}},ZR={init:function(){this.setColour(jR),this.appendDummyInput().appendField("WiFi").appendField(new Rt.FieldDropdown([["连接信息","1"],["连接状态","2"]]),"mode"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("查看wifi连接信息或者连接状态")}},$R={init:function(){this.setColour(jR),this.appendDummyInput().appendField("WiFi断开连接"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("断开wifi连接")}},tM={init:function(){this.setColour(jR),this.appendDummyInput("").setAlign(Rt.inputs.Align.RIGHT).appendField("打开热点"),this.appendValueInput("account").setAlign(Rt.inputs.Align.RIGHT).appendField("名称").setCheck(String),this.appendValueInput("password").setAlign(Rt.inputs.Align.RIGHT).appendField("密码").setCheck(String),this.appendValueInput("chl").setAlign(Rt.inputs.Align.RIGHT).appendField("通道").setCheck(Number),this.appendDummyInput().setAlign(Rt.inputs.Align.RIGHT).appendField("加密").appendField(new Rt.FieldDropdown([["WPA2_PSK","WPA2_PSK"],["OPEN","OPEN"],["WPA_PSK","WPA_PSK"],["WPA_WPA2_PSK","WPA_WPA2_PSK"]]),"mode"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("打开WiFi热点并配置")}},eM={init:function(){this.setColour(jR),this.appendDummyInput().appendField("关闭热点"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("关闭热点")}},iM={init:function(){this.setColour(jR),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("套接字 初始化"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("套接字初始化")}},nM={init:function(){this.setColour(jR),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("获取地址"),this.appendValueInput("addr").setAlign(Rt.inputs.Align.RIGHT).appendField("域名").setCheck(String),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("套接字根据域名解析地址IP信息")}},sM={init:function(){this.setColour(jR),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("创建连接"),this.appendValueInput("address").appendField("地址"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("套接字创建目标IP地址连接")}},oM={init:function(){this.setColour(jR),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("超时时间"),this.appendValueInput("time").setAlign(Rt.inputs.Align.RIGHT).appendField("").setCheck(Number),this.appendDummyInput().appendField("s"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("设置阻塞套接字超时时间")}},pM={init:function(){this.setColour(jR),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendValueInput("content").appendField("发送数据"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("套接发送数据")}},uM={init:function(){this.setColour(jR),this.appendValueInput("VAR").appendField("").setCheck("var"),this.appendDummyInput().appendField("接收数据"),this.appendValueInput("size").appendField("字节").setCheck(Number),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("套接接收数据,返回接收到的数据对象")}},aM={init:function(){this.setColour(jR),this.appendValueInput("VAR").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_CLOSE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_ESP32_NETWORK_SOCKET_CLOSE_TOOLTIP)}},lM=230,_M={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital),"PIN"),this.setOutput(!0)}},rM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital_pin),"PIN"),this.setOutput(!0,Number)}},dM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.analog),"PIN"),this.setOutput(!0)}},IM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.analog_pin),"PIN"),this.setOutput(!0,Number)}},TM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.dac),"PIN"),this.setOutput(!0)}},hM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.dac_pin),"PIN"),this.setOutput(!0,Number)}},mM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.button),"PIN"),this.setOutput(!0,Number)}},OM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.pwm),"PIN"),this.setOutput(!0)}},cM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.pwm_pin),"PIN"),this.setOutput(!0,Number)}},RM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.touch_pin),"PIN"),this.setOutput(!0,Number)}},MM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.touch),"PIN"),this.setOutput(!0)}},EM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.serial_pin),"PIN"),this.setOutput(!0,Number)}},CM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.builtinimg),"PIN"),this.setOutput(!0,"esp32_image")}},AM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.imglist),"PIN"),this.setOutput(!0)}},gM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.playlist),"PIN"),this.setOutput(!0)}},SM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.exlcdh),"PIN"),this.setOutput(!0,Number)}},DM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.exlcdv),"PIN"),this.setOutput(!0,Number)}},LM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.axis),"PIN"),this.setOutput(!0,Number)}},NM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.brightness),"PIN"),this.setOutput(!0,Number)}},fM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.tone_notes),"PIN"),this.setOutput(!0,Number)}},FM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.radio_power),"PIN"),this.setOutput(!0,Number)}},vM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.radio_datarate),"PIN"),this.setOutput(!0,Number)}},PM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.one_more),"PIN"),this.setOutput(!0)}},VM={init:function(){this.setColour(lM),this.appendDummyInput("").appendField(new Rt.FieldDropdown(Mt.Profile.default.digital_dot),"PIN"),this.setOutput(!0,Number)}},yM=40,YM={init:function(){this.setColour(yM),this.appendDummyInput("").appendField(new Rt.FieldDropdown([["A","17"],["B","16"]]),"KEY"),this.setOutput(!0),this.setTooltip()}},bM={init:function(){this.setColour(yM),this.appendDummyInput().appendField("初始化"),this.appendValueInput("key").appendField("按键"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip("初始化按键")}},kM={init:function(){this.setColour(yM),this.appendValueInput("key").appendField("按键"),this.appendDummyInput().appendField("被按下?"),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip("获取按键值")}},XM={init:function(){this.setColour(yM),this.appendDummyInput().appendField("DHT11"),this.appendValueInput("PIN",Number).appendField(Rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput("").appendField("获取").appendField(new Rt.FieldDropdown([["温度-℃","0"],["湿度-%","1"],["温湿度","2"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip("dht11,获取温湿度")}},GM={init:function(){this.setColour(yM),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_CHAOSHENGBO),this.appendValueInput("PIN1",Number).appendField("Trig #").setCheck(Number),this.appendValueInput("PIN2",Number).appendField("Echo #").setCheck(Number),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_CHAOSHENGBO)}},xM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},UM={init:function(){this.setColour(yM),this.appendValueInput("I2CSUB").appendField(Rt.Msg.CONTROLS_FOR_INPUT_WITH+"I2C").setCheck("var"),this.appendValueInput("SUB").appendField(Rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Rt.Msg.MIXLY_SETUP+Rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(new Rt.FieldDropdown([["MPU9250","MPU9250"],["BMP280","BMP280"],["SHT20","SHT20"],["ADXL345","ADXL345"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setFieldValue("MPU9250","key");var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return Rt.Msg.MIXLY_ESP32_SENSOR_USE_I2C_TOOLTIP+{MPU9250:"MPU9250",SHT20:"SHT20",BMP280:"BMP280",ADXL345:"ADXL345"}[e]}))}},HM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("BMP280").setCheck("var"),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GETTEMPERATUE,"get_BMP_temperature()"],[Rt.Msg.MIXLY_GETPRESSURE,"get_BMP_pressure()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_BMP_temperature()":Rt.Msg.MIXLY_MICROBIT_SENSOR_BMP_temperature_TOOLTIP,"get_BMP_pressure()":Rt.Msg.MIXLY_MICROBIT_SENSOR_BMP_press_TOOLTIP}[e]}))}},BM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("SHT20").setCheck("var"),this.appendDummyInput("").appendField(new Rt.FieldDropdown([[Rt.Msg.MIXLY_GETTEMPERATUE,"get_SHT_temperature()"],[Rt.Msg.MIXLY_GETHUMIDITY,"get_SHT_relative_humidity()"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key");return{"get_SHT_temperature()":Rt.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,"get_SHT_relative_humidity()":Rt.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP}[e]}))}},wM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_GET+Rt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},WM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Rt.Msg.MIXLY_ESP32_SENOR_GYRO).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_ESP32_SENOR_GYRO;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},KM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("MPU9250").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_GETTEMPERATUE),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_GETTEMPERATUE)}},QM={init:function(){this.setColour(yM),this.appendValueInput("SUB").appendField("ADXL345").setCheck("var"),this.appendDummyInput().appendField(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION).appendField(new Rt.FieldDropdown([["x","x"],["y","y"],["z","z"],["(x,y,z)","values"]]),"key"),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION);var t=this;this.setTooltip((function(){var e=t.getFieldValue("key"),i=Rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET,n=Rt.Msg.MIXLY_MICROBIT_Direction,s=Rt.Msg.MIXLY_MICROBIT_JS_ACCELERATION1;return i+{x:"x",y:"y",z:"z","(x,y,z)":Rt.Msg.MIXLY_MICROBIT_Shiliang_Direction}[e]+n+s}))}},jM=65,qM={init:function(){this.setColour(jM),this.appendValueInput("CONTENT",String).appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)}},JM={init:function(){this.setColour(jM),this.appendValueInput("CONTENT",String).appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_Huanhang_TOOLTIP+Rt.Msg.TEXT_PRINT_TOOLTIP)}},zM={init:function(){this.setColour(jM),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.appendValueInput("CONTENT",Number).appendField(new Rt.FieldDropdown([[Rt.Msg.MATH_BIN,"bin"],[Rt.Msg.MATH_OCT,"oct"],[Rt.Msg.MATH_DEC,"int"],[Rt.Msg.MATH_HEX,"hex"]]),"STAT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setFieldValue("hex","STAT"),this.setTooltip(Rt.Msg.TEXT_PRINT_HEX_TOOLTIP)}},ZM={init:function(){this.setColour(jM),this.appendValueInput("char_marker").setCheck(String).appendField(Rt.Msg.MIXLY_MICROBIT_JS_SERIAL_WHEN_CONTAIN_DATA),this.appendStatementInput("DO").appendField(Rt.Msg.MIXLY_DO)}},$M={init:function(){this.setColour(jM),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_READSTR),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERIAL_READ_STR)}},tE={init:function(){this.setColour(jM),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_SERIAL_AVAILABLE),this.setOutput(!0,Boolean),this.setTooltip(Rt.Msg.MIXLY_SERIAL_AVAILABLE1)}},eE={init:function(){this.setColour(jM),this.appendDummyInput().appendField("Serial").appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField(Rt.Msg.MIXLY_ESP32_READ_LINE),this.setOutput(!0,String),this.setTooltip(Rt.Msg.MIXLY_MICROBIT_JS_SERIAL_READ_LINE1)}},iE={init:function(){this.setColour(jM),this.appendDummyInput().appendField("Serial "+Rt.Msg.MIXLY_SERIAL_READSTR_UNTIL).appendField(new Rt.FieldDropdown([["new line","serial.delimiters(Delimiters.NewLine)"],[",","serial.delimiters(Delimiters.Comma)"],["$","serial.delimiters(Delimiters.Dollar)"],[":","serial.delimiters(Delimiters.Colon)"],[".","serial.delimiters(Delimiters.Fullstop)"],["#","serial.delimiters(Delimiters.Hash)"]]),"char_marker"),this.setInputsInline(!0),this.setOutput(!0,String)}},nE={init:function(){this.setColour(jM),this.appendValueInput("RX",Number).appendField(Rt.Msg.MIXLY_SETUP).appendField(new Rt.FieldDropdown([["uart1","1"],["uart2","2"],["uart3","3"]]),"mode").appendField("RX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendValueInput("TX",Number).appendField("TX#").setCheck(Number).setAlign(Rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(Rt.Msg.MIXLY_SERIAL_BEGIN).appendField(new Rt.FieldDropdown([["115200","115200"],["57600","57600"],["37400","38400"],["31250","31250"],["28800","28800"],["19200","19200"],["14400","14400"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["300","300"]]),"baudrate"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_SERIAL_softserial)}},sE={init:function(){this.setColour(jM),this.appendValueInput("VAR").appendField(Rt.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Rt.Msg.INOUT_input_TOOLTIP)}},oE={init:function(){this.setColour(jM),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.BLOCKPY_PRINT_TOOLTIP)}},pE={init:function(){this.setColour(jM),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Rt.Msg.TEXT_PRINT_TOOLTIP)}},uE={init:function(){this.setColour(jM),this.appendValueInput("VAR").appendField(Rt.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Rt.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Rt.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},aE={init:function(){this.setColour(jM),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Rt.icons.MutatorIcon(["system_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("system_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n {\n"+e.statementToCode(this,"do")+"})\n"},WD=function(t,e){return"control.waitMicros("+(e.valueToCode(this,"data",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},KD=function(t,e){return"control.raiseEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+")\n"},QD=function(t,e){return"control.onEvent("+(e.valueToCode(this,"system_event_bus_source",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", "+(e.valueToCode(this,"system_event_bus_value",e.ORDER_ATOMIC)||Mt.Profile.default.serial)+", () => {\n"+e.statementToCode(this,"do")+")\n"},jD=function(t,e){return["control.eventTimestamp()",e.ORDER_ATOMIC]},qD=function(t,e){return["control.eventValue()",e.ORDER_ATOMIC]},JD=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},zD=function(t,e){return[this.getFieldValue("key"),e.ORDER_ATOMIC]},ZD=function(t,e){return["control.deviceName()",e.ORDER_ATOMIC]},$D=function(t,e){return["control.deviceSerialNumber()",e.ORDER_ATOMIC]},tL=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},eL=function(t,e){switch(e.definitions_.import_time="import time",this.getFieldValue("Time")){case"ms":return["time.ticks_ms()",e.ORDER_ATOMIC];case"us":return["time.ticks_us()",e.ORDER_ATOMIC]}},iL=function(){return"while True:\n pass\n"},nL=function(t,e){return e.definitions_.import_mixgo="import mixgo","reset()\n"},sL=function(t,e){e.definitions_["import machine"]="import machine";return"machine.reset()\n"},oL=function(t,e){return e.definitions_["import gc"]="import gc",this.getFieldValue("gc")+"\n"},pL=function(t,e){return e.definitions_.import_os="import os","os.uname()"},uL=function(t,e){e.definitions_.import_time="import time";var i=e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000";switch(this.getFieldValue("Time")){case"s":return"time.sleep("+i+")\n";case"ms":return"time.sleep_ms("+i+")\n";case"us":return"time.sleep_us("+i+")\n"}},aL=function(t,e){e.definitions_["from machine import Timer"]="from machine import Timer";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=i%3,s=parseInt(i/3),o=e.valueToCode(this,"period",e.ORDER_NONE);return"tim"+i+" =Timer(Timer.TIMER"+n+",Timer.CHANNEL"+s+",mode=Timer.MODE_"+this.getFieldValue("mode")+",period = "+o+", callback = "+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},lL=function(t,e){return e.definitions_.import_time="import time",["time.ticks_diff("+(e.valueToCode(this,"END",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"START",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},_L=function(t,e){e.definitions_["from machine import Timer"]="from machine import Timer";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC);return"tim"+i+" = Timer(Timer.TIMER"+i%3+",Timer.CHANNEL"+parseInt(i/3)+", mode=Timer.MODE_PWM)\n"},rL=_L,dL=aL,IL=lL,TL=uL;const hL=function(t,e){return["["+this.getFieldValue("TEXT")+"]",e.ORDER_ATOMIC]},mL=function(t,e){return["("+this.getFieldValue("TEXT")+")",e.ORDER_ATOMIC]},OL=function(t,e){var i=this.getFieldValue("COLOR");return["("+("0x"+(i=i.substr(1)).substr(0,2))+","+("0x"+i.substr(2,2))+","+("0x"+i.substr(4,2))+")",e.ORDER_ATOMIC]},cL=function(t,e){var i=this.getFieldValue("COLOR");return[i=function(t){var e,i,n;e=(t=t.substr(1)).substr(0,2),i=t.substr(2,2),n=t.substr(4,2);var s=(64512&(t="0x"+(t=e+i+n)))>>10;return((248&t)>>3<<8)+((7&s)<<13)+((16252928&t)>>19<<3)+((56&s)>>3)}(i),e.ORDER_ATOMIC]};Object.assign(Rt.Variables,Ct),Object.assign(Rt.Procedures,Xl),Rt.Python=Gl,Rt.generator=Gl,Mt.Profile.default={},Object.assign(Mt.Profile,Ah),Object.assign(Mt.Profile.default,Ah.k210),Object.assign(Rt.Blocks,e,i,n,s,o,p,u,a,l,_,r,d,I,F,f,N,L,Y,b,k,X,G,x,U,H,B,w,W,K,Q,j,q,J,z,Z,$),Object.assign(Rt.Python.forBlock,T,h,m,O,c,R,M,E,C,A,g,S,D,y,V,P,v,tt,et,it,nt,st,ot,pt,ut,at,lt,_t,rt,dt,It,Tt,ht,mt,Ot,ct)})(); \ No newline at end of file diff --git a/boards/default/python_pyodide/index.xml b/boards/default/python_pyodide/index.xml index 218c24e0..3a0850ab 100644 --- a/boards/default/python_pyodide/index.xml +++ b/boards/default/python_pyodide/index.xml @@ -1 +1 @@ -promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as eetestThreadtestThreadWHILETRUEHello Mixly from Thread!101802990x151100a10.998124.821100101010001100501100110002110x2x0,1,2,30,1,2,30,1,2,3xMixlyMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistxmylist0mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}mydictresults0locationnames11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xreadme.txtffilename.txtfffilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtfilename.txtpathff0reponsehttps://mixio.mixly.cnreponsehttps://mixio.mixly.cnreponsetina20tina90tina0tina2020tina50tinatinatinatinatinatinatina5tinatina225tina5#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000#ff0000#FF0000tina#FF0000tina#FF0000tina#FF0000tina50tina50360tinascreenturtle.epstina10tinaMixly!tinaMixly!Arial8NUMInput a number:100100Input your nameWhat's your name?df1data.csvdfdfarrayNonearrayNonearrayarrayarraydfvalueFalsedfdf'a','b','c','d'x1.55.50.511array1array2myMatrixmyMatrixmyMatrixarraymatrix1matrix2array1array20,1,2,3xmyArraymyArraymyDimensionsmyArraymyArraymyFeatures0imagetemplatesmyArray0myArray0myArraymylistmylist0,1,2,3mydictmydict'a','b','c','d'mydict'ABCD''a','b','c','d'ser1ser10df1tagdf1tagdf11df1GTcolumndf1tag1df1tagmindf1columndf1tagser1ser11,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag0.25,0.35,0.1,0.3'a','b','c','d'0.2,0,0,011,21,31,41,51,61,71,81,910,20,40,60,80,100211Titleaxis1,2,3,41,2,3,415581.pngimg1.jpgfacehaarcascade_frontalface_default.xmlfaceRectsimgface1.15faceRectsimgface1.15100100200200Mixlyimg2.jpgimg0img001001003imgMixly02004310020220221001001010.00.010021.0-10.0,10.0TRUEirisiris_xiris_y0.3modelTRUEmodel1.0TRUEFALSE300modelmodel100pca2pcaxmodel5modelmodel8300modelxmodelx_trainy_trainmodelx_testy_testmodelx_testmodelmodelmodel/test.pkl1,2,3,4,511modellayermodelmodelxsys10historymodelinputTensoroutputTensormodelmy-modelmy-model1.jpg100-1010100NOTE_A41000NOTE_A4NOTE_A4 \ No newline at end of file +promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as eetestThreadtestThreadWHILETRUEHello Mixly from Thread!101802990x151100a10.998124.821100101010001100501100110002110x2x0,1,2,30,1,2,30,1,2,3xMixlyMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistxmylist0mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}mydictresults0locationnames11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xreadme.txtffilename.txtfffilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtfilename.txtpathff0reponsehttps://mixio.mixly.cnreponsehttps://mixio.mixly.cnreponsetina20tina90tina0tina2020tina50tinatinatinatinatinatinatina5tinatina225tina5#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000#ff0000#FF0000tina#FF0000tina#FF0000tina#FF0000tina50tina50360tinascreenturtle.epstina10tinaMixly!tinaMixly!Arial8NUMInput a number:100100Input your nameWhat's your name?df1data.csvdfdfarrayNonearrayNonearrayarrayarraydfvalueFalsedfdf'a','b','c','d'x1.55.50.511array1array2myMatrixmyMatrixmyMatrixarraymatrix1matrix2array1array20,1,2,3xmyArraymyArraymyDimensionsmyArraymyArraymyFeatures0imagetemplatesmyArray0myArray0myArraymylistmylist0,1,2,3mydictmydict'a','b','c','d'mydict'ABCD''a','b','c','d'ser1ser10df1tagdf1tagdf11df1GTcolumndf1tag1df1tagmindf1columndf1tagser1ser11,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag0.25,0.35,0.1,0.3'a','b','c','d'0.2,0,0,011,21,31,41,51,61,71,81,910,20,40,60,80,100211Titleaxis1,2,3,41,2,3,415581.pngimg1.jpgfacehaarcascade_frontalface_default.xmlfaceRectsimgface1.15faceRectsimgface1.15100100200200Mixlyimg2.jpgimg0img001001003imgMixly02004310020220221001001010.00.010021.0-10.0,10.0TRUEirisiris_xiris_y0.3modelTRUEmodel1.0TRUEFALSE300modelmodel100pca2pcaxmodel5modelmodel8300modelxmodelx_trainy_trainmodelx_testy_testmodelx_testmodelmodelmodel/test.pkl1,2,3,4,511modellayermodelmodelxsys10historymodelinputTensoroutputTensormodelmy-modelmy-model1.jpg100-1010100NOTE_A41000NOTE_A4NOTE_A4 \ No newline at end of file diff --git a/boards/default/python_pyodide/main.bundle.bce541eb.js b/boards/default/python_pyodide/main.bundle.2509889c.js similarity index 83% rename from boards/default/python_pyodide/main.bundle.bce541eb.js rename to boards/default/python_pyodide/main.bundle.2509889c.js index 32584b23..88b8ab58 100644 --- a/boards/default/python_pyodide/main.bundle.bce541eb.js +++ b/boards/default/python_pyodide/main.bundle.2509889c.js @@ -10110,7 +10110,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function Qge(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(o,a)}l((i=i.apply(e,t||[])).next())})}var Jge,e_e='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box; }\n .vega-embed.has-actions {\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset; }\n .vega-embed summary svg {\n width: 14px;\n height: 14px; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left; }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n .vega-embed .chart-wrapper {\n width: 100%;\n height: 100%; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n';function t_e(e,...t){for(const n of t)n_e(e,n);return e}function n_e(e,t){for(const n of Object.keys(t))Se(e,n,t[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});const i_e=v;let r_e=b;const s_e="undefined"!=typeof window?window:void 0;void 0===r_e&&(null===(Jge=null==s_e?void 0:s_e.vl)||void 0===Jge?void 0:Jge.compile)&&(r_e=s_e.vl);const o_e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},a_e={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},l_e={vega:"Vega","vega-lite":"Vega-Lite"},u_e={vega:i_e.version,"vega-lite":r_e?r_e.version:"not available"},c_e={vega:e=>e,"vega-lite":(e,t)=>r_e.compile(e,{config:t}).spec},d_e='\n\n \n \n \n',h_e="chart-wrapper";function p_e(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${l_e[i]} JSON Source`}function f_e(e,t){var n;if(e.$schema){const i=zme(e.$schema);t&&t!==i.library&&console.warn(`The given visualization spec is written in ${l_e[i.library]}, but mode argument sets ${null!==(n=l_e[t])&&void 0!==n?n:t}.`);const r=i.library;return(0,ee.satisfies)(u_e[r],`^${i.version.slice(1)}`)||console.warn(`The input spec uses ${l_e[r]} ${i.version}, but the current version of ${l_e[r]} is v${u_e[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}function m_e(e){return(t=e)&&"load"in t?e:i_e.loader(e);var t}function g_e(e){var t;return null!==(t=e.usermeta&&e.usermeta.embedOptions)&&void 0!==t?t:{}}function __e(e,t){var n;return Qge(this,void 0,void 0,function*(){const i=bt(e.config)?JSON.parse(yield t.load(e.config)):null!==(n=e.config)&&void 0!==n?n:{},r=bt(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),r?{patch:r}:{}),i?{config:i}:{})})}const y_e=function(e,t,n={}){var i,r,s;return Qge(this,void 0,void 0,function*(){let o,a;bt(t)?(a=m_e(n.loader),o=JSON.parse(yield a.load(t))):o=t;const l=g_e(o).loader;a&&!l||(a=m_e(null!==(i=n.loader)&&void 0!==i?i:l));const u=yield __e(g_e(o),a),c=yield __e(n,a),d=Object.assign(Object.assign({},t_e(c,u)),{config:Ae(null!==(r=c.config)&&void 0!==r?r:{},null!==(s=u.config)&&void 0!==s?s:{})});return yield function(e,t,n={},i){var r,s,o,a,l,u;return Qge(this,void 0,void 0,function*(){const c=n.theme?Ae(T[n.theme],null!==(r=n.config)&&void 0!==r?r:{}):n.config,d=mt(n.actions)?n.actions:t_e({},o_e,null!==(s=n.actions)&&void 0!==s?s:{}),h=Object.assign(Object.assign({},a_e),n.i18n),p=null!==(o=n.renderer)&&void 0!==o?o:"canvas",f=null!==(a=n.logLevel)&&void 0!==a?a:i_e.Warn,m=null!==(l=n.downloadFileName)&&void 0!==l?l:"visualization",g="string"==typeof e?document.querySelector(e):e;if(!g)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:i}=function(e){var t;const n=e.getRootNode?e.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}(g);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?e_e.toString():n.defaultStyle,i.appendChild(t)}}const _=f_e(t,n.mode);let y=c_e[_](t,c);if("vega-lite"===_&&y.$schema){const e=zme(y.$schema);(0,ee.satisfies)(u_e.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${u_e.vega}.`)}g.classList.add("vega-embed"),d&&g.classList.add("has-actions"),g.innerHTML="";let v=g;if(d){const e=document.createElement("div");e.classList.add(h_e),g.appendChild(e),v=e}const b=n.patch;b&&(y=b instanceof Function?b(y):$(y,b,!0,!1).newDocument),n.formatLocale&&i_e.formatLocale(n.formatLocale),n.timeFormatLocale&&i_e.timeFormatLocale(n.timeFormatLocale);const{ast:x}=n,E=i_e.parse(y,"vega-lite"===_?{}:c,{ast:x}),w=new(n.viewClass||i_e.View)(E,Object.assign({loader:i,logLevel:f,renderer:p},x?{expr:i_e.expressionInterpreter}:{}));if(!1!==n.tooltip){let e;e=function(e){return"function"==typeof e}(n.tooltip)?n.tooltip:new Zge(!0===n.tooltip?{}:n.tooltip).call,w.tooltip(e)}let I,{hover:A}=n;if(void 0===A&&(A="vega"===_),A){const{hoverSet:e,updateSet:t}="boolean"==typeof A?{}:A;w.hover(e,t)}if(n&&(null!=n.width&&w.width(n.width),null!=n.height&&w.height(n.height),null!=n.padding&&w.padding(n.padding)),yield w.initialize(v,n.bind).runAsync(),!1!==d){let e=g;if(!1!==n.defaultStyle){const t=document.createElement("details");t.title=h.CLICK_TO_VIEW_ACTIONS,g.append(t),e=t;const n=document.createElement("summary");n.innerHTML=d_e,t.append(n),I=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",I)}const i=document.createElement("div");if(e.append(i),i.classList.add("vega-actions"),!0===d||!1!==d.export)for(const e of["svg","png"])if(!0===d||!0===d.export||d.export[e]){const t=h[`${e.toUpperCase()}_ACTION`],r=document.createElement("a");r.text=t,r.href="#",r.target="_blank",r.download=`${m}.${e}`,r.addEventListener("mousedown",function(t){return Qge(this,void 0,void 0,function*(){t.preventDefault();const i=yield w.toImageURL(e,n.scaleFactor);this.href=i})}),i.append(r)}if(!0===d||!1!==d.source){const e=document.createElement("a");e.text=h.SOURCE_ACTION,e.href="#",e.addEventListener("click",function(e){var i,r;p_e(J()(t),null!==(i=n.sourceHeader)&&void 0!==i?i:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"",_),e.preventDefault()}),i.append(e)}if("vega-lite"===_&&(!0===d||!1!==d.compiled)){const e=document.createElement("a");e.text=h.COMPILED_ACTION,e.href="#",e.addEventListener("click",function(e){var t,i;p_e(J()(y),null!==(t=n.sourceHeader)&&void 0!==t?t:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"","vega"),e.preventDefault()}),i.append(e)}if(!0===d||!1!==d.editor){const e=null!==(u=n.editorUrl)&&void 0!==u?u:"https://vega.github.io/editor/",r=document.createElement("a");r.text=h.EDITOR_ACTION,r.href="#",r.addEventListener("click",function(n){!function(e,t,n){const i=e.open(t),{origin:r}=new URL(t);let s=40;e.addEventListener("message",function t(n){n.source===i&&(s=0,e.removeEventListener("message",t,!1))},!1),setTimeout(function e(){s<=0||(i.postMessage(n,r),setTimeout(e,250),s-=1)},250)}(window,e,{config:c,mode:_,renderer:p,spec:J()(t)}),n.preventDefault()}),i.append(r)}}function S(){I&&document.removeEventListener("click",I),w.finalize()}return{view:w,spec:t,vgSpec:y,finalize:S}})}(e,o,d,a)})}},66262:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}},26944:e=>{"use strict";e.exports=path},85817:()=>{},18590:()=>{},4530:()=>{},8108:()=>{},80551:()=>{},67425:()=>{},9496:()=>{},26786:()=>{},48884:()=>{},98001:()=>{},71613:()=>{},15312:()=>{},89032:()=>{},60574:()=>{},2672:()=>{},58215:()=>{},1417:()=>{},49391:()=>{},83220:()=>{},73985:()=>{},80032:()=>{},75650:()=>{},56644:()=>{},41234:()=>{},48487:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,n){var i,r,s;return n=n||{},i=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),r=""===i?1/0:void 0===n.maxLength?80:n.maxLength,s=n.replacer,function e(n,o,a){var l,u,c,d,h,p,f,m,g,_,y,v;if(n&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===(y=JSON.stringify(n,s)))return y;if(f=r-o.length-a,y.length<=f&&(g=y.replace(t,function(e,t){return t||e+" "})).length<=f)return g;if(null!=s&&(n=JSON.parse(y),s=void 0),"object"==typeof n&&null!==n){if(m=o+i,c=[],u=0,Array.isArray(n))for(_="[",l="]",f=n.length;u0)return[_,i+c.join(",\n"+m),l].join("\n"+o)}return y}(e,"",0)}},21045:e=>{"use strict";e.exports={rE:"3.0.8"}}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&t&&e;"object"==typeof r&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,__webpack_require__.d(n,i),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((t,n)=>(__webpack_require__.f[n](e,t),t),[])),__webpack_require__.u=e=>e+".bundle."+{38:"56383ce7",97:"b0fed7fa",195:"9941f7ca",211:"45847679",317:"a52389ac",837:"3c99d169",950:"b01fc844",960:"d893bd17",974:"66119c82"}[e]+".js",__webpack_require__.miniCssF=e=>"styles/"+e+".45554be0.css",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,i)=>{if(inProgress[e])inProgress[e].push(t);else{var r,s;if(void 0!==n)for(var o=document.getElementsByTagName("script"),a=0;a{r.onerror=r.onload=null,clearTimeout(c);var i=inProgress[e];if(delete inProgress[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach(e=>e(n)),t)return t(n)},c=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),s&&document.head.appendChild(r)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise((t,n)=>{var i=__webpack_require__.miniCssF(e),r=__webpack_require__.p+i;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),i=0;i{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",__webpack_require__.nc&&(s.nonce=__webpack_require__.nc),s.onerror=s.onload=n=>{if(s.onerror=s.onload=null,"load"===n.type)i();else{var o=n&&n.type,a=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+o+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=a,s.parentNode&&s.parentNode.removeChild(s),r(l)}},s.href=t,n?n.parentNode.insertBefore(s,n.nextSibling):document.head.appendChild(s)})(e,r,null,t,n)}),t={792:0};__webpack_require__.f.miniCss=(n,i)=>{t[n]?i.push(t[n]):0!==t[n]&&{317:1}[n]&&i.push(t[n]=e(n).then(()=>{t[n]=0},e=>{throw delete t[n],e}))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var i=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=r);var s=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(s,n=>{if(__webpack_require__.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+s+")",o.name="ChunkLoadError",o.type=r,o.request=s,i[1](o)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,r,[s,o,a]=n,l=0;if(s.some(t=>0!==e[t])){for(i in o)__webpack_require__.o(o,i)&&(__webpack_require__.m[i]=o[i]);if(a)a(__webpack_require__)}for(t&&t(n);l{"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{controls_type:()=>Qe,controls_typeLists:()=>Je,lists_zip:()=>et,lists_zip_container:()=>tt,lists_zip_item:()=>nt,unpack_iterable_object:()=>it,variables_change:()=>Ke,variables_get:()=>Xe,variables_global:()=>Ze,variables_set:()=>qe});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{base_setup:()=>ot,controls_delay:()=>at,controls_end_program:()=>lt,controls_except:()=>Tt,controls_finally:()=>xt,controls_flow_statements:()=>ft,controls_for:()=>mt,controls_forEach:()=>dt,controls_for_range:()=>gt,controls_if:()=>ut,controls_if_else:()=>vt,controls_if_elseif:()=>yt,controls_if_if:()=>_t,controls_lambda:()=>wt,controls_main:()=>st,controls_pass:()=>It,controls_range:()=>ct,controls_repeat_ext:()=>Et,controls_thread:()=>At,controls_try:()=>bt,controls_try_finally:()=>pt,controls_whileUntil:()=>ht,datetime_fromtimestamp:()=>Rt,do_while:()=>St,garbage_collection:()=>Ct,gene_unique_identifier:()=>Nt,get_mem_alloc:()=>Ot,get_mem_free:()=>Mt,get_unique_identifier:()=>kt});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{base_map:()=>en,generate_cartesian_product:()=>nn,math_arithmetic:()=>Bt,math_bit:()=>Ut,math_constant:()=>Lt,math_constant_mp:()=>Pt,math_constrain:()=>Wt,math_dec:()=>zt,math_degree_to_radian:()=>sn,math_indexer_number:()=>qt,math_map:()=>Xt,math_max_min:()=>Yt,math_number:()=>Ft,math_number_base_conversion:()=>Gt,math_radian_to_degree:()=>rn,math_random:()=>Ht,math_random_seed:()=>Kt,math_round:()=>Zt,math_selfcalcu:()=>$t,math_to_int:()=>jt,math_trig:()=>Vt,text_to_number:()=>Qt,text_to_number_skulpt:()=>Jt,turn_to_int:()=>tn});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{ascii_to_char:()=>hn,char_to_ascii:()=>pn,number_to_text:()=>fn,os_system:()=>$n,text:()=>an,text_bytes:()=>un,text_capital:()=>En,text_center:()=>wn,text_char:()=>cn,text_char_at:()=>_n,text_char_at2:()=>gn,text_char_at3:()=>Fn,text_compareTo:()=>Dn,text_compare_to:()=>xn,text_create_with_container:()=>kn,text_create_with_item:()=>Rn,text_encode:()=>Pn,text_equals_starts_ends:()=>Tn,text_eval:()=>Bn,text_find:()=>In,text_format:()=>Mn,text_format_noreturn:()=>Ln,text_join:()=>dn,text_join_seq:()=>An,text_length:()=>mn,text_random_char:()=>yn,text_replace:()=>Sn,text_split:()=>Cn,text_strip:()=>On,text_substring:()=>bn,text_substring2:()=>vn,text_substring3:()=>Nn,text_textarea:()=>ln});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ENUMERATE:()=>Ti,content_in_lists:()=>Ei,enumerate:()=>xi,list_many_input:()=>li,list_tolist:()=>hi,list_tolist2:()=>bi,list_trig:()=>si,lists_2d_get_col_row_data:()=>Yn,lists_2d_get_data_with_col_row:()=>jn,lists_append_extend:()=>Kn,lists_change_to:()=>ai,lists_change_to_general:()=>ci,lists_clear:()=>ti,lists_create_with:()=>Gn,lists_create_with2:()=>pi,lists_create_with_container:()=>Wn,lists_create_with_item:()=>Xn,lists_create_with_noreturn:()=>ui,lists_create_with_text:()=>Hn,lists_create_with_text2:()=>fi,lists_del_general:()=>di,lists_find:()=>ri,lists_getIndex3:()=>mi,lists_getSublist3:()=>gi,lists_get_index:()=>Vn,lists_get_random_item:()=>Zn,lists_get_random_sublist:()=>Qn,lists_get_sublist:()=>zn,lists_insert_value:()=>Jn,lists_insert_value2:()=>yi,lists_pop:()=>ii,lists_remove_at:()=>ni,lists_remove_at2:()=>vi,lists_reverse:()=>ei,lists_setIndex3:()=>_i,lists_set_index:()=>qn,lists_sort:()=>oi});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{dicts_add_change_del:()=>$i,dicts_add_or_change:()=>ki,dicts_clear:()=>Di,dicts_create_with:()=>Ii,dicts_create_with_container:()=>Ai,dicts_create_with_item:()=>Si,dicts_create_with_noreturn:()=>zi,dicts_deldict:()=>Bi,dicts_delete:()=>Ri,dicts_get:()=>Oi,dicts_get_default:()=>Mi,dicts_items:()=>Fi,dicts_keys:()=>Ci,dicts_length:()=>Pi,dicts_pop:()=>Ui,dicts_setdefault:()=>Vi,dicts_to_json:()=>Yi,dicts_to_json2:()=>Wi,dicts_to_to:()=>Hi,dicts_todict:()=>ji,dicts_update:()=>Ni,dicts_values:()=>Li,json_to_dicts:()=>Gi});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{logic_boolean:()=>Ji,logic_compare:()=>qi,logic_compare_continous:()=>Ki,logic_is:()=>ir,logic_is_in:()=>nr,logic_negate:()=>Qi,logic_null:()=>er,logic_operation:()=>Zi,logic_tobool:()=>rr,logic_true_or_false:()=>tr});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{sdcard_mount:()=>Sr,sdcard_use_spi_init:()=>Ar,storage_can_write_ornot:()=>pr,storage_change_dir:()=>wr,storage_close_file:()=>mr,storage_delete_file:()=>_r,storage_file_seek:()=>br,storage_file_tell:()=>vr,storage_file_write:()=>ur,storage_fileopen:()=>or,storage_fileopen_new:()=>ar,storage_fileopen_new_encoding:()=>lr,storage_get_a_line:()=>hr,storage_get_contents:()=>dr,storage_get_contents_without_para:()=>cr,storage_get_current_dir:()=>Tr,storage_get_file_size:()=>yr,storage_get_filename:()=>fr,storage_is_file:()=>Ir,storage_list_all_files:()=>gr,storage_make_dir:()=>xr,storage_open_file_with_os:()=>sr,storage_rename:()=>Er});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{procedures_callnoreturn:()=>Rr,procedures_callreturn:()=>Nr,procedures_defnoreturn:()=>Cr,procedures_defreturn:()=>Or,procedures_ifreturn:()=>Dr,procedures_mutatorarg:()=>kr,procedures_mutatorcontainer:()=>Mr,procedures_return:()=>Fr});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{tuple_change_to:()=>Wr,tuple_create_llm_params:()=>ns,tuple_create_with:()=>Pr,tuple_create_with_container:()=>Br,tuple_create_with_item:()=>$r,tuple_create_with_noreturn:()=>Zr,tuple_create_with_text2:()=>Ur,tuple_create_with_text_return:()=>Vr,tuple_del:()=>Yr,tuple_find:()=>Xr,tuple_getIndex:()=>zr,tuple_getSublist:()=>Kr,tuple_get_random_item:()=>Jr,tuple_get_sublist:()=>Qr,tuple_input:()=>ts,tuple_join:()=>Gr,tuple_length:()=>jr,tuple_max:()=>Hr,tuple_totuple:()=>es,tuple_trig:()=>qr});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{set_add_discard:()=>hs,set_clear:()=>us,set_create_with:()=>rs,set_create_with_container:()=>ss,set_create_with_item:()=>os,set_create_with_text_return:()=>ms,set_length:()=>as,set_operate:()=>cs,set_operate_update:()=>ds,set_pop:()=>ls,set_sub:()=>ps,set_toset:()=>gs,set_update:()=>fs});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{html_content:()=>Ts,html_content_more:()=>xs,html_document:()=>ys,html_form:()=>ws,html_head_body:()=>bs,html_style:()=>Es,html_style_color:()=>As,html_style_content:()=>Is,html_text:()=>Ss,html_title:()=>vs});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{attribute_access:()=>Vs,function_call:()=>Bs,function_call_container:()=>$s,function_call_item:()=>Us,raw_block:()=>Ms,raw_empty:()=>Rs,raw_expression:()=>ks,raw_table:()=>Os,text_comment:()=>Ns,text_print_multiple:()=>Fs,text_print_multiple_container:()=>Ls,text_print_multiple_item:()=>Ps,type_check:()=>Ds});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{controls_type:()=>Hs,controls_typeLists:()=>Ws,lists_zip:()=>Xs,unpack_iterable_object:()=>qs,variables_change:()=>Ys,variables_get:()=>zs,variables_global:()=>Gs,variables_set:()=>js});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{Panic_with_status_code:()=>so,base_setup:()=>Zs,controls_delay:()=>ro,controls_flow_statements:()=>io,controls_for:()=>eo,controls_forEach:()=>co,controls_for_range:()=>to,controls_if:()=>Qs,controls_interrupts:()=>lo,controls_lambda:()=>po,controls_main:()=>Ks,controls_millis:()=>oo,controls_nointerrupts:()=>uo,controls_pass:()=>mo,controls_range:()=>ho,controls_repeat:()=>Eo,controls_repeat_ext:()=>yo,controls_thread:()=>go,controls_try_finally:()=>Js,controls_whileUntil:()=>no,datetime_fromtimestamp:()=>wo,do_while:()=>_o,garbage_collection:()=>vo,gene_unique_identifier:()=>Io,get_mem_alloc:()=>bo,get_mem_free:()=>To,get_unique_identifier:()=>xo,reset:()=>ao,time_sleep:()=>fo});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{base_map:()=>Ho,generate_cartesian_product:()=>Xo,math_arithmetic:()=>Mo,math_bit:()=>Oo,math_constant:()=>So,math_constant_mp:()=>Co,math_constrain:()=>$o,math_dec:()=>Do,math_degree_to_radian:()=>Ko,math_indexer_number:()=>zo,math_map:()=>Bo,math_max_min:()=>Lo,math_number:()=>Ao,math_number_base_conversion:()=>Uo,math_radian_to_degree:()=>qo,math_random:()=>Po,math_random_seed:()=>Vo,math_round:()=>jo,math_selfcalcu:()=>ko,math_single:()=>Ro,math_to_int:()=>Fo,math_trig:()=>No,text_to_number:()=>Yo,text_to_number_skulpt:()=>Go,turn_to_int:()=>Wo});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{ascii_to_char:()=>na,char_to_ascii:()=>ia,number_to_text:()=>ra,os_system:()=>Sa,text:()=>Zo,text_bytes:()=>Jo,text_capital:()=>pa,text_center:()=>fa,text_char:()=>ea,text_char_at:()=>aa,text_char_at2:()=>oa,text_char_at3:()=>wa,text_compareTo:()=>Ea,text_compare_to:()=>ca,text_encode:()=>Ia,text_equals_starts_ends:()=>ua,text_eval:()=>Aa,text_find:()=>ma,text_format:()=>ba,text_format_noreturn:()=>Ta,text_join:()=>ta,text_join_seq:()=>ga,text_length:()=>sa,text_random_char:()=>la,text_replace:()=>_a,text_split:()=>ya,text_strip:()=>va,text_substring:()=>ha,text_substring2:()=>da,text_substring3:()=>xa,text_textarea:()=>Qo});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{content_in_lists:()=>al,enumerate:()=>ol,list_many_input:()=>Wa,list_tolist:()=>rl,list_tolist2:()=>sl,list_trig:()=>Ya,lists_2d_get_col_row_data:()=>Ma,lists_2d_get_data_with_col_row:()=>Oa,lists_append_extend:()=>Fa,lists_change_to:()=>Ha,lists_change_to_general:()=>qa,lists_clear:()=>Ua,lists_create_with:()=>ka,lists_create_with2:()=>Za,lists_create_with_noreturn:()=>Xa,lists_create_with_text:()=>Ra,lists_create_with_text2:()=>Qa,lists_del_general:()=>Ka,lists_find:()=>Va,lists_getIndex3:()=>Ja,lists_getSublist3:()=>el,lists_get_index:()=>Na,lists_get_random_item:()=>La,lists_get_random_sublist:()=>Pa,lists_get_sublist:()=>Ca,lists_insert_value:()=>Ba,lists_insert_value2:()=>nl,lists_pop:()=>ja,lists_remove_at:()=>za,lists_remove_at2:()=>il,lists_reverse:()=>$a,lists_setIndex3:()=>tl,lists_set_index:()=>Da,lists_sort:()=>Ga});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{dicts_add_change_del:()=>bl,dicts_add_or_change:()=>hl,dicts_clear:()=>ml,dicts_create_with:()=>ll,dicts_create_with_noreturn:()=>El,dicts_deldict:()=>vl,dicts_delete:()=>pl,dicts_get:()=>cl,dicts_get_default:()=>dl,dicts_items:()=>gl,dicts_keys:()=>ul,dicts_length:()=>yl,dicts_pop:()=>Tl,dicts_setdefault:()=>xl,dicts_to_json:()=>Il,dicts_to_json2:()=>Cl,dicts_to_to:()=>Sl,dicts_todict:()=>wl,dicts_update:()=>fl,dicts_values:()=>_l,json_to_dicts:()=>Al});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{logic_boolean:()=>Nl,logic_compare:()=>Ol,logic_compare_continous:()=>Ml,logic_is:()=>Pl,logic_is_in:()=>Ll,logic_negate:()=>Rl,logic_null:()=>Dl,logic_operation:()=>kl,logic_tobool:()=>Bl,logic_true_or_false:()=>Fl});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{sdcard_mount:()=>au,sdcard_use_spi_init:()=>ou,storage_can_write_ornot:()=>Wl,storage_change_dir:()=>tu,storage_close_file:()=>ql,storage_delete_file:()=>Zl,storage_file_seek:()=>eu,storage_file_tell:()=>Jl,storage_file_write:()=>jl,storage_fileopen:()=>Ul,storage_fileopen_new:()=>Vl,storage_fileopen_new_encoding:()=>zl,storage_get_a_line:()=>Hl,storage_get_contents:()=>Gl,storage_get_contents_without_para:()=>Yl,storage_get_current_dir:()=>nu,storage_get_file_size:()=>Ql,storage_get_filename:()=>Xl,storage_is_file:()=>su,storage_list_all_files:()=>Kl,storage_make_dir:()=>iu,storage_open_file_with_os:()=>$l,storage_rename:()=>ru});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{procedures_callnoreturn:()=>du,procedures_callreturn:()=>cu,procedures_defnoreturn:()=>uu,procedures_defreturn:()=>lu,procedures_ifreturn:()=>hu,procedures_return:()=>pu});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{tuple_change_to:()=>xu,tuple_create_llm_params:()=>ku,tuple_create_with:()=>fu,tuple_create_with_noreturn:()=>Au,tuple_create_with_text2:()=>mu,tuple_create_with_text_return:()=>gu,tuple_del:()=>vu,tuple_find:()=>Eu,tuple_getIndex:()=>_u,tuple_getSublist:()=>Iu,tuple_get_random_item:()=>Cu,tuple_get_sublist:()=>Su,tuple_input:()=>Mu,tuple_join:()=>bu,tuple_length:()=>yu,tuple_max:()=>Tu,tuple_totuple:()=>Ou,tuple_trig:()=>wu});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{set_add_discard:()=>Bu,set_clear:()=>Fu,set_create_with:()=>Ru,set_create_with_text_return:()=>Vu,set_length:()=>Nu,set_operate:()=>Lu,set_operate_update:()=>Pu,set_pop:()=>Du,set_sub:()=>$u,set_toset:()=>zu,set_update:()=>Uu});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{html_content:()=>Hu,html_content_more:()=>Wu,html_document:()=>ju,html_form:()=>qu,html_head_body:()=>Gu,html_style:()=>Xu,html_style_content:()=>Ku,html_text:()=>Zu,html_title:()=>Yu});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{attribute_access:()=>rc,function_call:()=>ic,raw_block:()=>Qu,raw_empty:()=>ec,raw_expression:()=>Ju,raw_table:()=>tc,type_check:()=>nc});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{AI_ChooseAndGet:()=>uc,AI_Face_match:()=>mc,AI_ImageClassify:()=>pc,AI_ImageClassify_Func:()=>fc,AI_Nlp:()=>yc,AI_Nlp_Func:()=>bc,AI_Nlp_Func_sim:()=>Tc,AI_Nlp_Sim:()=>vc,AI_Nlp_Topic:()=>xc,AI_Nlp_newsSummary:()=>Ec,AI_Ocr:()=>gc,AI_Ocr_Func:()=>_c,AI_Speech_asr:()=>hc,AI_Speech_synthesis:()=>dc,AI_audio:()=>wc,AI_client:()=>cc,AI_photo:()=>Ic,AI_result:()=>Ac});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{algorithm_add_path:()=>Nc,algorithm_add_school:()=>Oc,algorithm_all_books:()=>qc,algorithm_all_books_sequence:()=>Kc,algorithm_book_scale:()=>ld,algorithm_check_feet:()=>vd,algorithm_chick_calculate:()=>yd,algorithm_color_seclet:()=>Pd,algorithm_current_school:()=>$c,algorithm_del_path:()=>Dc,algorithm_delete_book:()=>rd,algorithm_delete_books:()=>sd,algorithm_delete_books2:()=>od,algorithm_divide_books:()=>nd,algorithm_find_path:()=>Mc,algorithm_first_book:()=>Zc,algorithm_fz_calc:()=>Ed,algorithm_fz_calc_first_min:()=>wd,algorithm_fz_compare:()=>Id,algorithm_fz_move:()=>Sd,algorithm_fz_set_min:()=>Ad,algorithm_get_book_num:()=>hd,algorithm_get_current_location:()=>Fd,algorithm_get_half_books:()=>id,algorithm_hxdb_add:()=>Rd,algorithm_hxdb_init_soldier:()=>Od,algorithm_hxdb_last_line:()=>kd,algorithm_hxdb_result:()=>Nd,algorithm_hxdb_stand_in_line:()=>Md,algorithm_init_fzsf:()=>xd,algorithm_init_hxdb:()=>Cd,algorithm_init_jttl:()=>md,algorithm_move_recent:()=>jc,algorithm_new_path:()=>kc,algorithm_next_book:()=>ed,algorithm_no_left:()=>Lc,algorithm_no_path:()=>Uc,algorithm_no_ring2:()=>Qc,algorithm_not_home:()=>Yc,algorithm_not_school:()=>Gc,algorithm_number_add:()=>cd,algorithm_number_zero:()=>ud,algorithm_prepare:()=>Cc,algorithm_prepare2:()=>Bc,algorithm_prepare_2_1:()=>Vc,algorithm_prepare_2_2:()=>zc,algorithm_print_book2:()=>ad,algorithm_print_divide:()=>fd,algorithm_print_jttl_answer:()=>bd,algorithm_print_number:()=>dd,algorithm_print_path:()=>Pc,algorithm_print_path2:()=>Hc,algorithm_print_sequence:()=>pd,algorithm_rabbit_add:()=>Td,algorithm_rabbit_number_in_range:()=>_d,algorithm_rabbit_zero:()=>gd,algorithm_return_path:()=>Fc,algorithm_set_path:()=>Rc,algorithm_two_left:()=>td,algorithm_void_path:()=>Ld,algorithm_yes_ring2:()=>Jc,hanoi_init:()=>Wc,hanoi_init_offline:()=>Dd,hanoi_move:()=>Xc});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{requests_attribute:()=>zd,requests_get:()=>Ud,requests_get_old:()=>$d,requests_method:()=>jd,requests_post:()=>Vd});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{cv_destroy_all:()=>qd,cv_face_classifier:()=>Qd,cv_face_detect:()=>Jd,cv_face_detect_all:()=>eh,cv_line_rect:()=>Kd,cv_read_image:()=>Gd,cv_show_image:()=>Hd,cv_text:()=>Zd,cv_waitkey:()=>Xd,cv_write_image:()=>Wd});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{array_create:()=>_h,array_toarray:()=>kh,dataframe_aggregate_func:()=>Ap,dataframe_create:()=>rh,dataframe_create_from_index:()=>oh,dataframe_create_from_one_index:()=>sh,dataframe_fillna:()=>hp,dataframe_get:()=>Ch,dataframe_groupby:()=>Ip,dataframe_head_tail:()=>Ep,dataframe_info:()=>pp,dataframe_median:()=>dp,dataframe_select:()=>wp,dataframe_sort_values:()=>xp,matrix_multiplication:()=>up,matrix_transpose:()=>lp,numpy_argmin_template_match:()=>ep,numpy_astype:()=>Zh,numpy_c_:()=>op,numpy_dot:()=>_p,numpy_linalg_det:()=>ap,numpy_linalg_inv:()=>cp,numpy_max:()=>mp,numpy_mean:()=>tp,numpy_mean_digit:()=>Jh,numpy_min:()=>fp,numpy_ones:()=>sp,numpy_random_random:()=>bp,numpy_reshape:()=>Kh,numpy_shape:()=>qh,numpy_size:()=>gp,numpy_square:()=>yp,numpy_std:()=>np,numpy_sum:()=>vp,numpy_trig:()=>Ih,pandas_drop_columns:()=>rp,pandas_dropna:()=>ip,pandas_readcsv:()=>Sh,pl_axes:()=>ph,pl_bar:()=>Th,pl_hist:()=>Eh,pl_label:()=>gh,pl_legend:()=>fh,pl_pie:()=>xh,pl_plot:()=>dh,pl_plot_bar:()=>yh,pl_plot_easy:()=>ch,pl_plot_scatter:()=>vh,pl_plot_xy:()=>bh,pl_savefig:()=>Oh,pl_show:()=>hh,pl_subplot:()=>Ah,pl_text:()=>Mh,pl_ticks:()=>wh,pl_title:()=>mh,plot_axes:()=>Fh,plot_bar:()=>zh,plot_cla:()=>Sp,plot_hist:()=>Yh,plot_label:()=>Bh,plot_legend:()=>Lh,plot_pie:()=>jh,plot_plot:()=>Nh,plot_plot_bar:()=>$h,plot_plot_easy:()=>Rh,plot_plot_scatter:()=>Uh,plot_plot_xy:()=>Vh,plot_savefig:()=>Wh,plot_show:()=>Dh,plot_subplot:()=>Hh,plot_text:()=>Xh,plot_ticks:()=>Gh,plot_title:()=>Ph,py_sum:()=>Tp,pylab_imshow:()=>Qh,series_create:()=>nh,series_create_from_index:()=>ih,series_create_from_text:()=>ah,series_get_num:()=>uh,series_index_value:()=>lh});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{ds_add_node_by_attr:()=>Lp,ds_add_node_by_name:()=>Fp,ds_create_linkedlist:()=>Op,ds_create_linkedlist_container:()=>Mp,ds_create_linkedlist_item:()=>kp,ds_create_node:()=>Rp,ds_del_node_by_attr:()=>Bp,ds_del_node_by_name:()=>Pp,ds_get_node_attr:()=>Np,ds_reverse_linkedlist:()=>$p,ds_set_node_attr:()=>Dp});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{factory_block:()=>Kp,factory_block_return:()=>Zp,factory_block_return_with_textarea:()=>Jp,factory_block_with_textarea:()=>Qp,factory_callMethod_noreturn:()=>Xp,factory_callMethod_return:()=>qp,factory_create_with_container:()=>Yp,factory_create_with_item:()=>Gp,factory_declare:()=>Wp,factory_from_import:()=>Vp,factory_function_noreturn:()=>jp,factory_function_return:()=>Hp,factory_import:()=>zp});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{hardware_arduino_analog_read:()=>af,hardware_arduino_analog_write:()=>of,hardware_arduino_digital_read:()=>sf,hardware_arduino_digital_write:()=>rf,hardware_arduino_start:()=>tf,inout_highlow:()=>nf});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{inout_input:()=>lf,inout_print:()=>uf,inout_print_container:()=>mf,inout_print_end:()=>df,inout_print_inline:()=>cf,inout_print_item:()=>gf,inout_print_many:()=>ff,inout_type_input:()=>hf,pyinout_type_input:()=>pf});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Uf,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>$f,IOT_EMQX_PING:()=>Pf,IOT_FORMATTING:()=>Ff,IOT_FORMAT_STRING:()=>Lf,IOT_MIXIO_NTP:()=>Bf,IOT_MIXIO_PUBLISH:()=>Sf,IOT_MIXIO_SUBSCRIBE:()=>Cf,IOT_MIXIO_UNSUBSCRIBE:()=>Of,iot_checkonenet:()=>Kf,iot_client_onboard:()=>jf,iot_create_with_item:()=>If,iot_http_client:()=>Yf,iot_http_data:()=>Gf,iot_mixio_check:()=>Rf,iot_mixio_connect:()=>Af,iot_mixio_connect_only:()=>kf,iot_mixio_disconnect:()=>Mf,iot_mixio_format_msg:()=>Df,iot_mixio_format_topic:()=>Nf,iot_mixly_key:()=>zf,iot_mixly_key_py:()=>Vf,iot_mqtt_client:()=>Hf,iot_mqtt_data:()=>Wf,iot_onenet_check:()=>bf,iot_onenet_connect:()=>yf,iot_onenet_disconnect:()=>vf,iot_onenet_publish:()=>xf,iot_onenet_publish_dict:()=>Tf,iot_onenetconnect:()=>Xf,iot_onenetdisconnect:()=>qf,iot_publish:()=>Zf,iot_publish_container:()=>Ef,iot_publish_item:()=>wf});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{pins_analog_read:()=>nm,pins_analog_write:()=>tm,pins_digital_read:()=>em,pins_digital_write:()=>Jf});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{serial_close:()=>om,serial_open:()=>im,serial_read_b:()=>sm,serial_write:()=>rm});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{sklearn_DecisionTreeClassifier_Regressor:()=>_m,sklearn_GaussianNB:()=>bm,sklearn_KMeans:()=>Em,sklearn_KMeans_fit:()=>wm,sklearn_KNeighborsClassifier_Regressor:()=>vm,sklearn_LinearRegression:()=>mm,sklearn_RandomForestClassifier_Regressor:()=>ym,sklearn_Ridge:()=>gm,sklearn_cluster_centers_labels_inertia:()=>km,sklearn_coef_intercept:()=>Mm,sklearn_data_target:()=>hm,sklearn_fit:()=>Im,sklearn_fit_no_target:()=>Am,sklearn_load:()=>dm,sklearn_make_blobs:()=>cm,sklearn_make_classification:()=>lm,sklearn_make_regression:()=>um,sklearn_pca:()=>Tm,sklearn_pca_fit_transform:()=>xm,sklearn_predict:()=>Sm,sklearn_save_load_model:()=>Rm,sklearn_score:()=>Cm,sklearn_score_no_target:()=>Om,sklearn_train_test_split:()=>pm,sklearn_train_test_split_no_target:()=>fm});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{Panic_with_status_code:()=>Pm,base_delay:()=>Dm,controls_millis:()=>Fm,controls_mstimer2:()=>$m,controls_mstimer2_start:()=>Um,controls_mstimer2_stop:()=>Vm,reset:()=>Bm,time_localtime:()=>Lm,time_sleep:()=>zm});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{turtle_bgcolor:()=>cg,turtle_bgcolor_hex:()=>vg,turtle_bgcolor_hex_new:()=>fg,turtle_circle:()=>ag,turtle_circle_advanced:()=>lg,turtle_clear:()=>tg,turtle_clone:()=>pg,turtle_color:()=>_g,turtle_color_hex:()=>yg,turtle_color_seclet:()=>Og,turtle_create:()=>Ym,turtle_done:()=>Gm,turtle_exitonclick:()=>Hm,turtle_fill:()=>ig,turtle_fillcolor:()=>hg,turtle_fillcolor_hex:()=>Tg,turtle_fillcolor_hex_new:()=>gg,turtle_getscreen:()=>Mg,turtle_goto:()=>Zm,turtle_listen:()=>Dg,turtle_move:()=>Wm,turtle_numinput:()=>wg,turtle_onclick:()=>Rg,turtle_onkey:()=>kg,turtle_ontimer:()=>Ng,turtle_pencolor:()=>dg,turtle_pencolor_hex:()=>bg,turtle_pencolor_hex_new:()=>mg,turtle_penup:()=>ng,turtle_pos_shape:()=>Jm,turtle_rotate:()=>Xm,turtle_screen_delay:()=>Km,turtle_screen_savefig:()=>Fg,turtle_setheading:()=>qm,turtle_setxy:()=>Qm,turtle_shape:()=>xg,turtle_shapesize:()=>Eg,turtle_size:()=>sg,turtle_size_speed:()=>rg,turtle_speed:()=>og,turtle_stamp:()=>eg,turtle_textinput:()=>Ig,turtle_visible:()=>ug,turtle_write:()=>Ag,turtle_write_format:()=>Sg,turtle_write_format_skulpt:()=>Cg});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{AI_ChooseAndGet:()=>Lg,AI_Face_match:()=>Vg,AI_ImageClassify:()=>Ug,AI_ImageClassify_Func:()=>Wg,AI_Nlp:()=>jg,AI_Nlp_Func:()=>qg,AI_Nlp_Func_sim:()=>Kg,AI_Nlp_Sim:()=>Yg,AI_Nlp_Topic:()=>Gg,AI_Nlp_newsSummary:()=>Hg,AI_Ocr:()=>zg,AI_Ocr_Func:()=>Xg,AI_Speech_asr:()=>$g,AI_Speech_synthesis:()=>Bg,AI_audio:()=>Zg,AI_client:()=>Pg,AI_photo:()=>Qg,AI_result:()=>Jg});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{algorithm_add_path:()=>s_,algorithm_add_school:()=>t_,algorithm_all_books:()=>x_,algorithm_all_books_sequence:()=>T_,algorithm_book_scale:()=>R_,algorithm_check_feet:()=>U_,algorithm_chick_calculate:()=>$_,algorithm_color_seclet:()=>iy,algorithm_current_school:()=>d_,algorithm_del_path:()=>o_,algorithm_delete_book:()=>M_,algorithm_divide_books:()=>C_,algorithm_find_path:()=>n_,algorithm_first_book:()=>E_,algorithm_fz_calc:()=>Y_,algorithm_fz_compare:()=>G_,algorithm_fz_move:()=>W_,algorithm_fz_set_min:()=>H_,algorithm_get_current_location:()=>ty,algorithm_get_half_books:()=>O_,algorithm_hxdb_add:()=>Q_,algorithm_hxdb_init_soldier:()=>q_,algorithm_hxdb_last_line:()=>Z_,algorithm_hxdb_result:()=>J_,algorithm_hxdb_stand_in_line:()=>K_,algorithm_init_fzsf:()=>j_,algorithm_init_hxdb:()=>X_,algorithm_init_jttl:()=>L_,algorithm_move_recent:()=>m_,algorithm_new_path:()=>i_,algorithm_next_book:()=>A_,algorithm_no_left:()=>l_,algorithm_no_path:()=>h_,algorithm_no_ring2:()=>w_,algorithm_not_home:()=>g_,algorithm_not_school:()=>__,algorithm_number_add:()=>D_,algorithm_number_zero:()=>N_,algorithm_prepare:()=>e_,algorithm_prepare2:()=>c_,algorithm_prepare_2_1:()=>p_,algorithm_prepare_2_2:()=>f_,algorithm_print_book2:()=>k_,algorithm_print_jttl_answer:()=>V_,algorithm_print_number:()=>F_,algorithm_print_path:()=>u_,algorithm_print_path2:()=>y_,algorithm_rabbit_add:()=>z_,algorithm_rabbit_number_in_range:()=>B_,algorithm_rabbit_zero:()=>P_,algorithm_return_path:()=>a_,algorithm_set_path:()=>r_,algorithm_two_left:()=>S_,algorithm_void_path:()=>ny,algorithm_yes_ring2:()=>I_,hanoi_init:()=>v_,hanoi_init_offline:()=>ey,hanoi_move:()=>b_});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{requests_attribute:()=>ay,requests_get:()=>sy,requests_get_old:()=>ry,requests_method:()=>ly,requests_post:()=>oy});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{array_create:()=>Iy,array_toarray:()=>$y,dataframe_aggregate_func:()=>Dv,dataframe_create:()=>hy,dataframe_create_from_index:()=>py,dataframe_create_from_one_index:()=>fy,dataframe_fillna:()=>bv,dataframe_get:()=>Ly,dataframe_groupby:()=>Nv,dataframe_head_tail:()=>kv,dataframe_info:()=>Tv,dataframe_median:()=>vv,dataframe_select:()=>Rv,dataframe_sort_values:()=>Mv,matrix_multiplication:()=>_v,matrix_transpose:()=>gv,numpy_argmin_template_match:()=>lv,numpy_astype:()=>sv,numpy_c_:()=>fv,numpy_dot:()=>Iv,numpy_linalg_det:()=>mv,numpy_linalg_inv:()=>yv,numpy_max:()=>Ev,numpy_mean:()=>uv,numpy_mean_digit:()=>av,numpy_min:()=>xv,numpy_ones:()=>pv,numpy_random_random:()=>Cv,numpy_reshape:()=>rv,numpy_shape:()=>iv,numpy_size:()=>wv,numpy_square:()=>Av,numpy_std:()=>cv,numpy_sum:()=>Sv,numpy_trig:()=>Ny,pandas_drop_columns:()=>hv,pandas_dropna:()=>dv,pandas_readcsv:()=>Fy,pl_axes:()=>vy,pl_bar:()=>Oy,pl_hist:()=>ky,pl_label:()=>wy,pl_legend:()=>xy,pl_pie:()=>My,pl_plot:()=>Ty,pl_plot_bar:()=>Ay,pl_plot_easy:()=>by,pl_plot_scatter:()=>Sy,pl_plot_xy:()=>Cy,pl_savefig:()=>Py,pl_show:()=>yy,pl_subplot:()=>Dy,pl_text:()=>By,pl_ticks:()=>Ry,pl_title:()=>Ey,plot_axes:()=>Vy,plot_bar:()=>Ky,plot_cla:()=>Fv,plot_hist:()=>Qy,plot_label:()=>Hy,plot_legend:()=>Yy,plot_pie:()=>Zy,plot_plot:()=>jy,plot_plot_bar:()=>Wy,plot_plot_easy:()=>zy,plot_plot_scatter:()=>Xy,plot_plot_xy:()=>qy,plot_savefig:()=>tv,plot_show:()=>Uy,plot_subplot:()=>ev,plot_text:()=>nv,plot_ticks:()=>Jy,plot_title:()=>Gy,py_sum:()=>Ov,pylab_imshow:()=>ov,series_create:()=>cy,series_create_from_index:()=>dy,series_create_from_text:()=>my,series_get_num:()=>_y,series_index_value:()=>gy});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{ds_add_node_by_attr:()=>Vv,ds_add_node_by_name:()=>Uv,ds_create_linkedlist:()=>Lv,ds_create_node:()=>Pv,ds_del_node_by_attr:()=>jv,ds_del_node_by_name:()=>zv,ds_get_node_attr:()=>Bv,ds_reverse_linkedlist:()=>Yv,ds_set_node_attr:()=>$v});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{factory_block:()=>Qv,factory_block_return:()=>Jv,factory_block_return_with_textarea:()=>tb,factory_block_with_textarea:()=>eb,factory_callMethod_noreturn:()=>Kv,factory_callMethod_return:()=>Zv,factory_declare:()=>qv,factory_from_import:()=>Gv,factory_function_noreturn:()=>Wv,factory_function_return:()=>Xv,factory_import:()=>Hv});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{hardware_arduino_analog_read:()=>ob,hardware_arduino_analog_write:()=>ab,hardware_arduino_digital_read:()=>sb,hardware_arduino_digital_write:()=>rb,hardware_arduino_start:()=>nb,inout_highlow:()=>ib});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{inout_input:()=>lb,inout_print:()=>ub,inout_print_end:()=>db,inout_print_inline:()=>cb,inout_print_many:()=>fb,inout_type_input:()=>hb,pyinout_type_input:()=>pb});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Ab,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Ob,IOT_EMQX_PING:()=>Mb,IOT_FORMATTING:()=>wb,IOT_FORMAT_STRING:()=>Ib,IOT_MIXIO_NTP:()=>kb,IOT_MIXIO_PUBLISH:()=>gb,IOT_MIXIO_SUBSCRIBE:()=>_b,IOT_MIXIO_UNSUBSCRIBE:()=>yb,iot_mixio_check:()=>Tb,iot_mixio_connect:()=>mb,iot_mixio_connect_only:()=>bb,iot_mixio_disconnect:()=>vb,iot_mixio_format_msg:()=>Eb,iot_mixio_format_topic:()=>xb,iot_mixly_key:()=>Sb,iot_mixly_key_py:()=>Cb});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{pins_analog_read:()=>Lb,pins_analog_write:()=>Fb,pins_digital:()=>Rb,pins_digital_read:()=>Db,pins_digital_write:()=>Nb});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{serial_close:()=>Ub,serial_open:()=>Pb,serial_read_b:()=>$b,serial_write:()=>Bb});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{sklearn_DecisionTreeClassifier_Regressor:()=>Kb,sklearn_GaussianNB:()=>Jb,sklearn_KMeans:()=>nT,sklearn_KMeans_fit:()=>iT,sklearn_KNeighborsClassifier_Regressor:()=>Qb,sklearn_LinearRegression:()=>Xb,sklearn_RandomForestClassifier_Regressor:()=>Zb,sklearn_Ridge:()=>qb,sklearn_cluster_centers_labels_inertia:()=>cT,sklearn_coef_intercept:()=>uT,sklearn_data_target:()=>Gb,sklearn_fit:()=>rT,sklearn_fit_no_target:()=>sT,sklearn_load:()=>Yb,sklearn_make_blobs:()=>jb,sklearn_make_classification:()=>Vb,sklearn_make_regression:()=>zb,sklearn_pca:()=>eT,sklearn_pca_fit_transform:()=>tT,sklearn_predict:()=>oT,sklearn_save_load_model:()=>dT,sklearn_score:()=>aT,sklearn_score_no_target:()=>lT,sklearn_train_test_split:()=>Hb,sklearn_train_test_split_no_target:()=>Wb});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{controls_end_program:()=>pT,controls_millis:()=>hT,time_localtime:()=>fT});var te={};__webpack_require__.r(te),__webpack_require__.d(te,{turtle_bgcolor:()=>FT,turtle_bgcolor_hex:()=>$T,turtle_bgcolor_hex_new:()=>zT,turtle_circle:()=>kT,turtle_circle_advanced:()=>NT,turtle_clear:()=>IT,turtle_clone:()=>BT,turtle_color:()=>HT,turtle_color_hex:()=>GT,turtle_color_seclet:()=>ex,turtle_create:()=>mT,turtle_done:()=>gT,turtle_exitonclick:()=>_T,turtle_fill:()=>ST,turtle_fillcolor:()=>PT,turtle_fillcolor_hex:()=>VT,turtle_fillcolor_hex_new:()=>YT,turtle_getscreen:()=>tx,turtle_goto:()=>xT,turtle_listen:()=>sx,turtle_move:()=>yT,turtle_numinput:()=>KT,turtle_onclick:()=>ix,turtle_onkey:()=>nx,turtle_ontimer:()=>rx,turtle_pencolor:()=>LT,turtle_pencolor_hex:()=>UT,turtle_pencolor_hex_new:()=>jT,turtle_penup:()=>AT,turtle_pos_shape:()=>ET,turtle_rotate:()=>vT,turtle_screen_delay:()=>TT,turtle_screen_savefig:()=>ox,turtle_setheading:()=>bT,turtle_setxy:()=>RT,turtle_shape:()=>WT,turtle_shapesize:()=>XT,turtle_size:()=>OT,turtle_size_speed:()=>CT,turtle_speed:()=>MT,turtle_stamp:()=>wT,turtle_textinput:()=>qT,turtle_visible:()=>DT,turtle_write:()=>ZT,turtle_write_format:()=>QT,turtle_write_format_skulpt:()=>JT});var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{sklearn_LinearRegression:()=>ax});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{sklearn_LinearRegression:()=>lx});var re={};__webpack_require__.r(re);var se={};__webpack_require__.r(se),__webpack_require__.d(se,{tensorflow_add:()=>px,tensorflow_compile:()=>fx,tensorflow_fit:()=>mx,tensorflow_get_loss:()=>gx,tensorflow_get_tensor_data:()=>yx,tensorflow_init_tensor:()=>cx,tensorflow_layers_dense:()=>hx,tensorflow_predict:()=>_x,tensorflow_prepare_picture:()=>Tx,tensorflow_save_or_export_model:()=>vx,tensorflow_sequential:()=>dx,tensorflow_use_load_model:()=>bx});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{BaseTransition:()=>XA,BaseTransitionPropsValidators:()=>GA,Comment:()=>qO,DeprecationTypes:()=>ck,EffectScope:()=>UE,ErrorCodes:()=>YI,ErrorTypeStrings:()=>rk,Fragment:()=>WO,KeepAlive:()=>OS,ReactiveEffect:()=>GE,Static:()=>KO,Suspense:()=>VO,Teleport:()=>BA,Text:()=>XO,TrackOpTypes:()=>MI,Transition:()=>xk,TransitionGroup:()=>vR,TriggerOpTypes:()=>kI,VueElement:()=>cR,assertNumber:()=>jI,callWithAsyncErrorHandling:()=>WI,callWithErrorHandling:()=>HI,camelize:()=>eE,capitalize:()=>iE,cloneVNode:()=>gM,compatUtils:()=>uk,computed:()=>ZM,createApp:()=>KR,createBlock:()=>oM,createCommentVNode:()=>vM,createElementBlock:()=>sM,createElementVNode:()=>hM,createHydrationRenderer:()=>dO,createPropsRestProxy:()=>AC,createRenderer:()=>cO,createSSRApp:()=>ZR,createSlots:()=>rC,createStaticVNode:()=>yM,createTextVNode:()=>_M,createVNode:()=>pM,customRef:()=>EI,defineAsyncComponent:()=>IS,defineComponent:()=>tS,defineCustomElement:()=>aR,defineEmits:()=>fC,defineExpose:()=>mC,defineModel:()=>yC,defineOptions:()=>gC,defineProps:()=>pC,defineSSRCustomElement:()=>lR,defineSlots:()=>_C,devtools:()=>sk,effect:()=>rw,effectScope:()=>VE,getCurrentInstance:()=>OM,getCurrentScope:()=>zE,getCurrentWatcher:()=>FI,getTransitionRawChildren:()=>eS,guardReactiveProps:()=>mM,h:()=>QM,handleError:()=>XI,hasInjectionContext:()=>HC,hydrate:()=>qR,hydrateOnIdle:()=>bS,hydrateOnInteraction:()=>ES,hydrateOnMediaQuery:()=>xS,hydrateOnVisible:()=>TS,initCustomFormatter:()=>JM,initDirectivesForSSR:()=>tN,inject:()=>GC,isMemoSame:()=>tk,isProxy:()=>aI,isReactive:()=>rI,isReadonly:()=>sI,isRef:()=>hI,isRuntimeOnly:()=>VM,isShallow:()=>oI,isVNode:()=>aM,markRaw:()=>uI,mergeDefaults:()=>wC,mergeModels:()=>IC,mergeProps:()=>EM,nextTick:()=>nA,normalizeClass:()=>yE,normalizeProps:()=>vE,normalizeStyle:()=>pE,onActivated:()=>kS,onBeforeMount:()=>$S,onBeforeUnmount:()=>jS,onBeforeUpdate:()=>VS,onDeactivated:()=>RS,onErrorCaptured:()=>XS,onMounted:()=>US,onRenderTracked:()=>WS,onRenderTriggered:()=>HS,onScopeDispose:()=>jE,onServerPrefetch:()=>GS,onUnmounted:()=>YS,onUpdated:()=>zS,onWatcherCleanup:()=>LI,openBlock:()=>JO,popScopeId:()=>wA,provide:()=>YC,proxyRefs:()=>TI,pushScopeId:()=>EA,queuePostFlushCb:()=>sA,reactive:()=>Jw,readonly:()=>tI,ref:()=>pI,registerRuntimeCompiler:()=>UM,render:()=>XR,renderList:()=>iC,renderSlot:()=>sC,resolveComponent:()=>ZS,resolveDirective:()=>eC,resolveDynamicComponent:()=>JS,resolveFilter:()=>lk,resolveTransitionHooks:()=>KA,setBlockTracking:()=>iM,setDevtoolsHook:()=>ok,setTransitionHooks:()=>JA,shallowReactive:()=>eI,shallowReadonly:()=>nI,shallowRef:()=>fI,ssrContextKey:()=>vO,ssrUtils:()=>ak,stop:()=>sw,toDisplayString:()=>FE,toHandlerKey:()=>rE,toHandlers:()=>aC,toRaw:()=>lI,toRef:()=>SI,toRefs:()=>wI,toValue:()=>vI,transformVNodeArgs:()=>uM,triggerRef:()=>_I,unref:()=>yI,useAttrs:()=>TC,useCssModule:()=>pR,useCssVars:()=>Vk,useHost:()=>dR,useId:()=>nS,useModel:()=>CO,useSSRContext:()=>bO,useShadowRoot:()=>hR,useSlots:()=>bC,useTemplateRef:()=>rS,useTransitionState:()=>jA,vModelCheckbox:()=>CR,vModelDynamic:()=>FR,vModelRadio:()=>MR,vModelSelect:()=>kR,vModelText:()=>SR,vShow:()=>Bk,version:()=>nk,warn:()=>ik,watch:()=>wO,watchEffect:()=>TO,watchPostEffect:()=>xO,watchSyncEffect:()=>EO,withAsyncContext:()=>SC,withCtx:()=>AA,withDefaults:()=>vC,withDirectives:()=>SA,withKeys:()=>zR,withMemo:()=>ek,withModifiers:()=>UR,withScopeId:()=>IA});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{COPYFILE_EXCL:()=>kP,COPYFILE_FICLONE:()=>RP,COPYFILE_FICLONE_FORCE:()=>NP,F_OK:()=>SP,O_APPEND:()=>VP,O_CREAT:()=>PP,O_DIRECT:()=>XP,O_DIRECTORY:()=>zP,O_DSYNC:()=>HP,O_EXCL:()=>BP,O_NOATIME:()=>jP,O_NOCTTY:()=>$P,O_NOFOLLOW:()=>YP,O_NONBLOCK:()=>qP,O_RDONLY:()=>DP,O_RDWR:()=>LP,O_SYMLINK:()=>WP,O_SYNC:()=>GP,O_TRUNC:()=>UP,O_WRONLY:()=>FP,R_OK:()=>CP,S_IFBLK:()=>eB,S_IFCHR:()=>nB,S_IFDIR:()=>tB,S_IFIFO:()=>iB,S_IFLNK:()=>QP,S_IFMT:()=>KP,S_IFREG:()=>JP,S_IFSOCK:()=>ZP,S_IRGRP:()=>hB,S_IROTH:()=>gB,S_IRUSR:()=>lB,S_IRWXG:()=>dB,S_IRWXO:()=>mB,S_IRWXU:()=>aB,S_ISGID:()=>sB,S_ISUID:()=>rB,S_ISVTX:()=>oB,S_IWGRP:()=>pB,S_IWOTH:()=>_B,S_IWUSR:()=>uB,S_IXGRP:()=>fB,S_IXOTH:()=>yB,S_IXUSR:()=>cB,UV_FS_O_FILEMAP:()=>vB,W_OK:()=>OP,X_OK:()=>MP,size_max:()=>bB});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{FileHandle:()=>jU,access:()=>mV,appendFile:()=>eV,chmod:()=>uV,chown:()=>aV,constants:()=>ae,copyFile:()=>yV,cp:()=>bV,exists:()=>GU,lchmod:()=>cV,lchown:()=>lV,link:()=>rV,lstat:()=>WU,lutimes:()=>hV,mkdir:()=>nV,mkdtemp:()=>_V,open:()=>ZU,opendir:()=>vV,readFile:()=>QU,readdir:()=>iV,readlink:()=>oV,realpath:()=>pV,rename:()=>YU,rm:()=>gV,rmdir:()=>tV,stat:()=>HU,statfs:()=>TV,symlink:()=>sV,truncate:()=>XU,unlink:()=>qU,utimes:()=>dV,watch:()=>fV,writeFile:()=>JU});var ue={};__webpack_require__.r(ue),__webpack_require__.d(ue,{BigIntStatsFs:()=>SB,Dir:()=>PU,Dirent:()=>LU,ReadStream:()=>$U,Stats:()=>wB,StatsFs:()=>AB,WriteStream:()=>UU,_synced:()=>R$,access:()=>nz,accessSync:()=>SU,appendFile:()=>RV,appendFileSync:()=>iU,chmod:()=>ZV,chmodSync:()=>xU,chown:()=>qV,chownSync:()=>bU,chroot:()=>P$,close:()=>DV,closeSync:()=>sU,constants:()=>ae,copyFile:()=>dz,copyFileSync:()=>MU,cp:()=>mz,cpSync:()=>DU,createReadStream:()=>az,createWriteStream:()=>lz,exists:()=>wV,existsSync:()=>H$,fchmod:()=>VV,fchmodSync:()=>hU,fchown:()=>UV,fchownSync:()=>dU,fdatasync:()=>PV,fdatasyncSync:()=>lU,fstat:()=>NV,fstatSync:()=>rU,fsync:()=>LV,fsyncSync:()=>aU,ftruncate:()=>FV,ftruncateSync:()=>oU,futimes:()=>zV,futimesSync:()=>pU,lchmod:()=>QV,lchmodSync:()=>EU,lchown:()=>KV,lchownSync:()=>TU,link:()=>HV,linkSync:()=>_U,lopenSync:()=>J$,lstat:()=>AV,lstatSync:()=>X$,lutimes:()=>ez,lutimesSync:()=>IU,mkdir:()=>YV,mkdirSync:()=>mU,mkdtemp:()=>cz,mkdtempSync:()=>OU,mount:()=>O$,mountObject:()=>F$,mounts:()=>C$,open:()=>OV,openAsBlob:()=>_z,openSync:()=>Q$,opendir:()=>fz,opendirSync:()=>NU,promises:()=>le,read:()=>$V,readFile:()=>MV,readFileSync:()=>tU,readSync:()=>cU,readdir:()=>GV,readdirSync:()=>gU,readlink:()=>XV,readlinkSync:()=>vU,readv:()=>hz,readvSync:()=>kU,realpath:()=>tz,realpathSync:()=>AU,rename:()=>EV,renameSync:()=>G$,rm:()=>uz,rmSync:()=>CU,rmdir:()=>jV,rmdirSync:()=>fU,stat:()=>IV,statSync:()=>W$,statfs:()=>gz,statfsSync:()=>FU,symlink:()=>WV,symlinkSync:()=>yU,truncate:()=>SV,truncateSync:()=>q$,umount:()=>M$,unlink:()=>CV,unlinkSync:()=>K$,unwatchFile:()=>sz,utimes:()=>JV,utimesSync:()=>wU,watch:()=>oz,watchFile:()=>rz,write:()=>BV,writeFile:()=>kV,writeFileSync:()=>nU,writeSync:()=>uU,writev:()=>pz,writevSync:()=>RU});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{maxNorm:()=>Y9,minMaxNorm:()=>W9,nonNeg:()=>H9,unitNorm:()=>G9});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{constant:()=>K9,glorotNormal:()=>i7,glorotUniform:()=>n7,heNormal:()=>r7,heUniform:()=>s7,identity:()=>e7,leCunNormal:()=>o7,leCunUniform:()=>a7,ones:()=>q9,orthogonal:()=>l7,randomNormal:()=>Q9,randomUniform:()=>Z9,truncatedNormal:()=>J9,varianceScaling:()=>t7,zeros:()=>X9});var he={};__webpack_require__.r(he),__webpack_require__.d(he,{Layer:()=>E9,RNN:()=>kte,RNNCell:()=>Rte,activation:()=>die,add:()=>bie,alphaDropout:()=>cre,average:()=>Tie,averagePooling1d:()=>Mie,averagePooling2d:()=>Nie,averagePooling3d:()=>Lie,avgPool1d:()=>kie,avgPool2d:()=>Die,avgPool3d:()=>Pie,avgPooling1d:()=>Rie,avgPooling2d:()=>Fie,avgPooling3d:()=>Bie,batchNormalization:()=>Sie,bidirectional:()=>nre,categoryEncoding:()=>mre,centerCrop:()=>pre,concatenate:()=>xie,conv1d:()=>nie,conv2d:()=>iie,conv2dTranspose:()=>rie,conv3d:()=>sie,conv3dTranspose:()=>oie,convLstm2d:()=>Qie,convLstm2dCell:()=>Jie,cropping2D:()=>lie,dense:()=>hie,depthwiseConv2d:()=>cie,dot:()=>Aie,dropout:()=>pie,elu:()=>Kne,embedding:()=>vie,flatten:()=>mie,gaussianDropout:()=>ure,gaussianNoise:()=>lre,globalAveragePooling1d:()=>$ie,globalAveragePooling2d:()=>Uie,globalMaxPool1d:()=>rre,globalMaxPool2d:()=>sre,globalMaxPooling1d:()=>Vie,globalMaxPooling2d:()=>zie,gru:()=>Hie,gruCell:()=>Wie,input:()=>Cee,inputLayer:()=>qne,layerNormalization:()=>Cie,leakyReLU:()=>Qne,lstm:()=>Xie,lstmCell:()=>qie,masking:()=>dre,maxPool1d:()=>ore,maxPool2d:()=>are,maxPooling1d:()=>jie,maxPooling2d:()=>Yie,maxPooling3d:()=>Gie,maximum:()=>Eie,minimum:()=>wie,multiply:()=>Iie,permute:()=>yie,prelu:()=>Jne,randomWidth:()=>gre,reLU:()=>Zne,repeatVector:()=>gie,rescaling:()=>hre,reshape:()=>_ie,resizing:()=>fre,rnn:()=>ere,separableConv2d:()=>aie,simpleRNN:()=>Kie,simpleRNNCell:()=>Zie,softmax:()=>eie,spatialDropout1d:()=>fie,stackedRNNCells:()=>tre,thresholdedReLU:()=>tie,timeDistributed:()=>ire,upSampling2d:()=>uie,zeroPadding2d:()=>Oie});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{MAPE:()=>Sre,MSE:()=>Mre,binaryAccuracy:()=>_re,binaryCrossentropy:()=>yre,categoricalAccuracy:()=>bre,categoricalCrossentropy:()=>Tre,cosineProximity:()=>wre,mape:()=>Cre,meanAbsoluteError:()=>Ire,meanAbsolutePercentageError:()=>Are,meanSquaredError:()=>Ore,mse:()=>kre,precision:()=>xre,r2Score:()=>Rre,recall:()=>Ere,sparseCategoricalAccuracy:()=>vre});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{modelFromJSON:()=>Eee});var me={};__webpack_require__.r(me),__webpack_require__.d(me,{l1:()=>Dre,l1l2:()=>Nre,l2:()=>Fre});var ge={};__webpack_require__.r(ge),__webpack_require__.d(ge,{json:()=>tse});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{json:()=>nse});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{json:()=>ise});var ve={};__webpack_require__.r(ve),__webpack_require__.d(ve,{json:()=>rse});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{json:()=>sse});var Te={};__webpack_require__.r(Te),__webpack_require__.d(Te,{json:()=>ose});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{json:()=>ase});var Ee={};__webpack_require__.r(Ee),__webpack_require__.d(Ee,{json:()=>lse});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{json:()=>use});var Ie={};__webpack_require__.r(Ie),__webpack_require__.d(Ie,{json:()=>cse});var Ae={};__webpack_require__.r(Ae),__webpack_require__.d(Ae,{json:()=>dse});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{json:()=>hse});var Ce={};__webpack_require__.r(Ce),__webpack_require__.d(Ce,{json:()=>pse});var Oe={};__webpack_require__.r(Oe),__webpack_require__.d(Oe,{json:()=>fse});var Me={};__webpack_require__.r(Me),__webpack_require__.d(Me,{json:()=>mse});var ke={};__webpack_require__.r(ke),__webpack_require__.d(ke,{json:()=>gse});var Re={};__webpack_require__.r(Re),__webpack_require__.d(Re,{json:()=>_se});var Ne={};__webpack_require__.r(Ne),__webpack_require__.d(Ne,{json:()=>yse});var De={};__webpack_require__.r(De),__webpack_require__.d(De,{json:()=>vse});var Fe={};__webpack_require__.r(Fe),__webpack_require__.d(Fe,{OP_SCOPE_SUFFIX:()=>Lse.BTT,abs:()=>Lse.tnl,acos:()=>Lse.HQu,acosh:()=>Lse.FqL,add:()=>Lse.WQq,addN:()=>Lse.QiD,all:()=>Lse.Q7R,any:()=>Lse.bzn,argMax:()=>Lse.FLi,argMin:()=>Lse.XRg,asin:()=>Lse.qRo,asinh:()=>Lse.yHs,atan:()=>Lse.rYl,atan2:()=>Lse.FPz,atanh:()=>Lse.rfv,avgPool:()=>Lse.$jT,avgPool3d:()=>Lse.sub,basicLSTMCell:()=>Lse.lZX,batchNorm:()=>Lse.$v7,batchNorm2d:()=>Lse.BFc,batchNorm3d:()=>Lse.kSi,batchNorm4d:()=>Lse.T5N,batchToSpaceND:()=>Lse.GTe,bincount:()=>Lse.HbZ,bitwiseAnd:()=>Lse.vjT,booleanMaskAsync:()=>Lse.ftb,broadcastArgs:()=>Lse.ROE,broadcastTo:()=>Lse.hOW,buffer:()=>Lse.ra8,cast:()=>Lse.wgE,ceil:()=>Lse.mkO,clipByValue:()=>Lse.zQh,clone:()=>Lse.o8B,complex:()=>Lse.faB,concat:()=>Lse.xWs,concat1d:()=>Lse.I1m,concat2d:()=>Lse.RPU,concat3d:()=>Lse.O5O,concat4d:()=>Lse.P1l,conv1d:()=>Lse.kA9,conv2d:()=>Lse.Xtf,conv2dTranspose:()=>Lse.wX9,conv3d:()=>Lse.IPL,conv3dTranspose:()=>Lse.jIJ,cos:()=>Lse.gnS,cosh:()=>Lse.yIG,cosineWindow:()=>Lse._jP,cumprod:()=>Lse.Lp0,cumsum:()=>Lse.rCv,denseBincount:()=>Lse.aOp,depthToSpace:()=>Lse.Rj8,depthwiseConv2d:()=>Lse.Gl3,diag:()=>Lse.smy,dilation2d:()=>Lse.X7t,div:()=>Lse.y4m,divNoNan:()=>Lse.ek5,dot:()=>Lse.Omf,dropout:()=>Lse.EZY,einsum:()=>Lse._3C,elu:()=>Lse.Pqc,enclosingPowerOfTwo:()=>Lse.FJY,ensureShape:()=>Lse.QP2,equal:()=>Lse.LCg,erf:()=>Lse.Y12,euclideanNorm:()=>Lse.p4S,exp:()=>Lse.oNF,expandDims:()=>Lse.UG6,expm1:()=>Lse.IYd,eye:()=>Lse.y5U,fft:()=>Lse.hVP,fill:()=>Lse.GSj,floor:()=>Lse.RIf,floorDiv:()=>Lse.wh_,fused:()=>Lse.cZk,gather:()=>Lse.kgh,gatherND:()=>Lse.SY9,greater:()=>Lse.rhj,greaterEqual:()=>Lse.DQN,ifft:()=>Lse.KGM,imag:()=>Lse.ngS,image:()=>Lse.Slp,inTopKAsync:()=>Lse.U4u,irfft:()=>Lse.ggX,isFinite:()=>Lse.MIs,isInf:()=>Lse.EN4,isNaN:()=>Lse.yrW,leakyRelu:()=>Lse.H8d,less:()=>Lse.M7h,lessEqual:()=>Lse.InN,linalg:()=>Lse.mPL,linspace:()=>Lse.mT8,localResponseNormalization:()=>Lse.Kgs,log:()=>Lse.Rm2,log1p:()=>Lse.Kko,logSigmoid:()=>Lse.nqI,logSoftmax:()=>Lse.HPB,logSumExp:()=>Lse.VZ,logicalAnd:()=>Lse.n76,logicalNot:()=>Lse.NSZ,logicalOr:()=>Lse.ztW,logicalXor:()=>Lse.rxB,losses:()=>Lse.YYh,lowerBound:()=>Lse.yzS,matMul:()=>Lse.NoW,max:()=>Lse.T9B,maxPool:()=>Lse.jgi,maxPool3d:()=>Lse.NYV,maxPoolWithArgmax:()=>Lse.RO,maximum:()=>Lse.PhQ,mean:()=>Lse.i2o,meshgrid:()=>Lse.OYQ,min:()=>Lse.jkA,minimum:()=>Lse.BpO,mirrorPad:()=>Lse.FFZ,mod:()=>Lse.ziu,moments:()=>Lse.Clk,movingAverage:()=>Lse.CRk,mul:()=>Lse.lKK,multiRNNCell:()=>Lse.YDF,multinomial:()=>Lse.OjQ,neg:()=>Lse.HZy,norm:()=>Lse.xbf,notEqual:()=>Lse.Ec,oneHot:()=>Lse.Mw0,ones:()=>Lse.SaS,onesLike:()=>Lse.P61,op:()=>Lse.op,outerProduct:()=>Lse.X4o,pad:()=>Lse.eVF,pad1d:()=>Lse.BZs,pad2d:()=>Lse.grY,pad3d:()=>Lse.XHu,pad4d:()=>Lse.WLX,pool:()=>Lse.dzn,pow:()=>Lse.n7C,prelu:()=>Lse.NsG,print:()=>Lse.yyV,prod:()=>Lse._eU,raggedGather:()=>Lse.whe,raggedRange:()=>Lse.iyU,raggedTensorToTensor:()=>Lse.Q0_,rand:()=>Lse._9M,randomGamma:()=>Lse.pR9,randomNormal:()=>Lse.FE$,randomStandardNormal:()=>Lse.m0H,randomUniform:()=>Lse.YeY,randomUniformInt:()=>Lse.HYA,range:()=>Lse.y17,real:()=>Lse.xav,reciprocal:()=>Lse.VOZ,relu:()=>Lse.VVh,relu6:()=>Lse.j__,reshape:()=>Lse.tQQ,reverse:()=>Lse.BEg,reverse1d:()=>Lse.QD2,reverse2d:()=>Lse.LMr,reverse3d:()=>Lse.I2l,reverse4d:()=>Lse.JYU,rfft:()=>Lse.z8$,round:()=>Lse.LIG,rsqrt:()=>Lse.Z$r,scalar:()=>Lse.d_2,scatterND:()=>Lse.NFr,searchSorted:()=>Lse.sZg,selu:()=>Lse.WfX,separableConv2d:()=>Lse.wdz,setdiff1dAsync:()=>Lse.F12,sigmoid:()=>Lse.ry7,sign:()=>Lse._SZ,signal:()=>Lse.vPA,sin:()=>Lse.F8e,sinh:()=>Lse.L0l,slice:()=>Lse.dik,slice1d:()=>Lse.Q$M,slice2d:()=>Lse.zAd,slice3d:()=>Lse.wck,slice4d:()=>Lse.R0O,softmax:()=>Lse.Vs9,softplus:()=>Lse.lw0,spaceToBatchND:()=>Lse.eDJ,sparse:()=>Lse.lMo,sparseToDense:()=>Lse.Zhr,spectral:()=>Lse.lOn,split:()=>Lse.lDo,sqrt:()=>Lse.RZD,square:()=>Lse.EwI,squaredDifference:()=>Lse.Pbu,squeeze:()=>Lse.r2V,stack:()=>Lse.t$z,step:()=>Lse.PMw,stridedSlice:()=>Lse.Ym9,string:()=>Lse.YjP,sub:()=>Lse.jbE,sum:()=>Lse.czq,tan:()=>Lse.Mlm,tanh:()=>Lse.ymU,tensor:()=>Lse.OEK,tensor1d:()=>Lse.tGX,tensor2d:()=>Lse.KtR,tensor3d:()=>Lse.$_$,tensor4d:()=>Lse.g9W,tensor5d:()=>Lse.Lpo,tensor6d:()=>Lse.yxw,tensorScatterUpdate:()=>Lse.NNh,tile:()=>Lse.Vsq,topk:()=>Lse.rfw,transpose:()=>Lse.mgz,truncatedNormal:()=>Lse.efE,unique:()=>Lse.AmM,unsortedSegmentSum:()=>Lse.zAU,unstack:()=>Lse.K$i,upperBound:()=>Lse.rni,variable:()=>Lse.bvq,where:()=>Lse._M9,whereAsync:()=>Lse.YJN,zeros:()=>Lse.Ul9,zerosLike:()=>Lse.POl});var Le={};__webpack_require__.r(Le),__webpack_require__.d(Le,{CSVDataset:()=>iae,Dataset:()=>Goe,FileDataSource:()=>gae,TextLineDataset:()=>Koe,URLDataSource:()=>_ae,array:()=>Woe,csv:()=>yae,func:()=>vae,generator:()=>bae,microphone:()=>xae,version_data:()=>Eae,webcam:()=>Tae,zip:()=>Xoe});var Pe={};__webpack_require__.r(Pe),__webpack_require__.d(Pe,{addImpl:()=>zae,bincountImpl:()=>Hae,bincountReduceImpl:()=>Wae,bitwiseAndImpl:()=>Xae,castImpl:()=>Pae,ceilImpl:()=>ele,concatImpl:()=>ile,equalImpl:()=>rle,expImpl:()=>ale,expm1Impl:()=>cle,floorDivImpl:()=>gle,floorImpl:()=>ple,gatherNdImpl:()=>vle,gatherV2Impl:()=>ble,greaterEqualImpl:()=>wle,greaterImpl:()=>Tle,lessEqualImpl:()=>Mle,lessImpl:()=>Sle,linSpaceImpl:()=>Nle,logImpl:()=>Dle,maxImpl:()=>Ple,maximumImpl:()=>Ble,minimumImpl:()=>Vle,multiplyImpl:()=>Yle,negImpl:()=>Xle,notEqualImpl:()=>Kle,prodImpl:()=>nue,raggedGatherImpl:()=>aue,raggedRangeImpl:()=>uue,raggedTensorToTensorImpl:()=>fue,rangeImpl:()=>mue,rsqrtImpl:()=>gue,scatterImpl:()=>vue,sigmoidImpl:()=>bue,simpleAbsImpl:()=>Sae,sliceImpl:()=>Eue,sparseFillEmptyRowsImpl:()=>Aue,sparseReshapeImpl:()=>Sue,sparseSegmentReductionImpl:()=>Cue,sqrtImpl:()=>Oue,squaredDifferenceImpl:()=>Rue,staticRegexReplaceImpl:()=>Fue,stridedSliceImpl:()=>Bue,stringNGramsImpl:()=>Uue,stringSplitImpl:()=>zue,stringToHashBucketFastImpl:()=>jue,subImpl:()=>Yue,tileImpl:()=>Xue,topKImpl:()=>Zue,transposeImpl:()=>Jle,uniqueImpl:()=>Que});var Be={};__webpack_require__.r(Be),__webpack_require__.d(Be,{assertNotComplex:()=>fme,bindCanvasToFramebuffer:()=>zfe,bindColorTextureToFramebuffer:()=>jfe,bindTextureToProgramUniformSampler:()=>Vfe,bindTextureUnit:()=>Pfe,bindVertexBufferToProgramAttribute:()=>Lfe,callAndCheck:()=>_fe,canBeRepresented:()=>bfe,createFragmentShader:()=>wfe,createFramebuffer:()=>Ffe,createProgram:()=>Sfe,createStaticIndexBuffer:()=>kfe,createStaticVertexBuffer:()=>Mfe,createTexture:()=>Nfe,createVertexShader:()=>Efe,getBatchDim:()=>qfe,getExtensionOrThrow:()=>xfe,getFramebufferErrorMessage:()=>Hfe,getMaxTexturesInShader:()=>ome,getNumChannels:()=>Rfe,getProgramUniformLocation:()=>Ufe,getProgramUniformLocationOrThrow:()=>$fe,getRowsCols:()=>Kfe,getShapeAs3D:()=>Zfe,getTextureShapeFromLogicalShape:()=>Qfe,getWebGLDisjointQueryTimerVersion:()=>ame,getWebGLErrorMessage:()=>Tfe,getWebGLMaxTextureSize:()=>ime,hasExtension:()=>lme,isCapableOfRenderingToFloatTexture:()=>cme,isDownloadFloatTextureEnabled:()=>dme,isReshapeFree:()=>eme,isWebGLFenceEnabled:()=>pme,isWebGLVersionEnabled:()=>ume,linkProgram:()=>Cfe,logShaderSourceAndInfoLog:()=>Afe,resetMaxTextureSize:()=>rme,resetMaxTexturesInShader:()=>sme,unbindColorTextureFromFramebuffer:()=>Yfe,unbindTextureUnit:()=>Bfe,validateFramebuffer:()=>Gfe,validateProgram:()=>Ofe,validateTextureSize:()=>Dfe});var $e={};__webpack_require__.r($e),__webpack_require__.d($e,{bindVertexProgramAttributeStreams:()=>age,createBufferFromOutputTexture:()=>cge,createFloat16MatrixTexture:()=>ege,createFloat16PackedMatrixTexture:()=>oge,createFloat32MatrixTexture:()=>Qme,createIndexBuffer:()=>qme,createPackedMatrixTexture:()=>rge,createUnsignedBytesMatrixTexture:()=>nge,createVertexBuffer:()=>Xme,createVertexShader:()=>Wme,downloadByteEncodedFloatMatrixFromOutputTexture:()=>hge,downloadFloat32MatrixFromBuffer:()=>dge,downloadMatrixFromPackedOutputTexture:()=>fge,downloadPackedMatrixFromBuffer:()=>pge,getInternalFormatForFloat16MatrixTexture:()=>Jme,getInternalFormatForFloat16PackedMatrixTexture:()=>sge,getInternalFormatForFloat32MatrixTexture:()=>Zme,getInternalFormatForPackedMatrixTexture:()=>ige,getInternalFormatForUnsignedBytesMatrixTexture:()=>tge,uploadDenseMatrixToTexture:()=>lge,uploadPixelDataToTexture:()=>uge});var Ue={};__webpack_require__.r(Ue),__webpack_require__.d(Ue,{Abs:()=>u3.Abs,Acos:()=>u3.Acos,Acosh:()=>u3.Acosh,AdadeltaOptimizer:()=>u3.AdadeltaOptimizer,AdagradOptimizer:()=>u3.AdagradOptimizer,AdamOptimizer:()=>u3.AdamOptimizer,AdamaxOptimizer:()=>u3.AdamaxOptimizer,Add:()=>u3.Add,AddN:()=>u3.AddN,All:()=>u3.All,Any:()=>u3.Any,ArgMax:()=>u3.ArgMax,ArgMin:()=>u3.ArgMin,Asin:()=>u3.Asin,Asinh:()=>u3.Asinh,Atan:()=>u3.Atan,Atan2:()=>u3.Atan2,Atanh:()=>u3.Atanh,AvgPool:()=>u3.AvgPool,AvgPool3D:()=>u3.AvgPool3D,AvgPool3DGrad:()=>u3.AvgPool3DGrad,AvgPoolGrad:()=>u3.AvgPoolGrad,BatchMatMul:()=>u3.BatchMatMul,BatchToSpaceND:()=>u3.BatchToSpaceND,Bincount:()=>u3.Bincount,BitwiseAnd:()=>u3.BitwiseAnd,BroadcastArgs:()=>u3.BroadcastArgs,BroadcastTo:()=>u3.BroadcastTo,Callback:()=>Lre,CallbackList:()=>p7,Cast:()=>u3.Cast,Ceil:()=>u3.Ceil,ClipByValue:()=>u3.ClipByValue,Complex:()=>u3.Complex,ComplexAbs:()=>u3.ComplexAbs,Concat:()=>u3.Concat,Conv2D:()=>u3.Conv2D,Conv2DBackpropFilter:()=>u3.Conv2DBackpropFilter,Conv2DBackpropInput:()=>u3.Conv2DBackpropInput,Conv3D:()=>u3.Conv3D,Conv3DBackpropFilterV2:()=>u3.Conv3DBackpropFilterV2,Conv3DBackpropInputV2:()=>u3.Conv3DBackpropInputV2,Cos:()=>u3.Cos,Cosh:()=>u3.Cosh,CropAndResize:()=>u3.CropAndResize,Cumprod:()=>u3.Cumprod,Cumsum:()=>u3.Cumsum,CustomCallback:()=>g7,DataStorage:()=>u3.DataStorage,DenseBincount:()=>u3.DenseBincount,DepthToSpace:()=>u3.DepthToSpace,DepthwiseConv2dNative:()=>u3.DepthwiseConv2dNative,DepthwiseConv2dNativeBackpropFilter:()=>u3.DepthwiseConv2dNativeBackpropFilter,DepthwiseConv2dNativeBackpropInput:()=>u3.DepthwiseConv2dNativeBackpropInput,Diag:()=>u3.Diag,Dilation2D:()=>u3.Dilation2D,Dilation2DBackpropFilter:()=>u3.Dilation2DBackpropFilter,Dilation2DBackpropInput:()=>u3.Dilation2DBackpropInput,Draw:()=>u3.Draw,ENV:()=>u3.ENV,EarlyStopping:()=>$re,Einsum:()=>u3.Einsum,Elu:()=>u3.Elu,EluGrad:()=>u3.EluGrad,Environment:()=>u3.Environment,Equal:()=>u3.Equal,Erf:()=>u3.Erf,Exp:()=>u3.Exp,ExpandDims:()=>u3.ExpandDims,Expm1:()=>u3.Expm1,FFT:()=>u3.FFT,Fill:()=>u3.Fill,FlipLeftRight:()=>u3.FlipLeftRight,Floor:()=>u3.Floor,FloorDiv:()=>u3.FloorDiv,FromPixels:()=>u3.FromPixels,FusedBatchNorm:()=>u3.FusedBatchNorm,FusedConv2D:()=>u3.FusedConv2D,FusedDepthwiseConv2D:()=>u3.FusedDepthwiseConv2D,GPGPUContext:()=>mge,GatherNd:()=>u3.GatherNd,GatherV2:()=>u3.GatherV2,GraphModel:()=>uoe,Greater:()=>u3.Greater,GreaterEqual:()=>u3.GreaterEqual,History:()=>m7,IFFT:()=>u3.IFFT,Identity:()=>u3.Identity,Imag:()=>u3.Imag,InputSpec:()=>y9,IsFinite:()=>u3.IsFinite,IsInf:()=>u3.IsInf,IsNan:()=>u3.IsNan,KernelBackend:()=>u3.KernelBackend,LRN:()=>u3.LRN,LRNGrad:()=>u3.LRNGrad,LayerVariable:()=>m9,LayersModel:()=>Tee,LeakyRelu:()=>u3.LeakyRelu,Less:()=>u3.Less,LessEqual:()=>u3.LessEqual,LinSpace:()=>u3.LinSpace,Log:()=>u3.Log,Log1p:()=>u3.Log1p,LogSoftmax:()=>u3.LogSoftmax,LogicalAnd:()=>u3.LogicalAnd,LogicalNot:()=>u3.LogicalNot,LogicalOr:()=>u3.LogicalOr,LogicalXor:()=>u3.LogicalXor,LowerBound:()=>u3.LowerBound,MathBackendCPU:()=>Aae,MathBackendWebGL:()=>M_e,MatrixBandPart:()=>u3.MatrixBandPart,Max:()=>u3.Max,MaxPool:()=>u3.MaxPool,MaxPool3D:()=>u3.MaxPool3D,MaxPool3DGrad:()=>u3.MaxPool3DGrad,MaxPoolGrad:()=>u3.MaxPoolGrad,MaxPoolWithArgmax:()=>u3.MaxPoolWithArgmax,Maximum:()=>u3.Maximum,Mean:()=>u3.Mean,Min:()=>u3.Min,Minimum:()=>u3.Minimum,MirrorPad:()=>u3.MirrorPad,Mod:()=>u3.Mod,MomentumOptimizer:()=>u3.MomentumOptimizer,Multinomial:()=>u3.Multinomial,Multiply:()=>u3.Multiply,Neg:()=>u3.Neg,NonMaxSuppressionV3:()=>u3.NonMaxSuppressionV3,NonMaxSuppressionV4:()=>u3.NonMaxSuppressionV4,NonMaxSuppressionV5:()=>u3.NonMaxSuppressionV5,NotEqual:()=>u3.NotEqual,OP_SCOPE_SUFFIX:()=>u3.OP_SCOPE_SUFFIX,OneHot:()=>u3.OneHot,OnesLike:()=>u3.OnesLike,Optimizer:()=>u3.Optimizer,OptimizerConstructors:()=>u3.OptimizerConstructors,Pack:()=>u3.Pack,PadV2:()=>u3.PadV2,Pool:()=>u3.Pool,Pow:()=>u3.Pow,Prelu:()=>u3.Prelu,Prod:()=>u3.Prod,RMSPropOptimizer:()=>u3.RMSPropOptimizer,RNN:()=>kte,RaggedGather:()=>u3.RaggedGather,RaggedRange:()=>u3.RaggedRange,RaggedTensorToTensor:()=>u3.RaggedTensorToTensor,Range:()=>u3.Range,Rank:()=>u3.Rank,Real:()=>u3.Real,RealDiv:()=>u3.RealDiv,Reciprocal:()=>u3.Reciprocal,Reduction:()=>u3.Reduction,Relu:()=>u3.Relu,Relu6:()=>u3.Relu6,Reshape:()=>u3.Reshape,ResizeBilinear:()=>u3.ResizeBilinear,ResizeBilinearGrad:()=>u3.ResizeBilinearGrad,ResizeNearestNeighbor:()=>u3.ResizeNearestNeighbor,ResizeNearestNeighborGrad:()=>u3.ResizeNearestNeighborGrad,Reverse:()=>u3.Reverse,RotateWithOffset:()=>u3.RotateWithOffset,Round:()=>u3.Round,Rsqrt:()=>u3.Rsqrt,SGDOptimizer:()=>u3.SGDOptimizer,ScatterNd:()=>u3.ScatterNd,SearchSorted:()=>u3.SearchSorted,Select:()=>u3.Select,Selu:()=>u3.Selu,Sequential:()=>Iee,Sigmoid:()=>u3.Sigmoid,Sign:()=>u3.Sign,Sin:()=>u3.Sin,Sinh:()=>u3.Sinh,Slice:()=>u3.Slice,Softmax:()=>u3.Softmax,Softplus:()=>u3.Softplus,SpaceToBatchND:()=>u3.SpaceToBatchND,SparseFillEmptyRows:()=>u3.SparseFillEmptyRows,SparseReshape:()=>u3.SparseReshape,SparseSegmentMean:()=>u3.SparseSegmentMean,SparseSegmentSum:()=>u3.SparseSegmentSum,SparseToDense:()=>u3.SparseToDense,SplitV:()=>u3.SplitV,Sqrt:()=>u3.Sqrt,Square:()=>u3.Square,SquaredDifference:()=>u3.SquaredDifference,StaticRegexReplace:()=>u3.StaticRegexReplace,Step:()=>u3.Step,StridedSlice:()=>u3.StridedSlice,StringNGrams:()=>u3.StringNGrams,StringSplit:()=>u3.StringSplit,StringToHashBucketFast:()=>u3.StringToHashBucketFast,Sub:()=>u3.Sub,Sum:()=>u3.Sum,SymbolicTensor:()=>v9,Tan:()=>u3.Tan,Tanh:()=>u3.Tanh,Tensor:()=>u3.Tensor,TensorBuffer:()=>u3.TensorBuffer,TensorScatterUpdate:()=>u3.TensorScatterUpdate,Tile:()=>u3.Tile,TopK:()=>u3.TopK,Transform:()=>u3.Transform,Transpose:()=>u3.Transpose,Unique:()=>u3.Unique,Unpack:()=>u3.Unpack,UnsortedSegmentSum:()=>u3.UnsortedSegmentSum,UpperBound:()=>u3.UpperBound,Variable:()=>u3.Variable,ZerosLike:()=>u3.ZerosLike,_FusedMatMul:()=>u3._FusedMatMul,abs:()=>u3.abs,acos:()=>u3.acos,acosh:()=>u3.acosh,add:()=>u3.add,addN:()=>u3.addN,all:()=>u3.all,any:()=>u3.any,argMax:()=>u3.argMax,argMin:()=>u3.argMin,asin:()=>u3.asin,asinh:()=>u3.asinh,atan:()=>u3.atan,atan2:()=>u3.atan2,atanh:()=>u3.atanh,avgPool:()=>u3.avgPool,avgPool3d:()=>u3.avgPool3d,backend:()=>u3.backend,backend_util:()=>u3.backend_util,basicLSTMCell:()=>u3.basicLSTMCell,batchNorm:()=>u3.batchNorm,batchNorm2d:()=>u3.batchNorm2d,batchNorm3d:()=>u3.batchNorm3d,batchNorm4d:()=>u3.batchNorm4d,batchToSpaceND:()=>u3.batchToSpaceND,bincount:()=>u3.bincount,bitwiseAnd:()=>u3.bitwiseAnd,booleanMaskAsync:()=>u3.booleanMaskAsync,broadcastArgs:()=>u3.broadcastArgs,broadcastTo:()=>u3.broadcastTo,broadcast_util:()=>u3.broadcast_util,browser:()=>u3.browser,buffer:()=>u3.buffer,callbacks:()=>Ure,cast:()=>u3.cast,ceil:()=>u3.ceil,clipByValue:()=>u3.clipByValue,clone:()=>u3.clone,complex:()=>u3.complex,concat:()=>u3.concat,concat1d:()=>u3.concat1d,concat2d:()=>u3.concat2d,concat3d:()=>u3.concat3d,concat4d:()=>u3.concat4d,constraints:()=>ce,conv1d:()=>u3.conv1d,conv2d:()=>u3.conv2d,conv2dTranspose:()=>u3.conv2dTranspose,conv3d:()=>u3.conv3d,conv3dTranspose:()=>u3.conv3dTranspose,copyRegisteredKernels:()=>u3.copyRegisteredKernels,cos:()=>u3.cos,cosh:()=>u3.cosh,cosineWindow:()=>u3.cosineWindow,cumprod:()=>u3.cumprod,cumsum:()=>u3.cumsum,customGrad:()=>u3.customGrad,data:()=>Le,denseBincount:()=>u3.denseBincount,deprecationWarn:()=>u3.deprecationWarn,depthToSpace:()=>u3.depthToSpace,depthwiseConv2d:()=>u3.depthwiseConv2d,deregisterOp:()=>Hre,device_util:()=>u3.device_util,diag:()=>u3.diag,dilation2d:()=>u3.dilation2d,disableDeprecationWarnings:()=>u3.disableDeprecationWarnings,dispose:()=>u3.dispose,disposeVariables:()=>u3.disposeVariables,div:()=>u3.div,divNoNan:()=>u3.divNoNan,dot:()=>u3.dot,dropout:()=>u3.dropout,einsum:()=>u3.einsum,elu:()=>u3.elu,enableDebugMode:()=>u3.enableDebugMode,enableProdMode:()=>u3.enableProdMode,enclosingPowerOfTwo:()=>u3.enclosingPowerOfTwo,engine:()=>u3.engine,ensureShape:()=>u3.ensureShape,env:()=>u3.env,equal:()=>u3.equal,erf:()=>u3.erf,euclideanNorm:()=>u3.euclideanNorm,exp:()=>u3.exp,expandDims:()=>u3.expandDims,expm1:()=>u3.expm1,eye:()=>u3.eye,fft:()=>u3.fft,fill:()=>u3.fill,findBackend:()=>u3.findBackend,findBackendFactory:()=>u3.findBackendFactory,floor:()=>u3.floor,floorDiv:()=>u3.floorDiv,forceHalfFloat:()=>R_e,fused:()=>u3.fused,gather:()=>u3.gather,gatherND:()=>u3.gatherND,gather_util:()=>u3.gather_util,getBackend:()=>u3.getBackend,getGradient:()=>u3.getGradient,getKernel:()=>u3.getKernel,getKernelsForBackend:()=>u3.getKernelsForBackend,gpgpu_util:()=>$e,grad:()=>u3.grad,grads:()=>u3.grads,greater:()=>u3.greater,greaterEqual:()=>u3.greaterEqual,ifft:()=>u3.ifft,imag:()=>u3.imag,image:()=>u3.image,inTopKAsync:()=>u3.inTopKAsync,initializers:()=>de,input:()=>Cee,io:()=>u3.io,irfft:()=>u3.irfft,isFinite:()=>u3.isFinite,isInf:()=>u3.isInf,isNaN:()=>u3.isNaN,keep:()=>u3.keep,kernel_impls:()=>u3.kernel_impls,layers:()=>he,leakyRelu:()=>u3.leakyRelu,less:()=>u3.less,lessEqual:()=>u3.lessEqual,linalg:()=>u3.linalg,linspace:()=>u3.linspace,loadGraphModel:()=>coe,loadGraphModelSync:()=>doe,loadLayersModel:()=>wee,localResponseNormalization:()=>u3.localResponseNormalization,log:()=>u3.log,log1p:()=>u3.log1p,logSigmoid:()=>u3.logSigmoid,logSoftmax:()=>u3.logSoftmax,logSumExp:()=>u3.logSumExp,logicalAnd:()=>u3.logicalAnd,logicalNot:()=>u3.logicalNot,logicalOr:()=>u3.logicalOr,logicalXor:()=>u3.logicalXor,losses:()=>u3.losses,lowerBound:()=>u3.lowerBound,matMul:()=>u3.matMul,math:()=>u3.math,max:()=>u3.max,maxPool:()=>u3.maxPool,maxPool3d:()=>u3.maxPool3d,maxPoolWithArgmax:()=>u3.maxPoolWithArgmax,maximum:()=>u3.maximum,mean:()=>u3.mean,memory:()=>u3.memory,meshgrid:()=>u3.meshgrid,metrics:()=>pe,min:()=>u3.min,minimum:()=>u3.minimum,mirrorPad:()=>u3.mirrorPad,mod:()=>u3.mod,model:()=>Aee,models:()=>fe,moments:()=>u3.moments,movingAverage:()=>u3.movingAverage,mul:()=>u3.mul,multiRNNCell:()=>u3.multiRNNCell,multinomial:()=>u3.multinomial,neg:()=>u3.neg,nextFrame:()=>u3.nextFrame,norm:()=>u3.norm,notEqual:()=>u3.notEqual,oneHot:()=>u3.oneHot,ones:()=>u3.ones,onesLike:()=>u3.onesLike,op:()=>u3.op,outerProduct:()=>u3.outerProduct,pad:()=>u3.pad,pad1d:()=>u3.pad1d,pad2d:()=>u3.pad2d,pad3d:()=>u3.pad3d,pad4d:()=>u3.pad4d,pool:()=>u3.pool,pow:()=>u3.pow,prelu:()=>u3.prelu,print:()=>u3.print,prod:()=>u3.prod,profile:()=>u3.profile,raggedGather:()=>u3.raggedGather,raggedRange:()=>u3.raggedRange,raggedTensorToTensor:()=>u3.raggedTensorToTensor,rand:()=>u3.rand,randomGamma:()=>u3.randomGamma,randomNormal:()=>u3.randomNormal,randomStandardNormal:()=>u3.randomStandardNormal,randomUniform:()=>u3.randomUniform,randomUniformInt:()=>u3.randomUniformInt,range:()=>u3.range,ready:()=>u3.ready,real:()=>u3.real,reciprocal:()=>u3.reciprocal,registerBackend:()=>u3.registerBackend,registerCallbackConstructor:()=>Oee,registerGradient:()=>u3.registerGradient,registerKernel:()=>u3.registerKernel,registerOp:()=>Yre,regularizers:()=>me,relu:()=>u3.relu,relu6:()=>u3.relu6,removeBackend:()=>u3.removeBackend,reshape:()=>u3.reshape,reverse:()=>u3.reverse,reverse1d:()=>u3.reverse1d,reverse2d:()=>u3.reverse2d,reverse3d:()=>u3.reverse3d,reverse4d:()=>u3.reverse4d,rfft:()=>u3.rfft,round:()=>u3.round,rsqrt:()=>u3.rsqrt,scalar:()=>u3.scalar,scatterND:()=>u3.scatterND,scatter_util:()=>u3.scatter_util,searchSorted:()=>u3.searchSorted,selu:()=>u3.selu,separableConv2d:()=>u3.separableConv2d,sequential:()=>See,serialization:()=>u3.serialization,setBackend:()=>u3.setBackend,setPlatform:()=>u3.setPlatform,setWebGLContext:()=>lfe,setdiff1dAsync:()=>u3.setdiff1dAsync,shared:()=>Pe,sigmoid:()=>u3.sigmoid,sign:()=>u3.sign,signal:()=>u3.signal,sin:()=>u3.sin,sinh:()=>u3.sinh,slice:()=>u3.slice,slice1d:()=>u3.slice1d,slice2d:()=>u3.slice2d,slice3d:()=>u3.slice3d,slice4d:()=>u3.slice4d,slice_util:()=>u3.slice_util,softmax:()=>u3.softmax,softplus:()=>u3.softplus,spaceToBatchND:()=>u3.spaceToBatchND,sparse:()=>u3.sparse,sparseToDense:()=>u3.sparseToDense,spectral:()=>u3.spectral,split:()=>u3.split,sqrt:()=>u3.sqrt,square:()=>u3.square,squaredDifference:()=>u3.squaredDifference,squeeze:()=>u3.squeeze,stack:()=>u3.stack,step:()=>u3.step,stridedSlice:()=>u3.stridedSlice,string:()=>u3.string,sub:()=>u3.sub,sum:()=>u3.sum,sumOutType:()=>u3.sumOutType,tan:()=>u3.tan,tanh:()=>u3.tanh,tensor:()=>u3.tensor,tensor1d:()=>u3.tensor1d,tensor2d:()=>u3.tensor2d,tensor3d:()=>u3.tensor3d,tensor4d:()=>u3.tensor4d,tensor5d:()=>u3.tensor5d,tensor6d:()=>u3.tensor6d,tensorScatterUpdate:()=>u3.tensorScatterUpdate,tensor_util:()=>u3.tensor_util,test_util:()=>u3.test_util,tidy:()=>u3.tidy,tile:()=>u3.tile,time:()=>u3.time,topk:()=>u3.topk,train:()=>u3.train,transpose:()=>u3.transpose,truncatedNormal:()=>u3.truncatedNormal,unique:()=>u3.unique,unregisterGradient:()=>u3.unregisterGradient,unregisterKernel:()=>u3.unregisterKernel,unsortedSegmentSum:()=>u3.unsortedSegmentSum,unstack:()=>u3.unstack,upcastType:()=>u3.upcastType,upperBound:()=>u3.upperBound,util:()=>u3.util,valueAndGrad:()=>u3.valueAndGrad,valueAndGrads:()=>u3.valueAndGrads,variable:()=>u3.variable,variableGrads:()=>u3.variableGrads,version:()=>Awe,version_converter:()=>hoe,version_core:()=>u3.version_core,version_cpu:()=>Jue,version_layers:()=>tee,version_webgl:()=>k_e,webgl:()=>N_e,webgl_util:()=>Be,where:()=>u3.where,whereAsync:()=>u3.whereAsync,zeros:()=>u3.zeros,zerosLike:()=>u3.zerosLike});const Ve=Blockly;Object.assign(Ve.Lang.ZhHans,{PYTHON_PYODIDE_IMAGE:"图像",PYTHON_PYODIDE_TOOL:"可教机器",PYTHON_PYODIDE_GAME:"生命游戏",PYTHON_PYODIDE_GAME_EPOCH:"代数",PYTHON_PYODIDE_GAME_START:"开始",PYTHON_PYODIDE_GAME_PAUSE:"暂停",PYTHON_PYODIDE_GAME_RANDOM:"随机初始化",PYTHON_PYODIDE_GAME_RESET:"重置",PYTHON_PYODIDE_LOADING:"Python3内核载入中...",PYTHON_PYODIDE_FILE_SYSTEM:"本地文件系统",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"载入本地文件夹"}),Object.assign(Ve.Lang.ZhHant,{PYTHON_PYODIDE_IMAGE:"影像",PYTHON_PYODIDE_TOOL:"可教機器",PYTHON_PYODIDE_GAME:"生命遊戲",PYTHON_PYODIDE_GAME_EPOCH:"代數",PYTHON_PYODIDE_GAME_START:"開始",PYTHON_PYODIDE_GAME_PAUSE:"暫停",PYTHON_PYODIDE_GAME_RANDOM:"隨機初始化",PYTHON_PYODIDE_GAME_RESET:"重置",PYTHON_PYODIDE_LOADING:"Python3核心載入...",PYTHON_PYODIDE_FILE_SYSTEM:"本機檔案系統",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"載入本機資料夾"}),Object.assign(Ve.Lang.En,{PYTHON_PYODIDE_IMAGE:"Image",PYTHON_PYODIDE_TOOL:"Teachable Machine",PYTHON_PYODIDE_GAME:"Game of Life",PYTHON_PYODIDE_GAME_EPOCH:"Iterations",PYTHON_PYODIDE_GAME_START:"Start",PYTHON_PYODIDE_GAME_PAUSE:"Pause",PYTHON_PYODIDE_GAME_RANDOM:"Random Initialization",PYTHON_PYODIDE_GAME_RESET:"Reset",PYTHON_PYODIDE_LOADING:"Python3 kernel loading...",PYTHON_PYODIDE_FILE_SYSTEM:"Local File System",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"Load Local Folder"}),Object.assign(Ve.Lang.ZhHans.MSG,{}),Object.assign(Ve.Lang.ZhHant.MSG,{}),Object.assign(Ve.Lang.En.MSG,{});const ze=Mixly,je={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),i=0;i1&&(o+=i)):n=o}else n="i";return n}},Ye=je; +function Qge(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(o,a)}l((i=i.apply(e,t||[])).next())})}var Jge,e_e='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box; }\n .vega-embed.has-actions {\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset; }\n .vega-embed summary svg {\n width: 14px;\n height: 14px; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left; }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n .vega-embed .chart-wrapper {\n width: 100%;\n height: 100%; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n';function t_e(e,...t){for(const n of t)n_e(e,n);return e}function n_e(e,t){for(const n of Object.keys(t))Se(e,n,t[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});const i_e=v;let r_e=b;const s_e="undefined"!=typeof window?window:void 0;void 0===r_e&&(null===(Jge=null==s_e?void 0:s_e.vl)||void 0===Jge?void 0:Jge.compile)&&(r_e=s_e.vl);const o_e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},a_e={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},l_e={vega:"Vega","vega-lite":"Vega-Lite"},u_e={vega:i_e.version,"vega-lite":r_e?r_e.version:"not available"},c_e={vega:e=>e,"vega-lite":(e,t)=>r_e.compile(e,{config:t}).spec},d_e='\n\n \n \n \n',h_e="chart-wrapper";function p_e(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${l_e[i]} JSON Source`}function f_e(e,t){var n;if(e.$schema){const i=zme(e.$schema);t&&t!==i.library&&console.warn(`The given visualization spec is written in ${l_e[i.library]}, but mode argument sets ${null!==(n=l_e[t])&&void 0!==n?n:t}.`);const r=i.library;return(0,ee.satisfies)(u_e[r],`^${i.version.slice(1)}`)||console.warn(`The input spec uses ${l_e[r]} ${i.version}, but the current version of ${l_e[r]} is v${u_e[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}function m_e(e){return(t=e)&&"load"in t?e:i_e.loader(e);var t}function g_e(e){var t;return null!==(t=e.usermeta&&e.usermeta.embedOptions)&&void 0!==t?t:{}}function __e(e,t){var n;return Qge(this,void 0,void 0,function*(){const i=bt(e.config)?JSON.parse(yield t.load(e.config)):null!==(n=e.config)&&void 0!==n?n:{},r=bt(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),r?{patch:r}:{}),i?{config:i}:{})})}const y_e=function(e,t,n={}){var i,r,s;return Qge(this,void 0,void 0,function*(){let o,a;bt(t)?(a=m_e(n.loader),o=JSON.parse(yield a.load(t))):o=t;const l=g_e(o).loader;a&&!l||(a=m_e(null!==(i=n.loader)&&void 0!==i?i:l));const u=yield __e(g_e(o),a),c=yield __e(n,a),d=Object.assign(Object.assign({},t_e(c,u)),{config:Ae(null!==(r=c.config)&&void 0!==r?r:{},null!==(s=u.config)&&void 0!==s?s:{})});return yield function(e,t,n={},i){var r,s,o,a,l,u;return Qge(this,void 0,void 0,function*(){const c=n.theme?Ae(T[n.theme],null!==(r=n.config)&&void 0!==r?r:{}):n.config,d=mt(n.actions)?n.actions:t_e({},o_e,null!==(s=n.actions)&&void 0!==s?s:{}),h=Object.assign(Object.assign({},a_e),n.i18n),p=null!==(o=n.renderer)&&void 0!==o?o:"canvas",f=null!==(a=n.logLevel)&&void 0!==a?a:i_e.Warn,m=null!==(l=n.downloadFileName)&&void 0!==l?l:"visualization",g="string"==typeof e?document.querySelector(e):e;if(!g)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:i}=function(e){var t;const n=e.getRootNode?e.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}(g);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?e_e.toString():n.defaultStyle,i.appendChild(t)}}const _=f_e(t,n.mode);let y=c_e[_](t,c);if("vega-lite"===_&&y.$schema){const e=zme(y.$schema);(0,ee.satisfies)(u_e.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${u_e.vega}.`)}g.classList.add("vega-embed"),d&&g.classList.add("has-actions"),g.innerHTML="";let v=g;if(d){const e=document.createElement("div");e.classList.add(h_e),g.appendChild(e),v=e}const b=n.patch;b&&(y=b instanceof Function?b(y):$(y,b,!0,!1).newDocument),n.formatLocale&&i_e.formatLocale(n.formatLocale),n.timeFormatLocale&&i_e.timeFormatLocale(n.timeFormatLocale);const{ast:x}=n,E=i_e.parse(y,"vega-lite"===_?{}:c,{ast:x}),w=new(n.viewClass||i_e.View)(E,Object.assign({loader:i,logLevel:f,renderer:p},x?{expr:i_e.expressionInterpreter}:{}));if(!1!==n.tooltip){let e;e=function(e){return"function"==typeof e}(n.tooltip)?n.tooltip:new Zge(!0===n.tooltip?{}:n.tooltip).call,w.tooltip(e)}let I,{hover:A}=n;if(void 0===A&&(A="vega"===_),A){const{hoverSet:e,updateSet:t}="boolean"==typeof A?{}:A;w.hover(e,t)}if(n&&(null!=n.width&&w.width(n.width),null!=n.height&&w.height(n.height),null!=n.padding&&w.padding(n.padding)),yield w.initialize(v,n.bind).runAsync(),!1!==d){let e=g;if(!1!==n.defaultStyle){const t=document.createElement("details");t.title=h.CLICK_TO_VIEW_ACTIONS,g.append(t),e=t;const n=document.createElement("summary");n.innerHTML=d_e,t.append(n),I=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",I)}const i=document.createElement("div");if(e.append(i),i.classList.add("vega-actions"),!0===d||!1!==d.export)for(const e of["svg","png"])if(!0===d||!0===d.export||d.export[e]){const t=h[`${e.toUpperCase()}_ACTION`],r=document.createElement("a");r.text=t,r.href="#",r.target="_blank",r.download=`${m}.${e}`,r.addEventListener("mousedown",function(t){return Qge(this,void 0,void 0,function*(){t.preventDefault();const i=yield w.toImageURL(e,n.scaleFactor);this.href=i})}),i.append(r)}if(!0===d||!1!==d.source){const e=document.createElement("a");e.text=h.SOURCE_ACTION,e.href="#",e.addEventListener("click",function(e){var i,r;p_e(J()(t),null!==(i=n.sourceHeader)&&void 0!==i?i:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"",_),e.preventDefault()}),i.append(e)}if("vega-lite"===_&&(!0===d||!1!==d.compiled)){const e=document.createElement("a");e.text=h.COMPILED_ACTION,e.href="#",e.addEventListener("click",function(e){var t,i;p_e(J()(y),null!==(t=n.sourceHeader)&&void 0!==t?t:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"","vega"),e.preventDefault()}),i.append(e)}if(!0===d||!1!==d.editor){const e=null!==(u=n.editorUrl)&&void 0!==u?u:"https://vega.github.io/editor/",r=document.createElement("a");r.text=h.EDITOR_ACTION,r.href="#",r.addEventListener("click",function(n){!function(e,t,n){const i=e.open(t),{origin:r}=new URL(t);let s=40;e.addEventListener("message",function t(n){n.source===i&&(s=0,e.removeEventListener("message",t,!1))},!1),setTimeout(function e(){s<=0||(i.postMessage(n,r),setTimeout(e,250),s-=1)},250)}(window,e,{config:c,mode:_,renderer:p,spec:J()(t)}),n.preventDefault()}),i.append(r)}}function S(){I&&document.removeEventListener("click",I),w.finalize()}return{view:w,spec:t,vgSpec:y,finalize:S}})}(e,o,d,a)})}},66262:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}},26944:e=>{"use strict";e.exports=path},85817:()=>{},18590:()=>{},4530:()=>{},8108:()=>{},80551:()=>{},67425:()=>{},9496:()=>{},26786:()=>{},48884:()=>{},98001:()=>{},71613:()=>{},15312:()=>{},89032:()=>{},60574:()=>{},2672:()=>{},58215:()=>{},1417:()=>{},49391:()=>{},83220:()=>{},73985:()=>{},80032:()=>{},75650:()=>{},56644:()=>{},41234:()=>{},48487:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,n){var i,r,s;return n=n||{},i=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),r=""===i?1/0:void 0===n.maxLength?80:n.maxLength,s=n.replacer,function e(n,o,a){var l,u,c,d,h,p,f,m,g,_,y,v;if(n&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===(y=JSON.stringify(n,s)))return y;if(f=r-o.length-a,y.length<=f&&(g=y.replace(t,function(e,t){return t||e+" "})).length<=f)return g;if(null!=s&&(n=JSON.parse(y),s=void 0),"object"==typeof n&&null!==n){if(m=o+i,c=[],u=0,Array.isArray(n))for(_="[",l="]",f=n.length;u0)return[_,i+c.join(",\n"+m),l].join("\n"+o)}return y}(e,"",0)}},21045:e=>{"use strict";e.exports={rE:"3.0.8"}}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&t&&e;"object"==typeof r&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,__webpack_require__.d(n,i),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((t,n)=>(__webpack_require__.f[n](e,t),t),[])),__webpack_require__.u=e=>e+".bundle."+{38:"56383ce7",97:"b0fed7fa",195:"9941f7ca",211:"45847679",317:"a52389ac",837:"3c99d169",950:"b01fc844",960:"d893bd17",974:"66119c82"}[e]+".js",__webpack_require__.miniCssF=e=>"styles/"+e+".45554be0.css",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,i)=>{if(inProgress[e])inProgress[e].push(t);else{var r,s;if(void 0!==n)for(var o=document.getElementsByTagName("script"),a=0;a{r.onerror=r.onload=null,clearTimeout(c);var i=inProgress[e];if(delete inProgress[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach(e=>e(n)),t)return t(n)},c=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),s&&document.head.appendChild(r)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise((t,n)=>{var i=__webpack_require__.miniCssF(e),r=__webpack_require__.p+i;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),i=0;i{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",__webpack_require__.nc&&(s.nonce=__webpack_require__.nc),s.onerror=s.onload=n=>{if(s.onerror=s.onload=null,"load"===n.type)i();else{var o=n&&n.type,a=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+o+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=a,s.parentNode&&s.parentNode.removeChild(s),r(l)}},s.href=t,n?n.parentNode.insertBefore(s,n.nextSibling):document.head.appendChild(s)})(e,r,null,t,n)}),t={792:0};__webpack_require__.f.miniCss=(n,i)=>{t[n]?i.push(t[n]):0!==t[n]&&{317:1}[n]&&i.push(t[n]=e(n).then(()=>{t[n]=0},e=>{throw delete t[n],e}))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var i=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=r);var s=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(s,n=>{if(__webpack_require__.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+s+")",o.name="ChunkLoadError",o.type=r,o.request=s,i[1](o)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,r,[s,o,a]=n,l=0;if(s.some(t=>0!==e[t])){for(i in o)__webpack_require__.o(o,i)&&(__webpack_require__.m[i]=o[i]);if(a)a(__webpack_require__)}for(t&&t(n);l{"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{controls_type:()=>Qe,controls_typeLists:()=>Je,lists_zip:()=>et,lists_zip_container:()=>tt,lists_zip_item:()=>nt,unpack_iterable_object:()=>it,variables_change:()=>Ke,variables_get:()=>Xe,variables_global:()=>Ze,variables_set:()=>qe});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{base_setup:()=>ot,controls_delay:()=>at,controls_end_program:()=>lt,controls_except:()=>Tt,controls_finally:()=>xt,controls_flow_statements:()=>ft,controls_for:()=>mt,controls_forEach:()=>dt,controls_for_range:()=>gt,controls_if:()=>ut,controls_if_else:()=>vt,controls_if_elseif:()=>yt,controls_if_if:()=>_t,controls_lambda:()=>wt,controls_main:()=>st,controls_pass:()=>It,controls_range:()=>ct,controls_repeat_ext:()=>Et,controls_thread:()=>At,controls_try:()=>bt,controls_try_finally:()=>pt,controls_whileUntil:()=>ht,datetime_fromtimestamp:()=>Rt,do_while:()=>St,garbage_collection:()=>Ct,gene_unique_identifier:()=>Nt,get_mem_alloc:()=>Ot,get_mem_free:()=>Mt,get_unique_identifier:()=>kt});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{base_map:()=>en,generate_cartesian_product:()=>nn,math_arithmetic:()=>Bt,math_bit:()=>Ut,math_constant:()=>Lt,math_constant_mp:()=>Pt,math_constrain:()=>Wt,math_dec:()=>zt,math_degree_to_radian:()=>sn,math_indexer_number:()=>qt,math_map:()=>Xt,math_max_min:()=>Yt,math_number:()=>Ft,math_number_base_conversion:()=>Gt,math_radian_to_degree:()=>rn,math_random:()=>Ht,math_random_seed:()=>Kt,math_round:()=>Zt,math_selfcalcu:()=>$t,math_to_int:()=>jt,math_trig:()=>Vt,text_to_number:()=>Qt,text_to_number_skulpt:()=>Jt,turn_to_int:()=>tn});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{ascii_to_char:()=>hn,char_to_ascii:()=>pn,number_to_text:()=>fn,os_system:()=>$n,text:()=>an,text_bytes:()=>un,text_capital:()=>En,text_center:()=>wn,text_char:()=>cn,text_char_at:()=>_n,text_char_at2:()=>gn,text_char_at3:()=>Fn,text_compareTo:()=>Dn,text_compare_to:()=>xn,text_create_with_container:()=>kn,text_create_with_item:()=>Rn,text_encode:()=>Pn,text_equals_starts_ends:()=>Tn,text_eval:()=>Bn,text_find:()=>In,text_format:()=>Mn,text_format_noreturn:()=>Ln,text_join:()=>dn,text_join_seq:()=>An,text_length:()=>mn,text_random_char:()=>yn,text_replace:()=>Sn,text_split:()=>Cn,text_strip:()=>On,text_substring:()=>bn,text_substring2:()=>vn,text_substring3:()=>Nn,text_textarea:()=>ln});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ENUMERATE:()=>Ti,content_in_lists:()=>Ei,enumerate:()=>xi,list_many_input:()=>li,list_tolist:()=>hi,list_tolist2:()=>bi,list_trig:()=>si,lists_2d_get_col_row_data:()=>Yn,lists_2d_get_data_with_col_row:()=>jn,lists_append_extend:()=>Kn,lists_change_to:()=>ai,lists_change_to_general:()=>ci,lists_clear:()=>ti,lists_create_with:()=>Gn,lists_create_with2:()=>pi,lists_create_with_container:()=>Wn,lists_create_with_item:()=>Xn,lists_create_with_noreturn:()=>ui,lists_create_with_text:()=>Hn,lists_create_with_text2:()=>fi,lists_del_general:()=>di,lists_find:()=>ri,lists_getIndex3:()=>mi,lists_getSublist3:()=>gi,lists_get_index:()=>Vn,lists_get_random_item:()=>Zn,lists_get_random_sublist:()=>Qn,lists_get_sublist:()=>zn,lists_insert_value:()=>Jn,lists_insert_value2:()=>yi,lists_pop:()=>ii,lists_remove_at:()=>ni,lists_remove_at2:()=>vi,lists_reverse:()=>ei,lists_setIndex3:()=>_i,lists_set_index:()=>qn,lists_sort:()=>oi});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{dicts_add_change_del:()=>$i,dicts_add_or_change:()=>ki,dicts_clear:()=>Di,dicts_create_with:()=>Ii,dicts_create_with_container:()=>Ai,dicts_create_with_item:()=>Si,dicts_create_with_noreturn:()=>zi,dicts_deldict:()=>Bi,dicts_delete:()=>Ri,dicts_get:()=>Oi,dicts_get_default:()=>Mi,dicts_items:()=>Fi,dicts_keys:()=>Ci,dicts_length:()=>Pi,dicts_pop:()=>Ui,dicts_setdefault:()=>Vi,dicts_to_json:()=>Yi,dicts_to_json2:()=>Wi,dicts_to_to:()=>Hi,dicts_todict:()=>ji,dicts_update:()=>Ni,dicts_values:()=>Li,json_to_dicts:()=>Gi});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{logic_boolean:()=>Ji,logic_compare:()=>qi,logic_compare_continous:()=>Ki,logic_is:()=>ir,logic_is_in:()=>nr,logic_negate:()=>Qi,logic_null:()=>er,logic_operation:()=>Zi,logic_tobool:()=>rr,logic_true_or_false:()=>tr});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{sdcard_mount:()=>Sr,sdcard_use_spi_init:()=>Ar,storage_can_write_ornot:()=>pr,storage_change_dir:()=>wr,storage_close_file:()=>mr,storage_delete_file:()=>_r,storage_file_seek:()=>br,storage_file_tell:()=>vr,storage_file_write:()=>ur,storage_fileopen:()=>or,storage_fileopen_new:()=>ar,storage_fileopen_new_encoding:()=>lr,storage_get_a_line:()=>hr,storage_get_contents:()=>dr,storage_get_contents_without_para:()=>cr,storage_get_current_dir:()=>Tr,storage_get_file_size:()=>yr,storage_get_filename:()=>fr,storage_is_file:()=>Ir,storage_list_all_files:()=>gr,storage_make_dir:()=>xr,storage_open_file_with_os:()=>sr,storage_rename:()=>Er});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{procedures_callnoreturn:()=>Rr,procedures_callreturn:()=>Nr,procedures_defnoreturn:()=>Cr,procedures_defreturn:()=>Or,procedures_ifreturn:()=>Dr,procedures_mutatorarg:()=>kr,procedures_mutatorcontainer:()=>Mr,procedures_return:()=>Fr});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{tuple_change_to:()=>Wr,tuple_create_llm_params:()=>ns,tuple_create_with:()=>Pr,tuple_create_with_container:()=>Br,tuple_create_with_item:()=>$r,tuple_create_with_noreturn:()=>Zr,tuple_create_with_text2:()=>Ur,tuple_create_with_text_return:()=>Vr,tuple_del:()=>Yr,tuple_find:()=>Xr,tuple_getIndex:()=>zr,tuple_getSublist:()=>Kr,tuple_get_random_item:()=>Jr,tuple_get_sublist:()=>Qr,tuple_input:()=>ts,tuple_join:()=>Gr,tuple_length:()=>jr,tuple_max:()=>Hr,tuple_totuple:()=>es,tuple_trig:()=>qr});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{set_add_discard:()=>hs,set_clear:()=>us,set_create_with:()=>rs,set_create_with_container:()=>ss,set_create_with_item:()=>os,set_create_with_text_return:()=>ms,set_length:()=>as,set_operate:()=>cs,set_operate_update:()=>ds,set_pop:()=>ls,set_sub:()=>ps,set_toset:()=>gs,set_update:()=>fs});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{html_content:()=>Ts,html_content_more:()=>xs,html_document:()=>ys,html_form:()=>ws,html_head_body:()=>bs,html_style:()=>Es,html_style_color:()=>As,html_style_content:()=>Is,html_text:()=>Ss,html_title:()=>vs});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{attribute_access:()=>Vs,function_call:()=>Bs,function_call_container:()=>$s,function_call_item:()=>Us,raw_block:()=>Ms,raw_empty:()=>Rs,raw_expression:()=>ks,raw_table:()=>Os,text_comment:()=>Ns,text_print_multiple:()=>Fs,text_print_multiple_container:()=>Ls,text_print_multiple_item:()=>Ps,type_check:()=>Ds});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{controls_type:()=>Hs,controls_typeLists:()=>Ws,lists_zip:()=>Xs,unpack_iterable_object:()=>qs,variables_change:()=>Ys,variables_get:()=>zs,variables_global:()=>Gs,variables_set:()=>js});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{Panic_with_status_code:()=>so,base_setup:()=>Zs,controls_delay:()=>ro,controls_flow_statements:()=>io,controls_for:()=>eo,controls_forEach:()=>co,controls_for_range:()=>to,controls_if:()=>Qs,controls_interrupts:()=>lo,controls_lambda:()=>po,controls_main:()=>Ks,controls_millis:()=>oo,controls_nointerrupts:()=>uo,controls_pass:()=>mo,controls_range:()=>ho,controls_repeat:()=>Eo,controls_repeat_ext:()=>yo,controls_thread:()=>go,controls_try_finally:()=>Js,controls_whileUntil:()=>no,datetime_fromtimestamp:()=>wo,do_while:()=>_o,garbage_collection:()=>vo,gene_unique_identifier:()=>Io,get_mem_alloc:()=>bo,get_mem_free:()=>To,get_unique_identifier:()=>xo,reset:()=>ao,time_sleep:()=>fo});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{base_map:()=>Ho,generate_cartesian_product:()=>Xo,math_arithmetic:()=>Mo,math_bit:()=>Oo,math_constant:()=>So,math_constant_mp:()=>Co,math_constrain:()=>$o,math_dec:()=>Do,math_degree_to_radian:()=>Ko,math_indexer_number:()=>zo,math_map:()=>Bo,math_max_min:()=>Lo,math_number:()=>Ao,math_number_base_conversion:()=>Uo,math_radian_to_degree:()=>qo,math_random:()=>Po,math_random_seed:()=>Vo,math_round:()=>jo,math_selfcalcu:()=>ko,math_single:()=>Ro,math_to_int:()=>Fo,math_trig:()=>No,text_to_number:()=>Yo,text_to_number_skulpt:()=>Go,turn_to_int:()=>Wo});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{ascii_to_char:()=>na,char_to_ascii:()=>ia,number_to_text:()=>ra,os_system:()=>Sa,text:()=>Zo,text_bytes:()=>Jo,text_capital:()=>pa,text_center:()=>fa,text_char:()=>ea,text_char_at:()=>aa,text_char_at2:()=>oa,text_char_at3:()=>wa,text_compareTo:()=>Ea,text_compare_to:()=>ca,text_encode:()=>Ia,text_equals_starts_ends:()=>ua,text_eval:()=>Aa,text_find:()=>ma,text_format:()=>ba,text_format_noreturn:()=>Ta,text_join:()=>ta,text_join_seq:()=>ga,text_length:()=>sa,text_random_char:()=>la,text_replace:()=>_a,text_split:()=>ya,text_strip:()=>va,text_substring:()=>ha,text_substring2:()=>da,text_substring3:()=>xa,text_textarea:()=>Qo});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{content_in_lists:()=>al,enumerate:()=>ol,list_many_input:()=>Wa,list_tolist:()=>rl,list_tolist2:()=>sl,list_trig:()=>Ya,lists_2d_get_col_row_data:()=>Ma,lists_2d_get_data_with_col_row:()=>Oa,lists_append_extend:()=>Fa,lists_change_to:()=>Ha,lists_change_to_general:()=>qa,lists_clear:()=>Ua,lists_create_with:()=>ka,lists_create_with2:()=>Za,lists_create_with_noreturn:()=>Xa,lists_create_with_text:()=>Ra,lists_create_with_text2:()=>Qa,lists_del_general:()=>Ka,lists_find:()=>Va,lists_getIndex3:()=>Ja,lists_getSublist3:()=>el,lists_get_index:()=>Na,lists_get_random_item:()=>La,lists_get_random_sublist:()=>Pa,lists_get_sublist:()=>Ca,lists_insert_value:()=>Ba,lists_insert_value2:()=>nl,lists_pop:()=>ja,lists_remove_at:()=>za,lists_remove_at2:()=>il,lists_reverse:()=>$a,lists_setIndex3:()=>tl,lists_set_index:()=>Da,lists_sort:()=>Ga});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{dicts_add_change_del:()=>bl,dicts_add_or_change:()=>hl,dicts_clear:()=>ml,dicts_create_with:()=>ll,dicts_create_with_noreturn:()=>El,dicts_deldict:()=>vl,dicts_delete:()=>pl,dicts_get:()=>cl,dicts_get_default:()=>dl,dicts_items:()=>gl,dicts_keys:()=>ul,dicts_length:()=>yl,dicts_pop:()=>Tl,dicts_setdefault:()=>xl,dicts_to_json:()=>Il,dicts_to_json2:()=>Cl,dicts_to_to:()=>Sl,dicts_todict:()=>wl,dicts_update:()=>fl,dicts_values:()=>_l,json_to_dicts:()=>Al});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{logic_boolean:()=>Nl,logic_compare:()=>Ol,logic_compare_continous:()=>Ml,logic_is:()=>Pl,logic_is_in:()=>Ll,logic_negate:()=>Rl,logic_null:()=>Dl,logic_operation:()=>kl,logic_tobool:()=>Bl,logic_true_or_false:()=>Fl});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{sdcard_mount:()=>au,sdcard_use_spi_init:()=>ou,storage_can_write_ornot:()=>Wl,storage_change_dir:()=>tu,storage_close_file:()=>ql,storage_delete_file:()=>Zl,storage_file_seek:()=>eu,storage_file_tell:()=>Jl,storage_file_write:()=>jl,storage_fileopen:()=>Ul,storage_fileopen_new:()=>Vl,storage_fileopen_new_encoding:()=>zl,storage_get_a_line:()=>Hl,storage_get_contents:()=>Gl,storage_get_contents_without_para:()=>Yl,storage_get_current_dir:()=>nu,storage_get_file_size:()=>Ql,storage_get_filename:()=>Xl,storage_is_file:()=>su,storage_list_all_files:()=>Kl,storage_make_dir:()=>iu,storage_open_file_with_os:()=>$l,storage_rename:()=>ru});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{procedures_callnoreturn:()=>du,procedures_callreturn:()=>cu,procedures_defnoreturn:()=>uu,procedures_defreturn:()=>lu,procedures_ifreturn:()=>hu,procedures_return:()=>pu});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{tuple_change_to:()=>xu,tuple_create_llm_params:()=>ku,tuple_create_with:()=>fu,tuple_create_with_noreturn:()=>Au,tuple_create_with_text2:()=>mu,tuple_create_with_text_return:()=>gu,tuple_del:()=>vu,tuple_find:()=>Eu,tuple_getIndex:()=>_u,tuple_getSublist:()=>Iu,tuple_get_random_item:()=>Cu,tuple_get_sublist:()=>Su,tuple_input:()=>Mu,tuple_join:()=>bu,tuple_length:()=>yu,tuple_max:()=>Tu,tuple_totuple:()=>Ou,tuple_trig:()=>wu});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{set_add_discard:()=>Bu,set_clear:()=>Fu,set_create_with:()=>Ru,set_create_with_text_return:()=>Vu,set_length:()=>Nu,set_operate:()=>Lu,set_operate_update:()=>Pu,set_pop:()=>Du,set_sub:()=>$u,set_toset:()=>zu,set_update:()=>Uu});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{html_content:()=>Hu,html_content_more:()=>Wu,html_document:()=>ju,html_form:()=>qu,html_head_body:()=>Gu,html_style:()=>Xu,html_style_content:()=>Ku,html_text:()=>Zu,html_title:()=>Yu});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{attribute_access:()=>rc,function_call:()=>ic,raw_block:()=>Qu,raw_empty:()=>ec,raw_expression:()=>Ju,raw_table:()=>tc,type_check:()=>nc});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{AI_ChooseAndGet:()=>uc,AI_Face_match:()=>mc,AI_ImageClassify:()=>pc,AI_ImageClassify_Func:()=>fc,AI_Nlp:()=>yc,AI_Nlp_Func:()=>bc,AI_Nlp_Func_sim:()=>Tc,AI_Nlp_Sim:()=>vc,AI_Nlp_Topic:()=>xc,AI_Nlp_newsSummary:()=>Ec,AI_Ocr:()=>gc,AI_Ocr_Func:()=>_c,AI_Speech_asr:()=>hc,AI_Speech_synthesis:()=>dc,AI_audio:()=>wc,AI_client:()=>cc,AI_photo:()=>Ic,AI_result:()=>Ac});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{algorithm_add_path:()=>Nc,algorithm_add_school:()=>Oc,algorithm_all_books:()=>qc,algorithm_all_books_sequence:()=>Kc,algorithm_book_scale:()=>ld,algorithm_check_feet:()=>vd,algorithm_chick_calculate:()=>yd,algorithm_color_seclet:()=>Pd,algorithm_current_school:()=>$c,algorithm_del_path:()=>Dc,algorithm_delete_book:()=>rd,algorithm_delete_books:()=>sd,algorithm_delete_books2:()=>od,algorithm_divide_books:()=>nd,algorithm_find_path:()=>Mc,algorithm_first_book:()=>Zc,algorithm_fz_calc:()=>Ed,algorithm_fz_calc_first_min:()=>wd,algorithm_fz_compare:()=>Id,algorithm_fz_move:()=>Sd,algorithm_fz_set_min:()=>Ad,algorithm_get_book_num:()=>hd,algorithm_get_current_location:()=>Fd,algorithm_get_half_books:()=>id,algorithm_hxdb_add:()=>Rd,algorithm_hxdb_init_soldier:()=>Od,algorithm_hxdb_last_line:()=>kd,algorithm_hxdb_result:()=>Nd,algorithm_hxdb_stand_in_line:()=>Md,algorithm_init_fzsf:()=>xd,algorithm_init_hxdb:()=>Cd,algorithm_init_jttl:()=>md,algorithm_move_recent:()=>jc,algorithm_new_path:()=>kc,algorithm_next_book:()=>ed,algorithm_no_left:()=>Lc,algorithm_no_path:()=>Uc,algorithm_no_ring2:()=>Qc,algorithm_not_home:()=>Yc,algorithm_not_school:()=>Gc,algorithm_number_add:()=>cd,algorithm_number_zero:()=>ud,algorithm_prepare:()=>Cc,algorithm_prepare2:()=>Bc,algorithm_prepare_2_1:()=>Vc,algorithm_prepare_2_2:()=>zc,algorithm_print_book2:()=>ad,algorithm_print_divide:()=>fd,algorithm_print_jttl_answer:()=>bd,algorithm_print_number:()=>dd,algorithm_print_path:()=>Pc,algorithm_print_path2:()=>Hc,algorithm_print_sequence:()=>pd,algorithm_rabbit_add:()=>Td,algorithm_rabbit_number_in_range:()=>_d,algorithm_rabbit_zero:()=>gd,algorithm_return_path:()=>Fc,algorithm_set_path:()=>Rc,algorithm_two_left:()=>td,algorithm_void_path:()=>Ld,algorithm_yes_ring2:()=>Jc,hanoi_init:()=>Wc,hanoi_init_offline:()=>Dd,hanoi_move:()=>Xc});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{requests_attribute:()=>zd,requests_get:()=>Ud,requests_get_old:()=>$d,requests_method:()=>jd,requests_post:()=>Vd});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{cv_destroy_all:()=>qd,cv_face_classifier:()=>Qd,cv_face_detect:()=>Jd,cv_face_detect_all:()=>eh,cv_line_rect:()=>Kd,cv_read_image:()=>Gd,cv_show_image:()=>Hd,cv_text:()=>Zd,cv_waitkey:()=>Xd,cv_write_image:()=>Wd});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{array_create:()=>_h,array_toarray:()=>kh,dataframe_aggregate_func:()=>Ap,dataframe_create:()=>rh,dataframe_create_from_index:()=>oh,dataframe_create_from_one_index:()=>sh,dataframe_fillna:()=>hp,dataframe_get:()=>Ch,dataframe_groupby:()=>Ip,dataframe_head_tail:()=>Ep,dataframe_info:()=>pp,dataframe_median:()=>dp,dataframe_select:()=>wp,dataframe_sort_values:()=>xp,matrix_multiplication:()=>up,matrix_transpose:()=>lp,numpy_argmin_template_match:()=>ep,numpy_astype:()=>Zh,numpy_c_:()=>op,numpy_dot:()=>_p,numpy_linalg_det:()=>ap,numpy_linalg_inv:()=>cp,numpy_max:()=>mp,numpy_mean:()=>tp,numpy_mean_digit:()=>Jh,numpy_min:()=>fp,numpy_ones:()=>sp,numpy_random_random:()=>bp,numpy_reshape:()=>Kh,numpy_shape:()=>qh,numpy_size:()=>gp,numpy_square:()=>yp,numpy_std:()=>np,numpy_sum:()=>vp,numpy_trig:()=>Ih,pandas_drop_columns:()=>rp,pandas_dropna:()=>ip,pandas_readcsv:()=>Sh,pl_axes:()=>ph,pl_bar:()=>Th,pl_hist:()=>Eh,pl_label:()=>gh,pl_legend:()=>fh,pl_pie:()=>xh,pl_plot:()=>dh,pl_plot_bar:()=>yh,pl_plot_easy:()=>ch,pl_plot_scatter:()=>vh,pl_plot_xy:()=>bh,pl_savefig:()=>Oh,pl_show:()=>hh,pl_subplot:()=>Ah,pl_text:()=>Mh,pl_ticks:()=>wh,pl_title:()=>mh,plot_axes:()=>Fh,plot_bar:()=>zh,plot_cla:()=>Sp,plot_hist:()=>Yh,plot_label:()=>Bh,plot_legend:()=>Lh,plot_pie:()=>jh,plot_plot:()=>Nh,plot_plot_bar:()=>$h,plot_plot_easy:()=>Rh,plot_plot_scatter:()=>Uh,plot_plot_xy:()=>Vh,plot_savefig:()=>Wh,plot_show:()=>Dh,plot_subplot:()=>Hh,plot_text:()=>Xh,plot_ticks:()=>Gh,plot_title:()=>Ph,py_sum:()=>Tp,pylab_imshow:()=>Qh,series_create:()=>nh,series_create_from_index:()=>ih,series_create_from_text:()=>ah,series_get_num:()=>uh,series_index_value:()=>lh});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{ds_add_node_by_attr:()=>Lp,ds_add_node_by_name:()=>Fp,ds_create_linkedlist:()=>Op,ds_create_linkedlist_container:()=>Mp,ds_create_linkedlist_item:()=>kp,ds_create_node:()=>Rp,ds_del_node_by_attr:()=>Bp,ds_del_node_by_name:()=>Pp,ds_get_node_attr:()=>Np,ds_reverse_linkedlist:()=>$p,ds_set_node_attr:()=>Dp});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{factory_block:()=>Kp,factory_block_return:()=>Zp,factory_block_return_with_textarea:()=>Jp,factory_block_with_textarea:()=>Qp,factory_callMethod_noreturn:()=>Xp,factory_callMethod_return:()=>qp,factory_create_with_container:()=>Yp,factory_create_with_item:()=>Gp,factory_declare:()=>Wp,factory_from_import:()=>Vp,factory_function_noreturn:()=>jp,factory_function_return:()=>Hp,factory_import:()=>zp});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{hardware_arduino_analog_read:()=>af,hardware_arduino_analog_write:()=>of,hardware_arduino_digital_read:()=>sf,hardware_arduino_digital_write:()=>rf,hardware_arduino_start:()=>tf,inout_highlow:()=>nf});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{inout_input:()=>lf,inout_print:()=>uf,inout_print_container:()=>mf,inout_print_end:()=>df,inout_print_inline:()=>cf,inout_print_item:()=>gf,inout_print_many:()=>ff,inout_type_input:()=>hf,pyinout_type_input:()=>pf});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Vf,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Uf,IOT_EMQX_PING:()=>Bf,IOT_FORMATTING:()=>Lf,IOT_FORMAT_STRING:()=>Pf,IOT_MIXIO_NTP:()=>$f,IOT_MIXIO_PUBLISH:()=>Sf,IOT_MIXIO_PUBLISHEX:()=>Cf,IOT_MIXIO_SUBSCRIBE:()=>Of,IOT_MIXIO_UNSUBSCRIBE:()=>Mf,iot_checkonenet:()=>Zf,iot_client_onboard:()=>Yf,iot_create_with_item:()=>If,iot_http_client:()=>Gf,iot_http_data:()=>Hf,iot_mixio_check:()=>Nf,iot_mixio_connect:()=>Af,iot_mixio_connect_only:()=>Rf,iot_mixio_disconnect:()=>kf,iot_mixio_format_msg:()=>Ff,iot_mixio_format_topic:()=>Df,iot_mixly_key:()=>jf,iot_mixly_key_py:()=>zf,iot_mqtt_client:()=>Wf,iot_mqtt_data:()=>Xf,iot_onenet_check:()=>bf,iot_onenet_connect:()=>yf,iot_onenet_disconnect:()=>vf,iot_onenet_publish:()=>xf,iot_onenet_publish_dict:()=>Tf,iot_onenetconnect:()=>qf,iot_onenetdisconnect:()=>Kf,iot_publish:()=>Qf,iot_publish_container:()=>Ef,iot_publish_item:()=>wf});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{pins_analog_read:()=>im,pins_analog_write:()=>nm,pins_digital_read:()=>tm,pins_digital_write:()=>em});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{serial_close:()=>am,serial_open:()=>rm,serial_read_b:()=>om,serial_write:()=>sm});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{sklearn_DecisionTreeClassifier_Regressor:()=>ym,sklearn_GaussianNB:()=>Tm,sklearn_KMeans:()=>wm,sklearn_KMeans_fit:()=>Im,sklearn_KNeighborsClassifier_Regressor:()=>bm,sklearn_LinearRegression:()=>gm,sklearn_RandomForestClassifier_Regressor:()=>vm,sklearn_Ridge:()=>_m,sklearn_cluster_centers_labels_inertia:()=>Rm,sklearn_coef_intercept:()=>km,sklearn_data_target:()=>pm,sklearn_fit:()=>Am,sklearn_fit_no_target:()=>Sm,sklearn_load:()=>hm,sklearn_make_blobs:()=>dm,sklearn_make_classification:()=>um,sklearn_make_regression:()=>cm,sklearn_pca:()=>xm,sklearn_pca_fit_transform:()=>Em,sklearn_predict:()=>Cm,sklearn_save_load_model:()=>Nm,sklearn_score:()=>Om,sklearn_score_no_target:()=>Mm,sklearn_train_test_split:()=>fm,sklearn_train_test_split_no_target:()=>mm});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{Panic_with_status_code:()=>Bm,base_delay:()=>Fm,controls_millis:()=>Lm,controls_mstimer2:()=>Um,controls_mstimer2_start:()=>Vm,controls_mstimer2_stop:()=>zm,reset:()=>$m,time_localtime:()=>Pm,time_sleep:()=>jm});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{turtle_bgcolor:()=>dg,turtle_bgcolor_hex:()=>Tg,turtle_bgcolor_hex_new:()=>gg,turtle_circle:()=>lg,turtle_circle_advanced:()=>ug,turtle_clear:()=>ng,turtle_clone:()=>mg,turtle_color:()=>vg,turtle_color_hex:()=>bg,turtle_color_seclet:()=>kg,turtle_create:()=>Gm,turtle_done:()=>Hm,turtle_exitonclick:()=>Wm,turtle_fill:()=>rg,turtle_fillcolor:()=>fg,turtle_fillcolor_hex:()=>Eg,turtle_fillcolor_hex_new:()=>yg,turtle_getscreen:()=>Rg,turtle_goto:()=>Qm,turtle_listen:()=>Lg,turtle_move:()=>Xm,turtle_numinput:()=>Ag,turtle_onclick:()=>Dg,turtle_onkey:()=>Ng,turtle_ontimer:()=>Fg,turtle_pencolor:()=>pg,turtle_pencolor_hex:()=>xg,turtle_pencolor_hex_new:()=>_g,turtle_penup:()=>ig,turtle_pos_shape:()=>eg,turtle_rotate:()=>qm,turtle_screen_delay:()=>Zm,turtle_screen_savefig:()=>Pg,turtle_setheading:()=>Km,turtle_setxy:()=>Jm,turtle_shape:()=>wg,turtle_shapesize:()=>Ig,turtle_size:()=>og,turtle_size_speed:()=>sg,turtle_speed:()=>ag,turtle_stamp:()=>tg,turtle_textinput:()=>Sg,turtle_tracer:()=>hg,turtle_visible:()=>cg,turtle_write:()=>Cg,turtle_write_format:()=>Og,turtle_write_format_skulpt:()=>Mg});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{AI_ChooseAndGet:()=>Bg,AI_Face_match:()=>jg,AI_ImageClassify:()=>zg,AI_ImageClassify_Func:()=>qg,AI_Nlp:()=>Gg,AI_Nlp_Func:()=>Zg,AI_Nlp_Func_sim:()=>Qg,AI_Nlp_Sim:()=>Hg,AI_Nlp_Topic:()=>Wg,AI_Nlp_newsSummary:()=>Xg,AI_Ocr:()=>Yg,AI_Ocr_Func:()=>Kg,AI_Speech_asr:()=>Vg,AI_Speech_synthesis:()=>Ug,AI_audio:()=>Jg,AI_client:()=>$g,AI_photo:()=>e_,AI_result:()=>t_});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{algorithm_add_path:()=>a_,algorithm_add_school:()=>i_,algorithm_all_books:()=>w_,algorithm_all_books_sequence:()=>E_,algorithm_book_scale:()=>D_,algorithm_check_feet:()=>z_,algorithm_chick_calculate:()=>V_,algorithm_color_seclet:()=>sy,algorithm_current_school:()=>p_,algorithm_del_path:()=>l_,algorithm_delete_book:()=>R_,algorithm_divide_books:()=>M_,algorithm_find_path:()=>r_,algorithm_first_book:()=>I_,algorithm_fz_calc:()=>H_,algorithm_fz_compare:()=>W_,algorithm_fz_move:()=>q_,algorithm_fz_set_min:()=>X_,algorithm_get_current_location:()=>iy,algorithm_get_half_books:()=>k_,algorithm_hxdb_add:()=>ey,algorithm_hxdb_init_soldier:()=>Z_,algorithm_hxdb_last_line:()=>J_,algorithm_hxdb_result:()=>ty,algorithm_hxdb_stand_in_line:()=>Q_,algorithm_init_fzsf:()=>G_,algorithm_init_hxdb:()=>K_,algorithm_init_jttl:()=>B_,algorithm_move_recent:()=>__,algorithm_new_path:()=>s_,algorithm_next_book:()=>C_,algorithm_no_left:()=>c_,algorithm_no_path:()=>f_,algorithm_no_ring2:()=>A_,algorithm_not_home:()=>y_,algorithm_not_school:()=>v_,algorithm_number_add:()=>L_,algorithm_number_zero:()=>F_,algorithm_prepare:()=>n_,algorithm_prepare2:()=>h_,algorithm_prepare_2_1:()=>m_,algorithm_prepare_2_2:()=>g_,algorithm_print_book2:()=>N_,algorithm_print_jttl_answer:()=>j_,algorithm_print_number:()=>P_,algorithm_print_path:()=>d_,algorithm_print_path2:()=>b_,algorithm_rabbit_add:()=>Y_,algorithm_rabbit_number_in_range:()=>U_,algorithm_rabbit_zero:()=>$_,algorithm_return_path:()=>u_,algorithm_set_path:()=>o_,algorithm_two_left:()=>O_,algorithm_void_path:()=>ry,algorithm_yes_ring2:()=>S_,hanoi_init:()=>T_,hanoi_init_offline:()=>ny,hanoi_move:()=>x_});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{requests_attribute:()=>uy,requests_get:()=>ay,requests_get_old:()=>oy,requests_method:()=>cy,requests_post:()=>ly});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{array_create:()=>Sy,array_toarray:()=>Vy,dataframe_aggregate_func:()=>Lv,dataframe_create:()=>fy,dataframe_create_from_index:()=>my,dataframe_create_from_one_index:()=>gy,dataframe_fillna:()=>xv,dataframe_get:()=>By,dataframe_groupby:()=>Fv,dataframe_head_tail:()=>Nv,dataframe_info:()=>Ev,dataframe_median:()=>Tv,dataframe_select:()=>Dv,dataframe_sort_values:()=>Rv,matrix_multiplication:()=>vv,matrix_transpose:()=>yv,numpy_argmin_template_match:()=>cv,numpy_astype:()=>av,numpy_c_:()=>gv,numpy_dot:()=>Sv,numpy_linalg_det:()=>_v,numpy_linalg_inv:()=>bv,numpy_max:()=>Iv,numpy_mean:()=>dv,numpy_mean_digit:()=>uv,numpy_min:()=>wv,numpy_ones:()=>mv,numpy_random_random:()=>Mv,numpy_reshape:()=>ov,numpy_shape:()=>sv,numpy_size:()=>Av,numpy_square:()=>Cv,numpy_std:()=>hv,numpy_sum:()=>Ov,numpy_trig:()=>Fy,pandas_drop_columns:()=>fv,pandas_dropna:()=>pv,pandas_readcsv:()=>Py,pl_axes:()=>Ty,pl_bar:()=>ky,pl_hist:()=>Ny,pl_label:()=>Ay,pl_legend:()=>wy,pl_pie:()=>Ry,pl_plot:()=>Ey,pl_plot_bar:()=>Cy,pl_plot_easy:()=>xy,pl_plot_scatter:()=>Oy,pl_plot_xy:()=>My,pl_savefig:()=>$y,pl_show:()=>by,pl_subplot:()=>Ly,pl_text:()=>Uy,pl_ticks:()=>Dy,pl_title:()=>Iy,plot_axes:()=>jy,plot_bar:()=>Qy,plot_cla:()=>Pv,plot_hist:()=>ev,plot_label:()=>Xy,plot_legend:()=>Hy,plot_pie:()=>Jy,plot_plot:()=>Gy,plot_plot_bar:()=>qy,plot_plot_easy:()=>Yy,plot_plot_scatter:()=>Ky,plot_plot_xy:()=>Zy,plot_savefig:()=>iv,plot_show:()=>zy,plot_subplot:()=>nv,plot_text:()=>rv,plot_ticks:()=>tv,plot_title:()=>Wy,py_sum:()=>kv,pylab_imshow:()=>lv,series_create:()=>hy,series_create_from_index:()=>py,series_create_from_text:()=>_y,series_get_num:()=>vy,series_index_value:()=>yy});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{ds_add_node_by_attr:()=>jv,ds_add_node_by_name:()=>zv,ds_create_linkedlist:()=>Bv,ds_create_node:()=>$v,ds_del_node_by_attr:()=>Gv,ds_del_node_by_name:()=>Yv,ds_get_node_attr:()=>Uv,ds_reverse_linkedlist:()=>Hv,ds_set_node_attr:()=>Vv});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{factory_block:()=>eb,factory_block_return:()=>tb,factory_block_return_with_textarea:()=>ib,factory_block_with_textarea:()=>nb,factory_callMethod_noreturn:()=>Qv,factory_callMethod_return:()=>Jv,factory_declare:()=>Zv,factory_from_import:()=>Wv,factory_function_noreturn:()=>qv,factory_function_return:()=>Kv,factory_import:()=>Xv});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{hardware_arduino_analog_read:()=>lb,hardware_arduino_analog_write:()=>ub,hardware_arduino_digital_read:()=>ab,hardware_arduino_digital_write:()=>ob,hardware_arduino_start:()=>rb,inout_highlow:()=>sb});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{inout_input:()=>cb,inout_print:()=>db,inout_print_end:()=>pb,inout_print_inline:()=>hb,inout_print_many:()=>gb,inout_type_input:()=>fb,pyinout_type_input:()=>mb});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Ob,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Rb,IOT_EMQX_PING:()=>Nb,IOT_FORMATTING:()=>Sb,IOT_FORMAT_STRING:()=>Cb,IOT_MIXIO_NTP:()=>Db,IOT_MIXIO_PUBLISH:()=>yb,IOT_MIXIO_PUBLISHEX:()=>vb,IOT_MIXIO_SUBSCRIBE:()=>bb,IOT_MIXIO_UNSUBSCRIBE:()=>Tb,iot_mixio_check:()=>wb,iot_mixio_connect:()=>_b,iot_mixio_connect_only:()=>Eb,iot_mixio_disconnect:()=>xb,iot_mixio_format_msg:()=>Ab,iot_mixio_format_topic:()=>Ib,iot_mixly_key:()=>Mb,iot_mixly_key_py:()=>kb});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{pins_analog_read:()=>$b,pins_analog_write:()=>Bb,pins_digital:()=>Fb,pins_digital_read:()=>Pb,pins_digital_write:()=>Lb});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{serial_close:()=>jb,serial_open:()=>Ub,serial_read_b:()=>zb,serial_write:()=>Vb});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{sklearn_DecisionTreeClassifier_Regressor:()=>Jb,sklearn_GaussianNB:()=>nT,sklearn_KMeans:()=>sT,sklearn_KMeans_fit:()=>oT,sklearn_KNeighborsClassifier_Regressor:()=>tT,sklearn_LinearRegression:()=>Zb,sklearn_RandomForestClassifier_Regressor:()=>eT,sklearn_Ridge:()=>Qb,sklearn_cluster_centers_labels_inertia:()=>pT,sklearn_coef_intercept:()=>hT,sklearn_data_target:()=>Xb,sklearn_fit:()=>aT,sklearn_fit_no_target:()=>lT,sklearn_load:()=>Wb,sklearn_make_blobs:()=>Hb,sklearn_make_classification:()=>Yb,sklearn_make_regression:()=>Gb,sklearn_pca:()=>iT,sklearn_pca_fit_transform:()=>rT,sklearn_predict:()=>uT,sklearn_save_load_model:()=>fT,sklearn_score:()=>cT,sklearn_score_no_target:()=>dT,sklearn_train_test_split:()=>qb,sklearn_train_test_split_no_target:()=>Kb});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{controls_end_program:()=>gT,controls_millis:()=>mT,time_localtime:()=>_T});var te={};__webpack_require__.r(te),__webpack_require__.d(te,{turtle_bgcolor:()=>BT,turtle_bgcolor_hex:()=>jT,turtle_bgcolor_hex_new:()=>HT,turtle_circle:()=>DT,turtle_circle_advanced:()=>LT,turtle_clear:()=>CT,turtle_clone:()=>zT,turtle_color:()=>KT,turtle_color_hex:()=>qT,turtle_color_seclet:()=>rx,turtle_create:()=>yT,turtle_done:()=>vT,turtle_exitonclick:()=>bT,turtle_fill:()=>MT,turtle_fillcolor:()=>VT,turtle_fillcolor_hex:()=>GT,turtle_fillcolor_hex_new:()=>XT,turtle_getscreen:()=>sx,turtle_goto:()=>IT,turtle_listen:()=>ux,turtle_move:()=>TT,turtle_numinput:()=>ex,turtle_onclick:()=>ax,turtle_onkey:()=>ox,turtle_ontimer:()=>lx,turtle_pencolor:()=>UT,turtle_pencolor_hex:()=>YT,turtle_pencolor_hex_new:()=>WT,turtle_penup:()=>OT,turtle_pos_shape:()=>AT,turtle_rotate:()=>xT,turtle_screen_delay:()=>wT,turtle_screen_savefig:()=>cx,turtle_setheading:()=>ET,turtle_setxy:()=>FT,turtle_shape:()=>ZT,turtle_shapesize:()=>QT,turtle_size:()=>RT,turtle_size_speed:()=>kT,turtle_speed:()=>NT,turtle_stamp:()=>ST,turtle_textinput:()=>JT,turtle_tracer:()=>$T,turtle_visible:()=>PT,turtle_write:()=>tx,turtle_write_format:()=>nx,turtle_write_format_skulpt:()=>ix});var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{sklearn_LinearRegression:()=>dx});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{sklearn_LinearRegression:()=>hx});var re={};__webpack_require__.r(re);var se={};__webpack_require__.r(se),__webpack_require__.d(se,{tensorflow_add:()=>_x,tensorflow_compile:()=>yx,tensorflow_fit:()=>vx,tensorflow_get_loss:()=>bx,tensorflow_get_tensor_data:()=>xx,tensorflow_init_tensor:()=>fx,tensorflow_layers_dense:()=>gx,tensorflow_predict:()=>Tx,tensorflow_prepare_picture:()=>Ix,tensorflow_save_or_export_model:()=>Ex,tensorflow_sequential:()=>mx,tensorflow_use_load_model:()=>wx});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{BaseTransition:()=>QA,BaseTransitionPropsValidators:()=>qA,Comment:()=>JO,DeprecationTypes:()=>fk,EffectScope:()=>YE,ErrorCodes:()=>XI,ErrorTypeStrings:()=>lk,Fragment:()=>ZO,KeepAlive:()=>NS,ReactiveEffect:()=>qE,Static:()=>eM,Suspense:()=>GO,Teleport:()=>zA,Text:()=>QO,TrackOpTypes:()=>DI,Transition:()=>Ak,TransitionGroup:()=>ER,TriggerOpTypes:()=>FI,VueElement:()=>fR,assertNumber:()=>WI,callWithAsyncErrorHandling:()=>ZI,callWithErrorHandling:()=>KI,camelize:()=>rE,capitalize:()=>aE,cloneVNode:()=>bM,compatUtils:()=>pk,computed:()=>tk,createApp:()=>eN,createBlock:()=>cM,createCommentVNode:()=>EM,createElementBlock:()=>uM,createElementVNode:()=>gM,createHydrationRenderer:()=>mO,createPropsRestProxy:()=>MC,createRenderer:()=>fO,createSSRApp:()=>tN,createSlots:()=>lC,createStaticVNode:()=>xM,createTextVNode:()=>TM,createVNode:()=>_M,customRef:()=>SI,defineAsyncComponent:()=>OS,defineComponent:()=>sS,defineCustomElement:()=>dR,defineEmits:()=>yC,defineExpose:()=>vC,defineModel:()=>xC,defineOptions:()=>bC,defineProps:()=>_C,defineSSRCustomElement:()=>hR,defineSlots:()=>TC,devtools:()=>uk,effect:()=>lw,effectScope:()=>GE,getCurrentInstance:()=>NM,getCurrentScope:()=>HE,getCurrentWatcher:()=>$I,getTransitionRawChildren:()=>rS,guardReactiveProps:()=>vM,h:()=>nk,handleError:()=>QI,hasInjectionContext:()=>KC,hydrate:()=>JR,hydrateOnIdle:()=>wS,hydrateOnInteraction:()=>SS,hydrateOnMediaQuery:()=>AS,hydrateOnVisible:()=>IS,initCustomFormatter:()=>ik,initDirectivesForSSR:()=>sN,inject:()=>qC,isMemoSame:()=>sk,isProxy:()=>dI,isReactive:()=>lI,isReadonly:()=>uI,isRef:()=>gI,isRuntimeOnly:()=>GM,isShallow:()=>cI,isVNode:()=>dM,markRaw:()=>pI,mergeDefaults:()=>CC,mergeModels:()=>OC,mergeProps:()=>SM,nextTick:()=>oA,normalizeClass:()=>xE,normalizeProps:()=>EE,normalizeStyle:()=>_E,onActivated:()=>FS,onBeforeMount:()=>jS,onBeforeUnmount:()=>WS,onBeforeUpdate:()=>GS,onDeactivated:()=>LS,onErrorCaptured:()=>QS,onMounted:()=>YS,onRenderTracked:()=>ZS,onRenderTriggered:()=>KS,onScopeDispose:()=>WE,onServerPrefetch:()=>qS,onUnmounted:()=>XS,onUpdated:()=>HS,onWatcherCleanup:()=>UI,openBlock:()=>iM,popScopeId:()=>CA,provide:()=>XC,proxyRefs:()=>II,pushScopeId:()=>SA,queuePostFlushCb:()=>uA,reactive:()=>iI,readonly:()=>sI,ref:()=>_I,registerRuntimeCompiler:()=>YM,render:()=>QR,renderList:()=>aC,renderSlot:()=>uC,resolveComponent:()=>tC,resolveDirective:()=>rC,resolveDynamicComponent:()=>iC,resolveFilter:()=>hk,resolveTransitionHooks:()=>eS,setBlockTracking:()=>aM,setDevtoolsHook:()=>ck,setTransitionHooks:()=>iS,shallowReactive:()=>rI,shallowReadonly:()=>oI,shallowRef:()=>yI,ssrContextKey:()=>EO,ssrUtils:()=>dk,stop:()=>uw,toDisplayString:()=>$E,toHandlerKey:()=>lE,toHandlers:()=>dC,toRaw:()=>hI,toRef:()=>kI,toRefs:()=>CI,toValue:()=>EI,transformVNodeArgs:()=>pM,triggerRef:()=>TI,unref:()=>xI,useAttrs:()=>IC,useCssModule:()=>_R,useCssVars:()=>Gk,useHost:()=>mR,useId:()=>oS,useModel:()=>RO,useSSRContext:()=>wO,useShadowRoot:()=>gR,useSlots:()=>wC,useTemplateRef:()=>lS,useTransitionState:()=>WA,vModelCheckbox:()=>RR,vModelDynamic:()=>$R,vModelRadio:()=>DR,vModelSelect:()=>FR,vModelText:()=>kR,vShow:()=>zk,version:()=>ok,warn:()=>ak,watch:()=>CO,watchEffect:()=>IO,watchPostEffect:()=>AO,watchSyncEffect:()=>SO,withAsyncContext:()=>kC,withCtx:()=>MA,withDefaults:()=>EC,withDirectives:()=>kA,withKeys:()=>HR,withMemo:()=>rk,withModifiers:()=>YR,withScopeId:()=>OA});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{COPYFILE_EXCL:()=>FP,COPYFILE_FICLONE:()=>LP,COPYFILE_FICLONE_FORCE:()=>PP,F_OK:()=>kP,O_APPEND:()=>GP,O_CREAT:()=>VP,O_DIRECT:()=>QP,O_DIRECTORY:()=>HP,O_DSYNC:()=>KP,O_EXCL:()=>zP,O_NOATIME:()=>WP,O_NOCTTY:()=>jP,O_NOFOLLOW:()=>XP,O_NONBLOCK:()=>JP,O_RDONLY:()=>BP,O_RDWR:()=>UP,O_SYMLINK:()=>ZP,O_SYNC:()=>qP,O_TRUNC:()=>YP,O_WRONLY:()=>$P,R_OK:()=>RP,S_IFBLK:()=>rB,S_IFCHR:()=>oB,S_IFDIR:()=>sB,S_IFIFO:()=>aB,S_IFLNK:()=>nB,S_IFMT:()=>eB,S_IFREG:()=>iB,S_IFSOCK:()=>tB,S_IRGRP:()=>gB,S_IROTH:()=>bB,S_IRUSR:()=>hB,S_IRWXG:()=>mB,S_IRWXO:()=>vB,S_IRWXU:()=>dB,S_ISGID:()=>uB,S_ISUID:()=>lB,S_ISVTX:()=>cB,S_IWGRP:()=>_B,S_IWOTH:()=>TB,S_IWUSR:()=>pB,S_IXGRP:()=>yB,S_IXOTH:()=>xB,S_IXUSR:()=>fB,UV_FS_O_FILEMAP:()=>EB,W_OK:()=>NP,X_OK:()=>DP,size_max:()=>wB});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{FileHandle:()=>WU,access:()=>vV,appendFile:()=>rV,chmod:()=>pV,chown:()=>dV,constants:()=>ae,copyFile:()=>xV,cp:()=>wV,exists:()=>qU,lchmod:()=>fV,lchown:()=>hV,link:()=>lV,lstat:()=>ZU,lutimes:()=>gV,mkdir:()=>oV,mkdtemp:()=>TV,open:()=>tV,opendir:()=>EV,readFile:()=>nV,readdir:()=>aV,readlink:()=>cV,realpath:()=>_V,rename:()=>XU,rm:()=>bV,rmdir:()=>sV,stat:()=>KU,statfs:()=>IV,symlink:()=>uV,truncate:()=>QU,unlink:()=>JU,utimes:()=>mV,watch:()=>yV,writeFile:()=>iV});var ue={};__webpack_require__.r(ue),__webpack_require__.d(ue,{BigIntStatsFs:()=>kB,Dir:()=>VU,Dirent:()=>UU,ReadStream:()=>jU,Stats:()=>CB,StatsFs:()=>MB,WriteStream:()=>YU,_synced:()=>L$,access:()=>oz,accessSync:()=>kU,appendFile:()=>LV,appendFileSync:()=>aU,chmod:()=>tz,chmodSync:()=>AU,chown:()=>JV,chownSync:()=>wU,chroot:()=>V$,close:()=>BV,closeSync:()=>uU,constants:()=>ae,copyFile:()=>mz,copyFileSync:()=>DU,cp:()=>vz,cpSync:()=>BU,createReadStream:()=>dz,createWriteStream:()=>hz,exists:()=>CV,existsSync:()=>K$,fchmod:()=>GV,fchmodSync:()=>gU,fchown:()=>YV,fchownSync:()=>mU,fdatasync:()=>VV,fdatasyncSync:()=>hU,fstat:()=>PV,fstatSync:()=>lU,fsync:()=>UV,fsyncSync:()=>dU,ftruncate:()=>$V,ftruncateSync:()=>cU,futimes:()=>HV,futimesSync:()=>_U,lchmod:()=>nz,lchmodSync:()=>SU,lchown:()=>ez,lchownSync:()=>IU,link:()=>KV,linkSync:()=>TU,lopenSync:()=>iU,lstat:()=>MV,lstatSync:()=>Q$,lutimes:()=>rz,lutimesSync:()=>OU,mkdir:()=>XV,mkdirSync:()=>vU,mkdtemp:()=>fz,mkdtempSync:()=>NU,mount:()=>N$,mountObject:()=>$$,mounts:()=>R$,open:()=>NV,openAsBlob:()=>Tz,openSync:()=>nU,opendir:()=>yz,opendirSync:()=>PU,promises:()=>le,read:()=>jV,readFile:()=>DV,readFileSync:()=>sU,readSync:()=>fU,readdir:()=>qV,readdirSync:()=>bU,readlink:()=>QV,readlinkSync:()=>EU,readv:()=>gz,readvSync:()=>FU,realpath:()=>sz,realpathSync:()=>MU,rename:()=>SV,renameSync:()=>q$,rm:()=>pz,rmSync:()=>RU,rmdir:()=>WV,rmdirSync:()=>yU,stat:()=>OV,statSync:()=>Z$,statfs:()=>bz,statfsSync:()=>$U,symlink:()=>ZV,symlinkSync:()=>xU,truncate:()=>kV,truncateSync:()=>J$,umount:()=>D$,unlink:()=>RV,unlinkSync:()=>eU,unwatchFile:()=>uz,utimes:()=>iz,utimesSync:()=>CU,watch:()=>cz,watchFile:()=>lz,write:()=>zV,writeFile:()=>FV,writeFileSync:()=>oU,writeSync:()=>pU,writev:()=>_z,writevSync:()=>LU});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{maxNorm:()=>X9,minMaxNorm:()=>Z9,nonNeg:()=>K9,unitNorm:()=>q9});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{constant:()=>e7,glorotNormal:()=>a7,glorotUniform:()=>o7,heNormal:()=>l7,heUniform:()=>u7,identity:()=>r7,leCunNormal:()=>c7,leCunUniform:()=>d7,ones:()=>J9,orthogonal:()=>h7,randomNormal:()=>n7,randomUniform:()=>t7,truncatedNormal:()=>i7,varianceScaling:()=>s7,zeros:()=>Q9});var he={};__webpack_require__.r(he),__webpack_require__.d(he,{Layer:()=>S9,RNN:()=>Fte,RNNCell:()=>Lte,activation:()=>mie,add:()=>wie,alphaDropout:()=>fre,average:()=>Iie,averagePooling1d:()=>Die,averagePooling2d:()=>Pie,averagePooling3d:()=>Uie,avgPool1d:()=>Fie,avgPool2d:()=>Bie,avgPool3d:()=>Vie,avgPooling1d:()=>Lie,avgPooling2d:()=>$ie,avgPooling3d:()=>zie,batchNormalization:()=>kie,bidirectional:()=>ore,categoryEncoding:()=>vre,centerCrop:()=>_re,concatenate:()=>Aie,conv1d:()=>oie,conv2d:()=>aie,conv2dTranspose:()=>lie,conv3d:()=>uie,conv3dTranspose:()=>cie,convLstm2d:()=>nre,convLstm2dCell:()=>ire,cropping2D:()=>hie,dense:()=>gie,depthwiseConv2d:()=>fie,dot:()=>Mie,dropout:()=>_ie,elu:()=>eie,embedding:()=>Eie,flatten:()=>vie,gaussianDropout:()=>pre,gaussianNoise:()=>hre,globalAveragePooling1d:()=>jie,globalAveragePooling2d:()=>Yie,globalMaxPool1d:()=>lre,globalMaxPool2d:()=>ure,globalMaxPooling1d:()=>Gie,globalMaxPooling2d:()=>Hie,gru:()=>Kie,gruCell:()=>Zie,input:()=>Ree,inputLayer:()=>Jne,layerNormalization:()=>Rie,leakyReLU:()=>nie,lstm:()=>Qie,lstmCell:()=>Jie,masking:()=>mre,maxPool1d:()=>cre,maxPool2d:()=>dre,maxPooling1d:()=>Wie,maxPooling2d:()=>Xie,maxPooling3d:()=>qie,maximum:()=>Sie,minimum:()=>Cie,multiply:()=>Oie,permute:()=>xie,prelu:()=>iie,randomWidth:()=>bre,reLU:()=>tie,repeatVector:()=>bie,rescaling:()=>gre,reshape:()=>Tie,resizing:()=>yre,rnn:()=>rre,separableConv2d:()=>die,simpleRNN:()=>ere,simpleRNNCell:()=>tre,softmax:()=>rie,spatialDropout1d:()=>yie,stackedRNNCells:()=>sre,thresholdedReLU:()=>sie,timeDistributed:()=>are,upSampling2d:()=>pie,zeroPadding2d:()=>Nie});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{MAPE:()=>kre,MSE:()=>Dre,binaryAccuracy:()=>Tre,binaryCrossentropy:()=>xre,categoricalAccuracy:()=>wre,categoricalCrossentropy:()=>Ire,cosineProximity:()=>Cre,mape:()=>Rre,meanAbsoluteError:()=>Ore,meanAbsolutePercentageError:()=>Mre,meanSquaredError:()=>Nre,mse:()=>Fre,precision:()=>Are,r2Score:()=>Lre,recall:()=>Sre,sparseCategoricalAccuracy:()=>Ere});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{modelFromJSON:()=>See});var me={};__webpack_require__.r(me),__webpack_require__.d(me,{l1:()=>Bre,l1l2:()=>Pre,l2:()=>$re});var ge={};__webpack_require__.r(ge),__webpack_require__.d(ge,{json:()=>sse});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{json:()=>ose});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{json:()=>ase});var ve={};__webpack_require__.r(ve),__webpack_require__.d(ve,{json:()=>lse});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{json:()=>use});var Te={};__webpack_require__.r(Te),__webpack_require__.d(Te,{json:()=>cse});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{json:()=>dse});var Ee={};__webpack_require__.r(Ee),__webpack_require__.d(Ee,{json:()=>hse});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{json:()=>pse});var Ie={};__webpack_require__.r(Ie),__webpack_require__.d(Ie,{json:()=>fse});var Ae={};__webpack_require__.r(Ae),__webpack_require__.d(Ae,{json:()=>mse});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{json:()=>gse});var Ce={};__webpack_require__.r(Ce),__webpack_require__.d(Ce,{json:()=>_se});var Oe={};__webpack_require__.r(Oe),__webpack_require__.d(Oe,{json:()=>yse});var Me={};__webpack_require__.r(Me),__webpack_require__.d(Me,{json:()=>vse});var ke={};__webpack_require__.r(ke),__webpack_require__.d(ke,{json:()=>bse});var Re={};__webpack_require__.r(Re),__webpack_require__.d(Re,{json:()=>Tse});var Ne={};__webpack_require__.r(Ne),__webpack_require__.d(Ne,{json:()=>xse});var De={};__webpack_require__.r(De),__webpack_require__.d(De,{json:()=>Ese});var Fe={};__webpack_require__.r(Fe),__webpack_require__.d(Fe,{OP_SCOPE_SUFFIX:()=>Use.BTT,abs:()=>Use.tnl,acos:()=>Use.HQu,acosh:()=>Use.FqL,add:()=>Use.WQq,addN:()=>Use.QiD,all:()=>Use.Q7R,any:()=>Use.bzn,argMax:()=>Use.FLi,argMin:()=>Use.XRg,asin:()=>Use.qRo,asinh:()=>Use.yHs,atan:()=>Use.rYl,atan2:()=>Use.FPz,atanh:()=>Use.rfv,avgPool:()=>Use.$jT,avgPool3d:()=>Use.sub,basicLSTMCell:()=>Use.lZX,batchNorm:()=>Use.$v7,batchNorm2d:()=>Use.BFc,batchNorm3d:()=>Use.kSi,batchNorm4d:()=>Use.T5N,batchToSpaceND:()=>Use.GTe,bincount:()=>Use.HbZ,bitwiseAnd:()=>Use.vjT,booleanMaskAsync:()=>Use.ftb,broadcastArgs:()=>Use.ROE,broadcastTo:()=>Use.hOW,buffer:()=>Use.ra8,cast:()=>Use.wgE,ceil:()=>Use.mkO,clipByValue:()=>Use.zQh,clone:()=>Use.o8B,complex:()=>Use.faB,concat:()=>Use.xWs,concat1d:()=>Use.I1m,concat2d:()=>Use.RPU,concat3d:()=>Use.O5O,concat4d:()=>Use.P1l,conv1d:()=>Use.kA9,conv2d:()=>Use.Xtf,conv2dTranspose:()=>Use.wX9,conv3d:()=>Use.IPL,conv3dTranspose:()=>Use.jIJ,cos:()=>Use.gnS,cosh:()=>Use.yIG,cosineWindow:()=>Use._jP,cumprod:()=>Use.Lp0,cumsum:()=>Use.rCv,denseBincount:()=>Use.aOp,depthToSpace:()=>Use.Rj8,depthwiseConv2d:()=>Use.Gl3,diag:()=>Use.smy,dilation2d:()=>Use.X7t,div:()=>Use.y4m,divNoNan:()=>Use.ek5,dot:()=>Use.Omf,dropout:()=>Use.EZY,einsum:()=>Use._3C,elu:()=>Use.Pqc,enclosingPowerOfTwo:()=>Use.FJY,ensureShape:()=>Use.QP2,equal:()=>Use.LCg,erf:()=>Use.Y12,euclideanNorm:()=>Use.p4S,exp:()=>Use.oNF,expandDims:()=>Use.UG6,expm1:()=>Use.IYd,eye:()=>Use.y5U,fft:()=>Use.hVP,fill:()=>Use.GSj,floor:()=>Use.RIf,floorDiv:()=>Use.wh_,fused:()=>Use.cZk,gather:()=>Use.kgh,gatherND:()=>Use.SY9,greater:()=>Use.rhj,greaterEqual:()=>Use.DQN,ifft:()=>Use.KGM,imag:()=>Use.ngS,image:()=>Use.Slp,inTopKAsync:()=>Use.U4u,irfft:()=>Use.ggX,isFinite:()=>Use.MIs,isInf:()=>Use.EN4,isNaN:()=>Use.yrW,leakyRelu:()=>Use.H8d,less:()=>Use.M7h,lessEqual:()=>Use.InN,linalg:()=>Use.mPL,linspace:()=>Use.mT8,localResponseNormalization:()=>Use.Kgs,log:()=>Use.Rm2,log1p:()=>Use.Kko,logSigmoid:()=>Use.nqI,logSoftmax:()=>Use.HPB,logSumExp:()=>Use.VZ,logicalAnd:()=>Use.n76,logicalNot:()=>Use.NSZ,logicalOr:()=>Use.ztW,logicalXor:()=>Use.rxB,losses:()=>Use.YYh,lowerBound:()=>Use.yzS,matMul:()=>Use.NoW,max:()=>Use.T9B,maxPool:()=>Use.jgi,maxPool3d:()=>Use.NYV,maxPoolWithArgmax:()=>Use.RO,maximum:()=>Use.PhQ,mean:()=>Use.i2o,meshgrid:()=>Use.OYQ,min:()=>Use.jkA,minimum:()=>Use.BpO,mirrorPad:()=>Use.FFZ,mod:()=>Use.ziu,moments:()=>Use.Clk,movingAverage:()=>Use.CRk,mul:()=>Use.lKK,multiRNNCell:()=>Use.YDF,multinomial:()=>Use.OjQ,neg:()=>Use.HZy,norm:()=>Use.xbf,notEqual:()=>Use.Ec,oneHot:()=>Use.Mw0,ones:()=>Use.SaS,onesLike:()=>Use.P61,op:()=>Use.op,outerProduct:()=>Use.X4o,pad:()=>Use.eVF,pad1d:()=>Use.BZs,pad2d:()=>Use.grY,pad3d:()=>Use.XHu,pad4d:()=>Use.WLX,pool:()=>Use.dzn,pow:()=>Use.n7C,prelu:()=>Use.NsG,print:()=>Use.yyV,prod:()=>Use._eU,raggedGather:()=>Use.whe,raggedRange:()=>Use.iyU,raggedTensorToTensor:()=>Use.Q0_,rand:()=>Use._9M,randomGamma:()=>Use.pR9,randomNormal:()=>Use.FE$,randomStandardNormal:()=>Use.m0H,randomUniform:()=>Use.YeY,randomUniformInt:()=>Use.HYA,range:()=>Use.y17,real:()=>Use.xav,reciprocal:()=>Use.VOZ,relu:()=>Use.VVh,relu6:()=>Use.j__,reshape:()=>Use.tQQ,reverse:()=>Use.BEg,reverse1d:()=>Use.QD2,reverse2d:()=>Use.LMr,reverse3d:()=>Use.I2l,reverse4d:()=>Use.JYU,rfft:()=>Use.z8$,round:()=>Use.LIG,rsqrt:()=>Use.Z$r,scalar:()=>Use.d_2,scatterND:()=>Use.NFr,searchSorted:()=>Use.sZg,selu:()=>Use.WfX,separableConv2d:()=>Use.wdz,setdiff1dAsync:()=>Use.F12,sigmoid:()=>Use.ry7,sign:()=>Use._SZ,signal:()=>Use.vPA,sin:()=>Use.F8e,sinh:()=>Use.L0l,slice:()=>Use.dik,slice1d:()=>Use.Q$M,slice2d:()=>Use.zAd,slice3d:()=>Use.wck,slice4d:()=>Use.R0O,softmax:()=>Use.Vs9,softplus:()=>Use.lw0,spaceToBatchND:()=>Use.eDJ,sparse:()=>Use.lMo,sparseToDense:()=>Use.Zhr,spectral:()=>Use.lOn,split:()=>Use.lDo,sqrt:()=>Use.RZD,square:()=>Use.EwI,squaredDifference:()=>Use.Pbu,squeeze:()=>Use.r2V,stack:()=>Use.t$z,step:()=>Use.PMw,stridedSlice:()=>Use.Ym9,string:()=>Use.YjP,sub:()=>Use.jbE,sum:()=>Use.czq,tan:()=>Use.Mlm,tanh:()=>Use.ymU,tensor:()=>Use.OEK,tensor1d:()=>Use.tGX,tensor2d:()=>Use.KtR,tensor3d:()=>Use.$_$,tensor4d:()=>Use.g9W,tensor5d:()=>Use.Lpo,tensor6d:()=>Use.yxw,tensorScatterUpdate:()=>Use.NNh,tile:()=>Use.Vsq,topk:()=>Use.rfw,transpose:()=>Use.mgz,truncatedNormal:()=>Use.efE,unique:()=>Use.AmM,unsortedSegmentSum:()=>Use.zAU,unstack:()=>Use.K$i,upperBound:()=>Use.rni,variable:()=>Use.bvq,where:()=>Use._M9,whereAsync:()=>Use.YJN,zeros:()=>Use.Ul9,zerosLike:()=>Use.POl});var Le={};__webpack_require__.r(Le),__webpack_require__.d(Le,{CSVDataset:()=>aae,Dataset:()=>qoe,FileDataSource:()=>bae,TextLineDataset:()=>eae,URLDataSource:()=>Tae,array:()=>Zoe,csv:()=>xae,func:()=>Eae,generator:()=>wae,microphone:()=>Aae,version_data:()=>Sae,webcam:()=>Iae,zip:()=>Qoe});var Pe={};__webpack_require__.r(Pe),__webpack_require__.d(Pe,{addImpl:()=>Hae,bincountImpl:()=>Kae,bincountReduceImpl:()=>Zae,bitwiseAndImpl:()=>Qae,castImpl:()=>Vae,ceilImpl:()=>rle,concatImpl:()=>ale,equalImpl:()=>lle,expImpl:()=>dle,expm1Impl:()=>fle,floorDivImpl:()=>ble,floorImpl:()=>_le,gatherNdImpl:()=>Ele,gatherV2Impl:()=>wle,greaterEqualImpl:()=>Cle,greaterImpl:()=>Ile,lessEqualImpl:()=>Dle,lessImpl:()=>kle,linSpaceImpl:()=>Ple,logImpl:()=>Ble,maxImpl:()=>Vle,maximumImpl:()=>zle,minimumImpl:()=>Gle,multiplyImpl:()=>Xle,negImpl:()=>Qle,notEqualImpl:()=>eue,prodImpl:()=>oue,raggedGatherImpl:()=>due,raggedRangeImpl:()=>pue,raggedTensorToTensorImpl:()=>yue,rangeImpl:()=>vue,rsqrtImpl:()=>bue,scatterImpl:()=>Eue,sigmoidImpl:()=>wue,simpleAbsImpl:()=>kae,sliceImpl:()=>Sue,sparseFillEmptyRowsImpl:()=>Mue,sparseReshapeImpl:()=>kue,sparseSegmentReductionImpl:()=>Rue,sqrtImpl:()=>Nue,squaredDifferenceImpl:()=>Lue,staticRegexReplaceImpl:()=>$ue,stridedSliceImpl:()=>zue,stringNGramsImpl:()=>Yue,stringSplitImpl:()=>Hue,stringToHashBucketFastImpl:()=>Wue,subImpl:()=>Xue,tileImpl:()=>Que,topKImpl:()=>tce,transposeImpl:()=>iue,uniqueImpl:()=>nce});var Be={};__webpack_require__.r(Be),__webpack_require__.d(Be,{assertNotComplex:()=>yme,bindCanvasToFramebuffer:()=>Hfe,bindColorTextureToFramebuffer:()=>Wfe,bindTextureToProgramUniformSampler:()=>Gfe,bindTextureUnit:()=>Vfe,bindVertexBufferToProgramAttribute:()=>Ufe,callAndCheck:()=>Tfe,canBeRepresented:()=>wfe,createFragmentShader:()=>Cfe,createFramebuffer:()=>$fe,createProgram:()=>kfe,createStaticIndexBuffer:()=>Ffe,createStaticVertexBuffer:()=>Dfe,createTexture:()=>Pfe,createVertexShader:()=>Sfe,getBatchDim:()=>Jfe,getExtensionOrThrow:()=>Afe,getFramebufferErrorMessage:()=>Kfe,getMaxTexturesInShader:()=>cme,getNumChannels:()=>Lfe,getProgramUniformLocation:()=>Yfe,getProgramUniformLocationOrThrow:()=>jfe,getRowsCols:()=>eme,getShapeAs3D:()=>tme,getTextureShapeFromLogicalShape:()=>nme,getWebGLDisjointQueryTimerVersion:()=>dme,getWebGLErrorMessage:()=>Ife,getWebGLMaxTextureSize:()=>ame,hasExtension:()=>hme,isCapableOfRenderingToFloatTexture:()=>fme,isDownloadFloatTextureEnabled:()=>mme,isReshapeFree:()=>rme,isWebGLFenceEnabled:()=>_me,isWebGLVersionEnabled:()=>pme,linkProgram:()=>Rfe,logShaderSourceAndInfoLog:()=>Mfe,resetMaxTextureSize:()=>lme,resetMaxTexturesInShader:()=>ume,unbindColorTextureFromFramebuffer:()=>Xfe,unbindTextureUnit:()=>zfe,validateFramebuffer:()=>qfe,validateProgram:()=>Nfe,validateTextureSize:()=>Bfe});var $e={};__webpack_require__.r($e),__webpack_require__.d($e,{bindVertexProgramAttributeStreams:()=>dge,createBufferFromOutputTexture:()=>fge,createFloat16MatrixTexture:()=>rge,createFloat16PackedMatrixTexture:()=>cge,createFloat32MatrixTexture:()=>nge,createIndexBuffer:()=>Jme,createPackedMatrixTexture:()=>lge,createUnsignedBytesMatrixTexture:()=>oge,createVertexBuffer:()=>Qme,createVertexShader:()=>Zme,downloadByteEncodedFloatMatrixFromOutputTexture:()=>gge,downloadFloat32MatrixFromBuffer:()=>mge,downloadMatrixFromPackedOutputTexture:()=>yge,downloadPackedMatrixFromBuffer:()=>_ge,getInternalFormatForFloat16MatrixTexture:()=>ige,getInternalFormatForFloat16PackedMatrixTexture:()=>uge,getInternalFormatForFloat32MatrixTexture:()=>tge,getInternalFormatForPackedMatrixTexture:()=>age,getInternalFormatForUnsignedBytesMatrixTexture:()=>sge,uploadDenseMatrixToTexture:()=>hge,uploadPixelDataToTexture:()=>pge});var Ue={};__webpack_require__.r(Ue),__webpack_require__.d(Ue,{Abs:()=>p3.Abs,Acos:()=>p3.Acos,Acosh:()=>p3.Acosh,AdadeltaOptimizer:()=>p3.AdadeltaOptimizer,AdagradOptimizer:()=>p3.AdagradOptimizer,AdamOptimizer:()=>p3.AdamOptimizer,AdamaxOptimizer:()=>p3.AdamaxOptimizer,Add:()=>p3.Add,AddN:()=>p3.AddN,All:()=>p3.All,Any:()=>p3.Any,ArgMax:()=>p3.ArgMax,ArgMin:()=>p3.ArgMin,Asin:()=>p3.Asin,Asinh:()=>p3.Asinh,Atan:()=>p3.Atan,Atan2:()=>p3.Atan2,Atanh:()=>p3.Atanh,AvgPool:()=>p3.AvgPool,AvgPool3D:()=>p3.AvgPool3D,AvgPool3DGrad:()=>p3.AvgPool3DGrad,AvgPoolGrad:()=>p3.AvgPoolGrad,BatchMatMul:()=>p3.BatchMatMul,BatchToSpaceND:()=>p3.BatchToSpaceND,Bincount:()=>p3.Bincount,BitwiseAnd:()=>p3.BitwiseAnd,BroadcastArgs:()=>p3.BroadcastArgs,BroadcastTo:()=>p3.BroadcastTo,Callback:()=>Ure,CallbackList:()=>_7,Cast:()=>p3.Cast,Ceil:()=>p3.Ceil,ClipByValue:()=>p3.ClipByValue,Complex:()=>p3.Complex,ComplexAbs:()=>p3.ComplexAbs,Concat:()=>p3.Concat,Conv2D:()=>p3.Conv2D,Conv2DBackpropFilter:()=>p3.Conv2DBackpropFilter,Conv2DBackpropInput:()=>p3.Conv2DBackpropInput,Conv3D:()=>p3.Conv3D,Conv3DBackpropFilterV2:()=>p3.Conv3DBackpropFilterV2,Conv3DBackpropInputV2:()=>p3.Conv3DBackpropInputV2,Cos:()=>p3.Cos,Cosh:()=>p3.Cosh,CropAndResize:()=>p3.CropAndResize,Cumprod:()=>p3.Cumprod,Cumsum:()=>p3.Cumsum,CustomCallback:()=>b7,DataStorage:()=>p3.DataStorage,DenseBincount:()=>p3.DenseBincount,DepthToSpace:()=>p3.DepthToSpace,DepthwiseConv2dNative:()=>p3.DepthwiseConv2dNative,DepthwiseConv2dNativeBackpropFilter:()=>p3.DepthwiseConv2dNativeBackpropFilter,DepthwiseConv2dNativeBackpropInput:()=>p3.DepthwiseConv2dNativeBackpropInput,Diag:()=>p3.Diag,Dilation2D:()=>p3.Dilation2D,Dilation2DBackpropFilter:()=>p3.Dilation2DBackpropFilter,Dilation2DBackpropInput:()=>p3.Dilation2DBackpropInput,Draw:()=>p3.Draw,ENV:()=>p3.ENV,EarlyStopping:()=>jre,Einsum:()=>p3.Einsum,Elu:()=>p3.Elu,EluGrad:()=>p3.EluGrad,Environment:()=>p3.Environment,Equal:()=>p3.Equal,Erf:()=>p3.Erf,Exp:()=>p3.Exp,ExpandDims:()=>p3.ExpandDims,Expm1:()=>p3.Expm1,FFT:()=>p3.FFT,Fill:()=>p3.Fill,FlipLeftRight:()=>p3.FlipLeftRight,Floor:()=>p3.Floor,FloorDiv:()=>p3.FloorDiv,FromPixels:()=>p3.FromPixels,FusedBatchNorm:()=>p3.FusedBatchNorm,FusedConv2D:()=>p3.FusedConv2D,FusedDepthwiseConv2D:()=>p3.FusedDepthwiseConv2D,GPGPUContext:()=>vge,GatherNd:()=>p3.GatherNd,GatherV2:()=>p3.GatherV2,GraphModel:()=>poe,Greater:()=>p3.Greater,GreaterEqual:()=>p3.GreaterEqual,History:()=>v7,IFFT:()=>p3.IFFT,Identity:()=>p3.Identity,Imag:()=>p3.Imag,InputSpec:()=>x9,IsFinite:()=>p3.IsFinite,IsInf:()=>p3.IsInf,IsNan:()=>p3.IsNan,KernelBackend:()=>p3.KernelBackend,LRN:()=>p3.LRN,LRNGrad:()=>p3.LRNGrad,LayerVariable:()=>v9,LayersModel:()=>Iee,LeakyRelu:()=>p3.LeakyRelu,Less:()=>p3.Less,LessEqual:()=>p3.LessEqual,LinSpace:()=>p3.LinSpace,Log:()=>p3.Log,Log1p:()=>p3.Log1p,LogSoftmax:()=>p3.LogSoftmax,LogicalAnd:()=>p3.LogicalAnd,LogicalNot:()=>p3.LogicalNot,LogicalOr:()=>p3.LogicalOr,LogicalXor:()=>p3.LogicalXor,LowerBound:()=>p3.LowerBound,MathBackendCPU:()=>Mae,MathBackendWebGL:()=>D_e,MatrixBandPart:()=>p3.MatrixBandPart,Max:()=>p3.Max,MaxPool:()=>p3.MaxPool,MaxPool3D:()=>p3.MaxPool3D,MaxPool3DGrad:()=>p3.MaxPool3DGrad,MaxPoolGrad:()=>p3.MaxPoolGrad,MaxPoolWithArgmax:()=>p3.MaxPoolWithArgmax,Maximum:()=>p3.Maximum,Mean:()=>p3.Mean,Min:()=>p3.Min,Minimum:()=>p3.Minimum,MirrorPad:()=>p3.MirrorPad,Mod:()=>p3.Mod,MomentumOptimizer:()=>p3.MomentumOptimizer,Multinomial:()=>p3.Multinomial,Multiply:()=>p3.Multiply,Neg:()=>p3.Neg,NonMaxSuppressionV3:()=>p3.NonMaxSuppressionV3,NonMaxSuppressionV4:()=>p3.NonMaxSuppressionV4,NonMaxSuppressionV5:()=>p3.NonMaxSuppressionV5,NotEqual:()=>p3.NotEqual,OP_SCOPE_SUFFIX:()=>p3.OP_SCOPE_SUFFIX,OneHot:()=>p3.OneHot,OnesLike:()=>p3.OnesLike,Optimizer:()=>p3.Optimizer,OptimizerConstructors:()=>p3.OptimizerConstructors,Pack:()=>p3.Pack,PadV2:()=>p3.PadV2,Pool:()=>p3.Pool,Pow:()=>p3.Pow,Prelu:()=>p3.Prelu,Prod:()=>p3.Prod,RMSPropOptimizer:()=>p3.RMSPropOptimizer,RNN:()=>Fte,RaggedGather:()=>p3.RaggedGather,RaggedRange:()=>p3.RaggedRange,RaggedTensorToTensor:()=>p3.RaggedTensorToTensor,Range:()=>p3.Range,Rank:()=>p3.Rank,Real:()=>p3.Real,RealDiv:()=>p3.RealDiv,Reciprocal:()=>p3.Reciprocal,Reduction:()=>p3.Reduction,Relu:()=>p3.Relu,Relu6:()=>p3.Relu6,Reshape:()=>p3.Reshape,ResizeBilinear:()=>p3.ResizeBilinear,ResizeBilinearGrad:()=>p3.ResizeBilinearGrad,ResizeNearestNeighbor:()=>p3.ResizeNearestNeighbor,ResizeNearestNeighborGrad:()=>p3.ResizeNearestNeighborGrad,Reverse:()=>p3.Reverse,RotateWithOffset:()=>p3.RotateWithOffset,Round:()=>p3.Round,Rsqrt:()=>p3.Rsqrt,SGDOptimizer:()=>p3.SGDOptimizer,ScatterNd:()=>p3.ScatterNd,SearchSorted:()=>p3.SearchSorted,Select:()=>p3.Select,Selu:()=>p3.Selu,Sequential:()=>Oee,Sigmoid:()=>p3.Sigmoid,Sign:()=>p3.Sign,Sin:()=>p3.Sin,Sinh:()=>p3.Sinh,Slice:()=>p3.Slice,Softmax:()=>p3.Softmax,Softplus:()=>p3.Softplus,SpaceToBatchND:()=>p3.SpaceToBatchND,SparseFillEmptyRows:()=>p3.SparseFillEmptyRows,SparseReshape:()=>p3.SparseReshape,SparseSegmentMean:()=>p3.SparseSegmentMean,SparseSegmentSum:()=>p3.SparseSegmentSum,SparseToDense:()=>p3.SparseToDense,SplitV:()=>p3.SplitV,Sqrt:()=>p3.Sqrt,Square:()=>p3.Square,SquaredDifference:()=>p3.SquaredDifference,StaticRegexReplace:()=>p3.StaticRegexReplace,Step:()=>p3.Step,StridedSlice:()=>p3.StridedSlice,StringNGrams:()=>p3.StringNGrams,StringSplit:()=>p3.StringSplit,StringToHashBucketFast:()=>p3.StringToHashBucketFast,Sub:()=>p3.Sub,Sum:()=>p3.Sum,SymbolicTensor:()=>E9,Tan:()=>p3.Tan,Tanh:()=>p3.Tanh,Tensor:()=>p3.Tensor,TensorBuffer:()=>p3.TensorBuffer,TensorScatterUpdate:()=>p3.TensorScatterUpdate,Tile:()=>p3.Tile,TopK:()=>p3.TopK,Transform:()=>p3.Transform,Transpose:()=>p3.Transpose,Unique:()=>p3.Unique,Unpack:()=>p3.Unpack,UnsortedSegmentSum:()=>p3.UnsortedSegmentSum,UpperBound:()=>p3.UpperBound,Variable:()=>p3.Variable,ZerosLike:()=>p3.ZerosLike,_FusedMatMul:()=>p3._FusedMatMul,abs:()=>p3.abs,acos:()=>p3.acos,acosh:()=>p3.acosh,add:()=>p3.add,addN:()=>p3.addN,all:()=>p3.all,any:()=>p3.any,argMax:()=>p3.argMax,argMin:()=>p3.argMin,asin:()=>p3.asin,asinh:()=>p3.asinh,atan:()=>p3.atan,atan2:()=>p3.atan2,atanh:()=>p3.atanh,avgPool:()=>p3.avgPool,avgPool3d:()=>p3.avgPool3d,backend:()=>p3.backend,backend_util:()=>p3.backend_util,basicLSTMCell:()=>p3.basicLSTMCell,batchNorm:()=>p3.batchNorm,batchNorm2d:()=>p3.batchNorm2d,batchNorm3d:()=>p3.batchNorm3d,batchNorm4d:()=>p3.batchNorm4d,batchToSpaceND:()=>p3.batchToSpaceND,bincount:()=>p3.bincount,bitwiseAnd:()=>p3.bitwiseAnd,booleanMaskAsync:()=>p3.booleanMaskAsync,broadcastArgs:()=>p3.broadcastArgs,broadcastTo:()=>p3.broadcastTo,broadcast_util:()=>p3.broadcast_util,browser:()=>p3.browser,buffer:()=>p3.buffer,callbacks:()=>Yre,cast:()=>p3.cast,ceil:()=>p3.ceil,clipByValue:()=>p3.clipByValue,clone:()=>p3.clone,complex:()=>p3.complex,concat:()=>p3.concat,concat1d:()=>p3.concat1d,concat2d:()=>p3.concat2d,concat3d:()=>p3.concat3d,concat4d:()=>p3.concat4d,constraints:()=>ce,conv1d:()=>p3.conv1d,conv2d:()=>p3.conv2d,conv2dTranspose:()=>p3.conv2dTranspose,conv3d:()=>p3.conv3d,conv3dTranspose:()=>p3.conv3dTranspose,copyRegisteredKernels:()=>p3.copyRegisteredKernels,cos:()=>p3.cos,cosh:()=>p3.cosh,cosineWindow:()=>p3.cosineWindow,cumprod:()=>p3.cumprod,cumsum:()=>p3.cumsum,customGrad:()=>p3.customGrad,data:()=>Le,denseBincount:()=>p3.denseBincount,deprecationWarn:()=>p3.deprecationWarn,depthToSpace:()=>p3.depthToSpace,depthwiseConv2d:()=>p3.depthwiseConv2d,deregisterOp:()=>Kre,device_util:()=>p3.device_util,diag:()=>p3.diag,dilation2d:()=>p3.dilation2d,disableDeprecationWarnings:()=>p3.disableDeprecationWarnings,dispose:()=>p3.dispose,disposeVariables:()=>p3.disposeVariables,div:()=>p3.div,divNoNan:()=>p3.divNoNan,dot:()=>p3.dot,dropout:()=>p3.dropout,einsum:()=>p3.einsum,elu:()=>p3.elu,enableDebugMode:()=>p3.enableDebugMode,enableProdMode:()=>p3.enableProdMode,enclosingPowerOfTwo:()=>p3.enclosingPowerOfTwo,engine:()=>p3.engine,ensureShape:()=>p3.ensureShape,env:()=>p3.env,equal:()=>p3.equal,erf:()=>p3.erf,euclideanNorm:()=>p3.euclideanNorm,exp:()=>p3.exp,expandDims:()=>p3.expandDims,expm1:()=>p3.expm1,eye:()=>p3.eye,fft:()=>p3.fft,fill:()=>p3.fill,findBackend:()=>p3.findBackend,findBackendFactory:()=>p3.findBackendFactory,floor:()=>p3.floor,floorDiv:()=>p3.floorDiv,forceHalfFloat:()=>L_e,fused:()=>p3.fused,gather:()=>p3.gather,gatherND:()=>p3.gatherND,gather_util:()=>p3.gather_util,getBackend:()=>p3.getBackend,getGradient:()=>p3.getGradient,getKernel:()=>p3.getKernel,getKernelsForBackend:()=>p3.getKernelsForBackend,gpgpu_util:()=>$e,grad:()=>p3.grad,grads:()=>p3.grads,greater:()=>p3.greater,greaterEqual:()=>p3.greaterEqual,ifft:()=>p3.ifft,imag:()=>p3.imag,image:()=>p3.image,inTopKAsync:()=>p3.inTopKAsync,initializers:()=>de,input:()=>Ree,io:()=>p3.io,irfft:()=>p3.irfft,isFinite:()=>p3.isFinite,isInf:()=>p3.isInf,isNaN:()=>p3.isNaN,keep:()=>p3.keep,kernel_impls:()=>p3.kernel_impls,layers:()=>he,leakyRelu:()=>p3.leakyRelu,less:()=>p3.less,lessEqual:()=>p3.lessEqual,linalg:()=>p3.linalg,linspace:()=>p3.linspace,loadGraphModel:()=>foe,loadGraphModelSync:()=>moe,loadLayersModel:()=>Cee,localResponseNormalization:()=>p3.localResponseNormalization,log:()=>p3.log,log1p:()=>p3.log1p,logSigmoid:()=>p3.logSigmoid,logSoftmax:()=>p3.logSoftmax,logSumExp:()=>p3.logSumExp,logicalAnd:()=>p3.logicalAnd,logicalNot:()=>p3.logicalNot,logicalOr:()=>p3.logicalOr,logicalXor:()=>p3.logicalXor,losses:()=>p3.losses,lowerBound:()=>p3.lowerBound,matMul:()=>p3.matMul,math:()=>p3.math,max:()=>p3.max,maxPool:()=>p3.maxPool,maxPool3d:()=>p3.maxPool3d,maxPoolWithArgmax:()=>p3.maxPoolWithArgmax,maximum:()=>p3.maximum,mean:()=>p3.mean,memory:()=>p3.memory,meshgrid:()=>p3.meshgrid,metrics:()=>pe,min:()=>p3.min,minimum:()=>p3.minimum,mirrorPad:()=>p3.mirrorPad,mod:()=>p3.mod,model:()=>Mee,models:()=>fe,moments:()=>p3.moments,movingAverage:()=>p3.movingAverage,mul:()=>p3.mul,multiRNNCell:()=>p3.multiRNNCell,multinomial:()=>p3.multinomial,neg:()=>p3.neg,nextFrame:()=>p3.nextFrame,norm:()=>p3.norm,notEqual:()=>p3.notEqual,oneHot:()=>p3.oneHot,ones:()=>p3.ones,onesLike:()=>p3.onesLike,op:()=>p3.op,outerProduct:()=>p3.outerProduct,pad:()=>p3.pad,pad1d:()=>p3.pad1d,pad2d:()=>p3.pad2d,pad3d:()=>p3.pad3d,pad4d:()=>p3.pad4d,pool:()=>p3.pool,pow:()=>p3.pow,prelu:()=>p3.prelu,print:()=>p3.print,prod:()=>p3.prod,profile:()=>p3.profile,raggedGather:()=>p3.raggedGather,raggedRange:()=>p3.raggedRange,raggedTensorToTensor:()=>p3.raggedTensorToTensor,rand:()=>p3.rand,randomGamma:()=>p3.randomGamma,randomNormal:()=>p3.randomNormal,randomStandardNormal:()=>p3.randomStandardNormal,randomUniform:()=>p3.randomUniform,randomUniformInt:()=>p3.randomUniformInt,range:()=>p3.range,ready:()=>p3.ready,real:()=>p3.real,reciprocal:()=>p3.reciprocal,registerBackend:()=>p3.registerBackend,registerCallbackConstructor:()=>Nee,registerGradient:()=>p3.registerGradient,registerKernel:()=>p3.registerKernel,registerOp:()=>Xre,regularizers:()=>me,relu:()=>p3.relu,relu6:()=>p3.relu6,removeBackend:()=>p3.removeBackend,reshape:()=>p3.reshape,reverse:()=>p3.reverse,reverse1d:()=>p3.reverse1d,reverse2d:()=>p3.reverse2d,reverse3d:()=>p3.reverse3d,reverse4d:()=>p3.reverse4d,rfft:()=>p3.rfft,round:()=>p3.round,rsqrt:()=>p3.rsqrt,scalar:()=>p3.scalar,scatterND:()=>p3.scatterND,scatter_util:()=>p3.scatter_util,searchSorted:()=>p3.searchSorted,selu:()=>p3.selu,separableConv2d:()=>p3.separableConv2d,sequential:()=>kee,serialization:()=>p3.serialization,setBackend:()=>p3.setBackend,setPlatform:()=>p3.setPlatform,setWebGLContext:()=>hfe,setdiff1dAsync:()=>p3.setdiff1dAsync,shared:()=>Pe,sigmoid:()=>p3.sigmoid,sign:()=>p3.sign,signal:()=>p3.signal,sin:()=>p3.sin,sinh:()=>p3.sinh,slice:()=>p3.slice,slice1d:()=>p3.slice1d,slice2d:()=>p3.slice2d,slice3d:()=>p3.slice3d,slice4d:()=>p3.slice4d,slice_util:()=>p3.slice_util,softmax:()=>p3.softmax,softplus:()=>p3.softplus,spaceToBatchND:()=>p3.spaceToBatchND,sparse:()=>p3.sparse,sparseToDense:()=>p3.sparseToDense,spectral:()=>p3.spectral,split:()=>p3.split,sqrt:()=>p3.sqrt,square:()=>p3.square,squaredDifference:()=>p3.squaredDifference,squeeze:()=>p3.squeeze,stack:()=>p3.stack,step:()=>p3.step,stridedSlice:()=>p3.stridedSlice,string:()=>p3.string,sub:()=>p3.sub,sum:()=>p3.sum,sumOutType:()=>p3.sumOutType,tan:()=>p3.tan,tanh:()=>p3.tanh,tensor:()=>p3.tensor,tensor1d:()=>p3.tensor1d,tensor2d:()=>p3.tensor2d,tensor3d:()=>p3.tensor3d,tensor4d:()=>p3.tensor4d,tensor5d:()=>p3.tensor5d,tensor6d:()=>p3.tensor6d,tensorScatterUpdate:()=>p3.tensorScatterUpdate,tensor_util:()=>p3.tensor_util,test_util:()=>p3.test_util,tidy:()=>p3.tidy,tile:()=>p3.tile,time:()=>p3.time,topk:()=>p3.topk,train:()=>p3.train,transpose:()=>p3.transpose,truncatedNormal:()=>p3.truncatedNormal,unique:()=>p3.unique,unregisterGradient:()=>p3.unregisterGradient,unregisterKernel:()=>p3.unregisterKernel,unsortedSegmentSum:()=>p3.unsortedSegmentSum,unstack:()=>p3.unstack,upcastType:()=>p3.upcastType,upperBound:()=>p3.upperBound,util:()=>p3.util,valueAndGrad:()=>p3.valueAndGrad,valueAndGrads:()=>p3.valueAndGrads,variable:()=>p3.variable,variableGrads:()=>p3.variableGrads,version:()=>Mwe,version_converter:()=>goe,version_core:()=>p3.version_core,version_cpu:()=>ice,version_layers:()=>see,version_webgl:()=>F_e,webgl:()=>P_e,webgl_util:()=>Be,where:()=>p3.where,whereAsync:()=>p3.whereAsync,zeros:()=>p3.zeros,zerosLike:()=>p3.zerosLike});const Ve=Blockly;Object.assign(Ve.Lang.ZhHans,{PYTHON_PYODIDE_IMAGE:"图像",PYTHON_PYODIDE_TOOL:"可教机器",PYTHON_PYODIDE_GAME:"生命游戏",PYTHON_PYODIDE_GAME_EPOCH:"代数",PYTHON_PYODIDE_GAME_START:"开始",PYTHON_PYODIDE_GAME_PAUSE:"暂停",PYTHON_PYODIDE_GAME_RANDOM:"随机初始化",PYTHON_PYODIDE_GAME_RESET:"重置",PYTHON_PYODIDE_LOADING:"Python3内核载入中...",PYTHON_PYODIDE_FILE_SYSTEM:"本地文件系统",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"载入本地文件夹"}),Object.assign(Ve.Lang.ZhHant,{PYTHON_PYODIDE_IMAGE:"影像",PYTHON_PYODIDE_TOOL:"可教機器",PYTHON_PYODIDE_GAME:"生命遊戲",PYTHON_PYODIDE_GAME_EPOCH:"代數",PYTHON_PYODIDE_GAME_START:"開始",PYTHON_PYODIDE_GAME_PAUSE:"暫停",PYTHON_PYODIDE_GAME_RANDOM:"隨機初始化",PYTHON_PYODIDE_GAME_RESET:"重置",PYTHON_PYODIDE_LOADING:"Python3核心載入...",PYTHON_PYODIDE_FILE_SYSTEM:"本機檔案系統",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"載入本機資料夾"}),Object.assign(Ve.Lang.En,{PYTHON_PYODIDE_IMAGE:"Image",PYTHON_PYODIDE_TOOL:"Teachable Machine",PYTHON_PYODIDE_GAME:"Game of Life",PYTHON_PYODIDE_GAME_EPOCH:"Iterations",PYTHON_PYODIDE_GAME_START:"Start",PYTHON_PYODIDE_GAME_PAUSE:"Pause",PYTHON_PYODIDE_GAME_RANDOM:"Random Initialization",PYTHON_PYODIDE_GAME_RESET:"Reset",PYTHON_PYODIDE_LOADING:"Python3 kernel loading...",PYTHON_PYODIDE_FILE_SYSTEM:"Local File System",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"Load Local Folder"}),Object.assign(Ve.Lang.ZhHans.MSG,{}),Object.assign(Ve.Lang.ZhHant.MSG,{}),Object.assign(Ve.Lang.En.MSG,{});const ze=Mixly,je={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),i=0;i1&&(o+=i)):n=o}else n="i";return n}},Ye=je; /** * @license * Visual Blocks Editor @@ -10130,34 +10130,34 @@ function Qge(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try * See the License for the specific language governing permissions and * limitations under the License. */ -class Ge{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),i=0;i0;r--)t.getInputTargetBlock("IF"+r)&&t.getInputTargetBlock("IF"+r).previousConnection?n[r]=t.getInputTargetBlock("IF"+r).previousConnection:n[r]=null,this.removeInput("IF"+r),t.getInputTargetBlock("DO"+r)&&t.getInputTargetBlock("DO"+r).previousConnection?i[r]=t.getInputTargetBlock("DO"+r).previousConnection:i[r]=null,this.removeInput("DO"+r);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(r=1;r<=this.elseifCount_;r++)this.appendValueInput("IF"+r).setCheck([Boolean,Number]).appendField(Ve.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+r).appendField(Ve.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.CONTROLS_IF_MSG_ELSE);for(r=n.length-2;r>0;r--)n[r]&&n[r].reconnect(this,"IF"+r);for(r=i.length-2;r>0;r--)i[r]&&i[r].reconnect(this,"DO"+r)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var r=e.newBlock("controls_if_elseif");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}if(this.elseCount_){var s=e.newBlock("controls_if_else");s.initSvg(),n.connect(s.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),i=[null],r=[null],s=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),r.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,s=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,r,s)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,n++;break;case"controls_if_else":r=this.getInput("ELSE");t.statementConnection_=r&&r.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var r=this.getInput("IF"+i),s=this.getInput("DO"+i);console.log(r.connection.targetConnection),e.push(r.connection.targetConnection),t.push(s.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(Ve.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(Ve.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var i=1;i<=this.elseifCount_;i++)e[i]&&e[i].reconnect(this,"IF"+i),t[i]&&t[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(rt),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PYTHON_RANGE).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},dt={init:function(){this.setColour(rt),this.appendValueInput("LIST").setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Ve.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(function(){return Ve.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ht={init:function(){this.setColour(rt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Ve.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Ve.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Ve.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return{WHILE:Ve.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Ve.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]})}},pt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var r=this.elseifCount_;r>0;r--)t.getInputTargetBlock("IF"+r)&&t.getInputTargetBlock("IF"+r).previousConnection?n[r]=t.getInputTargetBlock("IF"+r).previousConnection:n[r]=null,this.removeInput("IF"+r),t.getInputTargetBlock("DO"+r)&&t.getInputTargetBlock("DO"+r).previousConnection?i[r]=t.getInputTargetBlock("DO"+r).previousConnection:i[r]=null,this.removeInput("DO"+r);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(r=1;r<=this.elseifCount_;r++)this.appendValueInput("IF"+r).setCheck([Boolean,Number]).appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+r).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.MIXLY_PYTHON_FINALLY);for(r=n.length-2;r>0;r--)n[r]&&n[r].reconnect(this,"IF"+r);for(r=i.length-2;r>0;r--)i[r]&&i[r].reconnect(this,"DO"+r)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var r=e.newBlock("controls_except");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}if(this.elseCount_){var s=e.newBlock("controls_finally");s.initSvg(),n.connect(s.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),i=[null],r=[null],s=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),r.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,s=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,r,s)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,n++;break;case"controls_finally":r=this.getInput("ELSE");t.statementConnection_=r&&r.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var r=this.getInput("IF"+i),s=this.getInput("DO"+i);console.log(r.connection.targetConnection),e.push(r.connection.targetConnection),t.push(s.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var i=1;i<=this.elseifCount_;i++)e[i]&&e[i].reconnect(this,"IF"+i),t[i]&&t[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ft={init:function(){this.setColour(rt);var e=new Ve.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip(function(){var e=t.getFieldValue("FLOW");return{BREAK:Ve.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Ve.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]})},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},mt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Ve.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Ve.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},gt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Ve.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Ve.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};ht.OPERATORS=[[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ft.OPERATORS=[[Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const _t={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},yt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},vt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},bt={init:function(){this.setColour(rt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Tt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},xt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Et={init:function(){this.jsonInit({message0:Ve.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:rt,tooltip:Ve.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Ve.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},wt={init:function(){this.setColour(rt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_STAT),this.setOutput(!0)}},It={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},At={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(Ve.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Ve.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Ve.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Ve.FieldDropdown([[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(rt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Ct={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ot={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Mt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},kt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET+Ve.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_GET_UNIQUE_IDEN)}},Rt={init:function(){this.setColour(rt),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Nt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},Dt=230;Ve.FieldTextInput.math_number_validator=function(e){return String(e)},Ve.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const Ft={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new Ve.FieldTextInput("0",Ve.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MATH_NUMBER_TOOLTIP)}},Lt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Ve.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip(function(){var t=e.getFieldValue("CONSTANT");return{pi:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]})}},Pt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Ve.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip(function(){var t=e.getFieldValue("CONSTANT");return{pi:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]})}},Bt={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{ADD:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Ve.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]})}},$t={init:function(){this.setColour(Dt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{ADD:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Ve.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]})}},Ut={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Ve.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Vt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{SIN:Ve.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Ve.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Ve.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Ve.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Ve.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Ve.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Ve.Msg.MATH_SINGLE_TOOLTIP_LN}[t]})}},zt={init:function(){var e=[[Ve.Msg.MATH_BIN,"bin"],[Ve.Msg.MATH_OCT,"oct"],[Ve.Msg.MATH_HEX,"hex"]];this.setColour(Dt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP");var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{bin:Ve.Msg.MATH_DEC_TOOLTIP_BIN,oct:Ve.Msg.MATH_DEC_TOOLTIP_OCT,hex:Ve.Msg.MATH_DEC_TOOLTIP_HEX}[e]})}},jt={init:function(){var e=[[Ve.Msg.LANG_MATH_TO_ROUND,"round"],[Ve.Msg.LANG_MATH_TO_CEIL,"ceil"],[Ve.Msg.LANG_MATH_TO_FLOOR,"floor"],[Ve.Msg.MATH_ABS,"fabs"],[Ve.Msg.MATH_SQRT,"sqrt"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{sqrt:Ve.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Ve.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Ve.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Ve.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Ve.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Ve.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]})}},Yt={init:function(){var e=[[Ve.Msg.MIXLY_MAX,"max"],[Ve.Msg.MIXLY_MIN,"min"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{max:Ve.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Ve.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]})}},Gt={init:function(){var e=[[Ve.Msg.MATH_TWO,"two"],[Ve.Msg.MATH_EIGHT,"eight"],[Ve.Msg.MATH_TEN,"ten"],[Ve.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Dt),this.appendDummyInput("").appendField(Ve.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Ve.FieldDropdown(e),"OP").appendField(Ve.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Ve.Msg.MATH_ZHW).appendField(new Ve.FieldDropdown(e),"OP2").appendField(Ve.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP"),n={two:Ve.Msg.MATH_Before_two,eight:Ve.Msg.MATH_Before_eight,ten:Ve.Msg.MATH_Before_ten,sixteen:Ve.Msg.MATH_Before_sixteen},i=t.getFieldValue("OP2"),r={two:Ve.Msg.MATH_Behind_two,eight:Ve.Msg.MATH_Behind_eight,ten:Ve.Msg.MATH_Behind_ten,sixteen:Ve.Msg.MATH_Behind_sixteen};return n[e]+r[i]})}},Ht={init:function(){var e=[[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Dt),this.setOutput(!0,Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Ve.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TYPE"),n={int:Ve.Msg.LANG_MATH_INT,float:Ve.Msg.LANG_MATH_FLOAT_RANDOM};return Ve.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]})}},Wt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MATH_CONSTRAIN_TOOLTIP)}},Xt={init:function(){this.setColour(Dt),this.appendValueInput("NUM",Number).appendField(Ve.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Ve.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Ve.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_MATH_MAP)}},qt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new Ve.FieldTextInput("0",Ve.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Ve.Msg.MATH_NUMBER_TOOLTIP)}},Kt={init:function(){this.setColour(Dt),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Zt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MATH_ROUND).appendField(Ve.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Ve.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MATH_ROUND_NEW_TOOLTIP)}},Qt={init:function(){var e=[[Ve.Msg.MIXLY_TO_INT,"int"],[Ve.Msg.MIXLY_TO_FLOAT,"float"],[Ve.Msg.MIXLY_TO_BITES,"b"],[Ve.Msg.LANG_MATH_BYTE+Ve.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{int:Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]})}},Jt={init:function(){var e=[[Ve.Msg.MIXLY_TO_INT,"int"],[Ve.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{int:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]})}},en=Xt,tn={init:function(){this.setColour(Dt),this.appendValueInput("VAR").appendField(Ve.Msg.LANG_MATH_BYTE+Ve.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},nn={init:function(){this.setColour(Dt),this.itemCount_=1,this.setMutator(new Ve.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Ve.Msg.MIXLY_PRODUCT+Ve.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Ve.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const cn={init:function(){this.setColour(on),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput("",Ve.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new Ve.FieldImage(t,7,12,'"')}},dn={init:function(){this.setColour(on),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Ve.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},hn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},fn={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},mn={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},gn={init:function(){this.WHERE_OPTIONS=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.TEXT_GET_INDEX_RANDOM+1+Ve.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.LISTS_GET_INDEX_GET,"MODE"),Ve.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Ve.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),i="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Ve.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Ve.Msg.ONE_BASED_INDEXING?"#1":"#0")),i});var t=this;this.setTooltip(function(){var e=t.getFieldValue("WHERE"),n={FROM_START:Ve.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Ve.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Ve.Msg.TEXT_GET_INDEX_RANDOM};return Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+Ve.Msg.TEXT_CHARAT2})},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==Ve.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),Ve.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Ve.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new Ve.FieldDropdown(this.WHERE_OPTIONS,function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(t,"WHERE"),Ve.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},_n={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LISTS_GET_INDEX_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+Ve.Msg.LISTS_GET_INDEX_FROM_START+"n"+Ve.Msg.TEXT_CHARAT2)}},yn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Ve.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Ve.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},vn={init:function(){this.WHERE_OPTIONS_1=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Ve.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(Ve.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==Ve.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),Ve.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(Ve.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new Ve.FieldDropdown(this["WHERE_OPTIONS_"+e],function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=t){var r=this.sourceBlock_;return r.updateAt_(e,i),r.setFieldValue(n,"WHERE"+e),null}});this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},bn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Ve.Msg.LISTS_GET_INDEX_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Ve.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Tn={init:function(){var e=[[Ve.Msg.MIXLY_EQUALS,"==="],[Ve.Msg.MIXLY_STARTSWITH,"startswith"],[Ve.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(on),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Ve.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},xn={init:function(){this.setColour(on),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Ve.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_COMPARETO_HELP)}},En={init:function(){var e=[[Ve.Msg.TEXT_UPPER,"upper"],[Ve.Msg.TEXT_TITLE,"title"],[Ve.Msg.TEXT_CAPITALIZE,"capitalize"],[Ve.Msg.TEXT_SWAPCASE,"swapcase"],[Ve.Msg.TEXT_LOWER,"lower"]];this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip(function(){var e=t.getFieldValue("CAPITAL");return{upper:Ve.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Ve.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Ve.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Ve.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Ve.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]})}},wn={init:function(){var e=[[Ve.Msg.TEXT_LJUST,"ljust"],[Ve.Msg.TEXT_CENTER,"center"],[Ve.Msg.TEXT_RJUST,"rjust"]];this.setColour(on),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Ve.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Ve.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},In={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Ve.Msg.MIXLY_MID+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Ve.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},An={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Sn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Ve.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Ve.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Cn={init:function(){this.setColour(on),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Ve.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Ve.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},On={init:function(){var e=[[Ve.Msg.TEXT_TRIM_BOTH,"strip"],[Ve.Msg.TEXT_TRIM_LEFT,"lstrip"],[Ve.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(on),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(Ve.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{strip:Ve.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Ve.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Ve.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]})}},Mn={init:function(){this.setColour(on),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Ve.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;it?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ai={init:function(){this.setColour(wi),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Si={init:function(){this.setColour(wi),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ci={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_KEYS),this.setTooltip(Ve.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Oi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Ve.Msg.DICTS_GET_TOOLTIP)}},Mi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Ve.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},ki={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ri={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_DELETE_TOOLTIP)}},Ni={init:function(){this.setColour(wi),this.appendValueInput("DICT2").setCheck("Dict").appendField(Ve.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Ve.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MID),this.setTooltip(Ve.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_CLEAR),this.setTooltip(Ve.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_ITEMS),this.setTooltip(Ve.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Li={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_VALUES),this.setTooltip(Ve.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_LENGTH),this.setTooltip(Ve.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Bi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_DELDICT),this.setTooltip(Ve.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$i={init:function(){this.MODE=[[Ve.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Ve.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Ve.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=Ve.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=Ve.Msg.DICTS_DELETE_TOOLTIP}return t})},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new Ve.FieldDropdown(this.MODE,function(t){var n="INSERT"==t;if(n!=e){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(t,"WHERE"),null}});this.getInput("AT2").appendField(t,"WHERE")}},Ui={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setTooltip(Ve.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Vi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_SETDEFAULT_TOOLTIP)}},zi={init:function(){this.setColour(wi),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.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 Ve.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;it?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ji={init:function(){this.setColour(wi),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Yi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gi={init:function(){this.setColour(wi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi=210,qi={init:function(){var e=Ve.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{EQ:Ve.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Ve.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Ve.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Ve.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Ve.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Ve.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]}),this.prevBlocks_=[null,null]}},Ki={init:function(){var e=Ve.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=Ve.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new Ve.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Zi={init:function(){var e=[[Ve.Msg.LOGIC_OPERATION_AND,"AND"],[Ve.Msg.LOGIC_OPERATION_OR,"OR"],[Ve.Msg.LOGIC_OPERATION_NOR,"NOR"],[Ve.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{AND:Ve.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]})}},Qi={init:function(){this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Ve.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Ve.Msg.LOGIC_NEGATE_TOOLTIP)}},Ji={init:function(){var e=[[Ve.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Ve.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Ve.FieldDropdown(e),"BOOL"),this.setTooltip(Ve.Msg.LOGIC_BOOLEAN_TOOLTIP)}},er={init:function(){this.setColour(Xi),this.setOutput(!0),this.appendDummyInput().appendField(Ve.Msg.LOGIC_NULL),this.setTooltip(Ve.Msg.LOGIC_NULL_TOOLTIP)}},tr={init:function(){this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").appendField(Ve.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Ve.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},nr={init:function(){var e=[[Ve.Msg.TEXT_APPEND_TO,"in"],[Ve.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Ve.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(Ve.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Ve.Msg.IN)}},ir={init:function(){var e=[[Ve.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Ve.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},rr={init:function(){this.setColour(Xi),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},sr={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Ve.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},or={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"],[Ve.Msg.MIXLY_ADD,"a"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_ADD,"ab"],[Ve.Msg.MIXLY_R_W,"r+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_R_W,"rb+"],[Ve.Msg.MIXLY_W_R,"w+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_W_R,"wb+"],[Ve.Msg.MIXLY_A_R,"a+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_A_R,"ab+"]]),"MODE"),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ar={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG,o=Ve.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r+o})}},lr={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.MIXPY_TEXT_ENCODE).appendField(new Ve.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG,o=Ve.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r+o})}},ur={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},cr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},dr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+i})}},hr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MICROBIT_PYTHON_TYPE)}},pr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.HTML_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},fr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},mr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},gr={init:function(){this.setColour(0),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const _r={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Ve.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(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},yr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},vr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},br={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+r+"x"+i})}},Tr={init:function(){this.setColour(0),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},xr={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Ve.Msg.MIXLY_ESP32_SET+{mkdir:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]})}},Er={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Ve.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},wr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Ir={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_FILE,"isfile"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]})}},Ar={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SETUP+Ve.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Ve.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Sr={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Ve.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){var e=Ve.Procedures.findLegalName("",this),t=new Ve.FieldTextInput(e,Ve.Procedures.rename);t.setSpellcheck(!1),this.appendDummyInput().appendField(t,"NAME").appendField("","PARAMS"),this.setMutator(new Ve.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Ve.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Ve.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Ve.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(Ve.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){var e="";this.arguments_.length&&(e=Ve.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Ve.Events.disable();try{this.setFieldValue(e,"PARAMS")}finally{Ve.Events.enable()}},mutationToDom:function(e){var t=Ve.utils.xml.createElement("mutation");e&&t.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ws={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_FORM_CONTENT).appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_TEXT,"text"],[Ve.Msg.HTML_EMAIL,"email"],[Ve.Msg.HTML_NUMBER,"number"],[Ve.Msg.HTML_PASSWORD,"password"],[Ve.Msg.HTML_CHECKBOX,"checkbox"],[Ve.Msg.HTML_RADIOBUTTON,"radiobutton"],[Ve.Msg.HTML_BUTTON,"button"],[Ve.Msg.HTML_COLOUR,"colour"],[Ve.Msg.HTML_DATE,"date"],[Ve.Msg.HTML_LOCALTIME,"local time"],[Ve.Msg.HTML_FILE,"file"],[Ve.Msg.HTML_HIDDEN,"hidden"],[Ve.Msg.HTML_IMAGE,"image"],[Ve.Msg.HTML_MONTH,"month"],[Ve.Msg.HTML_RANGE,"range"],[Ve.Msg.HTML_RESET,"reset"],[Ve.Msg.HTML_SEARCH,"search"],[Ve.Msg.HTML_SUBMIT,"submit"],[Ve.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Ve.Msg.HTML_TIME,"time"],[Ve.Msg.HTML_URL,"url"],[Ve.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Ve.Msg.HTML_NAME).appendField(new Ve.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Ve.Msg.HTML_VALUE).appendField(new Ve.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Is={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldTextInput("property"),"KEY").appendField(":").appendField(new Ve.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},As={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldTextInput("property"),"KEY").appendField(":").appendField(new Ve.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_TEXT).appendField(new Ve.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs=160,Os={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Ve.FieldTable(""),"TEXT")}},Ms={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Ve.FieldMultilineInput(""),"TEXT")}},ks={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Ve.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Rs={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ns={init:function(){this.setColour(Cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Ve.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ds={init:function(){this.setColour(Cs),this.appendValueInput("VALUE").appendField(Ve.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Fs={init:function(){this.setColour(Cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Ve.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=Ve.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+l()+"("+e+", "+t+", "+n+") or "+u()+"("+e+", "+t+", "+n+")"},Ve.isNumber(i)&&Ve.isNumber(r)&&Ve.isNumber(s))i=parseFloat(i),r=parseFloat(r),s=Math.abs(parseFloat(s)),0==i%1&&0==r%1&&0==s%1?(i<=r?(r++,e=0==i&&1==s?r:i+", "+r,1!=s&&(e+=", "+s)):e=i+", "+--r+", -"+s,e="range("+e+")"):(e=i",GTE:">="};const kl=function(e,t){var n=this.getFieldValue("OP"),i="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,r=t.valueToCode(this,"A",i)||"False",s=t.valueToCode(this,"B",i)||"False";if("AND"==n)var o=r+" and "+s;else if("OR"==n)o=r+" or "+s;else if("NOR"==n)o="not("+r+"^"+s+")";else o=r+"^"+s;return[o,i]},Rl=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},Nl=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},Dl=function(e,t){return["None",t.ORDER_ATOMIC]},Fl=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},Ll=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,t.ORDER_ATOMIC]},Pl=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,t.ORDER_ATOMIC]},Bl=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},$l=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},Ul=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Vl=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},zl=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},jl=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},Yl=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},Gl=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Hl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Wl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},Xl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},ql=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},Kl=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},Zl=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},Ql=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Jl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},eu=function(e,t){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+i+")\n"},tu=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},nu=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},iu=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},ru=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},su=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},ou=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},au=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},lu=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),Ve.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(i=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var r=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";r&&(r=" return "+r+"\n");for(var s=[],o=0;o\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},Yu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},Gu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var r="<"+i+'>\n\t\n'+n+"\n";else r="<"+i+">\n"+n+"\n";return r},Hu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},Wu=function(e,t){var n=t.statementToCode(this,"DO"),i=t.valueToCode(this,"style"),r=this.getFieldValue("LEVEL");return"<"+r+" "+i+" >\n"+n+"\n"},Xu=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},qu=function(e,t){return'"},Ku=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Zu=function(){return this.getFieldValue("TEXT")+"\n"},Qu=function(e){return e.getFieldValue("TEXT")+"\n"},Ju=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},ec=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},tc=function(){return""},nc=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},ic=function(e,t){for(var n=e.getFieldValue("NAME"),i=e.hasReturn_,r=new Array(e.itemCount_),s=0;s0?t.join("\n")+n.join("\n")+i.join("\n")+o.join("\n")+a.join("")+e+"while True:\n"+l.join("")+u.join("\n"):t.join("\n")+n.join("\n")+i.join("\n")+o.join("\n")+a.join("")+e+u.join("\n")},ac.scrubNakedValue=function(e){return e+"\n"},ac.quote_=function(e){var t="'";return-1!==e.indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},ac.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},ac.scrub_=function(e,t,n){var i="";if(!e.outputConnection||!e.outputConnection.targetConnection){(s=e.getCommentText())&&(s=Ve.utils.string.wrap(s,ac.COMMENT_WRAP-3),i+=ac.prefixLines(s+"\n","# "));for(var r=0;r0?"int("+a+" + "+r+")":r<0?"int("+a+" - "+-r+")":"int("+a+")",i&&(a="-"+a)),a};const lc=205,uc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_CHOOSE_AND_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[Ve.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[Ve.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},cc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SETUP).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[Ve.Msg.MIXLY_AipSpeech,"AipSpeech"],[Ve.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[Ve.Msg.MIXLY_AipFace,"AipFace"],[Ve.Msg.MIXLY_AipOcr,"AipOcr"],[Ve.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipSpeech_synthesis).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.OLED_STRING).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},hc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipSpeech_asr).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_AipSpeech_File).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},pc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipImageClassify).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},fc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[Ve.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[Ve.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[Ve.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[Ve.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[Ve.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},mc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipFace_match).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image+"1"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(Ve.Msg.MIXLY_AipImageClassify_Image+"2"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},gc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipOcr).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},_c={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[Ve.Msg.MIXLY_AipOcr_webImage,"webImage"],[Ve.Msg.MIXLY_AipOcr_idcard,"idcard"],[Ve.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[Ve.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[Ve.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[Ve.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[Ve.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[Ve.Msg.MIXLY_AipOcr_receipt,"receipt"],[Ve.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[Ve.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[Ve.Msg.MIXLY_AipOcr_form,"tableRecognition"],[Ve.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[Ve.Msg.MIXLY_AipOcr_passport,"passport"],[Ve.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},yc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.OLED_STRING).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},vc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_Sim).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(Ve.Msg.OLED_STRING+"1").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(Ve.Msg.OLED_STRING+"2").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},bc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipNlp_lexer,"lexer"],[Ve.Msg.MIXLY_AipNlp_depParser,"depParser"],[Ve.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[Ve.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[Ve.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[Ve.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[Ve.Msg.MIXLY_AipNlp_keyword,"keyword"],[Ve.Msg.MIXLY_AipNlp_topic,"topic"],[Ve.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[Ve.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Tc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[Ve.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},xc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_topic).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Title).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Content).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Ec={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_summary).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Content).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(Ve.Msg.MIXLY_LIST_LEN).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},wc={init:function(){this.setColour(lc),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(Ve.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Ic={init:function(){this.setColour(lc),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(Ve.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},Ac={init:function(){this.setColour(lc),this.appendValueInput("AI").appendField(Ve.Msg.MIXPY_AI_RESULT).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify,"Image"],[Ve.Msg.MIXLY_AipSpeech_asr,"Speech"],[Ve.Msg.MIXLY_AipFace_match,"Face"],[Ve.Msg.MIXLY_AipOcr,"Ocr"],[Ve.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[Ve.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(Ve.Msg.LOGIC_NEGATE_TOOLTIP)}},Sc="#526FC3",Cc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Oc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Mc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},Rc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Nc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Fc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Lc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},Pc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Bc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$c={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},Uc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Vc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},Gc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},Hc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wc={init:function(){this.appendDummyInput().appendField("准备").appendField(new Ve.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Xc={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},qc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Kc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Qc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},Jc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},ed={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},td={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},nd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},id={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},rd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},od={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ad={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ld={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new Ve.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},ud={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},cd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField("n"+Ve.Msg.MIXLY_VALUE2).appendField(new Ve.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},md={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},gd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},_d={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},yd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},vd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},bd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Td={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},xd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Ed={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("计算").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},wd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Id={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Ad={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Sd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Cd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Od={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new Ve.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Md={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("使士兵").appendField(new Ve.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},kd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("剩余").appendField(new Ve.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Rd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Nd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Dd={init:function(){this.appendDummyInput().appendField("准备").appendField(new Ve.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},Fd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ld={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},Pd={init:function(){this.setColour(Sc),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Bd="#3288dd",$d={init:function(){this.setColour(Bd),this.appendValueInput("DOMAIN").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_REQUESTS_GET).appendField(new Ve.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ud={init:function(){this.setColour(Bd),this.appendValueInput("URL").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(Ve.Msg.blockpy_REQUESTS).appendField(Ve.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Vd={init:function(){this.setColour(Bd),this.appendValueInput("URL").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(Ve.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(Ve.Msg.blockpy_REQUESTS+Ve.Msg.OLED_STRING),this.appendDummyInput("").appendField(Ve.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},zd={init:function(){this.appendValueInput("VAL");var e=[[Ve.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[Ve.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Bd),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Ve.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},jd={init:function(){this.appendValueInput("VAR").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Bd),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("DIR");return{forward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]})}},Yd="f0a559",Gd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},Hd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Xd={init:function(){this.setColour(Yd),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MILLIS+Ve.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},qd={init:function(){this.setColour(Yd),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Kd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE);var e=[[Ve.Msg.MIXLY_CV_RECT,"rectangle"],[Ve.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Zd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new Ve.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Qd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},Jd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(Ve.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},eh={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(Ve.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(Ve.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(Ve.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},th=170,nh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_series_create).appendField(new Ve.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ih={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_series_create).appendField(new Ve.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},rh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},sh={init:function(){this.setColour(th);var e=[[Ve.Msg.DATAFRAME_RAW,"index"],[Ve.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},oh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ah={init:function(){this.setColour(th),this.appendDummyInput("").appendField(new Ve.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new Ve.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},lh={init:function(){this.setColour(th);var e=[[Ve.Msg.SERIES_INDEX,"index"],[Ve.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(Ve.Msg.SERIES_INDEX_VALUE).appendField(new Ve.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip(function(){var e=t.getFieldValue("INDEX_VALUE");return{index:Ve.Msg.SERIES_INDEX_TOOLTIP,value:Ve.Msg.HTML_VALUE_TOOLTIP}[e]})}},uh={init:function(){this.setColour(th),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(Ve.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(Ve.Msg.TUPLE_GET_INDEX_TOOLTIP)}},ch={init:function(){this.setColour(th),this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ph={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(Ve.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_h={init:function(){this.setColour(th),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_SPLITBYDOU).appendField(Ve.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},yh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Ve.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{plot:Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Ve.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]})}},vh={init:function(){this.setColour(th);var e=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],t=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_SCATTER).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Ve.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},bh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_XY).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Th={init:function(){this.setColour(th);var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_BAR).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Ve.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Ve.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},xh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Ve.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PIE).appendField(Ve.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Ve.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Ve.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Ve.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Eh={init:function(){this.setColour(th),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_HIST).appendField(Ve.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETTING).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_TICKS).appendField(Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Ih={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Ve.Msg.LANG_MATH_TO_ROUND,"round"],[Ve.Msg.LANG_MATH_TO_CEIL,"ceil"],[Ve.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(th),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Ve.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP"),this.setTooltip(Ve.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Ah={init:function(){this.setColour(th),this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT).appendField(Ve.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Sh={init:function(){this.setColour(th),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Ve.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ch={init:function(){this.setColour(th),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Ve.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Ve.FieldDropdown([[Ve.Msg.DATAFRAME_COLUMN,"column"],[Ve.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Ve.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Oh={init:function(){this.setColour(th),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Mh={init:function(){this.setColour(th);var e=[[Ve.Msg.TEXT_TRIM_LEFT,"right"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[Ve.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.MIXLY_SETTING).appendField(Ve.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_HOR).appendField(new Ve.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_VER).appendField(new Ve.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PL_TEXT_TOOLTIP)}},kh={init:function(){this.setColour(th),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},Rh={init:function(){this.setColour(th),this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ph={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(Ve.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$h={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Ve.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{plot:Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Ve.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]})}},Uh={init:function(){this.setColour(th);var e=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],t=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_SCATTER).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Ve.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Vh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_XY).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},zh={init:function(){this.setColour(th);var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_BAR).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Ve.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Ve.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},jh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Ve.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PIE).appendField(Ve.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Ve.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Ve.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Ve.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Yh={init:function(){this.setColour(th),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_HIST).appendField(Ve.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETTING).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_TICKS).appendField(Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Hh={init:function(){this.setColour(th),this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT).appendField(Ve.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Wh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Xh={init:function(){this.setColour(th);var e=[[Ve.Msg.TEXT_TRIM_LEFT,"right"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[Ve.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.MIXLY_SETTING).appendField(Ve.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_HOR).appendField(new Ve.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_VER).appendField(new Ve.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PL_TEXT_TOOLTIP)}},qh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},Kh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},Zh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new Ve.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},Qh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new Ve.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},Jh={init:function(){this.setColour(th),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},ep={init:function(){this.setColour(th),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},tp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},np={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},ip={init:function(){this.setColour(th),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},rp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},sp={init:function(){this.setColour(th),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},op={init:function(){this.setColour(th),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},ap={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},lp={init:function(){this.setColour(th),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},up={init:function(){this.setColour(th),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},cp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},hp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new Ve.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},pp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},fp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},mp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},gp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},_p={init:function(){this.setColour(th),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},yp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},vp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},bp={init:function(){this.setColour(th),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Tp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},xp={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("排序方式").appendField(new Ve.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ep={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("获取").appendField(new Ve.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(Ve.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},wp={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ip={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ap={init:function(){this.setColour(th),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Sp={init:function(){this.setColour(th),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cp=80,Op={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new Ve.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new Ve.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;it?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Mp={init:function(){this.setColour(Cp),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},kp={init:function(){this.setColour(Cp),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},Rp={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_NODE_USE).appendField(new Ve.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_CREATE_NODE_TOOLTIP)}},Np={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_AIP_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},Dp={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_AIP_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},Fp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[Ve.Msg.DS_ADD_NODE_BEFORE,"before"],[Ve.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_ADD_NODE_TOOLTIP)}},Lp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[Ve.Msg.DS_ADD_NODE_BEFORE,"before"],[Ve.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AS),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_ADD_NODE_TOOLTIP)}},Pp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},Bp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(Ve.Msg.DS_DEL_NODE_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AS),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},$p={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},Up="#777777",Vp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField("from ").appendField(new Ve.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new Ve.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField("import ").appendField(new Ve.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ef={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},wf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},If={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Af={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Ve.Msg.MIXLY_WIFI_USERNAME).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Ve.Msg.MIXLY_IOT_PASSWORD).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Ve.Msg.MIXLY_EMQX_PROJECT).setAlign(Ve.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Ve.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Cf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_SUBSCRIBE+Ve.Msg.MIXLY_MICROBIT_MSG).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Ve.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Of={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MSG.stop+Ve.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Mf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},kf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Ve.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Df={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Ff={init:function(){this.setColour(_f),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Lf={init:function(){this.setColour(_f),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Pf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Bf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO").appendField(Ve.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Ve.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},$f={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+Ve.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Uf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vf={init:function(){this.VISITOR_ID=ze.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(_f),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Ve.FieldImage(t,12,12,'"')}},zf={init:function(){this.VISITOR_ID=ze.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(_f),this.appendDummyInput("").appendField(new Ve.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},jf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO").appendField(Ve.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Yf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("HTTP"+Ve.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Ve.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Ve.Msg.MIXLY_REQUESTS_GET).appendField(Ve.Msg.MIXLY_GET_CURRENT_TIME).appendField(Ve.Msg.MIXLY_OPEN_DEBUG).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("HTTP"+Ve.Msg.MIXLY_Client).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Ve.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Ve.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Hf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MQTT"+Ve.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Ve.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Ve.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Ve.MQTT_Topic).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Ve.Msg.MIXLY_OPEN_DEBUG).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MQTT"+Ve.Msg.MIXLY_Client).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Ve.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Ve.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Xf=yf,qf=vf,Kf=bf,Zf=xf,Qf=230,Jf={init:function(){this.setColour(Qf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},em={init:function(){this.setColour(Qf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},tm={init:function(){this.setColour(Qf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},nm={init:function(){this.setColour(Qf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},im={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.MIXPY_SERIAL_OPEN)).appendField(new Ve.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SERIAL_BEGIN).appendField(new Ve.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},rm={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},sm={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},om={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(Ve.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},am=80,lm={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},um={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},cm={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},dm={init:function(){var e=[[Ve.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[Ve.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[Ve.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[Ve.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[Ve.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[Ve.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+Ve.Msg.LOAD).appendField(new Ve.FieldDropdown(e),"type").appendField(new Ve.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},hm={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+Ve.Msg.DATA_SET),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.EIGENVALUES,"data"],[Ve.Msg.LABEL_VALUE,"target"],[Ve.Msg.FEATURE,"feature_names"],[Ve.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},pm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},fm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},mm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},gm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},_m={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},ym={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},vm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_KNN_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},bm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Tm={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},xm={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Em={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},wm={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Im={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Am={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Sm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Cm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Om={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Mm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(Ve.inputs.Align.RIGHT).setCheck(null).appendField(Ve.Msg.MODEL_NAME),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_COEF,"coef_"],[Ve.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},km={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[Ve.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[Ve.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Rm={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField("sklearn").appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_SAVE_MODEL,"dump"],[Ve.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+Ve.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(am),this.setTooltip(""),this.setHelpUrl("")}},Nm=120,Dm={init:function(){this.setColour(Nm),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY+"("+Ve.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Fm={init:function(){this.setColour(Nm),this.appendDummyInput().appendField(Ve.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},Lm={init:function(){this.setColour(Nm),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},Pm={init:function(){this.setColour(Nm),this.appendValueInput("STATUS_CODE",Number).appendField(Ve.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Bm={init:function(){this.setColour(Nm),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},$m={init:function(){this.setColour(Nm),this.appendValueInput("TIME").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField("MsTimer2").appendField(Ve.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Um={init:function(){this.setColour(Nm),this.appendDummyInput().appendField("MsTimer2").appendField(Ve.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vm={init:function(){this.setColour(Nm),this.appendDummyInput().appendField("MsTimer2").appendField(Ve.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zm={init:function(){this.setColour(Nm),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},jm=180,Ym={init:function(){this.setColour(jm),this.appendDummyInput("").appendField(Ve.Msg.blockpy_turtle_create).appendField(new Ve.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Gm={init:function(){this.setColour(jm),this.appendDummyInput().appendField(Ve.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hm={init:function(){this.setColour(jm),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_forward,"forward"],[Ve.Msg.blockpy_backward,"backward"]];this.setColour(jm),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{forward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]})}},Xm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_left,"left"],[Ve.Msg.blockpy_right,"right"]];this.setColour(jm),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_rotate).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{left:Ve.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:Ve.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]})}},qm={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_setheading),this.appendDummyInput().appendField(Ve.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Km={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MILLIS),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(jm),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},Jm={init:function(){this.setColour(jm);var e=[[Ve.Msg.TURTLE_POS,"pos"],[Ve.Msg.TURTLE_SHAPE,"shape"],[Ve.Msg.TURTLE_HEADING,"heading"],[Ve.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[Ve.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[Ve.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.TURTLE_POS_SHAPE).appendField(new Ve.FieldDropdown(e),"DIR");var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{pos:Ve.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:Ve.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:Ve.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:Ve.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]}),this.setOutput(!0),this.setInputsInline(!0)}},eg={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput().appendField(Ve.Msg.TURTLE_STAMP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},tg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[Ve.Msg.blockpy_turtle_reset,"reset"],[Ve.Msg.blockpy_turtle_home,"home"]];this.setColour(jm),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{clear:Ve.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:Ve.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]})}},ng={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_penup,"penup"],[Ve.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(jm),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{penup:Ve.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:Ve.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]})}},ig={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_beginfill,"begin"],[Ve.Msg.blockpy_turtle_endfill,"end"]];this.setColour(jm),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{begin:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:Ve.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]})}},rg={init:function(){this.appendDummyInput("").appendField(new Ve.FieldTextInput("tina"),"TUR");var e=[[Ve.Msg.blockpy_turtle_size,"pensize"],[Ve.Msg.MIXLY_SPEED,"speed"]];this.setColour(jm),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_set).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{pensize:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]})}},sg={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_set_size),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},og={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_set_speed),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ag={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_circle,"circle"],[Ve.Msg.blockpy_turtle_dot,"dot"]];this.setColour(jm),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_draw).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{circle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:Ve.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]})}},lg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(Ve.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},ug={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_hide,"hideturtle"],[Ve.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(jm),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{hideturtle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]})}},cg={init:function(){this.setColour(jm),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_bgcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_pencolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_fillcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pg={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.TURTLE_CLONE),this.setTooltip(Ve.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},fg={init:function(){this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_g={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_pencolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_fillcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR1").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vg={init:function(){this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Tg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_shape_arrow,"arrow"],[Ve.Msg.blockpy_turtle_shape_turtle,"turtle"],[Ve.Msg.blockpy_turtle_shape_circle,"circle"],[Ve.Msg.blockpy_turtle_shape_square,"square"],[Ve.Msg.blockpy_turtle_shape_triangle,"triangle"],[Ve.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(jm),this.appendDummyInput("").appendField(Ve.Msg.blockpy_turtle_shape).appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_SHAPE_TOOLTIP)}},Eg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},wg={init:function(){this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(jm),this.appendValueInput("TITLE").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(Ve.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(Ve.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.TURTLE_NUMINPUT_TOOLTIP)}},Ig={init:function(){this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(jm),this.appendValueInput("TITLE").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},Ag={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Sg={init:function(){var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new Ve.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new Ve.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new Ve.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Cg={init:function(){var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(jm),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new Ve.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new Ve.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new Ve.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Og={init:function(){this.setColour(jm),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Mg={init:function(){this.setColour(jm),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new Ve.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},kg={init:function(){this.setColour(jm),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},Rg={init:function(){this.setColour(jm),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},Ng={init:function(){this.setColour(jm),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},Dg={init:function(){this.setColour(jm),this.appendValueInput("TUR"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fg={init:function(){this.setColour(jm),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},Lg=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},Pg=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},Bg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},$g=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Ug=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Vg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},zg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},jg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Yg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),r=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+","+r+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Gg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Hg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Wg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Xg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},qg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Kg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Zg=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},Qg=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},Jg=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var r=n+'["result"][0]["keyword"]';if("Speech"==i)r=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)r=n+'["score"]';if("Ocr"==i)r=n+'["words_result"]';return[r,t.ORDER_ATOMIC]},e_=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('ditu')\nmask = sprite.Sprite('white', 96, 354)\nmask.hide()\nhouse = [\n sprite.Sprite('mark', 150, 380),\n sprite.Sprite('xtxn', 96, 170),\n sprite.Sprite('xnvijx', 270, 45),\n sprite.Sprite('xnxbjx', 310, 182),\n sprite.Sprite('xnsijx', 300, 370),\n sprite.Sprite('xnkejx', 495, 220),\n sprite.Sprite('bwbwjx', 716, 85),\n sprite.Sprite('lelejx', 686, 314)\n]\nfor i in house:\n i.filterBrighter()\n i.hide()\n"},t_=function(){return"path = [1]\nmask.show()\ncar = sprite.Sprite('xnie', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},n_=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},i_=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},r_=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},s_=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},o_=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},a_=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},l_=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},u_=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},c_=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('ditu')\nmask = sprite.Sprite('white', 96, 354)\nmask.hide()\nhouse = [\n sprite.Sprite('mark', 150, 380),\n sprite.Sprite('xtxn', 96, 170),\n sprite.Sprite('xnvijx', 270, 45),\n sprite.Sprite('xnxbjx', 310, 182),\n sprite.Sprite('xnsijx', 300, 370),\n sprite.Sprite('xnkejx', 495, 220),\n sprite.Sprite('bwbwjx', 716, 85),\n sprite.Sprite('lelejx', 686, 314)\n]\nbarricade = sprite.Sprite('barricade', 610, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.filterBrighter()\n i.hide()\n"},d_=function(e,t){return["f == 1",t.ORDER_ATOMIC]},h_=function(){return"print('没有符合条件的路线')\n"},p_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},f_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},m_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},g_=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},__=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},y_=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},v_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},b_=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",i=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},T_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},x_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},E_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},w_=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},I_=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},A_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},S_=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},C_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},O_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},M_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},k_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},R_=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},N_=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},D_=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},F_=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},L_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},P_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},B_=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},$_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},U_=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},V_=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},z_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},j_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},Y_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var r="";return r+=`_S${n}.show()\ntime.sleep(1)\n`,r+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},G_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},H_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},W_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},X_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},q_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},K_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},Z_=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},Q_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},J_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},ey=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),i=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},Nv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},Dv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},Fv=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},Lv=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE),r="class "+i+":\n";r+=" def __init__(self):\n";for(var s=new Array(this.itemCount_),o=0;o0;r--)t.getInputTargetBlock("IF"+r)&&t.getInputTargetBlock("IF"+r).previousConnection?n[r]=t.getInputTargetBlock("IF"+r).previousConnection:n[r]=null,this.removeInput("IF"+r),t.getInputTargetBlock("DO"+r)&&t.getInputTargetBlock("DO"+r).previousConnection?i[r]=t.getInputTargetBlock("DO"+r).previousConnection:i[r]=null,this.removeInput("DO"+r);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(r=1;r<=this.elseifCount_;r++)this.appendValueInput("IF"+r).setCheck([Boolean,Number]).appendField(Ve.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+r).appendField(Ve.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.CONTROLS_IF_MSG_ELSE);for(r=n.length-2;r>0;r--)n[r]&&n[r].reconnect(this,"IF"+r);for(r=i.length-2;r>0;r--)i[r]&&i[r].reconnect(this,"DO"+r)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var r=e.newBlock("controls_if_elseif");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}if(this.elseCount_){var s=e.newBlock("controls_if_else");s.initSvg(),n.connect(s.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),i=[null],r=[null],s=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),r.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,s=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,r,s)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,n++;break;case"controls_if_else":r=this.getInput("ELSE");t.statementConnection_=r&&r.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var r=this.getInput("IF"+i),s=this.getInput("DO"+i);console.log(r.connection.targetConnection),e.push(r.connection.targetConnection),t.push(s.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(Ve.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(Ve.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var i=1;i<=this.elseifCount_;i++)e[i]&&e[i].reconnect(this,"IF"+i),t[i]&&t[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(rt),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PYTHON_RANGE).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},dt={init:function(){this.setColour(rt),this.appendValueInput("LIST").setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Ve.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(function(){return Ve.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ht={init:function(){this.setColour(rt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Ve.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Ve.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Ve.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return{WHILE:Ve.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Ve.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]})}},pt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var r=this.elseifCount_;r>0;r--)t.getInputTargetBlock("IF"+r)&&t.getInputTargetBlock("IF"+r).previousConnection?n[r]=t.getInputTargetBlock("IF"+r).previousConnection:n[r]=null,this.removeInput("IF"+r),t.getInputTargetBlock("DO"+r)&&t.getInputTargetBlock("DO"+r).previousConnection?i[r]=t.getInputTargetBlock("DO"+r).previousConnection:i[r]=null,this.removeInput("DO"+r);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(r=1;r<=this.elseifCount_;r++)this.appendValueInput("IF"+r).setCheck([Boolean,Number]).appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+r).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.MIXLY_PYTHON_FINALLY);for(r=n.length-2;r>0;r--)n[r]&&n[r].reconnect(this,"IF"+r);for(r=i.length-2;r>0;r--)i[r]&&i[r].reconnect(this,"DO"+r)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var r=e.newBlock("controls_except");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}if(this.elseCount_){var s=e.newBlock("controls_finally");s.initSvg(),n.connect(s.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),i=[null],r=[null],s=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),r.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,s=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,r,s)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,n++;break;case"controls_finally":r=this.getInput("ELSE");t.statementConnection_=r&&r.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var r=this.getInput("IF"+i),s=this.getInput("DO"+i);console.log(r.connection.targetConnection),e.push(r.connection.targetConnection),t.push(s.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var i=1;i<=this.elseifCount_;i++)e[i]&&e[i].reconnect(this,"IF"+i),t[i]&&t[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ft={init:function(){this.setColour(rt);var e=new Ve.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip(function(){var e=t.getFieldValue("FLOW");return{BREAK:Ve.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Ve.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]})},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},mt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Ve.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Ve.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},gt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Ve.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Ve.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};ht.OPERATORS=[[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ft.OPERATORS=[[Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const _t={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},yt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},vt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},bt={init:function(){this.setColour(rt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Tt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},xt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Et={init:function(){this.jsonInit({message0:Ve.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:rt,tooltip:Ve.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Ve.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},wt={init:function(){this.setColour(rt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_STAT),this.setOutput(!0)}},It={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},At={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(Ve.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Ve.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Ve.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Ve.FieldDropdown([[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(rt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Ct={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ot={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Mt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},kt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET+Ve.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_GET_UNIQUE_IDEN)}},Rt={init:function(){this.setColour(rt),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Nt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},Dt=230;Ve.FieldTextInput.math_number_validator=function(e){return String(e)},Ve.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const Ft={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new Ve.FieldTextInput("0",Ve.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MATH_NUMBER_TOOLTIP)}},Lt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Ve.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip(function(){var t=e.getFieldValue("CONSTANT");return{pi:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]})}},Pt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Ve.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip(function(){var t=e.getFieldValue("CONSTANT");return{pi:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]})}},Bt={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{ADD:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Ve.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]})}},$t={init:function(){this.setColour(Dt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{ADD:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Ve.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]})}},Ut={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Ve.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Vt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{SIN:Ve.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Ve.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Ve.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Ve.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Ve.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Ve.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Ve.Msg.MATH_SINGLE_TOOLTIP_LN}[t]})}},zt={init:function(){var e=[[Ve.Msg.MATH_BIN,"bin"],[Ve.Msg.MATH_OCT,"oct"],[Ve.Msg.MATH_HEX,"hex"]];this.setColour(Dt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP");var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{bin:Ve.Msg.MATH_DEC_TOOLTIP_BIN,oct:Ve.Msg.MATH_DEC_TOOLTIP_OCT,hex:Ve.Msg.MATH_DEC_TOOLTIP_HEX}[e]})}},jt={init:function(){var e=[[Ve.Msg.LANG_MATH_TO_ROUND,"round"],[Ve.Msg.LANG_MATH_TO_CEIL,"ceil"],[Ve.Msg.LANG_MATH_TO_FLOOR,"floor"],[Ve.Msg.MATH_ABS,"fabs"],[Ve.Msg.MATH_SQRT,"sqrt"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{sqrt:Ve.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Ve.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Ve.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Ve.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Ve.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Ve.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]})}},Yt={init:function(){var e=[[Ve.Msg.MIXLY_MAX,"max"],[Ve.Msg.MIXLY_MIN,"min"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{max:Ve.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Ve.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]})}},Gt={init:function(){var e=[[Ve.Msg.MATH_TWO,"two"],[Ve.Msg.MATH_EIGHT,"eight"],[Ve.Msg.MATH_TEN,"ten"],[Ve.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Dt),this.appendDummyInput("").appendField(Ve.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Ve.FieldDropdown(e),"OP").appendField(Ve.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Ve.Msg.MATH_ZHW).appendField(new Ve.FieldDropdown(e),"OP2").appendField(Ve.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP"),n={two:Ve.Msg.MATH_Before_two,eight:Ve.Msg.MATH_Before_eight,ten:Ve.Msg.MATH_Before_ten,sixteen:Ve.Msg.MATH_Before_sixteen},i=t.getFieldValue("OP2"),r={two:Ve.Msg.MATH_Behind_two,eight:Ve.Msg.MATH_Behind_eight,ten:Ve.Msg.MATH_Behind_ten,sixteen:Ve.Msg.MATH_Behind_sixteen};return n[e]+r[i]})}},Ht={init:function(){var e=[[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Dt),this.setOutput(!0,Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Ve.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TYPE"),n={int:Ve.Msg.LANG_MATH_INT,float:Ve.Msg.LANG_MATH_FLOAT_RANDOM};return Ve.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]})}},Wt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MATH_CONSTRAIN_TOOLTIP)}},Xt={init:function(){this.setColour(Dt),this.appendValueInput("NUM",Number).appendField(Ve.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Ve.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Ve.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_MATH_MAP)}},qt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new Ve.FieldTextInput("0",Ve.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Ve.Msg.MATH_NUMBER_TOOLTIP)}},Kt={init:function(){this.setColour(Dt),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Zt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MATH_ROUND).appendField(Ve.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Ve.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MATH_ROUND_NEW_TOOLTIP)}},Qt={init:function(){var e=[[Ve.Msg.MIXLY_TO_INT,"int"],[Ve.Msg.MIXLY_TO_FLOAT,"float"],[Ve.Msg.MIXLY_TO_BITES,"b"],[Ve.Msg.LANG_MATH_BYTE+Ve.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{int:Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]})}},Jt={init:function(){var e=[[Ve.Msg.MIXLY_TO_INT,"int"],[Ve.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{int:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]})}},en=Xt,tn={init:function(){this.setColour(Dt),this.appendValueInput("VAR").appendField(Ve.Msg.LANG_MATH_BYTE+Ve.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},nn={init:function(){this.setColour(Dt),this.itemCount_=1,this.setMutator(new Ve.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Ve.Msg.MIXLY_PRODUCT+Ve.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Ve.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const cn={init:function(){this.setColour(on),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput("",Ve.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new Ve.FieldImage(t,7,12,'"')}},dn={init:function(){this.setColour(on),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Ve.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},hn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},fn={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},mn={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},gn={init:function(){this.WHERE_OPTIONS=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.TEXT_GET_INDEX_RANDOM+1+Ve.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.LISTS_GET_INDEX_GET,"MODE"),Ve.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Ve.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),i="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Ve.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Ve.Msg.ONE_BASED_INDEXING?"#1":"#0")),i});var t=this;this.setTooltip(function(){var e=t.getFieldValue("WHERE"),n={FROM_START:Ve.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Ve.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Ve.Msg.TEXT_GET_INDEX_RANDOM};return Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+Ve.Msg.TEXT_CHARAT2})},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==Ve.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),Ve.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Ve.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new Ve.FieldDropdown(this.WHERE_OPTIONS,function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(t,"WHERE"),Ve.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},_n={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LISTS_GET_INDEX_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+Ve.Msg.LISTS_GET_INDEX_FROM_START+"n"+Ve.Msg.TEXT_CHARAT2)}},yn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Ve.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Ve.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},vn={init:function(){this.WHERE_OPTIONS_1=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Ve.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(Ve.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==Ve.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),Ve.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(Ve.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new Ve.FieldDropdown(this["WHERE_OPTIONS_"+e],function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=t){var r=this.sourceBlock_;return r.updateAt_(e,i),r.setFieldValue(n,"WHERE"+e),null}});this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},bn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Ve.Msg.LISTS_GET_INDEX_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Ve.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Tn={init:function(){var e=[[Ve.Msg.MIXLY_EQUALS,"==="],[Ve.Msg.MIXLY_STARTSWITH,"startswith"],[Ve.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(on),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Ve.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},xn={init:function(){this.setColour(on),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Ve.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_COMPARETO_HELP)}},En={init:function(){var e=[[Ve.Msg.TEXT_UPPER,"upper"],[Ve.Msg.TEXT_TITLE,"title"],[Ve.Msg.TEXT_CAPITALIZE,"capitalize"],[Ve.Msg.TEXT_SWAPCASE,"swapcase"],[Ve.Msg.TEXT_LOWER,"lower"]];this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip(function(){var e=t.getFieldValue("CAPITAL");return{upper:Ve.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Ve.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Ve.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Ve.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Ve.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]})}},wn={init:function(){var e=[[Ve.Msg.TEXT_LJUST,"ljust"],[Ve.Msg.TEXT_CENTER,"center"],[Ve.Msg.TEXT_RJUST,"rjust"]];this.setColour(on),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Ve.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Ve.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},In={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Ve.Msg.MIXLY_MID+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Ve.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},An={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Sn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Ve.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Ve.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Cn={init:function(){this.setColour(on),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Ve.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Ve.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},On={init:function(){var e=[[Ve.Msg.TEXT_TRIM_BOTH,"strip"],[Ve.Msg.TEXT_TRIM_LEFT,"lstrip"],[Ve.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(on),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(Ve.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{strip:Ve.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Ve.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Ve.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]})}},Mn={init:function(){this.setColour(on),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Ve.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;it?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ai={init:function(){this.setColour(wi),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Si={init:function(){this.setColour(wi),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ci={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_KEYS),this.setTooltip(Ve.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Oi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Ve.Msg.DICTS_GET_TOOLTIP)}},Mi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Ve.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},ki={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ri={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_DELETE_TOOLTIP)}},Ni={init:function(){this.setColour(wi),this.appendValueInput("DICT2").setCheck("Dict").appendField(Ve.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Ve.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MID),this.setTooltip(Ve.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_CLEAR),this.setTooltip(Ve.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_ITEMS),this.setTooltip(Ve.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Li={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_VALUES),this.setTooltip(Ve.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_LENGTH),this.setTooltip(Ve.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Bi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_DELDICT),this.setTooltip(Ve.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$i={init:function(){this.MODE=[[Ve.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Ve.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Ve.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=Ve.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=Ve.Msg.DICTS_DELETE_TOOLTIP}return t})},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new Ve.FieldDropdown(this.MODE,function(t){var n="INSERT"==t;if(n!=e){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(t,"WHERE"),null}});this.getInput("AT2").appendField(t,"WHERE")}},Ui={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setTooltip(Ve.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Vi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_SETDEFAULT_TOOLTIP)}},zi={init:function(){this.setColour(wi),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.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 Ve.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;it?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ji={init:function(){this.setColour(wi),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Yi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gi={init:function(){this.setColour(wi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi=210,qi={init:function(){var e=Ve.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{EQ:Ve.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Ve.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Ve.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Ve.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Ve.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Ve.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]}),this.prevBlocks_=[null,null]}},Ki={init:function(){var e=Ve.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=Ve.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new Ve.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Zi={init:function(){var e=[[Ve.Msg.LOGIC_OPERATION_AND,"AND"],[Ve.Msg.LOGIC_OPERATION_OR,"OR"],[Ve.Msg.LOGIC_OPERATION_NOR,"NOR"],[Ve.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{AND:Ve.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]})}},Qi={init:function(){this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Ve.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Ve.Msg.LOGIC_NEGATE_TOOLTIP)}},Ji={init:function(){var e=[[Ve.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Ve.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Ve.FieldDropdown(e),"BOOL"),this.setTooltip(Ve.Msg.LOGIC_BOOLEAN_TOOLTIP)}},er={init:function(){this.setColour(Xi),this.setOutput(!0),this.appendDummyInput().appendField(Ve.Msg.LOGIC_NULL),this.setTooltip(Ve.Msg.LOGIC_NULL_TOOLTIP)}},tr={init:function(){this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").appendField(Ve.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Ve.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},nr={init:function(){var e=[[Ve.Msg.TEXT_APPEND_TO,"in"],[Ve.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Ve.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(Ve.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Ve.Msg.IN)}},ir={init:function(){var e=[[Ve.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Ve.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},rr={init:function(){this.setColour(Xi),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},sr={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Ve.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},or={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"],[Ve.Msg.MIXLY_ADD,"a"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_ADD,"ab"],[Ve.Msg.MIXLY_R_W,"r+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_R_W,"rb+"],[Ve.Msg.MIXLY_W_R,"w+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_W_R,"wb+"],[Ve.Msg.MIXLY_A_R,"a+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_A_R,"ab+"]]),"MODE"),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ar={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG,o=Ve.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r+o})}},lr={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.MIXPY_TEXT_ENCODE).appendField(new Ve.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG,o=Ve.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r+o})}},ur={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},cr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},dr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+i})}},hr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MICROBIT_PYTHON_TYPE)}},pr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.HTML_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},fr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},mr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},gr={init:function(){this.setColour(0),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const _r={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Ve.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(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},yr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},vr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},br={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+r+"x"+i})}},Tr={init:function(){this.setColour(0),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},xr={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Ve.Msg.MIXLY_ESP32_SET+{mkdir:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]})}},Er={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Ve.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},wr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Ir={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_FILE,"isfile"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]})}},Ar={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SETUP+Ve.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Ve.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Sr={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Ve.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){var e=Ve.Procedures.findLegalName("",this),t=new Ve.FieldTextInput(e,Ve.Procedures.rename);t.setSpellcheck(!1),this.appendDummyInput().appendField(t,"NAME").appendField("","PARAMS"),this.setMutator(new Ve.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Ve.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Ve.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Ve.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(Ve.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){var e="";this.arguments_.length&&(e=Ve.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Ve.Events.disable();try{this.setFieldValue(e,"PARAMS")}finally{Ve.Events.enable()}},mutationToDom:function(e){var t=Ve.utils.xml.createElement("mutation");e&&t.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ws={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_FORM_CONTENT).appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_TEXT,"text"],[Ve.Msg.HTML_EMAIL,"email"],[Ve.Msg.HTML_NUMBER,"number"],[Ve.Msg.HTML_PASSWORD,"password"],[Ve.Msg.HTML_CHECKBOX,"checkbox"],[Ve.Msg.HTML_RADIOBUTTON,"radiobutton"],[Ve.Msg.HTML_BUTTON,"button"],[Ve.Msg.HTML_COLOUR,"colour"],[Ve.Msg.HTML_DATE,"date"],[Ve.Msg.HTML_LOCALTIME,"local time"],[Ve.Msg.HTML_FILE,"file"],[Ve.Msg.HTML_HIDDEN,"hidden"],[Ve.Msg.HTML_IMAGE,"image"],[Ve.Msg.HTML_MONTH,"month"],[Ve.Msg.HTML_RANGE,"range"],[Ve.Msg.HTML_RESET,"reset"],[Ve.Msg.HTML_SEARCH,"search"],[Ve.Msg.HTML_SUBMIT,"submit"],[Ve.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Ve.Msg.HTML_TIME,"time"],[Ve.Msg.HTML_URL,"url"],[Ve.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Ve.Msg.HTML_NAME).appendField(new Ve.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Ve.Msg.HTML_VALUE).appendField(new Ve.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Is={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldTextInput("property"),"KEY").appendField(":").appendField(new Ve.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},As={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldTextInput("property"),"KEY").appendField(":").appendField(new Ve.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_TEXT).appendField(new Ve.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs=160,Os={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Ve.FieldTable(""),"TEXT")}},Ms={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Ve.FieldMultilineInput(""),"TEXT")}},ks={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Ve.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Rs={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ns={init:function(){this.setColour(Cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Ve.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ds={init:function(){this.setColour(Cs),this.appendValueInput("VALUE").appendField(Ve.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Fs={init:function(){this.setColour(Cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Ve.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=Ve.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+l()+"("+e+", "+t+", "+n+") or "+u()+"("+e+", "+t+", "+n+")"},Ve.isNumber(i)&&Ve.isNumber(r)&&Ve.isNumber(s))i=parseFloat(i),r=parseFloat(r),s=Math.abs(parseFloat(s)),0==i%1&&0==r%1&&0==s%1?(i<=r?(r++,e=0==i&&1==s?r:i+", "+r,1!=s&&(e+=", "+s)):e=i+", "+--r+", -"+s,e="range("+e+")"):(e=i",GTE:">="};const kl=function(e,t){var n=this.getFieldValue("OP"),i="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,r=t.valueToCode(this,"A",i)||"False",s=t.valueToCode(this,"B",i)||"False";if("AND"==n)var o=r+" and "+s;else if("OR"==n)o=r+" or "+s;else if("NOR"==n)o="not("+r+"^"+s+")";else o=r+"^"+s;return[o,i]},Rl=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},Nl=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},Dl=function(e,t){return["None",t.ORDER_ATOMIC]},Fl=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},Ll=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,t.ORDER_ATOMIC]},Pl=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,t.ORDER_ATOMIC]},Bl=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},$l=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},Ul=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Vl=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},zl=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},jl=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},Yl=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},Gl=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Hl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Wl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},Xl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},ql=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},Kl=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},Zl=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},Ql=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Jl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},eu=function(e,t){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+i+")\n"},tu=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},nu=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},iu=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},ru=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},su=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},ou=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},au=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},lu=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),Ve.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(i=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var r=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";r&&(r=" return "+r+"\n");for(var s=[],o=0;o\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},Yu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},Gu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var r="<"+i+'>\n\t\n'+n+"\n";else r="<"+i+">\n"+n+"\n";return r},Hu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},Wu=function(e,t){var n=t.statementToCode(this,"DO"),i=t.valueToCode(this,"style"),r=this.getFieldValue("LEVEL");return"<"+r+" "+i+" >\n"+n+"\n"},Xu=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},qu=function(e,t){return'"},Ku=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Zu=function(){return this.getFieldValue("TEXT")+"\n"},Qu=function(e){return e.getFieldValue("TEXT")+"\n"},Ju=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},ec=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},tc=function(){return""},nc=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},ic=function(e,t){for(var n=e.getFieldValue("NAME"),i=e.hasReturn_,r=new Array(e.itemCount_),s=0;s0?t.join("\n")+n.join("\n")+i.join("\n")+o.join("\n")+a.join("")+e+"while True:\n"+l.join("")+u.join("\n"):t.join("\n")+n.join("\n")+i.join("\n")+o.join("\n")+a.join("")+e+u.join("\n")},ac.scrubNakedValue=function(e){return e+"\n"},ac.quote_=function(e){var t="'";return-1!==e.indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},ac.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},ac.scrub_=function(e,t,n){var i="";if(!e.outputConnection||!e.outputConnection.targetConnection){(s=e.getCommentText())&&(s=Ve.utils.string.wrap(s,ac.COMMENT_WRAP-3),i+=ac.prefixLines(s+"\n","# "));for(var r=0;r0?"int("+a+" + "+r+")":r<0?"int("+a+" - "+-r+")":"int("+a+")",i&&(a="-"+a)),a};const lc=205,uc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_CHOOSE_AND_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[Ve.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[Ve.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},cc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SETUP).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[Ve.Msg.MIXLY_AipSpeech,"AipSpeech"],[Ve.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[Ve.Msg.MIXLY_AipFace,"AipFace"],[Ve.Msg.MIXLY_AipOcr,"AipOcr"],[Ve.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipSpeech_synthesis).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.OLED_STRING).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},hc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipSpeech_asr).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_AipSpeech_File).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},pc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipImageClassify).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},fc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[Ve.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[Ve.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[Ve.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[Ve.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[Ve.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},mc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipFace_match).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image+"1"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(Ve.Msg.MIXLY_AipImageClassify_Image+"2"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},gc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipOcr).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},_c={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[Ve.Msg.MIXLY_AipOcr_webImage,"webImage"],[Ve.Msg.MIXLY_AipOcr_idcard,"idcard"],[Ve.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[Ve.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[Ve.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[Ve.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[Ve.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[Ve.Msg.MIXLY_AipOcr_receipt,"receipt"],[Ve.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[Ve.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[Ve.Msg.MIXLY_AipOcr_form,"tableRecognition"],[Ve.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[Ve.Msg.MIXLY_AipOcr_passport,"passport"],[Ve.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},yc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.OLED_STRING).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},vc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_Sim).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(Ve.Msg.OLED_STRING+"1").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(Ve.Msg.OLED_STRING+"2").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},bc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipNlp_lexer,"lexer"],[Ve.Msg.MIXLY_AipNlp_depParser,"depParser"],[Ve.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[Ve.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[Ve.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[Ve.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[Ve.Msg.MIXLY_AipNlp_keyword,"keyword"],[Ve.Msg.MIXLY_AipNlp_topic,"topic"],[Ve.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[Ve.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Tc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[Ve.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},xc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_topic).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Title).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Content).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Ec={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_summary).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Content).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(Ve.Msg.MIXLY_LIST_LEN).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},wc={init:function(){this.setColour(lc),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(Ve.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Ic={init:function(){this.setColour(lc),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(Ve.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},Ac={init:function(){this.setColour(lc),this.appendValueInput("AI").appendField(Ve.Msg.MIXPY_AI_RESULT).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify,"Image"],[Ve.Msg.MIXLY_AipSpeech_asr,"Speech"],[Ve.Msg.MIXLY_AipFace_match,"Face"],[Ve.Msg.MIXLY_AipOcr,"Ocr"],[Ve.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[Ve.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(Ve.Msg.LOGIC_NEGATE_TOOLTIP)}},Sc="#526FC3",Cc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Oc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Mc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},Rc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Nc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Fc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Lc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},Pc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Bc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$c={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},Uc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Vc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},Gc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},Hc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wc={init:function(){this.appendDummyInput().appendField("准备").appendField(new Ve.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Xc={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},qc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Kc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Qc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},Jc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},ed={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},td={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},nd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},id={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},rd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},od={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ad={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ld={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new Ve.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},ud={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},cd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField("n"+Ve.Msg.MIXLY_VALUE2).appendField(new Ve.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},md={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},gd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},_d={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},yd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},vd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},bd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Td={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},xd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Ed={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("计算").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},wd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Id={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Ad={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Sd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Cd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Od={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new Ve.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Md={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("使士兵").appendField(new Ve.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},kd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("剩余").appendField(new Ve.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Rd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Nd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Dd={init:function(){this.appendDummyInput().appendField("准备").appendField(new Ve.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},Fd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ld={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},Pd={init:function(){this.setColour(Sc),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Bd="#3288dd",$d={init:function(){this.setColour(Bd),this.appendValueInput("DOMAIN").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_REQUESTS_GET).appendField(new Ve.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ud={init:function(){this.setColour(Bd),this.appendValueInput("URL").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(Ve.Msg.blockpy_REQUESTS).appendField(Ve.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Vd={init:function(){this.setColour(Bd),this.appendValueInput("URL").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(Ve.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(Ve.Msg.blockpy_REQUESTS+Ve.Msg.OLED_STRING),this.appendDummyInput("").appendField(Ve.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},zd={init:function(){this.appendValueInput("VAL");var e=[[Ve.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[Ve.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Bd),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Ve.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},jd={init:function(){this.appendValueInput("VAR").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Bd),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("DIR");return{forward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]})}},Yd="f0a559",Gd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},Hd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Xd={init:function(){this.setColour(Yd),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MILLIS+Ve.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},qd={init:function(){this.setColour(Yd),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Kd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE);var e=[[Ve.Msg.MIXLY_CV_RECT,"rectangle"],[Ve.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Zd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new Ve.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Qd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},Jd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(Ve.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},eh={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(Ve.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(Ve.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(Ve.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},th=170,nh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_series_create).appendField(new Ve.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ih={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_series_create).appendField(new Ve.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},rh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},sh={init:function(){this.setColour(th);var e=[[Ve.Msg.DATAFRAME_RAW,"index"],[Ve.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},oh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ah={init:function(){this.setColour(th),this.appendDummyInput("").appendField(new Ve.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new Ve.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},lh={init:function(){this.setColour(th);var e=[[Ve.Msg.SERIES_INDEX,"index"],[Ve.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(Ve.Msg.SERIES_INDEX_VALUE).appendField(new Ve.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip(function(){var e=t.getFieldValue("INDEX_VALUE");return{index:Ve.Msg.SERIES_INDEX_TOOLTIP,value:Ve.Msg.HTML_VALUE_TOOLTIP}[e]})}},uh={init:function(){this.setColour(th),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(Ve.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(Ve.Msg.TUPLE_GET_INDEX_TOOLTIP)}},ch={init:function(){this.setColour(th),this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ph={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(Ve.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_h={init:function(){this.setColour(th),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_SPLITBYDOU).appendField(Ve.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},yh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Ve.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{plot:Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Ve.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]})}},vh={init:function(){this.setColour(th);var e=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],t=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_SCATTER).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Ve.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},bh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_XY).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Th={init:function(){this.setColour(th);var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_BAR).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Ve.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Ve.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},xh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Ve.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PIE).appendField(Ve.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Ve.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Ve.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Ve.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Eh={init:function(){this.setColour(th),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_HIST).appendField(Ve.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETTING).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_TICKS).appendField(Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Ih={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Ve.Msg.LANG_MATH_TO_ROUND,"round"],[Ve.Msg.LANG_MATH_TO_CEIL,"ceil"],[Ve.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(th),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Ve.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP"),this.setTooltip(Ve.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Ah={init:function(){this.setColour(th),this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT).appendField(Ve.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Sh={init:function(){this.setColour(th),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Ve.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ch={init:function(){this.setColour(th),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Ve.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Ve.FieldDropdown([[Ve.Msg.DATAFRAME_COLUMN,"column"],[Ve.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Ve.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Oh={init:function(){this.setColour(th),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Mh={init:function(){this.setColour(th);var e=[[Ve.Msg.TEXT_TRIM_LEFT,"right"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[Ve.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.MIXLY_SETTING).appendField(Ve.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_HOR).appendField(new Ve.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_VER).appendField(new Ve.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PL_TEXT_TOOLTIP)}},kh={init:function(){this.setColour(th),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},Rh={init:function(){this.setColour(th),this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ph={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(Ve.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$h={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Ve.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{plot:Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Ve.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]})}},Uh={init:function(){this.setColour(th);var e=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],t=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_SCATTER).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Ve.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Vh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_XY).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},zh={init:function(){this.setColour(th);var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_BAR).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Ve.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Ve.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},jh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Ve.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PIE).appendField(Ve.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Ve.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Ve.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Ve.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Yh={init:function(){this.setColour(th),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_HIST).appendField(Ve.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETTING).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_TICKS).appendField(Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Hh={init:function(){this.setColour(th),this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT).appendField(Ve.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Wh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Xh={init:function(){this.setColour(th);var e=[[Ve.Msg.TEXT_TRIM_LEFT,"right"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[Ve.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.MIXLY_SETTING).appendField(Ve.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_HOR).appendField(new Ve.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_VER).appendField(new Ve.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PL_TEXT_TOOLTIP)}},qh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},Kh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},Zh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new Ve.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},Qh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new Ve.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},Jh={init:function(){this.setColour(th),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},ep={init:function(){this.setColour(th),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},tp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},np={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},ip={init:function(){this.setColour(th),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},rp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},sp={init:function(){this.setColour(th),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},op={init:function(){this.setColour(th),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},ap={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},lp={init:function(){this.setColour(th),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},up={init:function(){this.setColour(th),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},cp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},hp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new Ve.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},pp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},fp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},mp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},gp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},_p={init:function(){this.setColour(th),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},yp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},vp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},bp={init:function(){this.setColour(th),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Tp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},xp={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("排序方式").appendField(new Ve.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ep={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("获取").appendField(new Ve.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(Ve.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},wp={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ip={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ap={init:function(){this.setColour(th),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Sp={init:function(){this.setColour(th),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cp=80,Op={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new Ve.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new Ve.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;it?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Mp={init:function(){this.setColour(Cp),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},kp={init:function(){this.setColour(Cp),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},Rp={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_NODE_USE).appendField(new Ve.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_CREATE_NODE_TOOLTIP)}},Np={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_AIP_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},Dp={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_AIP_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},Fp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[Ve.Msg.DS_ADD_NODE_BEFORE,"before"],[Ve.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_ADD_NODE_TOOLTIP)}},Lp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[Ve.Msg.DS_ADD_NODE_BEFORE,"before"],[Ve.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AS),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_ADD_NODE_TOOLTIP)}},Pp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},Bp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(Ve.Msg.DS_DEL_NODE_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AS),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},$p={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},Up="#777777",Vp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField("from ").appendField(new Ve.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new Ve.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField("import ").appendField(new Ve.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ef={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},wf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},If={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Af={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Ve.Msg.MIXLY_WIFI_USERNAME).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Ve.Msg.MIXLY_IOT_PASSWORD).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Ve.Msg.MIXLY_EMQX_PROJECT).setAlign(Ve.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Ve.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Cf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Ve.Msg.HTML_BODY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_Service_quality_display).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AT_MOST_ONCE,"0"],[Ve.Msg.MIXLY_AT_LEAST_ONCE,"1"]]),"quality"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Of={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_SUBSCRIBE+Ve.Msg.MIXLY_MICROBIT_MSG).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Ve.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Mf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MSG.stop+Ve.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},kf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Df={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Ve.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Ff={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Lf={init:function(){this.setColour(_f),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Pf={init:function(){this.setColour(_f),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Bf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},$f={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO").appendField(Ve.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Ve.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Uf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+Ve.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zf={init:function(){this.VISITOR_ID=ze.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(_f),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Ve.FieldImage(t,12,12,'"')}},jf={init:function(){this.VISITOR_ID=ze.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(_f),this.appendDummyInput("").appendField(new Ve.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Yf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO").appendField(Ve.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Gf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("HTTP"+Ve.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Ve.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Ve.Msg.MIXLY_REQUESTS_GET).appendField(Ve.Msg.MIXLY_GET_CURRENT_TIME).appendField(Ve.Msg.MIXLY_OPEN_DEBUG).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("HTTP"+Ve.Msg.MIXLY_Client).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Ve.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Ve.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Wf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MQTT"+Ve.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Ve.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Ve.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Ve.MQTT_Topic).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Ve.Msg.MIXLY_OPEN_DEBUG).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MQTT"+Ve.Msg.MIXLY_Client).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Ve.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Ve.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},qf=yf,Kf=vf,Zf=bf,Qf=xf,Jf=230,em={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},tm={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},nm={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},im={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},rm={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.MIXPY_SERIAL_OPEN)).appendField(new Ve.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SERIAL_BEGIN).appendField(new Ve.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},sm={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},om={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},am={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(Ve.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},lm=80,um={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},cm={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},dm={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},hm={init:function(){var e=[[Ve.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[Ve.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[Ve.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[Ve.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[Ve.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[Ve.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+Ve.Msg.LOAD).appendField(new Ve.FieldDropdown(e),"type").appendField(new Ve.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},pm={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+Ve.Msg.DATA_SET),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.EIGENVALUES,"data"],[Ve.Msg.LABEL_VALUE,"target"],[Ve.Msg.FEATURE,"feature_names"],[Ve.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},fm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},mm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},gm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},_m={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},ym={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},vm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},bm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_KNN_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Tm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},xm={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Em={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},wm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Im={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Am={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Sm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Cm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Om={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Mm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},km={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(Ve.inputs.Align.RIGHT).setCheck(null).appendField(Ve.Msg.MODEL_NAME),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_COEF,"coef_"],[Ve.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Rm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[Ve.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[Ve.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Nm={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField("sklearn").appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_SAVE_MODEL,"dump"],[Ve.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+Ve.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Dm=120,Fm={init:function(){this.setColour(Dm),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY+"("+Ve.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Lm={init:function(){this.setColour(Dm),this.appendDummyInput().appendField(Ve.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},Pm={init:function(){this.setColour(Dm),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},Bm={init:function(){this.setColour(Dm),this.appendValueInput("STATUS_CODE",Number).appendField(Ve.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},$m={init:function(){this.setColour(Dm),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},Um={init:function(){this.setColour(Dm),this.appendValueInput("TIME").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField("MsTimer2").appendField(Ve.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vm={init:function(){this.setColour(Dm),this.appendDummyInput().appendField("MsTimer2").appendField(Ve.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zm={init:function(){this.setColour(Dm),this.appendDummyInput().appendField("MsTimer2").appendField(Ve.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jm={init:function(){this.setColour(Dm),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Ym=180,Gm={init:function(){this.setColour(Ym),this.appendDummyInput("").appendField(Ve.Msg.blockpy_turtle_create).appendField(new Ve.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Hm={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wm={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_forward,"forward"],[Ve.Msg.blockpy_backward,"backward"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{forward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]})}},qm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_left,"left"],[Ve.Msg.blockpy_right,"right"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_rotate).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{left:Ve.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:Ve.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]})}},Km={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_setheading),this.appendDummyInput().appendField(Ve.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MILLIS),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qm={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},eg={init:function(){this.setColour(Ym);var e=[[Ve.Msg.TURTLE_POS,"pos"],[Ve.Msg.TURTLE_SHAPE,"shape"],[Ve.Msg.TURTLE_HEADING,"heading"],[Ve.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[Ve.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[Ve.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.TURTLE_POS_SHAPE).appendField(new Ve.FieldDropdown(e),"DIR");var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{pos:Ve.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:Ve.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:Ve.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:Ve.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]}),this.setOutput(!0),this.setInputsInline(!0)}},tg={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput().appendField(Ve.Msg.TURTLE_STAMP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ng={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[Ve.Msg.blockpy_turtle_reset,"reset"],[Ve.Msg.blockpy_turtle_home,"home"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{clear:Ve.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:Ve.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]})}},ig={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_penup,"penup"],[Ve.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{penup:Ve.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:Ve.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]})}},rg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_beginfill,"begin"],[Ve.Msg.blockpy_turtle_endfill,"end"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{begin:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:Ve.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]})}},sg={init:function(){this.appendDummyInput("").appendField(new Ve.FieldTextInput("tina"),"TUR");var e=[[Ve.Msg.blockpy_turtle_size,"pensize"],[Ve.Msg.MIXLY_SPEED,"speed"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_set).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{pensize:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]})}},og={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_set_size),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ag={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_set_speed),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_circle,"circle"],[Ve.Msg.blockpy_turtle_dot,"dot"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_draw).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{circle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:Ve.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]})}},ug={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(Ve.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},cg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_hide,"hideturtle"],[Ve.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{hideturtle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]})}},dg={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_bgcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hg={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTLE_TRACER),this.appendValueInput("STEP").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_TURTLE_TRACER_STEP),this.appendValueInput("DELAY").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_TURTLE_TRACER_DELAY_MS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_pencolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_fillcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mg={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.TURTLE_CLONE),this.setTooltip(Ve.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},gg={init:function(){this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_g={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_pencolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_fillcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR1").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Tg={init:function(){this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_shape_arrow,"arrow"],[Ve.Msg.blockpy_turtle_shape_turtle,"turtle"],[Ve.Msg.blockpy_turtle_shape_circle,"circle"],[Ve.Msg.blockpy_turtle_shape_square,"square"],[Ve.Msg.blockpy_turtle_shape_triangle,"triangle"],[Ve.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(Ym),this.appendDummyInput("").appendField(Ve.Msg.blockpy_turtle_shape).appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_SHAPE_TOOLTIP)}},Ig={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},Ag={init:function(){this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(Ym),this.appendValueInput("TITLE").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(Ve.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(Ve.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.TURTLE_NUMINPUT_TOOLTIP)}},Sg={init:function(){this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(Ym),this.appendValueInput("TITLE").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},Cg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Og={init:function(){var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new Ve.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new Ve.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new Ve.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Mg={init:function(){var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new Ve.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new Ve.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new Ve.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},kg={init:function(){this.setColour(Ym),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Rg={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new Ve.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ng={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},Dg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},Fg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},Lg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},Bg=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},$g=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},Ug=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Vg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},zg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},jg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Yg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Gg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Hg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),r=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+","+r+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Wg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Xg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},qg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Kg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Zg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Qg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Jg=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},e_=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},t_=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var r=n+'["result"][0]["keyword"]';if("Speech"==i)r=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)r=n+'["score"]';if("Ocr"==i)r=n+'["words_result"]';return[r,t.ORDER_ATOMIC]},n_=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('ditu')\nmask = sprite.Sprite('white', 96, 354)\nmask.hide()\nhouse = [\n sprite.Sprite('mark', 150, 380),\n sprite.Sprite('xtxn', 96, 170),\n sprite.Sprite('xnvijx', 270, 45),\n sprite.Sprite('xnxbjx', 310, 182),\n sprite.Sprite('xnsijx', 300, 370),\n sprite.Sprite('xnkejx', 495, 220),\n sprite.Sprite('bwbwjx', 716, 85),\n sprite.Sprite('lelejx', 686, 314)\n]\nfor i in house:\n i.filterBrighter()\n i.hide()\n"},i_=function(){return"path = [1]\nmask.show()\ncar = sprite.Sprite('xnie', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},r_=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},s_=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},o_=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},a_=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},l_=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},u_=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},c_=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},d_=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},h_=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('ditu')\nmask = sprite.Sprite('white', 96, 354)\nmask.hide()\nhouse = [\n sprite.Sprite('mark', 150, 380),\n sprite.Sprite('xtxn', 96, 170),\n sprite.Sprite('xnvijx', 270, 45),\n sprite.Sprite('xnxbjx', 310, 182),\n sprite.Sprite('xnsijx', 300, 370),\n sprite.Sprite('xnkejx', 495, 220),\n sprite.Sprite('bwbwjx', 716, 85),\n sprite.Sprite('lelejx', 686, 314)\n]\nbarricade = sprite.Sprite('barricade', 610, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.filterBrighter()\n i.hide()\n"},p_=function(e,t){return["f == 1",t.ORDER_ATOMIC]},f_=function(){return"print('没有符合条件的路线')\n"},m_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},g_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},__=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},y_=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},v_=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},b_=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},T_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},x_=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",i=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},E_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},w_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},I_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},A_=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},S_=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},C_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},O_=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},M_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},k_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},R_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},N_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},D_=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},F_=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},L_=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},P_=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},B_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},$_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},U_=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},V_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},z_=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},j_=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},Y_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},G_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},H_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var r="";return r+=`_S${n}.show()\ntime.sleep(1)\n`,r+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},W_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},X_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},q_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},K_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},Z_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},Q_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},J_=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},ey=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},ty=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},ny=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),i=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},Fv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},Lv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},Pv=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},Bv=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE),r="class "+i+":\n";r+=" def __init__(self):\n";for(var s=new Array(this.itemCount_),o=0;oe in t}const Ax={},Sx=[],Cx=()=>{},Ox=()=>!1,Mx=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),kx=e=>e.startsWith("onUpdate:"),Rx=Object.assign,Nx=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Dx=Object.prototype.hasOwnProperty,Fx=(e,t)=>Dx.call(e,t),Lx=Array.isArray,Px=e=>"[object Map]"===Hx(e),Bx=e=>"[object Set]"===Hx(e),$x=e=>"[object Date]"===Hx(e),Ux=e=>"function"==typeof e,Vx=e=>"string"==typeof e,zx=e=>"symbol"==typeof e,jx=e=>null!==e&&"object"==typeof e,Yx=e=>(jx(e)||Ux(e))&&Ux(e.then)&&Ux(e.catch),Gx=Object.prototype.toString,Hx=e=>Gx.call(e),Wx=e=>Hx(e).slice(8,-1),Xx=e=>"[object Object]"===Hx(e),qx=e=>Vx(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,Kx=Ix(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Zx=Ix("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Qx=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Jx=/-(\w)/g,eE=Qx(e=>e.replace(Jx,(e,t)=>t?t.toUpperCase():"")),tE=/\B([A-Z])/g,nE=Qx(e=>e.replace(tE,"-$1").toLowerCase()),iE=Qx(e=>e.charAt(0).toUpperCase()+e.slice(1)),rE=Qx(e=>e?`on${iE(e)}`:""),sE=(e,t)=>!Object.is(e,t),oE=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},lE=e=>{const t=parseFloat(e);return isNaN(t)?e:t},uE=e=>{const t=Vx(e)?Number(e):NaN;return isNaN(t)?e:t};let cE;const dE=()=>cE||(cE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:{});const hE=Ix("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function pE(e){if(Lx(e)){const t={};for(let n=0;n{if(e){const n=e.split(mE);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function yE(e){let t="";if(Vx(e))t=e;else if(Lx(e))for(let n=0;n?@[\\\]^`{|}~]/g;function kE(e,t){return e.replace(ME,e=>t?'"'===e?'\\\\\\"':`\\\\${e}`:`\\${e}`)}function RE(e,t){if(e===t)return!0;let n=$x(e),i=$x(t);if(n||i)return!(!n||!i)&&e.getTime()===t.getTime();if(n=zx(e),i=zx(t),n||i)return e===t;if(n=Lx(e),i=Lx(t),n||i)return!(!n||!i)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&iRE(e,t))}const DE=e=>!(!e||!0!==e.__v_isRef),FE=e=>Vx(e)?e:null==e?"":Lx(e)||jx(e)&&(e.toString===Gx||!Ux(e.toString))?DE(e)?FE(e.value):JSON.stringify(e,LE,2):String(e),LE=(e,t)=>DE(t)?LE(e,t.value):Px(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[PE(t,i)+" =>"]=n,e),{})}:Bx(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>PE(e))}:zx(t)?PE(t):!jx(t)||Lx(t)||Xx(t)?t:String(t),PE=(e,t="")=>{var n;return zx(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let BE,$E;class UE{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=BE,!e&&BE&&(this.index=(BE.scopes||(BE.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0)return;if(WE){let e=WE;for(WE=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;HE;){let t=HE;for(HE=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function QE(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function JE(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),nw(i),iw(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function ew(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(tw(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function tw(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===dw)return;e.globalVersion=dw;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!ew(e))return void(e.flags&=-3);const n=$E,i=ow;$E=e,ow=!0;try{QE(e);const n=e.fn(e._value);(0===t.version||sE(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{$E=n,ow=i,JE(e),e.flags&=-3}}function nw(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)nw(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function iw(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function rw(e,t){e.effect instanceof GE&&(e=e.effect.fn);const n=new GE(e);t&&Rx(n,t);try{n.run()}catch(e){throw n.stop(),e}const i=n.run.bind(n);return i.effect=n,i}function sw(e){e.effect.stop()}let ow=!0;const aw=[];function lw(){aw.push(ow),ow=!1}function uw(){const e=aw.pop();ow=void 0===e||e}function cw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=$E;$E=void 0;try{t()}finally{$E=e}}}let dw=0;class hw{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class pw{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!$E||!ow||$E===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==$E)t=this.activeLink=new hw($E,this),$E.deps?(t.prevDep=$E.depsTail,$E.depsTail.nextDep=t,$E.depsTail=t):$E.deps=$E.depsTail=t,fw(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=$E.depsTail,t.nextDep=void 0,$E.depsTail.nextDep=t,$E.depsTail=t,$E.deps===t&&($E.deps=e)}return t}trigger(e){this.version++,dw++,this.notify(e)}notify(e){KE();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ZE()}}}function fw(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)fw(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const mw=new WeakMap,gw=Symbol(""),_w=Symbol(""),yw=Symbol("");function vw(e,t,n){if(ow&&$E){let t=mw.get(e);t||mw.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new pw),i.map=t,i.key=n),i.track()}}function bw(e,t,n,i,r,s){const o=mw.get(e);if(!o)return void dw++;const a=e=>{e&&e.trigger()};if(KE(),"clear"===t)o.forEach(a);else{const r=Lx(e),s=r&&qx(n);if(r&&"length"===n){const e=Number(i);o.forEach((t,n)=>{("length"===n||n===yw||!zx(n)&&n>=e)&&a(t)})}else switch((void 0!==n||o.has(void 0))&&a(o.get(n)),s&&a(o.get(yw)),t){case"add":r?s&&a(o.get("length")):(a(o.get(gw)),Px(e)&&a(o.get(_w)));break;case"delete":r||(a(o.get(gw)),Px(e)&&a(o.get(_w)));break;case"set":Px(e)&&a(o.get(gw))}}ZE()}function Tw(e){const t=lI(e);return t===e?t:(vw(t,0,yw),oI(e)?t:t.map(cI))}function xw(e){return vw(e=lI(e),0,yw),e}const Ew={__proto__:null,[Symbol.iterator](){return ww(this,Symbol.iterator,cI)},concat(...e){return Tw(this).concat(...e.map(e=>Lx(e)?Tw(e):e))},entries(){return ww(this,"entries",e=>(e[1]=cI(e[1]),e))},every(e,t){return Aw(this,"every",e,t,void 0,arguments)},filter(e,t){return Aw(this,"filter",e,t,e=>e.map(cI),arguments)},find(e,t){return Aw(this,"find",e,t,cI,arguments)},findIndex(e,t){return Aw(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Aw(this,"findLast",e,t,cI,arguments)},findLastIndex(e,t){return Aw(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Aw(this,"forEach",e,t,void 0,arguments)},includes(...e){return Cw(this,"includes",e)},indexOf(...e){return Cw(this,"indexOf",e)},join(e){return Tw(this).join(e)},lastIndexOf(...e){return Cw(this,"lastIndexOf",e)},map(e,t){return Aw(this,"map",e,t,void 0,arguments)},pop(){return Ow(this,"pop")},push(...e){return Ow(this,"push",e)},reduce(e,...t){return Sw(this,"reduce",e,t)},reduceRight(e,...t){return Sw(this,"reduceRight",e,t)},shift(){return Ow(this,"shift")},some(e,t){return Aw(this,"some",e,t,void 0,arguments)},splice(...e){return Ow(this,"splice",e)},toReversed(){return Tw(this).toReversed()},toSorted(e){return Tw(this).toSorted(e)},toSpliced(...e){return Tw(this).toSpliced(...e)},unshift(...e){return Ow(this,"unshift",e)},values(){return ww(this,"values",cI)}};function ww(e,t,n){const i=xw(e),r=i[t]();return i===e||oI(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const Iw=Array.prototype;function Aw(e,t,n,i,r,s){const o=xw(e),a=o!==e&&!oI(e),l=o[t];if(l!==Iw[t]){const t=l.apply(e,s);return a?cI(t):t}let u=n;o!==e&&(a?u=function(t,i){return n.call(this,cI(t),i,e)}:n.length>2&&(u=function(t,i){return n.call(this,t,i,e)}));const c=l.call(o,u,i);return a&&r?r(c):c}function Sw(e,t,n,i){const r=xw(e);let s=n;return r!==e&&(oI(e)?n.length>3&&(s=function(t,i,r){return n.call(this,t,i,r,e)}):s=function(t,i,r){return n.call(this,t,cI(i),r,e)}),r[t](s,...i)}function Cw(e,t,n){const i=lI(e);vw(i,0,yw);const r=i[t](...n);return-1!==r&&!1!==r||!aI(n[0])?r:(n[0]=lI(n[0]),i[t](...n))}function Ow(e,t,n=[]){lw(),KE();const i=lI(e)[t].apply(e,n);return ZE(),uw(),i}const Mw=Ix("__proto__,__v_isRef,__isVue"),kw=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(zx));function Rw(e){zx(e)||(e=String(e));const t=lI(this);return vw(t,0,e),t.hasOwnProperty(e)}class Nw{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?Qw:Zw:r?Kw:qw).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=Lx(e);if(!i){let e;if(s&&(e=Ew[t]))return e;if("hasOwnProperty"===t)return Rw}const o=Reflect.get(e,t,hI(e)?e:n);return(zx(t)?kw.has(t):Mw(t))?o:(i||vw(e,0,t),r?o:hI(o)?s&&qx(t)?o:o.value:jx(o)?i?tI(o):Jw(o):o)}}class Dw extends Nw{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=sI(r);if(oI(n)||sI(n)||(r=lI(r),n=lI(n)),!Lx(e)&&hI(r)&&!hI(n))return!t&&(r.value=n,!0)}const s=Lx(e)&&qx(t)?Number(t)e,Vw=e=>Reflect.getPrototypeOf(e);function zw(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function jw(e,t){const n={get(n){const i=this.__v_raw,r=lI(i),s=lI(n);e||(sE(n,s)&&vw(r,0,n),vw(r,0,s));const{has:o}=Vw(r),a=t?Uw:e?dI:cI;return o.call(r,n)?a(i.get(n)):o.call(r,s)?a(i.get(s)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&vw(lI(t),0,gw),Reflect.get(t,"size",t)},has(t){const n=this.__v_raw,i=lI(n),r=lI(t);return e||(sE(t,r)&&vw(i,0,t),vw(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,s=r.__v_raw,o=lI(s),a=t?Uw:e?dI:cI;return!e&&vw(o,0,gw),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}};Rx(n,e?{add:zw("add"),set:zw("set"),delete:zw("delete"),clear:zw("clear")}:{add(e){t||oI(e)||sI(e)||(e=lI(e));const n=lI(this);return Vw(n).has.call(n,e)||(n.add(e),bw(n,"add",e,e)),this},set(e,n){t||oI(n)||sI(n)||(n=lI(n));const i=lI(this),{has:r,get:s}=Vw(i);let o=r.call(i,e);o||(e=lI(e),o=r.call(i,e));const a=s.call(i,e);return i.set(e,n),o?sE(n,a)&&bw(i,"set",e,n):bw(i,"add",e,n),this},delete(e){const t=lI(this),{has:n,get:i}=Vw(t);let r=n.call(t,e);r||(e=lI(e),r=n.call(t,e));i&&i.call(t,e);const s=t.delete(e);return r&&bw(t,"delete",e,void 0),s},clear(){const e=lI(this),t=0!==e.size,n=e.clear();return t&&bw(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,s=lI(r),o=Px(s),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,u=r[e](...i),c=n?Uw:t?dI:cI;return!t&&vw(s,0,l?_w:gw),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function Yw(e,t){const n=jw(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(Fx(n,i)&&i in t?n:t,i,r)}const Gw={get:Yw(!1,!1)},Hw={get:Yw(!1,!0)},Ww={get:Yw(!0,!1)},Xw={get:Yw(!0,!0)};const qw=new WeakMap,Kw=new WeakMap,Zw=new WeakMap,Qw=new WeakMap;function Jw(e){return sI(e)?e:iI(e,!1,Lw,Gw,qw)}function eI(e){return iI(e,!1,Bw,Hw,Kw)}function tI(e){return iI(e,!0,Pw,Ww,Zw)}function nI(e){return iI(e,!0,$w,Xw,Qw)}function iI(e,t,n,i,r){if(!jx(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(Wx(a));var a;if(0===o)return e;const l=new Proxy(e,2===o?i:n);return r.set(e,l),l}function rI(e){return sI(e)?rI(e.__v_raw):!(!e||!e.__v_isReactive)}function sI(e){return!(!e||!e.__v_isReadonly)}function oI(e){return!(!e||!e.__v_isShallow)}function aI(e){return!!e&&!!e.__v_raw}function lI(e){const t=e&&e.__v_raw;return t?lI(t):e}function uI(e){return!Fx(e,"__v_skip")&&Object.isExtensible(e)&&aE(e,"__v_skip",!0),e}const cI=e=>jx(e)?Jw(e):e,dI=e=>jx(e)?tI(e):e;function hI(e){return!!e&&!0===e.__v_isRef}function pI(e){return mI(e,!1)}function fI(e){return mI(e,!0)}function mI(e,t){return hI(e)?e:new gI(e,t)}class gI{constructor(e,t){this.dep=new pw,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:lI(e),this._value=t?e:cI(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||oI(e)||sI(e);e=n?e:lI(e),sE(e,t)&&(this._rawValue=e,this._value=n?e:cI(e),this.dep.trigger())}}function _I(e){e.dep&&e.dep.trigger()}function yI(e){return hI(e)?e.value:e}function vI(e){return Ux(e)?e():yI(e)}const bI={get:(e,t,n)=>"__v_raw"===t?e:yI(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return hI(r)&&!hI(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function TI(e){return rI(e)?e:new Proxy(e,bI)}class xI{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new pw,{get:n,set:i}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function EI(e){return new xI(e)}function wI(e){const t=Lx(e)?new Array(e.length):{};for(const n in e)t[n]=CI(e,n);return t}class II{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=mw.get(e);return n&&n.get(t)}(lI(this._object),this._key)}}class AI{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function SI(e,t,n){return hI(e)?e:Ux(e)?new AI(e):jx(e)&&arguments.length>1?CI(e,t,n):pI(e)}function CI(e,t,n){const i=e[t];return hI(i)?i:new II(e,t,n)}class OI{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new pw(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=dw-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||$E===this))return qE(this,!0),!0}get value(){const e=this.dep.track();return tw(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const MI={GET:"get",HAS:"has",ITERATE:"iterate"},kI={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},RI={},NI=new WeakMap;let DI;function FI(){return DI}function LI(e,t=!1,n=DI){if(n){let t=NI.get(n);t||NI.set(n,t=[]),t.push(e)}else 0}function PI(e,t=1/0,n){if(t<=0||!jx(e)||e.__v_skip)return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,hI(e))PI(e.value,t,n);else if(Lx(e))for(let i=0;i{PI(e,t,n)});else if(Xx(e)){for(const i in e)PI(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&PI(e[i],t,n)}return e} +function Ox(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const Mx={},kx=[],Rx=()=>{},Nx=()=>!1,Dx=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fx=e=>e.startsWith("onUpdate:"),Lx=Object.assign,Px=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Bx=Object.prototype.hasOwnProperty,$x=(e,t)=>Bx.call(e,t),Ux=Array.isArray,Vx=e=>"[object Map]"===Kx(e),zx=e=>"[object Set]"===Kx(e),jx=e=>"[object Date]"===Kx(e),Yx=e=>"function"==typeof e,Gx=e=>"string"==typeof e,Hx=e=>"symbol"==typeof e,Wx=e=>null!==e&&"object"==typeof e,Xx=e=>(Wx(e)||Yx(e))&&Yx(e.then)&&Yx(e.catch),qx=Object.prototype.toString,Kx=e=>qx.call(e),Zx=e=>Kx(e).slice(8,-1),Qx=e=>"[object Object]"===Kx(e),Jx=e=>Gx(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,eE=Ox(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),tE=Ox("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),nE=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},iE=/-(\w)/g,rE=nE(e=>e.replace(iE,(e,t)=>t?t.toUpperCase():"")),sE=/\B([A-Z])/g,oE=nE(e=>e.replace(sE,"-$1").toLowerCase()),aE=nE(e=>e.charAt(0).toUpperCase()+e.slice(1)),lE=nE(e=>e?`on${aE(e)}`:""),uE=(e,t)=>!Object.is(e,t),cE=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},hE=e=>{const t=parseFloat(e);return isNaN(t)?e:t},pE=e=>{const t=Gx(e)?Number(e):NaN;return isNaN(t)?e:t};let fE;const mE=()=>fE||(fE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:{});const gE=Ox("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function _E(e){if(Ux(e)){const t={};for(let n=0;n{if(e){const n=e.split(vE);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function xE(e){let t="";if(Gx(e))t=e;else if(Ux(e))for(let n=0;n?@[\\\]^`{|}~]/g;function FE(e,t){return e.replace(DE,e=>t?'"'===e?'\\\\\\"':`\\\\${e}`:`\\${e}`)}function LE(e,t){if(e===t)return!0;let n=jx(e),i=jx(t);if(n||i)return!(!n||!i)&&e.getTime()===t.getTime();if(n=Hx(e),i=Hx(t),n||i)return e===t;if(n=Ux(e),i=Ux(t),n||i)return!(!n||!i)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&iLE(e,t))}const BE=e=>!(!e||!0!==e.__v_isRef),$E=e=>Gx(e)?e:null==e?"":Ux(e)||Wx(e)&&(e.toString===qx||!Yx(e.toString))?BE(e)?$E(e.value):JSON.stringify(e,UE,2):String(e),UE=(e,t)=>BE(t)?UE(e,t.value):Vx(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[VE(t,i)+" =>"]=n,e),{})}:zx(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>VE(e))}:Hx(t)?VE(t):!Wx(t)||Ux(t)||Qx(t)?t:String(t),VE=(e,t="")=>{var n;return Hx(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let zE,jE;class YE{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=zE,!e&&zE&&(this.index=(zE.scopes||(zE.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0)return;if(ZE){let e=ZE;for(ZE=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;KE;){let t=KE;for(KE=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function nw(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function iw(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),ow(i),aw(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function rw(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sw(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sw(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===mw)return;e.globalVersion=mw;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!rw(e))return void(e.flags&=-3);const n=jE,i=cw;jE=e,cw=!0;try{nw(e);const n=e.fn(e._value);(0===t.version||uE(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{jE=n,cw=i,iw(e),e.flags&=-3}}function ow(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ow(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function aw(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function lw(e,t){e.effect instanceof qE&&(e=e.effect.fn);const n=new qE(e);t&&Lx(n,t);try{n.run()}catch(e){throw n.stop(),e}const i=n.run.bind(n);return i.effect=n,i}function uw(e){e.effect.stop()}let cw=!0;const dw=[];function hw(){dw.push(cw),cw=!1}function pw(){const e=dw.pop();cw=void 0===e||e}function fw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=jE;jE=void 0;try{t()}finally{jE=e}}}let mw=0;class gw{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class _w{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!jE||!cw||jE===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==jE)t=this.activeLink=new gw(jE,this),jE.deps?(t.prevDep=jE.depsTail,jE.depsTail.nextDep=t,jE.depsTail=t):jE.deps=jE.depsTail=t,yw(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=jE.depsTail,t.nextDep=void 0,jE.depsTail.nextDep=t,jE.depsTail=t,jE.deps===t&&(jE.deps=e)}return t}trigger(e){this.version++,mw++,this.notify(e)}notify(e){ew();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{tw()}}}function yw(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)yw(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vw=new WeakMap,bw=Symbol(""),Tw=Symbol(""),xw=Symbol("");function Ew(e,t,n){if(cw&&jE){let t=vw.get(e);t||vw.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new _w),i.map=t,i.key=n),i.track()}}function ww(e,t,n,i,r,s){const o=vw.get(e);if(!o)return void mw++;const a=e=>{e&&e.trigger()};if(ew(),"clear"===t)o.forEach(a);else{const r=Ux(e),s=r&&Jx(n);if(r&&"length"===n){const e=Number(i);o.forEach((t,n)=>{("length"===n||n===xw||!Hx(n)&&n>=e)&&a(t)})}else switch((void 0!==n||o.has(void 0))&&a(o.get(n)),s&&a(o.get(xw)),t){case"add":r?s&&a(o.get("length")):(a(o.get(bw)),Vx(e)&&a(o.get(Tw)));break;case"delete":r||(a(o.get(bw)),Vx(e)&&a(o.get(Tw)));break;case"set":Vx(e)&&a(o.get(bw))}}tw()}function Iw(e){const t=hI(e);return t===e?t:(Ew(t,0,xw),cI(e)?t:t.map(fI))}function Aw(e){return Ew(e=hI(e),0,xw),e}const Sw={__proto__:null,[Symbol.iterator](){return Cw(this,Symbol.iterator,fI)},concat(...e){return Iw(this).concat(...e.map(e=>Ux(e)?Iw(e):e))},entries(){return Cw(this,"entries",e=>(e[1]=fI(e[1]),e))},every(e,t){return Mw(this,"every",e,t,void 0,arguments)},filter(e,t){return Mw(this,"filter",e,t,e=>e.map(fI),arguments)},find(e,t){return Mw(this,"find",e,t,fI,arguments)},findIndex(e,t){return Mw(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Mw(this,"findLast",e,t,fI,arguments)},findLastIndex(e,t){return Mw(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Mw(this,"forEach",e,t,void 0,arguments)},includes(...e){return Rw(this,"includes",e)},indexOf(...e){return Rw(this,"indexOf",e)},join(e){return Iw(this).join(e)},lastIndexOf(...e){return Rw(this,"lastIndexOf",e)},map(e,t){return Mw(this,"map",e,t,void 0,arguments)},pop(){return Nw(this,"pop")},push(...e){return Nw(this,"push",e)},reduce(e,...t){return kw(this,"reduce",e,t)},reduceRight(e,...t){return kw(this,"reduceRight",e,t)},shift(){return Nw(this,"shift")},some(e,t){return Mw(this,"some",e,t,void 0,arguments)},splice(...e){return Nw(this,"splice",e)},toReversed(){return Iw(this).toReversed()},toSorted(e){return Iw(this).toSorted(e)},toSpliced(...e){return Iw(this).toSpliced(...e)},unshift(...e){return Nw(this,"unshift",e)},values(){return Cw(this,"values",fI)}};function Cw(e,t,n){const i=Aw(e),r=i[t]();return i===e||cI(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const Ow=Array.prototype;function Mw(e,t,n,i,r,s){const o=Aw(e),a=o!==e&&!cI(e),l=o[t];if(l!==Ow[t]){const t=l.apply(e,s);return a?fI(t):t}let u=n;o!==e&&(a?u=function(t,i){return n.call(this,fI(t),i,e)}:n.length>2&&(u=function(t,i){return n.call(this,t,i,e)}));const c=l.call(o,u,i);return a&&r?r(c):c}function kw(e,t,n,i){const r=Aw(e);let s=n;return r!==e&&(cI(e)?n.length>3&&(s=function(t,i,r){return n.call(this,t,i,r,e)}):s=function(t,i,r){return n.call(this,t,fI(i),r,e)}),r[t](s,...i)}function Rw(e,t,n){const i=hI(e);Ew(i,0,xw);const r=i[t](...n);return-1!==r&&!1!==r||!dI(n[0])?r:(n[0]=hI(n[0]),i[t](...n))}function Nw(e,t,n=[]){hw(),ew();const i=hI(e)[t].apply(e,n);return tw(),pw(),i}const Dw=Ox("__proto__,__v_isRef,__isVue"),Fw=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(Hx));function Lw(e){Hx(e)||(e=String(e));const t=hI(this);return Ew(t,0,e),t.hasOwnProperty(e)}class Pw{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?nI:tI:r?eI:Jw).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=Ux(e);if(!i){let e;if(s&&(e=Sw[t]))return e;if("hasOwnProperty"===t)return Lw}const o=Reflect.get(e,t,gI(e)?e:n);return(Hx(t)?Fw.has(t):Dw(t))?o:(i||Ew(e,0,t),r?o:gI(o)?s&&Jx(t)?o:o.value:Wx(o)?i?sI(o):iI(o):o)}}class Bw extends Pw{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=uI(r);if(cI(n)||uI(n)||(r=hI(r),n=hI(n)),!Ux(e)&&gI(r)&&!gI(n))return!t&&(r.value=n,!0)}const s=Ux(e)&&Jx(t)?Number(t)e,Gw=e=>Reflect.getPrototypeOf(e);function Hw(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ww(e,t){const n={get(n){const i=this.__v_raw,r=hI(i),s=hI(n);e||(uE(n,s)&&Ew(r,0,n),Ew(r,0,s));const{has:o}=Gw(r),a=t?Yw:e?mI:fI;return o.call(r,n)?a(i.get(n)):o.call(r,s)?a(i.get(s)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&Ew(hI(t),0,bw),Reflect.get(t,"size",t)},has(t){const n=this.__v_raw,i=hI(n),r=hI(t);return e||(uE(t,r)&&Ew(i,0,t),Ew(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,s=r.__v_raw,o=hI(s),a=t?Yw:e?mI:fI;return!e&&Ew(o,0,bw),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}};Lx(n,e?{add:Hw("add"),set:Hw("set"),delete:Hw("delete"),clear:Hw("clear")}:{add(e){t||cI(e)||uI(e)||(e=hI(e));const n=hI(this);return Gw(n).has.call(n,e)||(n.add(e),ww(n,"add",e,e)),this},set(e,n){t||cI(n)||uI(n)||(n=hI(n));const i=hI(this),{has:r,get:s}=Gw(i);let o=r.call(i,e);o||(e=hI(e),o=r.call(i,e));const a=s.call(i,e);return i.set(e,n),o?uE(n,a)&&ww(i,"set",e,n):ww(i,"add",e,n),this},delete(e){const t=hI(this),{has:n,get:i}=Gw(t);let r=n.call(t,e);r||(e=hI(e),r=n.call(t,e));i&&i.call(t,e);const s=t.delete(e);return r&&ww(t,"delete",e,void 0),s},clear(){const e=hI(this),t=0!==e.size,n=e.clear();return t&&ww(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,s=hI(r),o=Vx(s),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,u=r[e](...i),c=n?Yw:t?mI:fI;return!t&&Ew(s,0,l?Tw:bw),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function Xw(e,t){const n=Ww(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get($x(n,i)&&i in t?n:t,i,r)}const qw={get:Xw(!1,!1)},Kw={get:Xw(!1,!0)},Zw={get:Xw(!0,!1)},Qw={get:Xw(!0,!0)};const Jw=new WeakMap,eI=new WeakMap,tI=new WeakMap,nI=new WeakMap;function iI(e){return uI(e)?e:aI(e,!1,Uw,qw,Jw)}function rI(e){return aI(e,!1,zw,Kw,eI)}function sI(e){return aI(e,!0,Vw,Zw,tI)}function oI(e){return aI(e,!0,jw,Qw,nI)}function aI(e,t,n,i,r){if(!Wx(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(Zx(a));var a;if(0===o)return e;const l=new Proxy(e,2===o?i:n);return r.set(e,l),l}function lI(e){return uI(e)?lI(e.__v_raw):!(!e||!e.__v_isReactive)}function uI(e){return!(!e||!e.__v_isReadonly)}function cI(e){return!(!e||!e.__v_isShallow)}function dI(e){return!!e&&!!e.__v_raw}function hI(e){const t=e&&e.__v_raw;return t?hI(t):e}function pI(e){return!$x(e,"__v_skip")&&Object.isExtensible(e)&&dE(e,"__v_skip",!0),e}const fI=e=>Wx(e)?iI(e):e,mI=e=>Wx(e)?sI(e):e;function gI(e){return!!e&&!0===e.__v_isRef}function _I(e){return vI(e,!1)}function yI(e){return vI(e,!0)}function vI(e,t){return gI(e)?e:new bI(e,t)}class bI{constructor(e,t){this.dep=new _w,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:hI(e),this._value=t?e:fI(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||cI(e)||uI(e);e=n?e:hI(e),uE(e,t)&&(this._rawValue=e,this._value=n?e:fI(e),this.dep.trigger())}}function TI(e){e.dep&&e.dep.trigger()}function xI(e){return gI(e)?e.value:e}function EI(e){return Yx(e)?e():xI(e)}const wI={get:(e,t,n)=>"__v_raw"===t?e:xI(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return gI(r)&&!gI(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function II(e){return lI(e)?e:new Proxy(e,wI)}class AI{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new _w,{get:n,set:i}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function SI(e){return new AI(e)}function CI(e){const t=Ux(e)?new Array(e.length):{};for(const n in e)t[n]=RI(e,n);return t}class OI{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=vw.get(e);return n&&n.get(t)}(hI(this._object),this._key)}}class MI{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function kI(e,t,n){return gI(e)?e:Yx(e)?new MI(e):Wx(e)&&arguments.length>1?RI(e,t,n):_I(e)}function RI(e,t,n){const i=e[t];return gI(i)?i:new OI(e,t,n)}class NI{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new _w(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=mw-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||jE===this))return JE(this,!0),!0}get value(){const e=this.dep.track();return sw(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const DI={GET:"get",HAS:"has",ITERATE:"iterate"},FI={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},LI={},PI=new WeakMap;let BI;function $I(){return BI}function UI(e,t=!1,n=BI){if(n){let t=PI.get(n);t||PI.set(n,t=[]),t.push(e)}else 0}function VI(e,t=1/0,n){if(t<=0||!Wx(e)||e.__v_skip)return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,gI(e))VI(e.value,t,n);else if(Ux(e))for(let i=0;i{VI(e,t,n)});else if(Qx(e)){for(const i in e)VI(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&VI(e[i],t,n)}return e} /** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ -const BI=[];let $I=!1;function UI(e,...t){if($I)return;$I=!0,lw();const n=BI.length?BI[BI.length-1].component:null,i=n&&n.appContext.config.warnHandler,r=function(){let e=BI[BI.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const i=e.component&&e.component.parent;e=i&&i.vnode}return t}();if(i)HI(i,n,11,[e+t.map(e=>{var t,n;return null!=(n=null==(t=e.toString)?void 0:t.call(e))?n:JSON.stringify(e)}).join(""),n&&n.proxy,r.map(({vnode:e})=>`at <${qM(n,e.type)}>`).join("\n"),r]);else{const n=[`[Vue warn]: ${e}`,...t];r.length&&n.push("\n",...function(e){const t=[];return e.forEach((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",i=!!e.component&&null==e.component.parent,r=` at <${qM(e.component,e.type,i)}`,s=">"+n;return e.props?[r,...VI(e.props),s]:[r+s]}(e))}),t}(r)),console.warn(...n)}uw(),$I=!1}function VI(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...zI(n,e[n]))}),n.length>3&&t.push(" ..."),t}function zI(e,t,n){return Vx(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:hI(t)?(t=zI(e,lI(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Ux(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=lI(t),n?t:[`${e}=`,t])}function jI(e,t){}const YI={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},GI={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function HI(e,t,n,i){try{return i?e(...i):e()}catch(e){XI(e,t,n)}}function WI(e,t,n,i){if(Ux(e)){const r=HI(e,t,n,i);return r&&Yx(r)&&r.catch(e=>{XI(e,t,n)}),r}if(Lx(e)){const r=[];for(let s=0;s=lA(n)?qI.push(e):qI.splice(function(e){let t=KI+1,n=qI.length;for(;t>>1,r=qI[i],s=lA(r);slA(e)-lA(t));if(ZI.length=0,QI)return void QI.push(...e);for(QI=e,JI=0;JInull==e.id?2&e.flags?-1:1/0:e.id;function uA(e){try{for(KI=0;KIcA.emit(e,...t)),dA=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null==(i=null==(n=window.navigator)?void 0:n.userAgent)?void 0:i.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{fA(e,t)}),setTimeout(()=>{cA||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,hA=!0,dA=[])},3e3)}else hA=!0,dA=[]}const mA=vA("component:added"),gA=vA("component:updated"),_A=vA("component:removed"),yA=e=>{cA&&"function"==typeof cA.cleanupBuffer&&!cA.cleanupBuffer(e)&&_A(e)}; +const zI=[];let jI=!1;function YI(e,...t){if(jI)return;jI=!0,hw();const n=zI.length?zI[zI.length-1].component:null,i=n&&n.appContext.config.warnHandler,r=function(){let e=zI[zI.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const i=e.component&&e.component.parent;e=i&&i.vnode}return t}();if(i)KI(i,n,11,[e+t.map(e=>{var t,n;return null!=(n=null==(t=e.toString)?void 0:t.call(e))?n:JSON.stringify(e)}).join(""),n&&n.proxy,r.map(({vnode:e})=>`at <${JM(n,e.type)}>`).join("\n"),r]);else{const n=[`[Vue warn]: ${e}`,...t];r.length&&n.push("\n",...function(e){const t=[];return e.forEach((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",i=!!e.component&&null==e.component.parent,r=` at <${JM(e.component,e.type,i)}`,s=">"+n;return e.props?[r,...GI(e.props),s]:[r+s]}(e))}),t}(r)),console.warn(...n)}pw(),jI=!1}function GI(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...HI(n,e[n]))}),n.length>3&&t.push(" ..."),t}function HI(e,t,n){return Gx(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:gI(t)?(t=HI(e,hI(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Yx(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=hI(t),n?t:[`${e}=`,t])}function WI(e,t){}const XI={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},qI={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function KI(e,t,n,i){try{return i?e(...i):e()}catch(e){QI(e,t,n)}}function ZI(e,t,n,i){if(Yx(e)){const r=KI(e,t,n,i);return r&&Xx(r)&&r.catch(e=>{QI(e,t,n)}),r}if(Ux(e)){const r=[];for(let s=0;s=hA(n)?JI.push(e):JI.splice(function(e){let t=eA+1,n=JI.length;for(;t>>1,r=JI[i],s=hA(r);shA(e)-hA(t));if(tA.length=0,nA)return void nA.push(...e);for(nA=e,iA=0;iAnull==e.id?2&e.flags?-1:1/0:e.id;function pA(e){try{for(eA=0;eAfA.emit(e,...t)),mA=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null==(i=null==(n=window.navigator)?void 0:n.userAgent)?void 0:i.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{yA(e,t)}),setTimeout(()=>{fA||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,gA=!0,mA=[])},3e3)}else gA=!0,mA=[]}const vA=EA("component:added"),bA=EA("component:updated"),TA=EA("component:removed"),xA=e=>{fA&&"function"==typeof fA.cleanupBuffer&&!fA.cleanupBuffer(e)&&TA(e)}; /*! #__NO_SIDE_EFFECTS__ */ -function vA(e){return t=>{pA(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let bA=null,TA=null;function xA(e){const t=bA;return bA=e,TA=e&&e.type.__scopeId||null,t}function EA(e){TA=e}function wA(){TA=null}const IA=e=>AA;function AA(e,t=bA,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&iM(-1);const r=xA(t);let s;try{s=e(...n)}finally{xA(r),i._d&&iM(1)}return __VUE_PROD_DEVTOOLS__&&gA(t),s};return i._n=!0,i._c=!0,i._d=!0,i}function SA(e,t){if(null===bA)return e;const n=GM(bA),i=e.dirs||(e.dirs=[]);for(let e=0;ee.__isTeleport,kA=e=>e&&(e.disabled||""===e.disabled),RA=e=>e&&(e.defer||""===e.defer),NA=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,DA=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,FA=(e,t)=>{const n=e&&e.to;if(Vx(n)){if(t){return t(n)}return null}return n},LA={name:"Teleport",__isTeleport:!0,process(e,t,n,i,r,s,o,a,l,u){const{mc:c,pc:d,pbc:h,o:{insert:p,querySelector:f,createText:m,createComment:g}}=u,_=kA(t.props);let{shapeFlag:y,children:v,dynamicChildren:b}=t;if(null==e){const e=t.el=m(""),u=t.anchor=m("");p(e,n,i),p(u,n,i);const d=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(v,e,t,r,s,o,a,l))},h=()=>{const e=t.target=FA(t.props,f),n=UA(e,t,m,p);e&&("svg"!==o&&NA(e)?o="svg":"mathml"!==o&&DA(e)&&(o="mathml"),_||(d(e,n),$A(t,!1)))};_&&(d(n,u),$A(t,!0)),RA(t.props)?uO(()=>{h(),t.el.__isMounted=!0},s):h()}else{if(RA(t.props)&&!e.el.__isMounted)return void uO(()=>{LA.process(e,t,n,i,r,s,o,a,l,u),delete e.el.__isMounted},s);t.el=e.el,t.targetStart=e.targetStart;const c=t.anchor=e.anchor,p=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=kA(e.props),y=g?n:p,v=g?c:m;if("svg"===o||NA(p)?o="svg":("mathml"===o||DA(p))&&(o="mathml"),b?(h(e.dynamicChildren,b,y,r,s,o,a),gO(e,t,!0)):l||d(e,t,y,v,r,s,o,a,!1),_)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):PA(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=FA(t.props,f);e&&PA(t,e,null,u,0)}else g&&PA(t,p,m,u,1);$A(t,_)}},remove(e,t,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:h}=e;if(d&&(r(u),r(c)),s&&r(l),16&o){const e=s||!kA(h);for(let r=0;r{e.isMounted=!0}),jS(()=>{e.isUnmounting=!0}),e}const YA=[Function,Array],GA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:YA,onEnter:YA,onAfterEnter:YA,onEnterCancelled:YA,onBeforeLeave:YA,onLeave:YA,onAfterLeave:YA,onLeaveCancelled:YA,onBeforeAppear:YA,onAppear:YA,onAfterAppear:YA,onAppearCancelled:YA},HA=e=>{const t=e.subTree;return t.component?HA(t.component):t};function WA(e){let t=e[0];if(e.length>1){let n=!1;for(const i of e)if(i.type!==qO){0,t=i,n=!0;break}}return t}const XA={name:"BaseTransition",props:GA,setup(e,{slots:t}){const n=OM(),i=jA();return()=>{const r=t.default&&eS(t.default(),!0);if(!r||!r.length)return;const s=WA(r),o=lI(e),{mode:a}=o;if(i.isLeaving)return ZA(s);const l=QA(s);if(!l)return ZA(s);let u=KA(l,o,i,n,e=>u=e);l.type!==qO&&JA(l,u);let c=n.subTree&&QA(n.subTree);if(c&&c.type!==qO&&!lM(l,c)&&HA(n).type!==qO){let e=KA(c,o,i,n);if(JA(c,e),"out-in"===a&&l.type!==qO)return i.isLeaving=!0,e.afterLeave=()=>{i.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},ZA(s);"in-out"===a&&l.type!==qO?e.delayLeave=(e,t,n)=>{qA(i,c)[String(c.key)]=c,e[VA]=()=>{t(),e[VA]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function qA(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function KA(e,t,n,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:f,onLeaveCancelled:m,onBeforeAppear:g,onAppear:_,onAfterAppear:y,onAppearCancelled:v}=t,b=String(e.key),T=qA(n,e),x=(e,t)=>{e&&WI(e,i,9,t)},E=(e,t)=>{const n=t[1];x(e,t),Lx(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:o,persisted:a,beforeEnter(t){let i=l;if(!n.isMounted){if(!s)return;i=g||l}t[VA]&&t[VA](!0);const r=T[b];r&&lM(e,r)&&r.el[VA]&&r.el[VA](),x(i,[t])},enter(e){let t=u,i=c,r=d;if(!n.isMounted){if(!s)return;t=_||u,i=y||c,r=v||d}let o=!1;const a=e[zA]=t=>{o||(o=!0,x(t?r:i,[e]),w.delayedLeave&&w.delayedLeave(),e[zA]=void 0)};t?E(t,[e,a]):a()},leave(t,i){const r=String(e.key);if(t[zA]&&t[zA](!0),n.isUnmounting)return i();x(h,[t]);let s=!1;const o=t[VA]=n=>{s||(s=!0,i(),x(n?m:f,[t]),t[VA]=void 0,T[r]===e&&delete T[r])};T[r]=e,p?E(p,[t,o]):o()},clone(e){const s=KA(e,t,n,i,r);return r&&r(s),s}};return w}function ZA(e){if(SS(e))return(e=gM(e)).children=null,e}function QA(e){if(!SS(e))return MA(e.type)&&e.children?WA(e.children):e;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&Ux(n.default))return n.default()}}function JA(e,t){6&e.shapeFlag&&e.component?(e.transition=t,JA(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function eS(e,t=!1,n){let i=[],r=0;for(let s=0;s1)for(let e=0;eRx({name:e.name},t,{setup:e}))():e}function nS(){const e=OM();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function iS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rS(e){const t=OM(),n=fI(null);if(t){const i=t.refs===Ax?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}else 0;return n}function sS(e,t,n,i,r=!1){if(Lx(e))return void e.forEach((e,s)=>sS(e,t&&(Lx(t)?t[s]:t),n,i,r));if(wS(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&sS(e,t,n,i.component.subTree));const s=4&i.shapeFlag?GM(i.component):i.el,o=r?null:s,{i:a,r:l}=e;const u=t&&t.r,c=a.refs===Ax?a.refs={}:a.refs,d=a.setupState,h=lI(d),p=d===Ax?()=>!1:e=>Fx(h,e);if(null!=u&&u!==l&&(Vx(u)?(c[u]=null,p(u)&&(d[u]=null)):hI(u)&&(u.value=null)),Ux(l))HI(l,a,12,[o,c]);else{const t=Vx(l),i=hI(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?d[l]:c[l]:l.value;r?Lx(n)&&Nx(n,s):Lx(n)?n.includes(s)||n.push(s):t?(c[l]=[s],p(l)&&(d[l]=c[l])):(l.value=[s],e.k&&(c[e.k]=l.value))}else t?(c[l]=o,p(l)&&(d[l]=o)):i&&(l.value=o,e.k&&(c[e.k]=o))};o?(a.id=-1,uO(a,n)):a()}else 0}}let oS=!1;const aS=()=>{oS||(console.error("Hydration completed but contains mismatches."),oS=!0)},lS=e=>{if(1===e.nodeType)return(e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)(e)?"svg":(e=>e.namespaceURI.includes("MathML"))(e)?"mathml":void 0},uS=e=>8===e.nodeType;function cS(e){const{mt:t,p:n,o:{patchProp:i,createText:r,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:u}}=e,c=(n,i,a,u,y,v=!1)=>{v=v||!!i.dynamicChildren;const b=uS(n)&&"["===n.data,T=()=>f(n,i,a,u,y,b),{type:x,ref:E,shapeFlag:w,patchFlag:I}=i;let A=n.nodeType;i.el=n,__VUE_PROD_DEVTOOLS__&&(aE(n,"__vnode",i,!0),aE(n,"__vueParentComponent",a,!0)),-2===I&&(v=!1,i.dynamicChildren=null);let S=null;switch(x){case XO:3!==A?""===i.children?(l(i.el=r(""),o(n),n),S=n):S=T():(n.data!==i.children&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&UI("Hydration text mismatch in",n.parentNode,`\n - rendered on server: ${JSON.stringify(n.data)}\n - expected on client: ${JSON.stringify(i.children)}`),aS(),n.data=i.children),S=s(n));break;case qO:_(n)?(S=s(n),g(i.el=n.content.firstChild,n,a)):S=8!==A||b?T():s(n);break;case KO:if(b&&(A=(n=s(n)).nodeType),1===A||3===A){S=n;const e=!i.children.length;for(let t=0;t{o=o||!!t.dynamicChildren;const{type:l,props:u,patchFlag:c,shapeFlag:d,dirs:p,transition:f}=t,m="input"===l||"option"===l;if(m||-1!==c){p&&CA(t,null,n,"created");let l,y=!1;if(_(e)){y=mO(null,f)&&n&&n.vnode.props&&n.vnode.props.appear;const i=e.content.firstChild;y&&f.beforeEnter(i),g(i,e,n),t.el=e=i}if(16&d&&(!u||!u.innerHTML&&!u.textContent)){let i=h(e.firstChild,t,e,n,r,s,o),l=!1;for(;i;){_S(e,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!l&&(UI("Hydration children mismatch on",e,"\nServer rendered element contains more child nodes than client vdom."),l=!0),aS());const t=i;i=i.nextSibling,a(t)}}else if(8&d){let n=t.children;"\n"!==n[0]||"PRE"!==e.tagName&&"TEXTAREA"!==e.tagName||(n=n.slice(1)),e.textContent!==n&&(_S(e,0)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&UI("Hydration text content mismatch on",e,`\n - rendered on server: ${e.textContent}\n - expected on client: ${t.children}`),aS()),e.textContent=t.children)}if(u)if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||m||!o||48&c){const r=e.tagName.includes("-");for(const s in u)!__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||p&&p.some(e=>e.dir.created)||!dS(e,s,u[s],t,n)||aS(),(m&&(s.endsWith("value")||"indeterminate"===s)||Mx(s)&&!Kx(s)||"."===s[0]||r)&&i(e,s,null,u[s],void 0,n)}else if(u.onClick)i(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&rI(u.style))for(const e in u.style)u.style[e];(l=u&&u.onVnodeBeforeMount)&&wM(l,n,t),p&&CA(t,null,n,"beforeMount"),((l=u&&u.onVnodeMounted)||p||y)&&GO(()=>{l&&wM(l,n,t),y&&f.enter(e),p&&CA(t,null,n,"mounted")},r)}return e.nextSibling},h=(e,t,i,o,a,u,d)=>{d=d||!!t.dynamicChildren;const h=t.children,p=h.length;let f=!1;for(let t=0;t{const{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);const d=o(e),p=h(s(e),t,d,n,i,r,a);return p&&uS(p)&&"]"===p.data?s(t.anchor=p):(aS(),l(t.anchor=u("]"),d,p),p)},f=(e,t,i,r,l,u)=>{if(_S(e.parentElement,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&UI("Hydration node mismatch:\n- rendered on server:",e,3===e.nodeType?"(text)":uS(e)&&"["===e.data?"(start of fragment)":"","\n- expected on client:",t.type),aS()),t.el=null,u){const t=m(e);for(;;){const n=s(e);if(!n||n===t)break;a(n)}}const c=s(e),d=o(e);return a(e),n(null,t,d,c,i,r,lS(d),l),i&&(i.vnode.el=t.el,BO(i,t.el)),c},m=(e,t="[",n="]")=>{let i=0;for(;e;)if((e=s(e))&&uS(e)&&(e.data===t&&i++,e.data===n)){if(0===i)return s(e);i--}return e},g=(e,t,n)=>{const i=t.parentNode;i&&i.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes())return __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&UI("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,e,t),aA(),void(t._vnode=e);c(t.firstChild,e,null,null,null),aA(),t._vnode=e},c]}function dS(e,t,n,i,r){let s,o,a,l;if("class"===t)a=e.getAttribute("class"),l=yE(n),function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(hS(a||""),hS(l))||(s=2,o="class");else if("style"===t){a=e.getAttribute("style")||"",l=Vx(n)?n:function(e){if(!e)return"";if(Vx(e))return e;let t="";for(const n in e){const i=e[n];(Vx(i)||"number"==typeof i)&&(t+=`${n.startsWith("--")?n:nE(n)}:${i};`)}return t}(pE(n));const t=pS(a),u=pS(l);if(i.dirs)for(const{dir:e,value:t}of i.dirs)"show"!==e.name||t||u.set("display","none");r&&fS(r,i,u),function(e,t){if(e.size!==t.size)return!1;for(const[n,i]of e)if(i!==t.get(n))return!1;return!0}(t,u)||(s=3,o="style")}else(e instanceof SVGElement&&OE(t)||e instanceof HTMLElement&&(AE(t)||CE(t)))&&(AE(t)?(a=e.hasAttribute(t),l=SE(n)):null==n?(a=e.hasAttribute(t),l=!1):(a=e.hasAttribute(t)?e.getAttribute(t):"value"===t&&"TEXTAREA"===e.tagName&&e.value,l=!!function(e){if(null==e)return!1;const t=typeof e;return"string"===t||"number"===t||"boolean"===t}(n)&&String(n)),a!==l&&(s=4,o=t));if(null!=s&&!_S(e,s)){const t=e=>!1===e?"(not rendered)":`${o}="${e}"`;return UI(`Hydration ${gS[s]} mismatch on`,e,`\n - rendered on server: ${t(a)}\n - expected on client: ${t(l)}\n Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.\n You should fix the source of the mismatch.`),!0}return!1}function hS(e){return new Set(e.trim().split(/\s+/))}function pS(e){const t=new Map;for(const n of e.split(";")){let[e,i]=n.split(":");e=e.trim(),i=i&&i.trim(),e&&i&&t.set(e,i)}return t}function fS(e,t,n){const i=e.subTree;if(e.getCssVars&&(t===i||i&&i.type===WO&&i.children.includes(t))){const t=e.getCssVars();for(const e in t)n.set(`--${kE(e,!1)}`,String(t[e]))}t===i&&e.parent&&fS(e.parent,e.vnode,n)}const mS="data-allow-mismatch",gS={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function _S(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(mS);)e=e.parentElement;const n=e&&e.getAttribute(mS);if(null==n)return!1;if(""===n)return!0;{const e=n.split(",");return!(0!==t||!e.includes("children"))||n.split(",").includes(gS[t])}}const yS=dE().requestIdleCallback||(e=>setTimeout(e,1)),vS=dE().cancelIdleCallback||(e=>clearTimeout(e)),bS=(e=1e4)=>t=>{const n=yS(t,{timeout:e});return()=>vS(n)};const TS=e=>(t,n)=>{const i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){i.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element)return function(e){const{top:t,left:n,bottom:i,right:r}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:o}=window;return(t>0&&t0&&i0&&n0&&ri.disconnect()},xS=e=>t=>{if(e){const n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},ES=(e=[])=>(t,n)=>{Vx(e)&&(e=[e]);let i=!1;const r=e=>{i||(i=!0,s(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},s=()=>{n(t=>{for(const n of e)t.removeEventListener(n,r)})};return n(t=>{for(const n of e)t.addEventListener(n,r,{once:!0})}),s};const wS=e=>!!e.type.__asyncLoader; -/*! #__NO_SIDE_EFFECTS__ */function IS(e){Ux(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:r=200,hydrate:s,timeout:o,suspensible:a=!0,onError:l}=e;let u,c=null,d=0;const h=()=>{let e;return c||(e=c=t().catch(e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise((t,n)=>{l(e,()=>t((d++,c=null,h())),()=>n(e),d+1)});throw e}).then(t=>e!==c&&c?c:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),u=t,t)))};return tS({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(e,t,n){const i=s?()=>{const i=s(n,t=>function(e,t){if(uS(e)&&"["===e.data){let n=1,i=e.nextSibling;for(;i;){if(1===i.nodeType){if(!1===t(i))break}else if(uS(i))if("]"===i.data){if(0===--n)break}else"["===i.data&&n++;i=i.nextSibling}}else t(e)}(e,t));i&&(t.bum||(t.bum=[])).push(i)}:n;u?i():h().then(()=>!t.isUnmounted&&i())},get __asyncResolved(){return u},setup(){const e=CM;if(iS(e),u)return()=>AS(u,e);const t=t=>{c=null,XI(t,e,13,!i)};if(a&&e.suspense||PM)return h().then(t=>()=>AS(t,e)).catch(e=>(t(e),()=>i?pM(i,{error:e}):null));const s=pI(!1),l=pI(),d=pI(!!r);return r&&setTimeout(()=>{d.value=!1},r),null!=o&&setTimeout(()=>{if(!s.value&&!l.value){const e=new Error(`Async component timed out after ${o}ms.`);t(e),l.value=e}},o),h().then(()=>{s.value=!0,e.parent&&SS(e.parent.vnode)&&e.parent.update()}).catch(e=>{t(e),l.value=e}),()=>s.value&&u?AS(u,e):l.value&&i?pM(i,{error:l.value}):n&&!d.value?pM(n):void 0}})}function AS(e,t){const{ref:n,props:i,children:r,ce:s}=t.vnode,o=pM(e,i,r);return o.ref=n,o.ce=s,delete t.vnode.ce,o}const SS=e=>e.type.__isKeepAlive,CS={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=OM(),i=n.ctx;if(!i.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const r=new Map,s=new Set;let o=null;__VUE_PROD_DEVTOOLS__&&(n.__v_cache=r);const a=n.suspense,{renderer:{p:l,m:u,um:c,o:{createElement:d}}}=i,h=d("div");function p(e){FS(e),c(e,n,a,!0)}function f(e){r.forEach((t,n)=>{const i=XM(t.type);i&&!e(i)&&m(n)})}function m(e){const t=r.get(e);!t||o&&lM(t,o)?o&&FS(o):p(t),r.delete(e),s.delete(e)}i.activate=(e,t,n,i,r)=>{const s=e.component;u(e,t,n,0,a),l(s.vnode,e,t,n,s,a,i,e.slotScopeIds,r),uO(()=>{s.isDeactivated=!1,s.a&&oE(s.a);const t=e.props&&e.props.onVnodeMounted;t&&wM(t,s.parent,e)},a),__VUE_PROD_DEVTOOLS__&&mA(s)},i.deactivate=e=>{const t=e.component;yO(t.m),yO(t.a),u(e,h,null,1,a),uO(()=>{t.da&&oE(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&wM(n,t.parent,e),t.isDeactivated=!0},a),__VUE_PROD_DEVTOOLS__&&mA(t)},wO(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>MS(e,t)),t&&f(e=>!MS(t,e))},{flush:"post",deep:!0});let g=null;const _=()=>{null!=g&&($O(n.subTree.type)?uO(()=>{r.set(g,LS(n.subTree))},n.subTree.suspense):r.set(g,LS(n.subTree)))};return US(_),zS(_),jS(()=>{r.forEach(e=>{const{subTree:t,suspense:i}=n,r=LS(t);if(e.type===r.type&&e.key===r.key){FS(r);const e=r.component.da;return void(e&&uO(e,i))}p(e)})}),()=>{if(g=null,!t.default)return o=null;const n=t.default(),i=n[0];if(n.length>1)return o=null,n;if(!(aM(i)&&(4&i.shapeFlag||128&i.shapeFlag)))return o=null,i;let a=LS(i);if(a.type===qO)return o=null,a;const l=a.type,u=XM(wS(a)?a.type.__asyncResolved||{}:l),{include:c,exclude:d,max:h}=e;if(c&&(!u||!MS(c,u))||d&&u&&MS(d,u))return a.shapeFlag&=-257,o=a,i;const p=null==a.key?l:a.key,f=r.get(p);return a.el&&(a=gM(a),128&i.shapeFlag&&(i.ssContent=a)),g=p,f?(a.el=f.el,a.component=f.component,a.transition&&JA(a,a.transition),a.shapeFlag|=512,s.delete(p),s.add(p)):(s.add(p),h&&s.size>parseInt(h,10)&&m(s.values().next().value)),a.shapeFlag|=256,o=a,$O(i.type)?i:a}}},OS=CS;function MS(e,t){return Lx(e)?e.some(e=>MS(e,t)):Vx(e)?e.split(",").includes(t):"[object RegExp]"===Hx(e)&&(e.lastIndex=0,e.test(t))}function kS(e,t){NS(e,"a",t)}function RS(e,t){NS(e,"da",t)}function NS(e,t,n=CM){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(PS(t,i,n),n){let e=n.parent;for(;e&&e.parent;)SS(e.parent.vnode)&&DS(i,t,n,e),e=e.parent}}function DS(e,t,n,i){const r=PS(t,e,i,!0);YS(()=>{Nx(i[t],r)},n)}function FS(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function LS(e){return 128&e.shapeFlag?e.ssContent:e}function PS(e,t,n=CM,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{lw();const r=RM(n),s=WI(t,n,e,i);return r(),uw(),s});return i?r.unshift(s):r.push(s),s}}const BS=e=>(t,n=CM)=>{PM&&"sp"!==e||PS(e,(...e)=>t(...e),n)},$S=BS("bm"),US=BS("m"),VS=BS("bu"),zS=BS("u"),jS=BS("bum"),YS=BS("um"),GS=BS("sp"),HS=BS("rtg"),WS=BS("rtc");function XS(e,t=CM){PS("ec",e,t)}const qS="components",KS="directives";function ZS(e,t){return tC(qS,e,!0,t)||e}const QS=Symbol.for("v-ndc");function JS(e){return Vx(e)?tC(qS,e,!1)||e:e||QS}function eC(e){return tC(KS,e)}function tC(e,t,n=!0,i=!1){const r=bA||CM;if(r){const n=r.type;if(e===qS){const e=XM(n,!1);if(e&&(e===t||e===eE(t)||e===iE(eE(t))))return n}const s=nC(r[e]||n[e],t)||nC(r.appContext[e],t);return!s&&i?n:s}}function nC(e,t){return e&&(e[t]||e[eE(t)]||e[iE(eE(t))])}function iC(e,t,n,i){let r;const s=n&&n[i],o=Lx(e);if(o||Vx(e)){let n=!1;o&&rI(e)&&(n=!oI(e),e=xw(e)),r=new Array(e.length);for(let i=0,o=e.length;it(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,o=n.length;i{const t=i.fn(...e);return t&&(t.key=i.key),t}:i.fn)}return e}function sC(e,t,n={},i,r){if(bA.ce||bA.parent&&wS(bA.parent)&&bA.parent.ce)return"default"!==t&&(n.name=t),JO(),oM(WO,null,[pM("slot",n,i&&i())],64);let s=e[t];s&&s._c&&(s._d=!1),JO();const o=s&&oC(s(n)),a=n.key||o&&o.key,l=oM(WO,{key:(a&&!zx(a)?a:`_${t}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function oC(e){return e.some(e=>!aM(e)||e.type!==qO&&!(e.type===WO&&!oC(e.children)))?e:null}function aC(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:rE(i)]=e[i];return n}const lC=e=>e?DM(e)?GM(e):lC(e.parent):null,uC=Rx(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lC(e.parent),$root:e=>lC(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?RC(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{iA(e.update)}),$nextTick:e=>e.n||(e.n=nA.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?AO.bind(e):Cx}),cC=(e,t)=>e!==Ax&&!e.__isScriptSetup&&Fx(e,t),dC={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;let u;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(cC(i,t))return o[t]=1,i[t];if(r!==Ax&&Fx(r,t))return o[t]=2,r[t];if((u=e.propsOptions[0])&&Fx(u,t))return o[t]=3,s[t];if(n!==Ax&&Fx(n,t))return o[t]=4,n[t];__VUE_OPTIONS_API__&&!CC||(o[t]=0)}}const c=uC[t];let d,h;return c?("$attrs"===t&&vw(e.attrs,0,""),c(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==Ax&&Fx(n,t)?(o[t]=4,n[t]):(h=l.config.globalProperties,Fx(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return cC(r,t)?(r[t]=n,!0):i!==Ax&&Fx(i,t)?(i[t]=n,!0):!Fx(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:s}},o){let a;return!!n[o]||e!==Ax&&Fx(e,o)||cC(t,o)||(a=s[0])&&Fx(a,o)||Fx(i,o)||Fx(uC,o)||Fx(r.config.globalProperties,o)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:Fx(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};const hC=Rx({},dC,{get(e,t){if(t!==Symbol.unscopables)return dC.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!hE(t)});function pC(){return null}function fC(){return null}function mC(e){0}function gC(e){0}function _C(){return null}function yC(){0}function vC(e,t){return null}function bC(){return xC().slots}function TC(){return xC().attrs}function xC(){const e=OM();return e.setupContext||(e.setupContext=YM(e))}function EC(e){return Lx(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function wC(e,t){const n=EC(e);for(const e in t){if(e.startsWith("__skip"))continue;let i=n[e];i?Lx(i)||Ux(i)?i=n[e]={type:i,default:t[e]}:i.default=t[e]:null===i&&(i=n[e]={default:t[e]}),i&&t[`__skip_${e}`]&&(i.skipFactory=!0)}return n}function IC(e,t){return e&&t?Lx(e)&&Lx(t)?e.concat(t):Rx({},EC(e),EC(t)):e||t}function AC(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function SC(e){const t=OM();let n=e();return NM(),Yx(n)&&(n=n.catch(e=>{throw RM(t),e})),[n,()=>RM(t)]}let CC=!0;function OC(e){const t=RC(e),n=e.proxy,i=e.ctx;CC=!1,t.beforeCreate&&MC(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:d,mounted:h,beforeUpdate:p,updated:f,activated:m,deactivated:g,beforeDestroy:_,beforeUnmount:y,destroyed:v,unmounted:b,render:T,renderTracked:x,renderTriggered:E,errorCaptured:w,serverPrefetch:I,expose:A,inheritAttrs:S,components:C,directives:O,filters:M}=t;if(u&&function(e,t){Lx(e)&&(e=LC(e));for(const n in e){const i=e[n];let r;r=jx(i)?"default"in i?GC(i.from||n,i.default,!0):GC(i.from||n):GC(i),hI(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(u,i,null),o)for(const e in o){const t=o[e];Ux(t)&&(i[e]=t.bind(n))}if(r){0;const t=r.call(n,n);0,jx(t)&&(e.data=Jw(t))}if(CC=!0,s)for(const e in s){const t=s[e],r=Ux(t)?t.bind(n,n):Ux(t.get)?t.get.bind(n,n):Cx;0;const o=!Ux(t)&&Ux(t.set)?t.set.bind(n):Cx,a=ZM({get:r,set:o});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)kC(a[e],i,n,e);if(l){const e=Ux(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{YC(t,e[t])})}function k(e,t){Lx(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&MC(c,e,"c"),k($S,d),k(US,h),k(VS,p),k(zS,f),k(kS,m),k(RS,g),k(XS,w),k(WS,x),k(HS,E),k(jS,y),k(YS,b),k(GS,I),Lx(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});T&&e.render===Cx&&(e.render=T),null!=S&&(e.inheritAttrs=S),C&&(e.components=C),O&&(e.directives=O),I&&iS(e)}function MC(e,t,n){WI(Lx(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function kC(e,t,n,i){let r=i.includes(".")?SO(n,i):()=>n[i];if(Vx(e)){const n=t[e];Ux(n)&&wO(r,n)}else if(Ux(e))wO(r,e.bind(n));else if(jx(e))if(Lx(e))e.forEach(e=>kC(e,t,n,i));else{const i=Ux(e.handler)?e.handler.bind(n):t[e.handler];Ux(i)&&wO(r,i,e)}else 0}function RC(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>NC(l,e,o,!0)),NC(l,t,o)):l=t,jx(t)&&s.set(t,l),l}function NC(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&NC(e,s,n,!0),r&&r.forEach(t=>NC(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=DC[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const DC={data:FC,props:$C,emits:$C,methods:BC,computed:BC,beforeCreate:PC,created:PC,beforeMount:PC,mounted:PC,beforeUpdate:PC,updated:PC,beforeDestroy:PC,beforeUnmount:PC,destroyed:PC,unmounted:PC,activated:PC,deactivated:PC,errorCaptured:PC,serverPrefetch:PC,components:BC,directives:BC,watch:function(e,t){if(!e)return t;if(!t)return e;const n=Rx(Object.create(null),e);for(const i in t)n[i]=PC(e[i],t[i]);return n},provide:FC,inject:function(e,t){return BC(LC(e),LC(t))}};function FC(e,t){return t?e?function(){return Rx(Ux(e)?e.call(this,this):e,Ux(t)?t.call(this,this):t)}:t:e}function LC(e){if(Lx(e)){const t={};for(let n=0;n(s.has(e)||(e&&Ux(e.install)?(s.add(e),e.install(l,...t)):Ux(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,o,u){if(!a){0;const c=l._ceVNode||pM(n,i);return c.appContext=r,!0===u?u="svg":!1===u&&(u=void 0),o&&t?t(c,s):e(c,s,u),a=!0,l._container=s,s.__vue_app__=l,__VUE_PROD_DEVTOOLS__&&(l._instance=c.component,function(e,t){pA("app:init",e,t,{Fragment:WO,Text:XO,Comment:qO,Static:KO})}(l,nk)),GM(c.component)}},onUnmount(e){o.push(e)},unmount(){a&&(WI(o,l._instance,16),e(null,l._container),__VUE_PROD_DEVTOOLS__&&(l._instance=null,function(e){pA("app:unmount",e)}(l)),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=jC;jC=l;try{return e()}finally{jC=t}}};return l}}let jC=null;function YC(e,t){if(CM){let n=CM.provides;const i=CM.parent&&CM.parent.provides;i===n&&(n=CM.provides=Object.create(i)),n[e]=t}else 0}function GC(e,t,n=!1){const i=CM||bA;if(i||jC){const r=jC?jC._context.provides:i?null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&Ux(t)?t.call(i&&i.proxy):t}else 0}function HC(){return!!(CM||bA||jC)}const WC={},XC=()=>Object.create(WC),qC=e=>Object.getPrototypeOf(e)===WC;function KC(e,t,n,i){const[r,s]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(Kx(l))continue;const u=t[l];let c;r&&Fx(r,c=eE(l))?s&&s.includes(c)?(o||(o={}))[c]=u:n[c]=u:RO(e.emitsOptions,l)||l in i&&u===i[l]||(i[l]=u,a=!0)}if(s){const t=lI(n),i=o||Ax;for(let o=0;o{l=!0;const[n,i]=JC(e,t,!0);Rx(o,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!s&&!l)return jx(e)&&i.set(e,Sx),Sx;if(Lx(s))for(let e=0;e"_"===e[0]||"$stable"===e,nO=e=>Lx(e)?e.map(bM):[bM(e)],iO=(e,t,n)=>{if(t._n)return t;const i=AA((...e)=>nO(t(...e)),n);return i._c=!1,i},rO=(e,t,n)=>{const i=e._ctx;for(const n in e){if(tO(n))continue;const r=e[n];if(Ux(r))t[n]=iO(0,r,i);else if(null!=r){0;const e=nO(r);t[n]=()=>e}}},sO=(e,t)=>{const n=nO(t);e.slots.default=()=>n},oO=(e,t,n)=>{for(const i in t)(n||"_"!==i)&&(e[i]=t[i])},aO=(e,t,n)=>{const i=e.slots=XC();if(32&e.vnode.shapeFlag){const e=t._;e?(oO(i,t,n),n&&aE(i,"_",e,!0)):rO(t,i)}else t&&sO(e,t)},lO=(e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=Ax;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:oO(r,t,n):(s=!t.$stable,rO(t,r)),o=t}else t&&(sO(e,t),o={default:1});if(s)for(const e in r)tO(e)||null!=o[e]||delete r[e]};const uO=GO;function cO(e){return hO(e)}function dO(e){return hO(e,cS)}function hO(e,t){"boolean"!=typeof __VUE_OPTIONS_API__&&(dE().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(dE().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(dE().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const n=dE();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&fA(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:h,setScopeId:p=Cx,insertStaticContent:f}=e,m=(e,t,n,i=null,r=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!lM(e,t)&&(i=z(e),P(e,r,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:u,ref:c,shapeFlag:d}=t;switch(u){case XO:g(e,t,n,i);break;case qO:_(e,t,n,i);break;case KO:null==e&&y(t,n,i,o);break;case WO:S(e,t,n,i,r,s,o,a,l);break;default:1&d?b(e,t,n,i,r,s,o,a,l):6&d?C(e,t,n,i,r,s,o,a,l):(64&d||128&d)&&u.process(e,t,n,i,r,s,o,a,l,G)}null!=c&&r&&sS(c,e&&e.ref,s,t||e,!t)},g=(e,t,n,r)=>{if(null==e)i(t.el=a(t.children),n,r);else{const n=t.el=e.el;t.children!==e.children&&u(n,t.children)}},_=(e,t,n,r)=>{null==e?i(t.el=l(t.children||""),n,r):t.el=e.el},y=(e,t,n,i)=>{[e.el,e.anchor]=f(e.children,t,n,i,e.el,e.anchor)},v=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),r(e),e=n;r(t)},b=(e,t,n,i,r,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?T(t,n,i,r,s,o,a,l):w(e,t,r,s,o,a,l)},T=(e,t,n,r,a,l,u,d)=>{let h,p;const{props:f,shapeFlag:m,transition:g,dirs:_}=e;if(h=e.el=o(e.type,l,f&&f.is,f),8&m?c(h,e.children):16&m&&E(e.children,h,null,r,a,pO(e,l),u,d),_&&CA(e,null,r,"created"),x(h,e,e.scopeId,u,r),f){for(const e in f)"value"===e||Kx(e)||s(h,e,null,f[e],l,r);"value"in f&&s(h,"value",null,f.value,l),(p=f.onVnodeBeforeMount)&&wM(p,r,e)}__VUE_PROD_DEVTOOLS__&&(aE(h,"__vnode",e,!0),aE(h,"__vueParentComponent",r,!0)),_&&CA(e,null,r,"beforeMount");const y=mO(a,g);y&&g.beforeEnter(h),i(h,t,n),((p=f&&f.onVnodeMounted)||y||_)&&uO(()=>{p&&wM(p,r,e),y&&g.enter(h),_&&CA(e,null,r,"mounted")},a)},x=(e,t,n,i,r)=>{if(n&&p(e,n),i)for(let t=0;t{for(let u=l;u{const l=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(l.__vnode=t);let{patchFlag:u,dynamicChildren:d,dirs:h}=t;u|=16&e.patchFlag;const p=e.props||Ax,f=t.props||Ax;let m;if(n&&fO(n,!1),(m=f.onVnodeBeforeUpdate)&&wM(m,n,t,e),h&&CA(t,e,n,"beforeUpdate"),n&&fO(n,!0),(p.innerHTML&&null==f.innerHTML||p.textContent&&null==f.textContent)&&c(l,""),d?I(e.dynamicChildren,d,l,n,i,pO(t,r),o):a||N(e,t,l,null,n,i,pO(t,r),o,!1),u>0){if(16&u)A(l,p,f,n,r);else if(2&u&&p.class!==f.class&&s(l,"class",null,f.class,r),4&u&&s(l,"style",p.style,f.style,r),8&u){const e=t.dynamicProps;for(let t=0;t{m&&wM(m,n,t,e),h&&CA(t,e,n,"updated")},i)},I=(e,t,n,i,r,s,o)=>{for(let a=0;a{if(t!==n){if(t!==Ax)for(const o in t)Kx(o)||o in n||s(e,o,t[o],null,r,i);for(const o in n){if(Kx(o))continue;const a=n[o],l=t[o];a!==l&&"value"!==o&&s(e,o,l,a,r,i)}"value"in n&&s(e,"value",t.value,n.value,r)}},S=(e,t,n,r,s,o,l,u,c)=>{const d=t.el=e?e.el:a(""),h=t.anchor=e?e.anchor:a("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(u=u?u.concat(m):m),null==e?(i(d,n,r),i(h,n,r),E(t.children||[],n,h,s,o,l,u,c)):p>0&&64&p&&f&&e.dynamicChildren?(I(e.dynamicChildren,f,n,s,o,l,u),(null!=t.key||s&&t===s.subTree)&&gO(e,t,!0)):N(e,t,n,h,s,o,l,u,c)},C=(e,t,n,i,r,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,l):O(t,n,i,r,s,o,l):M(e,t,l)},O=(e,t,n,i,r,s,o)=>{const a=e.component=SM(e,i,r);if(SS(e)&&(a.ctx.renderer=G),BM(a,!1,o),a.asyncDep){if(r&&r.registerDep(a,k,o),!e.el){const e=a.subTree=pM(qO);_(null,e,t,n)}}else k(a,e,t,n,r,s,o)},M=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,u=s.emitsOptions;0;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==o&&(i?!o||PO(i,o,u):!!o);if(1024&l)return!0;if(16&l)return i?PO(i,o,u):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:u}=e;{const n=_O(e);if(n)return t&&(t.el=u.el,R(e,t,o)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let c,h=t;0,fO(e,!1),t?(t.el=u.el,R(e,t,o)):t=u,n&&oE(n),(c=t.props&&t.props.onVnodeBeforeUpdate)&&wM(c,l,t,u),fO(e,!0);const p=NO(e);0;const f=e.subTree;e.subTree=p,m(f,p,d(f.el),z(f),e,r,s),t.el=p.el,null===h&&BO(e,p.el),i&&uO(i,r),(c=t.props&&t.props.onVnodeUpdated)&&uO(()=>wM(c,l,t,u),r),__VUE_PROD_DEVTOOLS__&&gA(e)}else{let o;const{el:a,props:l}=t,{bm:u,m:c,parent:d,root:h,type:p}=e,f=wS(t);if(fO(e,!1),u&&oE(u),!f&&(o=l&&l.onVnodeBeforeMount)&&wM(o,d,t),fO(e,!0),a&&W){const t=()=>{e.subTree=NO(e),W(a,e.subTree,e,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{h.ce&&h.ce._injectChildStyle(p);const o=e.subTree=NO(e);0,m(null,o,n,i,e,r,s),t.el=o.el}if(c&&uO(c,r),!f&&(o=l&&l.onVnodeMounted)){const e=t;uO(()=>wM(o,d,e),r)}(256&t.shapeFlag||d&&wS(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&uO(e.a,r),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&mA(e),t=n=i=null}};e.scope.on();const l=e.effect=new GE(a);e.scope.off();const u=e.update=l.run.bind(l),c=e.job=l.runIfDirty.bind(l);c.i=e,c.id=e.uid,l.scheduler=()=>iA(c),fO(e,!0),u()},R=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=lI(r),[l]=e.propsOptions;let u=!1;if(!(i||o>0)||16&o){let i;KC(e,t,r,s)&&(u=!0);for(const s in a)t&&(Fx(t,s)||(i=nE(s))!==s&&Fx(t,i))||(l?!n||void 0===n[s]&&void 0===n[i]||(r[s]=ZC(l,a,s,void 0,e,!0)):delete r[s]);if(s!==a)for(const e in s)t&&Fx(t,e)||(delete s[e],u=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let i=0;i{const u=e&&e.children,d=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void F(u,h,n,i,r,s,o,a,l);if(256&p)return void D(u,h,n,i,r,s,o,a,l)}8&f?(16&d&&V(u,r,s),h!==u&&c(n,h)):16&d?16&f?F(u,h,n,i,r,s,o,a,l):V(u,r,s,!0):(8&d&&c(n,""),16&f&&E(h,n,i,r,s,o,a,l))},D=(e,t,n,i,r,s,o,a,l)=>{t=t||Sx;const u=(e=e||Sx).length,c=t.length,d=Math.min(u,c);let h;for(h=0;hc?V(e,r,s,!0,!1,d):E(t,n,i,r,s,o,a,l,d)},F=(e,t,n,i,r,s,o,a,l)=>{let u=0;const c=t.length;let d=e.length-1,h=c-1;for(;u<=d&&u<=h;){const i=e[u],c=t[u]=l?TM(t[u]):bM(t[u]);if(!lM(i,c))break;m(i,c,n,null,r,s,o,a,l),u++}for(;u<=d&&u<=h;){const i=e[d],u=t[h]=l?TM(t[h]):bM(t[h]);if(!lM(i,u))break;m(i,u,n,null,r,s,o,a,l),d--,h--}if(u>d){if(u<=h){const e=h+1,d=eh)for(;u<=d;)P(e[u],r,s,!0),u++;else{const p=u,f=u,g=new Map;for(u=f;u<=h;u++){const e=t[u]=l?TM(t[u]):bM(t[u]);null!=e.key&&g.set(e.key,u)}let _,y=0;const v=h-f+1;let b=!1,T=0;const x=new Array(v);for(u=0;u=v){P(i,r,s,!0);continue}let c;if(null!=i.key)c=g.get(i.key);else for(_=f;_<=h;_++)if(0===x[_-f]&&lM(i,t[_])){c=_;break}void 0===c?P(i,r,s,!0):(x[c-f]=u+1,c>=T?T=c:b=!0,m(i,t[c],n,null,r,s,o,a,l),y++)}const E=b?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i>1,e[n[a]]0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(x):Sx;for(_=E.length-1,u=v-1;u>=0;u--){const e=f+u,d=t[e],h=e+1{const{el:o,type:a,transition:l,children:u,shapeFlag:c}=e;if(6&c)return void L(e.component.subTree,t,n,r);if(128&c)return void e.suspense.move(t,n,r);if(64&c)return void a.move(e,t,n,G);if(a===WO){i(o,t,n);for(let e=0;e{let s;for(;e&&e!==t;)s=h(e),i(e,n,r),e=s;i(t,n,r)})(e,t,n);if(2!==r&&1&c&&l)if(0===r)l.beforeEnter(o),i(o,t,n),uO(()=>l.enter(o),s);else{const{leave:e,delayLeave:r,afterLeave:s}=l,a=()=>i(o,t,n),u=()=>{e(o,()=>{a(),s&&s()})};r?r(o,a,u):u()}else i(o,t,n)},P=(e,t,n,i=!1,r=!1)=>{const{type:s,props:o,ref:a,children:l,dynamicChildren:u,shapeFlag:c,patchFlag:d,dirs:h,cacheIndex:p}=e;if(-2===d&&(r=!1),null!=a&&sS(a,null,n,e,!0),null!=p&&(t.renderCache[p]=void 0),256&c)return void t.ctx.deactivate(e);const f=1&c&&h,m=!wS(e);let g;if(m&&(g=o&&o.onVnodeBeforeUnmount)&&wM(g,t,e),6&c)U(e.component,n,i);else{if(128&c)return void e.suspense.unmount(n,i);f&&CA(e,null,t,"beforeUnmount"),64&c?e.type.remove(e,t,n,G,i):u&&!u.hasOnce&&(s!==WO||d>0&&64&d)?V(u,t,n,!1,!0):(s===WO&&384&d||!r&&16&c)&&V(l,t,n),i&&B(e)}(m&&(g=o&&o.onVnodeUnmounted)||f)&&uO(()=>{g&&wM(g,t,e),f&&CA(e,null,t,"unmounted")},n)},B=e=>{const{type:t,el:n,anchor:i,transition:s}=e;if(t===WO)return void $(n,i);if(t===KO)return void v(e);const o=()=>{r(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},$=(e,t)=>{let n;for(;e!==t;)n=h(e),r(e),e=n;r(t)},U=(e,t,n)=>{const{bum:i,scope:r,job:s,subTree:o,um:a,m:l,a:u}=e;yO(l),yO(u),i&&oE(i),r.stop(),s&&(s.flags|=8,P(o,e,t,n)),a&&uO(a,t),uO(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve()),__VUE_PROD_DEVTOOLS__&&yA(e)},V=(e,t,n,i=!1,r=!1,s=0)=>{for(let o=s;o{if(6&e.shapeFlag)return z(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=h(e.anchor||e.el),n=t&&t[OA];return n?h(n):t};let j=!1;const Y=(e,t,n)=>{null==e?t._vnode&&P(t._vnode,null,null,!0):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,j||(j=!0,oA(),aA(),j=!1)},G={p:m,um:P,m:L,r:B,mt:O,mc:E,pc:N,pbc:I,n:z,o:e};let H,W;return t&&([H,W]=t(G)),{render:Y,hydrate:H,createApp:zC(Y,H)}}function pO({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function fO({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function mO(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function gO(e,t,n=!1){const i=e.children,r=t.children;if(Lx(i)&&Lx(r))for(let e=0;e{{const e=GC(vO);return e}};function TO(e,t){return IO(e,null,t)}function xO(e,t){return IO(e,null,{flush:"post"})}function EO(e,t){return IO(e,null,{flush:"sync"})}function wO(e,t,n){return IO(e,t,n)}function IO(e,t,n=Ax){const{immediate:i,deep:r,flush:s,once:o}=n;const a=Rx({},n);const l=t&&i||!t&&"post"!==s;let u;if(PM)if("sync"===s){const e=bO();u=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=Cx,e.resume=Cx,e.pause=Cx,e}const c=CM;a.call=(e,t,n)=>WI(e,c,t,n);let d=!1;"post"===s?a.scheduler=e=>{uO(e,c&&c.suspense)}:"sync"!==s&&(d=!0,a.scheduler=(e,t)=>{t?e():iA(e)}),a.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))};const h=function(e,t,n=Ax){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,u=e=>r?e:oI(e)||!1===r||0===r?PI(e,1):PI(e);let c,d,h,p,f=!1,m=!1;if(hI(e)?(d=()=>e.value,f=oI(e)):rI(e)?(d=()=>u(e),f=!0):Lx(e)?(m=!0,f=e.some(e=>rI(e)||oI(e)),d=()=>e.map(e=>hI(e)?e.value:rI(e)?u(e):Ux(e)?l?l(e,2):e():void 0)):d=Ux(e)?t?l?()=>l(e,2):e:()=>{if(h){lw();try{h()}finally{uw()}}const t=DI;DI=c;try{return l?l(e,3,[p]):e(p)}finally{DI=t}}:Cx,t&&r){const e=d,t=!0===r?1/0:r;d=()=>PI(e(),t)}const g=zE(),_=()=>{c.stop(),g&&g.active&&Nx(g.effects,c)};if(s&&t){const e=t;t=(...t)=>{e(...t),_()}}let y=m?new Array(e.length).fill(RI):RI;const v=e=>{if(1&c.flags&&(c.dirty||e))if(t){const e=c.run();if(r||f||(m?e.some((e,t)=>sE(e,y[t])):sE(e,y))){h&&h();const n=DI;DI=c;try{const n=[e,y===RI?void 0:m&&y[0]===RI?[]:y,p];l?l(t,3,n):t(...n),y=e}finally{DI=n}}}else c.run()};return a&&a(v),c=new GE(d),c.scheduler=o?()=>o(v,!1):v,p=e=>LI(e,!1,c),h=c.onStop=()=>{const e=NI.get(c);if(e){if(l)l(e,4);else for(const t of e)t();NI.delete(c)}},t?i?v(!0):y=c.run():o?o(v.bind(null,!0),!0):c.run(),_.pause=c.pause.bind(c),_.resume=c.resume.bind(c),_.stop=_,_}(e,t,a);return PM&&(u?u.push(h):l&&h()),h}function AO(e,t,n){const i=this.proxy,r=Vx(e)?e.includes(".")?SO(i,e):()=>i[e]:e.bind(i,i);let s;Ux(t)?s=t:(s=t.handler,n=t);const o=RM(this),a=IO(r,s.bind(i),n);return o(),a}function SO(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{let l,u,c=Ax;return EO(()=>{const t=e[r];sE(l,t)&&(l=t,a())}),{get:()=>(o(),n.get?n.get(l):l),set(e){const o=n.set?n.set(e):e;if(!(sE(o,l)||c!==Ax&&sE(e,c)))return;const d=i.vnode.props;d&&(t in d||r in d||s in d)&&(`onUpdate:${t}`in d||`onUpdate:${r}`in d||`onUpdate:${s}`in d)||(l=e,a()),i.emit(`update:${t}`,o),sE(e,o)&&sE(e,c)&&!sE(o,u)&&a(),c=e,u=o}}});return a[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?o||Ax:a,done:!1}:{done:!0}}},a}const OO=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${eE(t)}Modifiers`]||e[`${nE(t)}Modifiers`];function MO(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Ax;let r=n;const s=t.startsWith("update:"),o=s&&OO(i,t.slice(7));let a;o&&(o.trim&&(r=n.map(e=>Vx(e)?e.trim():e)),o.number&&(r=n.map(lE))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){pA("component:emit",e.appContext.app,e,t,n)}(e,t,r);let l=i[a=rE(t)]||i[a=rE(eE(t))];!l&&s&&(l=i[a=rE(nE(t))]),l&&WI(l,e,6,r);const u=i[a+"Once"];if(u){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,WI(u,e,6,r)}}function kO(e,t,n=!1){const i=t.emitsCache,r=i.get(e);if(void 0!==r)return r;const s=e.emits;let o={},a=!1;if(__VUE_OPTIONS_API__&&!Ux(e)){const i=e=>{const n=kO(e,t,!0);n&&(a=!0,Rx(o,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||a?(Lx(s)?s.forEach(e=>o[e]=null):Rx(o,s),jx(e)&&i.set(e,o),o):(jx(e)&&i.set(e,null),null)}function RO(e,t){return!(!e||!Mx(t))&&(t=t.slice(2).replace(/Once$/,""),Fx(e,t[0].toLowerCase()+t.slice(1))||Fx(e,nE(t))||Fx(e,t))}function NO(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:u,renderCache:c,props:d,data:h,setupState:p,ctx:f,inheritAttrs:m}=e,g=xA(e);let _,y;try{if(4&n.shapeFlag){const e=r||i,t=e;_=bM(u.call(t,e,c,d,p,h,f)),y=a}else{const e=t;0,_=bM(e.length>1?e(d,{attrs:a,slots:o,emit:l}):e(d,null)),y=t.props?a:FO(a)}}catch(t){ZO.length=0,XI(t,e,1),_=pM(qO)}let v=_;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=v;e.length&&7&t&&(s&&e.some(kx)&&(y=LO(y,s)),v=gM(v,y,!1,!0))}return n.dirs&&(v=gM(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&JA(v,n.transition),_=v,xA(g),_}function DO(e,t=!0){let n;for(let t=0;t{let t;for(const n in e)("class"===n||"style"===n||Mx(n))&&((t||(t={}))[n]=e[n]);return t},LO=(e,t)=>{const n={};for(const i in e)kx(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function PO(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense;let UO=0;const VO={name:"Suspense",__isSuspense:!0,process(e,t,n,i,r,s,o,a,l,u){if(null==e)!function(e,t,n,i,r,s,o,a,l){const{p:u,o:{createElement:c}}=l,d=c("div"),h=e.suspense=jO(e,r,i,t,d,n,s,o,a,l);u(null,h.pendingBranch=e.ssContent,d,null,i,h,s,o),h.deps>0?(zO(e,"onPending"),zO(e,"onFallback"),u(null,e.ssFallback,t,n,i,null,s,o),HO(h,e.ssFallback)):h.resolve(!1,!0)}(t,n,i,r,s,o,a,l,u);else{if(s&&s.deps>0&&!e.suspense.isInFallback)return t.suspense=e.suspense,t.suspense.vnode=t,void(t.el=e.el);!function(e,t,n,i,r,s,o,a,{p:l,um:u,o:{createElement:c}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:g,isHydrating:_}=d;if(m)d.pendingBranch=h,lM(h,m)?(l(m,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0?d.resolve():g&&(_||(l(f,p,n,i,r,null,s,o,a),HO(d,p)))):(d.pendingId=UO++,_?(d.isHydrating=!1,d.activeBranch=m):u(m,r,d),d.deps=0,d.effects.length=0,d.hiddenContainer=c("div"),g?(l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0?d.resolve():(l(f,p,n,i,r,null,s,o,a),HO(d,p))):f&&lM(h,f)?(l(f,h,n,i,r,d,s,o,a),d.resolve(!0)):(l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0&&d.resolve()));else if(f&&lM(h,f))l(f,h,n,i,r,d,s,o,a),HO(d,h);else if(zO(t,"onPending"),d.pendingBranch=h,512&h.shapeFlag?d.pendingId=h.component.suspenseId:d.pendingId=UO++,l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0)d.resolve();else{const{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):0===e&&d.fallback(p)}}(e,t,n,i,r,o,a,l,u)}},hydrate:function(e,t,n,i,r,s,o,a,l){const u=t.suspense=jO(t,i,n,e.parentNode,document.createElement("div"),null,r,s,o,a,!0),c=l(e,u.pendingBranch=t.ssContent,n,u,s,o);0===u.deps&&u.resolve(!1,!0);return c},normalize:function(e){const{shapeFlag:t,children:n}=e,i=32&t;e.ssContent=YO(i?n.default:n),e.ssFallback=i?YO(n.fallback):pM(qO)}};function zO(e,t){const n=e.props&&e.props[t];Ux(n)&&n()}function jO(e,t,n,i,r,s,o,a,l,u,c=!1){const{p:d,m:h,um:p,n:f,o:{parentNode:m,remove:g}}=u;let _;const y=function(e){const t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?uE(e.props.timeout):void 0;const b=s,T={vnode:e,parent:t,parentComponent:n,namespace:o,container:i,hiddenContainer:r,deps:0,pendingId:UO++,timeout:"number"==typeof v?v:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:i,activeBranch:r,pendingBranch:o,pendingId:a,effects:l,parentComponent:u,container:c}=T;let d=!1;T.isHydrating?T.isHydrating=!1:e||(d=r&&o.transition&&"out-in"===o.transition.mode,d&&(r.transition.afterLeave=()=>{a===T.pendingId&&(h(o,c,s===b?f(r):s,0),sA(l))}),r&&(m(r.el)===c&&(s=f(r)),p(r,u,T,!0)),d||h(o,c,s,0)),HO(T,o),T.pendingBranch=null,T.isInFallback=!1;let g=T.parent,v=!1;for(;g;){if(g.pendingBranch){g.effects.push(...l),v=!0;break}g=g.parent}v||d||sA(l),T.effects=[],y&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),zO(i,"onResolve")},fallback(e){if(!T.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:i,container:r,namespace:s}=T;zO(t,"onFallback");const o=f(n),u=()=>{T.isInFallback&&(d(null,e,r,o,i,null,s,a,l),HO(T,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),T.isInFallback=!0,p(n,i,null,!0),c||u()},move(e,t,n){T.activeBranch&&h(T.activeBranch,e,t,n),T.container=e},next:()=>T.activeBranch&&f(T.activeBranch),registerDep(e,t,n){const i=!!T.pendingBranch;i&&T.deps++;const r=e.vnode.el;e.asyncDep.catch(t=>{XI(t,e,0)}).then(s=>{if(e.isUnmounted||T.isUnmounted||T.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:a}=e;$M(e,s,!1),r&&(a.el=r);const l=!r&&e.subTree.el;t(e,a,m(r||e.subTree.el),r?null:f(e.subTree),T,o,n),l&&g(l),BO(e,a.el),i&&0===--T.deps&&T.resolve()})},unmount(e,t){T.isUnmounted=!0,T.activeBranch&&p(T.activeBranch,n,e,t),T.pendingBranch&&p(T.pendingBranch,n,e,t)}};return T}function YO(e){let t;if(Ux(e)){const n=nM&&e._c;n&&(e._d=!1,JO()),e=e(),n&&(e._d=!0,t=QO,eM())}if(Lx(e)){const t=DO(e);0,e=t}return e=bM(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function GO(e,t){t&&t.pendingBranch?Lx(e)?t.effects.push(...e):t.effects.push(e):sA(e)}function HO(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,i&&i.subTree===n&&(i.vnode.el=r,BO(i,r))}const WO=Symbol.for("v-fgt"),XO=Symbol.for("v-txt"),qO=Symbol.for("v-cmt"),KO=Symbol.for("v-stc"),ZO=[];let QO=null;function JO(e=!1){ZO.push(QO=e?null:[])}function eM(){ZO.pop(),QO=ZO[ZO.length-1]||null}let tM,nM=1;function iM(e,t=!1){nM+=e,e<0&&QO&&t&&(QO.hasOnce=!0)}function rM(e){return e.dynamicChildren=nM>0?QO||Sx:null,eM(),nM>0&&QO&&QO.push(e),e}function sM(e,t,n,i,r,s){return rM(hM(e,t,n,i,r,s,!0))}function oM(e,t,n,i,r){return rM(pM(e,t,n,i,r,!0))}function aM(e){return!!e&&!0===e.__v_isVNode}function lM(e,t){return e.type===t.type&&e.key===t.key}function uM(e){tM=e}const cM=({key:e})=>null!=e?e:null,dM=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?Vx(e)||hI(e)||Ux(e)?{i:bA,r:e,k:t,f:!!n}:e:null);function hM(e,t=null,n=null,i=0,r=null,s=(e===WO?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&cM(t),ref:t&&dM(t),scopeId:TA,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:bA};return a?(xM(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=Vx(n)?8:16),nM>0&&!o&&QO&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&QO.push(l),l}const pM=fM;function fM(e,t=null,n=null,i=0,r=null,s=!1){if(e&&e!==QS||(e=qO),aM(e)){const i=gM(e,t,!0);return n&&xM(i,n),nM>0&&!s&&QO&&(6&i.shapeFlag?QO[QO.indexOf(e)]=i:QO.push(i)),i.patchFlag=-2,i}if(KM(e)&&(e=e.__vccOpts),t){t=mM(t);let{class:e,style:n}=t;e&&!Vx(e)&&(t.class=yE(e)),jx(n)&&(aI(n)&&!Lx(n)&&(n=Rx({},n)),t.style=pE(n))}return hM(e,t,n,i,r,Vx(e)?1:$O(e)?128:MA(e)?64:jx(e)?4:Ux(e)?2:0,s,!0)}function mM(e){return e?aI(e)||qC(e)?Rx({},e):e:null}function gM(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,u=t?EM(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&cM(u),ref:t&&t.ref?n&&s?Lx(s)?s.concat(dM(t)):[s,dM(t)]:dM(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==WO?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&gM(e.ssContent),ssFallback:e.ssFallback&&gM(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&JA(c,l.clone(c)),c}function _M(e=" ",t=0){return pM(XO,null,e,t)}function yM(e,t){const n=pM(KO,null,e);return n.staticCount=t,n}function vM(e="",t=!1){return t?(JO(),oM(qO,null,e)):pM(qO,null,e)}function bM(e){return null==e||"boolean"==typeof e?pM(qO):Lx(e)?pM(WO,null,e.slice()):aM(e)?TM(e):pM(XO,null,String(e))}function TM(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:gM(e)}function xM(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if(Lx(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),xM(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||qC(t)?3===i&&bA&&(1===bA.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=bA}}else Ux(t)?(t={default:t,_ctx:bA},n=32):(t=String(t),64&i?(n=16,t=[_M(t)]):n=8);e.children=t,e.shapeFlag|=n}function EM(...e){const t={};for(let n=0;nCM||bA;let MM,kM;{const e=dE(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};MM=t("__VUE_INSTANCE_SETTERS__",e=>CM=e),kM=t("__VUE_SSR_SETTERS__",e=>PM=e)}const RM=e=>{const t=CM;return MM(e),e.scope.on(),()=>{e.scope.off(),MM(t)}},NM=()=>{CM&&CM.scope.off(),MM(null)};function DM(e){return 4&e.vnode.shapeFlag}let FM,LM,PM=!1;function BM(e,t=!1,n=!1){t&&kM(t);const{props:i,children:r}=e.vnode,s=DM(e);!function(e,t,n,i=!1){const r={},s=XC();e.propsDefaults=Object.create(null),KC(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:eI(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,i,s,t),aO(e,r,n);const o=s?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,dC),!1;const{setup:i}=n;if(i){lw();const n=e.setupContext=i.length>1?YM(e):null,r=RM(e),s=HI(i,e,0,[e.props,n]),o=Yx(s);if(uw(),r(),!o&&!e.sp||wS(e)||iS(e),o){if(s.then(NM,NM),t)return s.then(n=>{$M(e,n,t)}).catch(t=>{XI(t,e,0)});e.asyncDep=s}else $M(e,s,t)}else zM(e,t)}(e,t):void 0;return t&&kM(!1),o}function $M(e,t,n){Ux(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:jx(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=TI(t)),zM(e,n)}function UM(e){FM=e,LM=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,hC))}}const VM=()=>!FM;function zM(e,t,n){const i=e.type;if(!e.render){if(!t&&FM&&!i.render){const t=i.template||__VUE_OPTIONS_API__&&RC(e).template;if(t){0;const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:o}=i,a=Rx(Rx({isCustomElement:n,delimiters:s},r),o);i.render=FM(t,a)}}e.render=i.render||Cx,LM&&LM(e)}if(__VUE_OPTIONS_API__){const t=RM(e);lw();try{OC(e)}finally{uw(),t()}}}const jM={get:(e,t)=>(vw(e,0,""),e[t])};function YM(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,jM),slots:e.slots,emit:e.emit,expose:t}}function GM(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(TI(uI(e.exposed)),{get:(t,n)=>n in t?t[n]:n in uC?uC[n](e):void 0,has:(e,t)=>t in e||t in uC})):e.proxy}const HM=/(?:^|[-_])(\w)/g,WM=e=>e.replace(HM,e=>e.toUpperCase()).replace(/[-_]/g,"");function XM(e,t=!0){return Ux(e)?e.displayName||e.name:e.name||t&&e.__name}function qM(e,t,n=!1){let i=XM(t);if(!i&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(i=e[1])}if(!i&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};i=n(e.components||e.parent.type.components)||n(e.appContext.components)}return i?WM(i):n?"App":"Anonymous"}function KM(e){return Ux(e)&&"__vccOpts"in e}const ZM=(e,t)=>{const n=function(e,t,n=!1){let i,r;return Ux(e)?i=e:(i=e.get,r=e.set),new OI(i,r,n)}(e,0,PM);return n};function QM(e,t,n){const i=arguments.length;return 2===i?jx(t)&&!Lx(t)?aM(t)?pM(e,null,[t]):pM(e,t):pM(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&aM(n)&&(n=[n]),pM(e,t,n))}function JM(){return void 0}function ek(e,t,n,i){const r=n[i];if(r&&tk(r,e))return r;const s=t();return s.memo=e.slice(),s.cacheIndex=i,n[i]=s}function tk(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&QO&&QO.push(e),!0}const nk="3.5.13",ik=Cx,rk=GI,sk=cA,ok=fA,ak={createComponentInstance:SM,setupComponent:BM,renderComponentRoot:NO,setCurrentRenderingInstance:xA,isVNode:aM,normalizeVNode:bM,getComponentPublicInstance:GM,ensureValidVNode:oC,pushWarningContext:function(e){BI.push(e)},popWarningContext:function(){BI.pop()}},lk=null,uk=null,ck=null; +function EA(e){return t=>{_A(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let wA=null,IA=null;function AA(e){const t=wA;return wA=e,IA=e&&e.type.__scopeId||null,t}function SA(e){IA=e}function CA(){IA=null}const OA=e=>MA;function MA(e,t=wA,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&aM(-1);const r=AA(t);let s;try{s=e(...n)}finally{AA(r),i._d&&aM(1)}return __VUE_PROD_DEVTOOLS__&&bA(t),s};return i._n=!0,i._c=!0,i._d=!0,i}function kA(e,t){if(null===wA)return e;const n=qM(wA),i=e.dirs||(e.dirs=[]);for(let e=0;ee.__isTeleport,FA=e=>e&&(e.disabled||""===e.disabled),LA=e=>e&&(e.defer||""===e.defer),PA=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,BA=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,$A=(e,t)=>{const n=e&&e.to;if(Gx(n)){if(t){return t(n)}return null}return n},UA={name:"Teleport",__isTeleport:!0,process(e,t,n,i,r,s,o,a,l,u){const{mc:c,pc:d,pbc:h,o:{insert:p,querySelector:f,createText:m,createComment:g}}=u,_=FA(t.props);let{shapeFlag:y,children:v,dynamicChildren:b}=t;if(null==e){const e=t.el=m(""),u=t.anchor=m("");p(e,n,i),p(u,n,i);const d=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(v,e,t,r,s,o,a,l))},h=()=>{const e=t.target=$A(t.props,f),n=YA(e,t,m,p);e&&("svg"!==o&&PA(e)?o="svg":"mathml"!==o&&BA(e)&&(o="mathml"),_||(d(e,n),jA(t,!1)))};_&&(d(n,u),jA(t,!0)),LA(t.props)?pO(()=>{h(),t.el.__isMounted=!0},s):h()}else{if(LA(t.props)&&!e.el.__isMounted)return void pO(()=>{UA.process(e,t,n,i,r,s,o,a,l,u),delete e.el.__isMounted},s);t.el=e.el,t.targetStart=e.targetStart;const c=t.anchor=e.anchor,p=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=FA(e.props),y=g?n:p,v=g?c:m;if("svg"===o||PA(p)?o="svg":("mathml"===o||BA(p))&&(o="mathml"),b?(h(e.dynamicChildren,b,y,r,s,o,a),bO(e,t,!0)):l||d(e,t,y,v,r,s,o,a,!1),_)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):VA(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=$A(t.props,f);e&&VA(t,e,null,u,0)}else g&&VA(t,p,m,u,1);jA(t,_)}},remove(e,t,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:h}=e;if(d&&(r(u),r(c)),s&&r(l),16&o){const e=s||!FA(h);for(let r=0;r{e.isMounted=!0}),WS(()=>{e.isUnmounting=!0}),e}const XA=[Function,Array],qA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:XA,onEnter:XA,onAfterEnter:XA,onEnterCancelled:XA,onBeforeLeave:XA,onLeave:XA,onAfterLeave:XA,onLeaveCancelled:XA,onBeforeAppear:XA,onAppear:XA,onAfterAppear:XA,onAppearCancelled:XA},KA=e=>{const t=e.subTree;return t.component?KA(t.component):t};function ZA(e){let t=e[0];if(e.length>1){let n=!1;for(const i of e)if(i.type!==JO){0,t=i,n=!0;break}}return t}const QA={name:"BaseTransition",props:qA,setup(e,{slots:t}){const n=NM(),i=WA();return()=>{const r=t.default&&rS(t.default(),!0);if(!r||!r.length)return;const s=ZA(r),o=hI(e),{mode:a}=o;if(i.isLeaving)return tS(s);const l=nS(s);if(!l)return tS(s);let u=eS(l,o,i,n,e=>u=e);l.type!==JO&&iS(l,u);let c=n.subTree&&nS(n.subTree);if(c&&c.type!==JO&&!hM(l,c)&&KA(n).type!==JO){let e=eS(c,o,i,n);if(iS(c,e),"out-in"===a&&l.type!==JO)return i.isLeaving=!0,e.afterLeave=()=>{i.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},tS(s);"in-out"===a&&l.type!==JO?e.delayLeave=(e,t,n)=>{JA(i,c)[String(c.key)]=c,e[GA]=()=>{t(),e[GA]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function JA(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function eS(e,t,n,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:f,onLeaveCancelled:m,onBeforeAppear:g,onAppear:_,onAfterAppear:y,onAppearCancelled:v}=t,b=String(e.key),T=JA(n,e),x=(e,t)=>{e&&ZI(e,i,9,t)},E=(e,t)=>{const n=t[1];x(e,t),Ux(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:o,persisted:a,beforeEnter(t){let i=l;if(!n.isMounted){if(!s)return;i=g||l}t[GA]&&t[GA](!0);const r=T[b];r&&hM(e,r)&&r.el[GA]&&r.el[GA](),x(i,[t])},enter(e){let t=u,i=c,r=d;if(!n.isMounted){if(!s)return;t=_||u,i=y||c,r=v||d}let o=!1;const a=e[HA]=t=>{o||(o=!0,x(t?r:i,[e]),w.delayedLeave&&w.delayedLeave(),e[HA]=void 0)};t?E(t,[e,a]):a()},leave(t,i){const r=String(e.key);if(t[HA]&&t[HA](!0),n.isUnmounting)return i();x(h,[t]);let s=!1;const o=t[GA]=n=>{s||(s=!0,i(),x(n?m:f,[t]),t[GA]=void 0,T[r]===e&&delete T[r])};T[r]=e,p?E(p,[t,o]):o()},clone(e){const s=eS(e,t,n,i,r);return r&&r(s),s}};return w}function tS(e){if(kS(e))return(e=bM(e)).children=null,e}function nS(e){if(!kS(e))return DA(e.type)&&e.children?ZA(e.children):e;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&Yx(n.default))return n.default()}}function iS(e,t){6&e.shapeFlag&&e.component?(e.transition=t,iS(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function rS(e,t=!1,n){let i=[],r=0;for(let s=0;s1)for(let e=0;eLx({name:e.name},t,{setup:e}))():e}function oS(){const e=NM();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function aS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function lS(e){const t=NM(),n=yI(null);if(t){const i=t.refs===Mx?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}else 0;return n}function uS(e,t,n,i,r=!1){if(Ux(e))return void e.forEach((e,s)=>uS(e,t&&(Ux(t)?t[s]:t),n,i,r));if(CS(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&uS(e,t,n,i.component.subTree));const s=4&i.shapeFlag?qM(i.component):i.el,o=r?null:s,{i:a,r:l}=e;const u=t&&t.r,c=a.refs===Mx?a.refs={}:a.refs,d=a.setupState,h=hI(d),p=d===Mx?()=>!1:e=>$x(h,e);if(null!=u&&u!==l&&(Gx(u)?(c[u]=null,p(u)&&(d[u]=null)):gI(u)&&(u.value=null)),Yx(l))KI(l,a,12,[o,c]);else{const t=Gx(l),i=gI(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?d[l]:c[l]:l.value;r?Ux(n)&&Px(n,s):Ux(n)?n.includes(s)||n.push(s):t?(c[l]=[s],p(l)&&(d[l]=c[l])):(l.value=[s],e.k&&(c[e.k]=l.value))}else t?(c[l]=o,p(l)&&(d[l]=o)):i&&(l.value=o,e.k&&(c[e.k]=o))};o?(a.id=-1,pO(a,n)):a()}else 0}}let cS=!1;const dS=()=>{cS||(console.error("Hydration completed but contains mismatches."),cS=!0)},hS=e=>{if(1===e.nodeType)return(e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)(e)?"svg":(e=>e.namespaceURI.includes("MathML"))(e)?"mathml":void 0},pS=e=>8===e.nodeType;function fS(e){const{mt:t,p:n,o:{patchProp:i,createText:r,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:u}}=e,c=(n,i,a,u,y,v=!1)=>{v=v||!!i.dynamicChildren;const b=pS(n)&&"["===n.data,T=()=>f(n,i,a,u,y,b),{type:x,ref:E,shapeFlag:w,patchFlag:I}=i;let A=n.nodeType;i.el=n,__VUE_PROD_DEVTOOLS__&&(dE(n,"__vnode",i,!0),dE(n,"__vueParentComponent",a,!0)),-2===I&&(v=!1,i.dynamicChildren=null);let S=null;switch(x){case QO:3!==A?""===i.children?(l(i.el=r(""),o(n),n),S=n):S=T():(n.data!==i.children&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&YI("Hydration text mismatch in",n.parentNode,`\n - rendered on server: ${JSON.stringify(n.data)}\n - expected on client: ${JSON.stringify(i.children)}`),dS(),n.data=i.children),S=s(n));break;case JO:_(n)?(S=s(n),g(i.el=n.content.firstChild,n,a)):S=8!==A||b?T():s(n);break;case eM:if(b&&(A=(n=s(n)).nodeType),1===A||3===A){S=n;const e=!i.children.length;for(let t=0;t{o=o||!!t.dynamicChildren;const{type:l,props:u,patchFlag:c,shapeFlag:d,dirs:p,transition:f}=t,m="input"===l||"option"===l;if(m||-1!==c){p&&RA(t,null,n,"created");let l,y=!1;if(_(e)){y=vO(null,f)&&n&&n.vnode.props&&n.vnode.props.appear;const i=e.content.firstChild;y&&f.beforeEnter(i),g(i,e,n),t.el=e=i}if(16&d&&(!u||!u.innerHTML&&!u.textContent)){let i=h(e.firstChild,t,e,n,r,s,o),l=!1;for(;i;){TS(e,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!l&&(YI("Hydration children mismatch on",e,"\nServer rendered element contains more child nodes than client vdom."),l=!0),dS());const t=i;i=i.nextSibling,a(t)}}else if(8&d){let n=t.children;"\n"!==n[0]||"PRE"!==e.tagName&&"TEXTAREA"!==e.tagName||(n=n.slice(1)),e.textContent!==n&&(TS(e,0)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&YI("Hydration text content mismatch on",e,`\n - rendered on server: ${e.textContent}\n - expected on client: ${t.children}`),dS()),e.textContent=t.children)}if(u)if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||m||!o||48&c){const r=e.tagName.includes("-");for(const s in u)!__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||p&&p.some(e=>e.dir.created)||!mS(e,s,u[s],t,n)||dS(),(m&&(s.endsWith("value")||"indeterminate"===s)||Dx(s)&&!eE(s)||"."===s[0]||r)&&i(e,s,null,u[s],void 0,n)}else if(u.onClick)i(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&lI(u.style))for(const e in u.style)u.style[e];(l=u&&u.onVnodeBeforeMount)&&CM(l,n,t),p&&RA(t,null,n,"beforeMount"),((l=u&&u.onVnodeMounted)||p||y)&&qO(()=>{l&&CM(l,n,t),y&&f.enter(e),p&&RA(t,null,n,"mounted")},r)}return e.nextSibling},h=(e,t,i,o,a,u,d)=>{d=d||!!t.dynamicChildren;const h=t.children,p=h.length;let f=!1;for(let t=0;t{const{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);const d=o(e),p=h(s(e),t,d,n,i,r,a);return p&&pS(p)&&"]"===p.data?s(t.anchor=p):(dS(),l(t.anchor=u("]"),d,p),p)},f=(e,t,i,r,l,u)=>{if(TS(e.parentElement,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&YI("Hydration node mismatch:\n- rendered on server:",e,3===e.nodeType?"(text)":pS(e)&&"["===e.data?"(start of fragment)":"","\n- expected on client:",t.type),dS()),t.el=null,u){const t=m(e);for(;;){const n=s(e);if(!n||n===t)break;a(n)}}const c=s(e),d=o(e);return a(e),n(null,t,d,c,i,r,hS(d),l),i&&(i.vnode.el=t.el,zO(i,t.el)),c},m=(e,t="[",n="]")=>{let i=0;for(;e;)if((e=s(e))&&pS(e)&&(e.data===t&&i++,e.data===n)){if(0===i)return s(e);i--}return e},g=(e,t,n)=>{const i=t.parentNode;i&&i.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes())return __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&YI("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,e,t),dA(),void(t._vnode=e);c(t.firstChild,e,null,null,null),dA(),t._vnode=e},c]}function mS(e,t,n,i,r){let s,o,a,l;if("class"===t)a=e.getAttribute("class"),l=xE(n),function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(gS(a||""),gS(l))||(s=2,o="class");else if("style"===t){a=e.getAttribute("style")||"",l=Gx(n)?n:function(e){if(!e)return"";if(Gx(e))return e;let t="";for(const n in e){const i=e[n];(Gx(i)||"number"==typeof i)&&(t+=`${n.startsWith("--")?n:oE(n)}:${i};`)}return t}(_E(n));const t=_S(a),u=_S(l);if(i.dirs)for(const{dir:e,value:t}of i.dirs)"show"!==e.name||t||u.set("display","none");r&&yS(r,i,u),function(e,t){if(e.size!==t.size)return!1;for(const[n,i]of e)if(i!==t.get(n))return!1;return!0}(t,u)||(s=3,o="style")}else(e instanceof SVGElement&&NE(t)||e instanceof HTMLElement&&(ME(t)||RE(t)))&&(ME(t)?(a=e.hasAttribute(t),l=kE(n)):null==n?(a=e.hasAttribute(t),l=!1):(a=e.hasAttribute(t)?e.getAttribute(t):"value"===t&&"TEXTAREA"===e.tagName&&e.value,l=!!function(e){if(null==e)return!1;const t=typeof e;return"string"===t||"number"===t||"boolean"===t}(n)&&String(n)),a!==l&&(s=4,o=t));if(null!=s&&!TS(e,s)){const t=e=>!1===e?"(not rendered)":`${o}="${e}"`;return YI(`Hydration ${bS[s]} mismatch on`,e,`\n - rendered on server: ${t(a)}\n - expected on client: ${t(l)}\n Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.\n You should fix the source of the mismatch.`),!0}return!1}function gS(e){return new Set(e.trim().split(/\s+/))}function _S(e){const t=new Map;for(const n of e.split(";")){let[e,i]=n.split(":");e=e.trim(),i=i&&i.trim(),e&&i&&t.set(e,i)}return t}function yS(e,t,n){const i=e.subTree;if(e.getCssVars&&(t===i||i&&i.type===ZO&&i.children.includes(t))){const t=e.getCssVars();for(const e in t)n.set(`--${FE(e,!1)}`,String(t[e]))}t===i&&e.parent&&yS(e.parent,e.vnode,n)}const vS="data-allow-mismatch",bS={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function TS(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(vS);)e=e.parentElement;const n=e&&e.getAttribute(vS);if(null==n)return!1;if(""===n)return!0;{const e=n.split(",");return!(0!==t||!e.includes("children"))||n.split(",").includes(bS[t])}}const xS=mE().requestIdleCallback||(e=>setTimeout(e,1)),ES=mE().cancelIdleCallback||(e=>clearTimeout(e)),wS=(e=1e4)=>t=>{const n=xS(t,{timeout:e});return()=>ES(n)};const IS=e=>(t,n)=>{const i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){i.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element)return function(e){const{top:t,left:n,bottom:i,right:r}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:o}=window;return(t>0&&t0&&i0&&n0&&ri.disconnect()},AS=e=>t=>{if(e){const n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},SS=(e=[])=>(t,n)=>{Gx(e)&&(e=[e]);let i=!1;const r=e=>{i||(i=!0,s(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},s=()=>{n(t=>{for(const n of e)t.removeEventListener(n,r)})};return n(t=>{for(const n of e)t.addEventListener(n,r,{once:!0})}),s};const CS=e=>!!e.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */function OS(e){Yx(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:r=200,hydrate:s,timeout:o,suspensible:a=!0,onError:l}=e;let u,c=null,d=0;const h=()=>{let e;return c||(e=c=t().catch(e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise((t,n)=>{l(e,()=>t((d++,c=null,h())),()=>n(e),d+1)});throw e}).then(t=>e!==c&&c?c:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),u=t,t)))};return sS({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(e,t,n){const i=s?()=>{const i=s(n,t=>function(e,t){if(pS(e)&&"["===e.data){let n=1,i=e.nextSibling;for(;i;){if(1===i.nodeType){if(!1===t(i))break}else if(pS(i))if("]"===i.data){if(0===--n)break}else"["===i.data&&n++;i=i.nextSibling}}else t(e)}(e,t));i&&(t.bum||(t.bum=[])).push(i)}:n;u?i():h().then(()=>!t.isUnmounted&&i())},get __asyncResolved(){return u},setup(){const e=RM;if(aS(e),u)return()=>MS(u,e);const t=t=>{c=null,QI(t,e,13,!i)};if(a&&e.suspense||VM)return h().then(t=>()=>MS(t,e)).catch(e=>(t(e),()=>i?_M(i,{error:e}):null));const s=_I(!1),l=_I(),d=_I(!!r);return r&&setTimeout(()=>{d.value=!1},r),null!=o&&setTimeout(()=>{if(!s.value&&!l.value){const e=new Error(`Async component timed out after ${o}ms.`);t(e),l.value=e}},o),h().then(()=>{s.value=!0,e.parent&&kS(e.parent.vnode)&&e.parent.update()}).catch(e=>{t(e),l.value=e}),()=>s.value&&u?MS(u,e):l.value&&i?_M(i,{error:l.value}):n&&!d.value?_M(n):void 0}})}function MS(e,t){const{ref:n,props:i,children:r,ce:s}=t.vnode,o=_M(e,i,r);return o.ref=n,o.ce=s,delete t.vnode.ce,o}const kS=e=>e.type.__isKeepAlive,RS={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=NM(),i=n.ctx;if(!i.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const r=new Map,s=new Set;let o=null;__VUE_PROD_DEVTOOLS__&&(n.__v_cache=r);const a=n.suspense,{renderer:{p:l,m:u,um:c,o:{createElement:d}}}=i,h=d("div");function p(e){$S(e),c(e,n,a,!0)}function f(e){r.forEach((t,n)=>{const i=QM(t.type);i&&!e(i)&&m(n)})}function m(e){const t=r.get(e);!t||o&&hM(t,o)?o&&$S(o):p(t),r.delete(e),s.delete(e)}i.activate=(e,t,n,i,r)=>{const s=e.component;u(e,t,n,0,a),l(s.vnode,e,t,n,s,a,i,e.slotScopeIds,r),pO(()=>{s.isDeactivated=!1,s.a&&cE(s.a);const t=e.props&&e.props.onVnodeMounted;t&&CM(t,s.parent,e)},a),__VUE_PROD_DEVTOOLS__&&vA(s)},i.deactivate=e=>{const t=e.component;xO(t.m),xO(t.a),u(e,h,null,1,a),pO(()=>{t.da&&cE(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&CM(n,t.parent,e),t.isDeactivated=!0},a),__VUE_PROD_DEVTOOLS__&&vA(t)},CO(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>DS(e,t)),t&&f(e=>!DS(t,e))},{flush:"post",deep:!0});let g=null;const _=()=>{null!=g&&(jO(n.subTree.type)?pO(()=>{r.set(g,US(n.subTree))},n.subTree.suspense):r.set(g,US(n.subTree)))};return YS(_),HS(_),WS(()=>{r.forEach(e=>{const{subTree:t,suspense:i}=n,r=US(t);if(e.type===r.type&&e.key===r.key){$S(r);const e=r.component.da;return void(e&&pO(e,i))}p(e)})}),()=>{if(g=null,!t.default)return o=null;const n=t.default(),i=n[0];if(n.length>1)return o=null,n;if(!(dM(i)&&(4&i.shapeFlag||128&i.shapeFlag)))return o=null,i;let a=US(i);if(a.type===JO)return o=null,a;const l=a.type,u=QM(CS(a)?a.type.__asyncResolved||{}:l),{include:c,exclude:d,max:h}=e;if(c&&(!u||!DS(c,u))||d&&u&&DS(d,u))return a.shapeFlag&=-257,o=a,i;const p=null==a.key?l:a.key,f=r.get(p);return a.el&&(a=bM(a),128&i.shapeFlag&&(i.ssContent=a)),g=p,f?(a.el=f.el,a.component=f.component,a.transition&&iS(a,a.transition),a.shapeFlag|=512,s.delete(p),s.add(p)):(s.add(p),h&&s.size>parseInt(h,10)&&m(s.values().next().value)),a.shapeFlag|=256,o=a,jO(i.type)?i:a}}},NS=RS;function DS(e,t){return Ux(e)?e.some(e=>DS(e,t)):Gx(e)?e.split(",").includes(t):"[object RegExp]"===Kx(e)&&(e.lastIndex=0,e.test(t))}function FS(e,t){PS(e,"a",t)}function LS(e,t){PS(e,"da",t)}function PS(e,t,n=RM){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(VS(t,i,n),n){let e=n.parent;for(;e&&e.parent;)kS(e.parent.vnode)&&BS(i,t,n,e),e=e.parent}}function BS(e,t,n,i){const r=VS(t,e,i,!0);XS(()=>{Px(i[t],r)},n)}function $S(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function US(e){return 128&e.shapeFlag?e.ssContent:e}function VS(e,t,n=RM,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{hw();const r=LM(n),s=ZI(t,n,e,i);return r(),pw(),s});return i?r.unshift(s):r.push(s),s}}const zS=e=>(t,n=RM)=>{VM&&"sp"!==e||VS(e,(...e)=>t(...e),n)},jS=zS("bm"),YS=zS("m"),GS=zS("bu"),HS=zS("u"),WS=zS("bum"),XS=zS("um"),qS=zS("sp"),KS=zS("rtg"),ZS=zS("rtc");function QS(e,t=RM){VS("ec",e,t)}const JS="components",eC="directives";function tC(e,t){return sC(JS,e,!0,t)||e}const nC=Symbol.for("v-ndc");function iC(e){return Gx(e)?sC(JS,e,!1)||e:e||nC}function rC(e){return sC(eC,e)}function sC(e,t,n=!0,i=!1){const r=wA||RM;if(r){const n=r.type;if(e===JS){const e=QM(n,!1);if(e&&(e===t||e===rE(t)||e===aE(rE(t))))return n}const s=oC(r[e]||n[e],t)||oC(r.appContext[e],t);return!s&&i?n:s}}function oC(e,t){return e&&(e[t]||e[rE(t)]||e[aE(rE(t))])}function aC(e,t,n,i){let r;const s=n&&n[i],o=Ux(e);if(o||Gx(e)){let n=!1;o&&lI(e)&&(n=!cI(e),e=Aw(e)),r=new Array(e.length);for(let i=0,o=e.length;it(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,o=n.length;i{const t=i.fn(...e);return t&&(t.key=i.key),t}:i.fn)}return e}function uC(e,t,n={},i,r){if(wA.ce||wA.parent&&CS(wA.parent)&&wA.parent.ce)return"default"!==t&&(n.name=t),iM(),cM(ZO,null,[_M("slot",n,i&&i())],64);let s=e[t];s&&s._c&&(s._d=!1),iM();const o=s&&cC(s(n)),a=n.key||o&&o.key,l=cM(ZO,{key:(a&&!Hx(a)?a:`_${t}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function cC(e){return e.some(e=>!dM(e)||e.type!==JO&&!(e.type===ZO&&!cC(e.children)))?e:null}function dC(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:lE(i)]=e[i];return n}const hC=e=>e?BM(e)?qM(e):hC(e.parent):null,pC=Lx(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>hC(e.parent),$root:e=>hC(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?LC(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{aA(e.update)}),$nextTick:e=>e.n||(e.n=oA.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?MO.bind(e):Rx}),fC=(e,t)=>e!==Mx&&!e.__isScriptSetup&&$x(e,t),mC={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;let u;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(fC(i,t))return o[t]=1,i[t];if(r!==Mx&&$x(r,t))return o[t]=2,r[t];if((u=e.propsOptions[0])&&$x(u,t))return o[t]=3,s[t];if(n!==Mx&&$x(n,t))return o[t]=4,n[t];__VUE_OPTIONS_API__&&!RC||(o[t]=0)}}const c=pC[t];let d,h;return c?("$attrs"===t&&Ew(e.attrs,0,""),c(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==Mx&&$x(n,t)?(o[t]=4,n[t]):(h=l.config.globalProperties,$x(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return fC(r,t)?(r[t]=n,!0):i!==Mx&&$x(i,t)?(i[t]=n,!0):!$x(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:s}},o){let a;return!!n[o]||e!==Mx&&$x(e,o)||fC(t,o)||(a=s[0])&&$x(a,o)||$x(i,o)||$x(pC,o)||$x(r.config.globalProperties,o)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:$x(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};const gC=Lx({},mC,{get(e,t){if(t!==Symbol.unscopables)return mC.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!gE(t)});function _C(){return null}function yC(){return null}function vC(e){0}function bC(e){0}function TC(){return null}function xC(){0}function EC(e,t){return null}function wC(){return AC().slots}function IC(){return AC().attrs}function AC(){const e=NM();return e.setupContext||(e.setupContext=XM(e))}function SC(e){return Ux(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function CC(e,t){const n=SC(e);for(const e in t){if(e.startsWith("__skip"))continue;let i=n[e];i?Ux(i)||Yx(i)?i=n[e]={type:i,default:t[e]}:i.default=t[e]:null===i&&(i=n[e]={default:t[e]}),i&&t[`__skip_${e}`]&&(i.skipFactory=!0)}return n}function OC(e,t){return e&&t?Ux(e)&&Ux(t)?e.concat(t):Lx({},SC(e),SC(t)):e||t}function MC(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function kC(e){const t=NM();let n=e();return PM(),Xx(n)&&(n=n.catch(e=>{throw LM(t),e})),[n,()=>LM(t)]}let RC=!0;function NC(e){const t=LC(e),n=e.proxy,i=e.ctx;RC=!1,t.beforeCreate&&DC(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:d,mounted:h,beforeUpdate:p,updated:f,activated:m,deactivated:g,beforeDestroy:_,beforeUnmount:y,destroyed:v,unmounted:b,render:T,renderTracked:x,renderTriggered:E,errorCaptured:w,serverPrefetch:I,expose:A,inheritAttrs:S,components:C,directives:O,filters:M}=t;if(u&&function(e,t){Ux(e)&&(e=UC(e));for(const n in e){const i=e[n];let r;r=Wx(i)?"default"in i?qC(i.from||n,i.default,!0):qC(i.from||n):qC(i),gI(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(u,i,null),o)for(const e in o){const t=o[e];Yx(t)&&(i[e]=t.bind(n))}if(r){0;const t=r.call(n,n);0,Wx(t)&&(e.data=iI(t))}if(RC=!0,s)for(const e in s){const t=s[e],r=Yx(t)?t.bind(n,n):Yx(t.get)?t.get.bind(n,n):Rx;0;const o=!Yx(t)&&Yx(t.set)?t.set.bind(n):Rx,a=tk({get:r,set:o});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)FC(a[e],i,n,e);if(l){const e=Yx(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{XC(t,e[t])})}function k(e,t){Ux(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&DC(c,e,"c"),k(jS,d),k(YS,h),k(GS,p),k(HS,f),k(FS,m),k(LS,g),k(QS,w),k(ZS,x),k(KS,E),k(WS,y),k(XS,b),k(qS,I),Ux(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});T&&e.render===Rx&&(e.render=T),null!=S&&(e.inheritAttrs=S),C&&(e.components=C),O&&(e.directives=O),I&&aS(e)}function DC(e,t,n){ZI(Ux(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function FC(e,t,n,i){let r=i.includes(".")?kO(n,i):()=>n[i];if(Gx(e)){const n=t[e];Yx(n)&&CO(r,n)}else if(Yx(e))CO(r,e.bind(n));else if(Wx(e))if(Ux(e))e.forEach(e=>FC(e,t,n,i));else{const i=Yx(e.handler)?e.handler.bind(n):t[e.handler];Yx(i)&&CO(r,i,e)}else 0}function LC(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>PC(l,e,o,!0)),PC(l,t,o)):l=t,Wx(t)&&s.set(t,l),l}function PC(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&PC(e,s,n,!0),r&&r.forEach(t=>PC(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=BC[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const BC={data:$C,props:jC,emits:jC,methods:zC,computed:zC,beforeCreate:VC,created:VC,beforeMount:VC,mounted:VC,beforeUpdate:VC,updated:VC,beforeDestroy:VC,beforeUnmount:VC,destroyed:VC,unmounted:VC,activated:VC,deactivated:VC,errorCaptured:VC,serverPrefetch:VC,components:zC,directives:zC,watch:function(e,t){if(!e)return t;if(!t)return e;const n=Lx(Object.create(null),e);for(const i in t)n[i]=VC(e[i],t[i]);return n},provide:$C,inject:function(e,t){return zC(UC(e),UC(t))}};function $C(e,t){return t?e?function(){return Lx(Yx(e)?e.call(this,this):e,Yx(t)?t.call(this,this):t)}:t:e}function UC(e){if(Ux(e)){const t={};for(let n=0;n(s.has(e)||(e&&Yx(e.install)?(s.add(e),e.install(l,...t)):Yx(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,o,u){if(!a){0;const c=l._ceVNode||_M(n,i);return c.appContext=r,!0===u?u="svg":!1===u&&(u=void 0),o&&t?t(c,s):e(c,s,u),a=!0,l._container=s,s.__vue_app__=l,__VUE_PROD_DEVTOOLS__&&(l._instance=c.component,function(e,t){_A("app:init",e,t,{Fragment:ZO,Text:QO,Comment:JO,Static:eM})}(l,ok)),qM(c.component)}},onUnmount(e){o.push(e)},unmount(){a&&(ZI(o,l._instance,16),e(null,l._container),__VUE_PROD_DEVTOOLS__&&(l._instance=null,function(e){_A("app:unmount",e)}(l)),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=WC;WC=l;try{return e()}finally{WC=t}}};return l}}let WC=null;function XC(e,t){if(RM){let n=RM.provides;const i=RM.parent&&RM.parent.provides;i===n&&(n=RM.provides=Object.create(i)),n[e]=t}else 0}function qC(e,t,n=!1){const i=RM||wA;if(i||WC){const r=WC?WC._context.provides:i?null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&Yx(t)?t.call(i&&i.proxy):t}else 0}function KC(){return!!(RM||wA||WC)}const ZC={},QC=()=>Object.create(ZC),JC=e=>Object.getPrototypeOf(e)===ZC;function eO(e,t,n,i){const[r,s]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(eE(l))continue;const u=t[l];let c;r&&$x(r,c=rE(l))?s&&s.includes(c)?(o||(o={}))[c]=u:n[c]=u:LO(e.emitsOptions,l)||l in i&&u===i[l]||(i[l]=u,a=!0)}if(s){const t=hI(n),i=o||Mx;for(let o=0;o{l=!0;const[n,i]=iO(e,t,!0);Lx(o,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!s&&!l)return Wx(e)&&i.set(e,kx),kx;if(Ux(s))for(let e=0;e"_"===e[0]||"$stable"===e,oO=e=>Ux(e)?e.map(wM):[wM(e)],aO=(e,t,n)=>{if(t._n)return t;const i=MA((...e)=>oO(t(...e)),n);return i._c=!1,i},lO=(e,t,n)=>{const i=e._ctx;for(const n in e){if(sO(n))continue;const r=e[n];if(Yx(r))t[n]=aO(0,r,i);else if(null!=r){0;const e=oO(r);t[n]=()=>e}}},uO=(e,t)=>{const n=oO(t);e.slots.default=()=>n},cO=(e,t,n)=>{for(const i in t)(n||"_"!==i)&&(e[i]=t[i])},dO=(e,t,n)=>{const i=e.slots=QC();if(32&e.vnode.shapeFlag){const e=t._;e?(cO(i,t,n),n&&dE(i,"_",e,!0)):lO(t,i)}else t&&uO(e,t)},hO=(e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=Mx;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:cO(r,t,n):(s=!t.$stable,lO(t,r)),o=t}else t&&(uO(e,t),o={default:1});if(s)for(const e in r)sO(e)||null!=o[e]||delete r[e]};const pO=qO;function fO(e){return gO(e)}function mO(e){return gO(e,fS)}function gO(e,t){"boolean"!=typeof __VUE_OPTIONS_API__&&(mE().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(mE().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(mE().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const n=mE();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&yA(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:h,setScopeId:p=Rx,insertStaticContent:f}=e,m=(e,t,n,i=null,r=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!hM(e,t)&&(i=z(e),P(e,r,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:u,ref:c,shapeFlag:d}=t;switch(u){case QO:g(e,t,n,i);break;case JO:_(e,t,n,i);break;case eM:null==e&&y(t,n,i,o);break;case ZO:S(e,t,n,i,r,s,o,a,l);break;default:1&d?b(e,t,n,i,r,s,o,a,l):6&d?C(e,t,n,i,r,s,o,a,l):(64&d||128&d)&&u.process(e,t,n,i,r,s,o,a,l,G)}null!=c&&r&&uS(c,e&&e.ref,s,t||e,!t)},g=(e,t,n,r)=>{if(null==e)i(t.el=a(t.children),n,r);else{const n=t.el=e.el;t.children!==e.children&&u(n,t.children)}},_=(e,t,n,r)=>{null==e?i(t.el=l(t.children||""),n,r):t.el=e.el},y=(e,t,n,i)=>{[e.el,e.anchor]=f(e.children,t,n,i,e.el,e.anchor)},v=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),r(e),e=n;r(t)},b=(e,t,n,i,r,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?T(t,n,i,r,s,o,a,l):w(e,t,r,s,o,a,l)},T=(e,t,n,r,a,l,u,d)=>{let h,p;const{props:f,shapeFlag:m,transition:g,dirs:_}=e;if(h=e.el=o(e.type,l,f&&f.is,f),8&m?c(h,e.children):16&m&&E(e.children,h,null,r,a,_O(e,l),u,d),_&&RA(e,null,r,"created"),x(h,e,e.scopeId,u,r),f){for(const e in f)"value"===e||eE(e)||s(h,e,null,f[e],l,r);"value"in f&&s(h,"value",null,f.value,l),(p=f.onVnodeBeforeMount)&&CM(p,r,e)}__VUE_PROD_DEVTOOLS__&&(dE(h,"__vnode",e,!0),dE(h,"__vueParentComponent",r,!0)),_&&RA(e,null,r,"beforeMount");const y=vO(a,g);y&&g.beforeEnter(h),i(h,t,n),((p=f&&f.onVnodeMounted)||y||_)&&pO(()=>{p&&CM(p,r,e),y&&g.enter(h),_&&RA(e,null,r,"mounted")},a)},x=(e,t,n,i,r)=>{if(n&&p(e,n),i)for(let t=0;t{for(let u=l;u{const l=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(l.__vnode=t);let{patchFlag:u,dynamicChildren:d,dirs:h}=t;u|=16&e.patchFlag;const p=e.props||Mx,f=t.props||Mx;let m;if(n&&yO(n,!1),(m=f.onVnodeBeforeUpdate)&&CM(m,n,t,e),h&&RA(t,e,n,"beforeUpdate"),n&&yO(n,!0),(p.innerHTML&&null==f.innerHTML||p.textContent&&null==f.textContent)&&c(l,""),d?I(e.dynamicChildren,d,l,n,i,_O(t,r),o):a||N(e,t,l,null,n,i,_O(t,r),o,!1),u>0){if(16&u)A(l,p,f,n,r);else if(2&u&&p.class!==f.class&&s(l,"class",null,f.class,r),4&u&&s(l,"style",p.style,f.style,r),8&u){const e=t.dynamicProps;for(let t=0;t{m&&CM(m,n,t,e),h&&RA(t,e,n,"updated")},i)},I=(e,t,n,i,r,s,o)=>{for(let a=0;a{if(t!==n){if(t!==Mx)for(const o in t)eE(o)||o in n||s(e,o,t[o],null,r,i);for(const o in n){if(eE(o))continue;const a=n[o],l=t[o];a!==l&&"value"!==o&&s(e,o,l,a,r,i)}"value"in n&&s(e,"value",t.value,n.value,r)}},S=(e,t,n,r,s,o,l,u,c)=>{const d=t.el=e?e.el:a(""),h=t.anchor=e?e.anchor:a("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(u=u?u.concat(m):m),null==e?(i(d,n,r),i(h,n,r),E(t.children||[],n,h,s,o,l,u,c)):p>0&&64&p&&f&&e.dynamicChildren?(I(e.dynamicChildren,f,n,s,o,l,u),(null!=t.key||s&&t===s.subTree)&&bO(e,t,!0)):N(e,t,n,h,s,o,l,u,c)},C=(e,t,n,i,r,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,l):O(t,n,i,r,s,o,l):M(e,t,l)},O=(e,t,n,i,r,s,o)=>{const a=e.component=kM(e,i,r);if(kS(e)&&(a.ctx.renderer=G),zM(a,!1,o),a.asyncDep){if(r&&r.registerDep(a,k,o),!e.el){const e=a.subTree=_M(JO);_(null,e,t,n)}}else k(a,e,t,n,r,s,o)},M=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,u=s.emitsOptions;0;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==o&&(i?!o||VO(i,o,u):!!o);if(1024&l)return!0;if(16&l)return i?VO(i,o,u):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:u}=e;{const n=TO(e);if(n)return t&&(t.el=u.el,R(e,t,o)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let c,h=t;0,yO(e,!1),t?(t.el=u.el,R(e,t,o)):t=u,n&&cE(n),(c=t.props&&t.props.onVnodeBeforeUpdate)&&CM(c,l,t,u),yO(e,!0);const p=PO(e);0;const f=e.subTree;e.subTree=p,m(f,p,d(f.el),z(f),e,r,s),t.el=p.el,null===h&&zO(e,p.el),i&&pO(i,r),(c=t.props&&t.props.onVnodeUpdated)&&pO(()=>CM(c,l,t,u),r),__VUE_PROD_DEVTOOLS__&&bA(e)}else{let o;const{el:a,props:l}=t,{bm:u,m:c,parent:d,root:h,type:p}=e,f=CS(t);if(yO(e,!1),u&&cE(u),!f&&(o=l&&l.onVnodeBeforeMount)&&CM(o,d,t),yO(e,!0),a&&W){const t=()=>{e.subTree=PO(e),W(a,e.subTree,e,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{h.ce&&h.ce._injectChildStyle(p);const o=e.subTree=PO(e);0,m(null,o,n,i,e,r,s),t.el=o.el}if(c&&pO(c,r),!f&&(o=l&&l.onVnodeMounted)){const e=t;pO(()=>CM(o,d,e),r)}(256&t.shapeFlag||d&&CS(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&pO(e.a,r),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&vA(e),t=n=i=null}};e.scope.on();const l=e.effect=new qE(a);e.scope.off();const u=e.update=l.run.bind(l),c=e.job=l.runIfDirty.bind(l);c.i=e,c.id=e.uid,l.scheduler=()=>aA(c),yO(e,!0),u()},R=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=hI(r),[l]=e.propsOptions;let u=!1;if(!(i||o>0)||16&o){let i;eO(e,t,r,s)&&(u=!0);for(const s in a)t&&($x(t,s)||(i=oE(s))!==s&&$x(t,i))||(l?!n||void 0===n[s]&&void 0===n[i]||(r[s]=tO(l,a,s,void 0,e,!0)):delete r[s]);if(s!==a)for(const e in s)t&&$x(t,e)||(delete s[e],u=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let i=0;i{const u=e&&e.children,d=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void F(u,h,n,i,r,s,o,a,l);if(256&p)return void D(u,h,n,i,r,s,o,a,l)}8&f?(16&d&&V(u,r,s),h!==u&&c(n,h)):16&d?16&f?F(u,h,n,i,r,s,o,a,l):V(u,r,s,!0):(8&d&&c(n,""),16&f&&E(h,n,i,r,s,o,a,l))},D=(e,t,n,i,r,s,o,a,l)=>{t=t||kx;const u=(e=e||kx).length,c=t.length,d=Math.min(u,c);let h;for(h=0;hc?V(e,r,s,!0,!1,d):E(t,n,i,r,s,o,a,l,d)},F=(e,t,n,i,r,s,o,a,l)=>{let u=0;const c=t.length;let d=e.length-1,h=c-1;for(;u<=d&&u<=h;){const i=e[u],c=t[u]=l?IM(t[u]):wM(t[u]);if(!hM(i,c))break;m(i,c,n,null,r,s,o,a,l),u++}for(;u<=d&&u<=h;){const i=e[d],u=t[h]=l?IM(t[h]):wM(t[h]);if(!hM(i,u))break;m(i,u,n,null,r,s,o,a,l),d--,h--}if(u>d){if(u<=h){const e=h+1,d=eh)for(;u<=d;)P(e[u],r,s,!0),u++;else{const p=u,f=u,g=new Map;for(u=f;u<=h;u++){const e=t[u]=l?IM(t[u]):wM(t[u]);null!=e.key&&g.set(e.key,u)}let _,y=0;const v=h-f+1;let b=!1,T=0;const x=new Array(v);for(u=0;u=v){P(i,r,s,!0);continue}let c;if(null!=i.key)c=g.get(i.key);else for(_=f;_<=h;_++)if(0===x[_-f]&&hM(i,t[_])){c=_;break}void 0===c?P(i,r,s,!0):(x[c-f]=u+1,c>=T?T=c:b=!0,m(i,t[c],n,null,r,s,o,a,l),y++)}const E=b?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i>1,e[n[a]]0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(x):kx;for(_=E.length-1,u=v-1;u>=0;u--){const e=f+u,d=t[e],h=e+1{const{el:o,type:a,transition:l,children:u,shapeFlag:c}=e;if(6&c)return void L(e.component.subTree,t,n,r);if(128&c)return void e.suspense.move(t,n,r);if(64&c)return void a.move(e,t,n,G);if(a===ZO){i(o,t,n);for(let e=0;e{let s;for(;e&&e!==t;)s=h(e),i(e,n,r),e=s;i(t,n,r)})(e,t,n);if(2!==r&&1&c&&l)if(0===r)l.beforeEnter(o),i(o,t,n),pO(()=>l.enter(o),s);else{const{leave:e,delayLeave:r,afterLeave:s}=l,a=()=>i(o,t,n),u=()=>{e(o,()=>{a(),s&&s()})};r?r(o,a,u):u()}else i(o,t,n)},P=(e,t,n,i=!1,r=!1)=>{const{type:s,props:o,ref:a,children:l,dynamicChildren:u,shapeFlag:c,patchFlag:d,dirs:h,cacheIndex:p}=e;if(-2===d&&(r=!1),null!=a&&uS(a,null,n,e,!0),null!=p&&(t.renderCache[p]=void 0),256&c)return void t.ctx.deactivate(e);const f=1&c&&h,m=!CS(e);let g;if(m&&(g=o&&o.onVnodeBeforeUnmount)&&CM(g,t,e),6&c)U(e.component,n,i);else{if(128&c)return void e.suspense.unmount(n,i);f&&RA(e,null,t,"beforeUnmount"),64&c?e.type.remove(e,t,n,G,i):u&&!u.hasOnce&&(s!==ZO||d>0&&64&d)?V(u,t,n,!1,!0):(s===ZO&&384&d||!r&&16&c)&&V(l,t,n),i&&B(e)}(m&&(g=o&&o.onVnodeUnmounted)||f)&&pO(()=>{g&&CM(g,t,e),f&&RA(e,null,t,"unmounted")},n)},B=e=>{const{type:t,el:n,anchor:i,transition:s}=e;if(t===ZO)return void $(n,i);if(t===eM)return void v(e);const o=()=>{r(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},$=(e,t)=>{let n;for(;e!==t;)n=h(e),r(e),e=n;r(t)},U=(e,t,n)=>{const{bum:i,scope:r,job:s,subTree:o,um:a,m:l,a:u}=e;xO(l),xO(u),i&&cE(i),r.stop(),s&&(s.flags|=8,P(o,e,t,n)),a&&pO(a,t),pO(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve()),__VUE_PROD_DEVTOOLS__&&xA(e)},V=(e,t,n,i=!1,r=!1,s=0)=>{for(let o=s;o{if(6&e.shapeFlag)return z(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=h(e.anchor||e.el),n=t&&t[NA];return n?h(n):t};let j=!1;const Y=(e,t,n)=>{null==e?t._vnode&&P(t._vnode,null,null,!0):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,j||(j=!0,cA(),dA(),j=!1)},G={p:m,um:P,m:L,r:B,mt:O,mc:E,pc:N,pbc:I,n:z,o:e};let H,W;return t&&([H,W]=t(G)),{render:Y,hydrate:H,createApp:HC(Y,H)}}function _O({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function yO({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function vO(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function bO(e,t,n=!1){const i=e.children,r=t.children;if(Ux(i)&&Ux(r))for(let e=0;e{{const e=qC(EO);return e}};function IO(e,t){return OO(e,null,t)}function AO(e,t){return OO(e,null,{flush:"post"})}function SO(e,t){return OO(e,null,{flush:"sync"})}function CO(e,t,n){return OO(e,t,n)}function OO(e,t,n=Mx){const{immediate:i,deep:r,flush:s,once:o}=n;const a=Lx({},n);const l=t&&i||!t&&"post"!==s;let u;if(VM)if("sync"===s){const e=wO();u=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=Rx,e.resume=Rx,e.pause=Rx,e}const c=RM;a.call=(e,t,n)=>ZI(e,c,t,n);let d=!1;"post"===s?a.scheduler=e=>{pO(e,c&&c.suspense)}:"sync"!==s&&(d=!0,a.scheduler=(e,t)=>{t?e():aA(e)}),a.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))};const h=function(e,t,n=Mx){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,u=e=>r?e:cI(e)||!1===r||0===r?VI(e,1):VI(e);let c,d,h,p,f=!1,m=!1;if(gI(e)?(d=()=>e.value,f=cI(e)):lI(e)?(d=()=>u(e),f=!0):Ux(e)?(m=!0,f=e.some(e=>lI(e)||cI(e)),d=()=>e.map(e=>gI(e)?e.value:lI(e)?u(e):Yx(e)?l?l(e,2):e():void 0)):d=Yx(e)?t?l?()=>l(e,2):e:()=>{if(h){hw();try{h()}finally{pw()}}const t=BI;BI=c;try{return l?l(e,3,[p]):e(p)}finally{BI=t}}:Rx,t&&r){const e=d,t=!0===r?1/0:r;d=()=>VI(e(),t)}const g=HE(),_=()=>{c.stop(),g&&g.active&&Px(g.effects,c)};if(s&&t){const e=t;t=(...t)=>{e(...t),_()}}let y=m?new Array(e.length).fill(LI):LI;const v=e=>{if(1&c.flags&&(c.dirty||e))if(t){const e=c.run();if(r||f||(m?e.some((e,t)=>uE(e,y[t])):uE(e,y))){h&&h();const n=BI;BI=c;try{const n=[e,y===LI?void 0:m&&y[0]===LI?[]:y,p];l?l(t,3,n):t(...n),y=e}finally{BI=n}}}else c.run()};return a&&a(v),c=new qE(d),c.scheduler=o?()=>o(v,!1):v,p=e=>UI(e,!1,c),h=c.onStop=()=>{const e=PI.get(c);if(e){if(l)l(e,4);else for(const t of e)t();PI.delete(c)}},t?i?v(!0):y=c.run():o?o(v.bind(null,!0),!0):c.run(),_.pause=c.pause.bind(c),_.resume=c.resume.bind(c),_.stop=_,_}(e,t,a);return VM&&(u?u.push(h):l&&h()),h}function MO(e,t,n){const i=this.proxy,r=Gx(e)?e.includes(".")?kO(i,e):()=>i[e]:e.bind(i,i);let s;Yx(t)?s=t:(s=t.handler,n=t);const o=LM(this),a=OO(r,s.bind(i),n);return o(),a}function kO(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{let l,u,c=Mx;return SO(()=>{const t=e[r];uE(l,t)&&(l=t,a())}),{get:()=>(o(),n.get?n.get(l):l),set(e){const o=n.set?n.set(e):e;if(!(uE(o,l)||c!==Mx&&uE(e,c)))return;const d=i.vnode.props;d&&(t in d||r in d||s in d)&&(`onUpdate:${t}`in d||`onUpdate:${r}`in d||`onUpdate:${s}`in d)||(l=e,a()),i.emit(`update:${t}`,o),uE(e,o)&&uE(e,c)&&!uE(o,u)&&a(),c=e,u=o}}});return a[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?o||Mx:a,done:!1}:{done:!0}}},a}const NO=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${rE(t)}Modifiers`]||e[`${oE(t)}Modifiers`];function DO(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Mx;let r=n;const s=t.startsWith("update:"),o=s&&NO(i,t.slice(7));let a;o&&(o.trim&&(r=n.map(e=>Gx(e)?e.trim():e)),o.number&&(r=n.map(hE))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){_A("component:emit",e.appContext.app,e,t,n)}(e,t,r);let l=i[a=lE(t)]||i[a=lE(rE(t))];!l&&s&&(l=i[a=lE(oE(t))]),l&&ZI(l,e,6,r);const u=i[a+"Once"];if(u){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,ZI(u,e,6,r)}}function FO(e,t,n=!1){const i=t.emitsCache,r=i.get(e);if(void 0!==r)return r;const s=e.emits;let o={},a=!1;if(__VUE_OPTIONS_API__&&!Yx(e)){const i=e=>{const n=FO(e,t,!0);n&&(a=!0,Lx(o,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||a?(Ux(s)?s.forEach(e=>o[e]=null):Lx(o,s),Wx(e)&&i.set(e,o),o):(Wx(e)&&i.set(e,null),null)}function LO(e,t){return!(!e||!Dx(t))&&(t=t.slice(2).replace(/Once$/,""),$x(e,t[0].toLowerCase()+t.slice(1))||$x(e,oE(t))||$x(e,t))}function PO(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:u,renderCache:c,props:d,data:h,setupState:p,ctx:f,inheritAttrs:m}=e,g=AA(e);let _,y;try{if(4&n.shapeFlag){const e=r||i,t=e;_=wM(u.call(t,e,c,d,p,h,f)),y=a}else{const e=t;0,_=wM(e.length>1?e(d,{attrs:a,slots:o,emit:l}):e(d,null)),y=t.props?a:$O(a)}}catch(t){tM.length=0,QI(t,e,1),_=_M(JO)}let v=_;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=v;e.length&&7&t&&(s&&e.some(Fx)&&(y=UO(y,s)),v=bM(v,y,!1,!0))}return n.dirs&&(v=bM(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&iS(v,n.transition),_=v,AA(g),_}function BO(e,t=!0){let n;for(let t=0;t{let t;for(const n in e)("class"===n||"style"===n||Dx(n))&&((t||(t={}))[n]=e[n]);return t},UO=(e,t)=>{const n={};for(const i in e)Fx(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function VO(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense;let YO=0;const GO={name:"Suspense",__isSuspense:!0,process(e,t,n,i,r,s,o,a,l,u){if(null==e)!function(e,t,n,i,r,s,o,a,l){const{p:u,o:{createElement:c}}=l,d=c("div"),h=e.suspense=WO(e,r,i,t,d,n,s,o,a,l);u(null,h.pendingBranch=e.ssContent,d,null,i,h,s,o),h.deps>0?(HO(e,"onPending"),HO(e,"onFallback"),u(null,e.ssFallback,t,n,i,null,s,o),KO(h,e.ssFallback)):h.resolve(!1,!0)}(t,n,i,r,s,o,a,l,u);else{if(s&&s.deps>0&&!e.suspense.isInFallback)return t.suspense=e.suspense,t.suspense.vnode=t,void(t.el=e.el);!function(e,t,n,i,r,s,o,a,{p:l,um:u,o:{createElement:c}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:g,isHydrating:_}=d;if(m)d.pendingBranch=h,hM(h,m)?(l(m,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0?d.resolve():g&&(_||(l(f,p,n,i,r,null,s,o,a),KO(d,p)))):(d.pendingId=YO++,_?(d.isHydrating=!1,d.activeBranch=m):u(m,r,d),d.deps=0,d.effects.length=0,d.hiddenContainer=c("div"),g?(l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0?d.resolve():(l(f,p,n,i,r,null,s,o,a),KO(d,p))):f&&hM(h,f)?(l(f,h,n,i,r,d,s,o,a),d.resolve(!0)):(l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0&&d.resolve()));else if(f&&hM(h,f))l(f,h,n,i,r,d,s,o,a),KO(d,h);else if(HO(t,"onPending"),d.pendingBranch=h,512&h.shapeFlag?d.pendingId=h.component.suspenseId:d.pendingId=YO++,l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0)d.resolve();else{const{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):0===e&&d.fallback(p)}}(e,t,n,i,r,o,a,l,u)}},hydrate:function(e,t,n,i,r,s,o,a,l){const u=t.suspense=WO(t,i,n,e.parentNode,document.createElement("div"),null,r,s,o,a,!0),c=l(e,u.pendingBranch=t.ssContent,n,u,s,o);0===u.deps&&u.resolve(!1,!0);return c},normalize:function(e){const{shapeFlag:t,children:n}=e,i=32&t;e.ssContent=XO(i?n.default:n),e.ssFallback=i?XO(n.fallback):_M(JO)}};function HO(e,t){const n=e.props&&e.props[t];Yx(n)&&n()}function WO(e,t,n,i,r,s,o,a,l,u,c=!1){const{p:d,m:h,um:p,n:f,o:{parentNode:m,remove:g}}=u;let _;const y=function(e){const t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?pE(e.props.timeout):void 0;const b=s,T={vnode:e,parent:t,parentComponent:n,namespace:o,container:i,hiddenContainer:r,deps:0,pendingId:YO++,timeout:"number"==typeof v?v:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:i,activeBranch:r,pendingBranch:o,pendingId:a,effects:l,parentComponent:u,container:c}=T;let d=!1;T.isHydrating?T.isHydrating=!1:e||(d=r&&o.transition&&"out-in"===o.transition.mode,d&&(r.transition.afterLeave=()=>{a===T.pendingId&&(h(o,c,s===b?f(r):s,0),uA(l))}),r&&(m(r.el)===c&&(s=f(r)),p(r,u,T,!0)),d||h(o,c,s,0)),KO(T,o),T.pendingBranch=null,T.isInFallback=!1;let g=T.parent,v=!1;for(;g;){if(g.pendingBranch){g.effects.push(...l),v=!0;break}g=g.parent}v||d||uA(l),T.effects=[],y&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),HO(i,"onResolve")},fallback(e){if(!T.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:i,container:r,namespace:s}=T;HO(t,"onFallback");const o=f(n),u=()=>{T.isInFallback&&(d(null,e,r,o,i,null,s,a,l),KO(T,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),T.isInFallback=!0,p(n,i,null,!0),c||u()},move(e,t,n){T.activeBranch&&h(T.activeBranch,e,t,n),T.container=e},next:()=>T.activeBranch&&f(T.activeBranch),registerDep(e,t,n){const i=!!T.pendingBranch;i&&T.deps++;const r=e.vnode.el;e.asyncDep.catch(t=>{QI(t,e,0)}).then(s=>{if(e.isUnmounted||T.isUnmounted||T.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:a}=e;jM(e,s,!1),r&&(a.el=r);const l=!r&&e.subTree.el;t(e,a,m(r||e.subTree.el),r?null:f(e.subTree),T,o,n),l&&g(l),zO(e,a.el),i&&0===--T.deps&&T.resolve()})},unmount(e,t){T.isUnmounted=!0,T.activeBranch&&p(T.activeBranch,n,e,t),T.pendingBranch&&p(T.pendingBranch,n,e,t)}};return T}function XO(e){let t;if(Yx(e)){const n=oM&&e._c;n&&(e._d=!1,iM()),e=e(),n&&(e._d=!0,t=nM,rM())}if(Ux(e)){const t=BO(e);0,e=t}return e=wM(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function qO(e,t){t&&t.pendingBranch?Ux(e)?t.effects.push(...e):t.effects.push(e):uA(e)}function KO(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,i&&i.subTree===n&&(i.vnode.el=r,zO(i,r))}const ZO=Symbol.for("v-fgt"),QO=Symbol.for("v-txt"),JO=Symbol.for("v-cmt"),eM=Symbol.for("v-stc"),tM=[];let nM=null;function iM(e=!1){tM.push(nM=e?null:[])}function rM(){tM.pop(),nM=tM[tM.length-1]||null}let sM,oM=1;function aM(e,t=!1){oM+=e,e<0&&nM&&t&&(nM.hasOnce=!0)}function lM(e){return e.dynamicChildren=oM>0?nM||kx:null,rM(),oM>0&&nM&&nM.push(e),e}function uM(e,t,n,i,r,s){return lM(gM(e,t,n,i,r,s,!0))}function cM(e,t,n,i,r){return lM(_M(e,t,n,i,r,!0))}function dM(e){return!!e&&!0===e.__v_isVNode}function hM(e,t){return e.type===t.type&&e.key===t.key}function pM(e){sM=e}const fM=({key:e})=>null!=e?e:null,mM=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?Gx(e)||gI(e)||Yx(e)?{i:wA,r:e,k:t,f:!!n}:e:null);function gM(e,t=null,n=null,i=0,r=null,s=(e===ZO?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fM(t),ref:t&&mM(t),scopeId:IA,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:wA};return a?(AM(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=Gx(n)?8:16),oM>0&&!o&&nM&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&nM.push(l),l}const _M=yM;function yM(e,t=null,n=null,i=0,r=null,s=!1){if(e&&e!==nC||(e=JO),dM(e)){const i=bM(e,t,!0);return n&&AM(i,n),oM>0&&!s&&nM&&(6&i.shapeFlag?nM[nM.indexOf(e)]=i:nM.push(i)),i.patchFlag=-2,i}if(ek(e)&&(e=e.__vccOpts),t){t=vM(t);let{class:e,style:n}=t;e&&!Gx(e)&&(t.class=xE(e)),Wx(n)&&(dI(n)&&!Ux(n)&&(n=Lx({},n)),t.style=_E(n))}return gM(e,t,n,i,r,Gx(e)?1:jO(e)?128:DA(e)?64:Wx(e)?4:Yx(e)?2:0,s,!0)}function vM(e){return e?dI(e)||JC(e)?Lx({},e):e:null}function bM(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,u=t?SM(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&fM(u),ref:t&&t.ref?n&&s?Ux(s)?s.concat(mM(t)):[s,mM(t)]:mM(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ZO?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bM(e.ssContent),ssFallback:e.ssFallback&&bM(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&iS(c,l.clone(c)),c}function TM(e=" ",t=0){return _M(QO,null,e,t)}function xM(e,t){const n=_M(eM,null,e);return n.staticCount=t,n}function EM(e="",t=!1){return t?(iM(),cM(JO,null,e)):_M(JO,null,e)}function wM(e){return null==e||"boolean"==typeof e?_M(JO):Ux(e)?_M(ZO,null,e.slice()):dM(e)?IM(e):_M(QO,null,String(e))}function IM(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:bM(e)}function AM(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if(Ux(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),AM(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||JC(t)?3===i&&wA&&(1===wA.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=wA}}else Yx(t)?(t={default:t,_ctx:wA},n=32):(t=String(t),64&i?(n=16,t=[TM(t)]):n=8);e.children=t,e.shapeFlag|=n}function SM(...e){const t={};for(let n=0;nRM||wA;let DM,FM;{const e=mE(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};DM=t("__VUE_INSTANCE_SETTERS__",e=>RM=e),FM=t("__VUE_SSR_SETTERS__",e=>VM=e)}const LM=e=>{const t=RM;return DM(e),e.scope.on(),()=>{e.scope.off(),DM(t)}},PM=()=>{RM&&RM.scope.off(),DM(null)};function BM(e){return 4&e.vnode.shapeFlag}let $M,UM,VM=!1;function zM(e,t=!1,n=!1){t&&FM(t);const{props:i,children:r}=e.vnode,s=BM(e);!function(e,t,n,i=!1){const r={},s=QC();e.propsDefaults=Object.create(null),eO(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:rI(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,i,s,t),dO(e,r,n);const o=s?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mC),!1;const{setup:i}=n;if(i){hw();const n=e.setupContext=i.length>1?XM(e):null,r=LM(e),s=KI(i,e,0,[e.props,n]),o=Xx(s);if(pw(),r(),!o&&!e.sp||CS(e)||aS(e),o){if(s.then(PM,PM),t)return s.then(n=>{jM(e,n,t)}).catch(t=>{QI(t,e,0)});e.asyncDep=s}else jM(e,s,t)}else HM(e,t)}(e,t):void 0;return t&&FM(!1),o}function jM(e,t,n){Yx(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Wx(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=II(t)),HM(e,n)}function YM(e){$M=e,UM=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,gC))}}const GM=()=>!$M;function HM(e,t,n){const i=e.type;if(!e.render){if(!t&&$M&&!i.render){const t=i.template||__VUE_OPTIONS_API__&&LC(e).template;if(t){0;const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:o}=i,a=Lx(Lx({isCustomElement:n,delimiters:s},r),o);i.render=$M(t,a)}}e.render=i.render||Rx,UM&&UM(e)}if(__VUE_OPTIONS_API__){const t=LM(e);hw();try{NC(e)}finally{pw(),t()}}}const WM={get:(e,t)=>(Ew(e,0,""),e[t])};function XM(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,WM),slots:e.slots,emit:e.emit,expose:t}}function qM(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(II(pI(e.exposed)),{get:(t,n)=>n in t?t[n]:n in pC?pC[n](e):void 0,has:(e,t)=>t in e||t in pC})):e.proxy}const KM=/(?:^|[-_])(\w)/g,ZM=e=>e.replace(KM,e=>e.toUpperCase()).replace(/[-_]/g,"");function QM(e,t=!0){return Yx(e)?e.displayName||e.name:e.name||t&&e.__name}function JM(e,t,n=!1){let i=QM(t);if(!i&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(i=e[1])}if(!i&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};i=n(e.components||e.parent.type.components)||n(e.appContext.components)}return i?ZM(i):n?"App":"Anonymous"}function ek(e){return Yx(e)&&"__vccOpts"in e}const tk=(e,t)=>{const n=function(e,t,n=!1){let i,r;return Yx(e)?i=e:(i=e.get,r=e.set),new NI(i,r,n)}(e,0,VM);return n};function nk(e,t,n){const i=arguments.length;return 2===i?Wx(t)&&!Ux(t)?dM(t)?_M(e,null,[t]):_M(e,t):_M(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&dM(n)&&(n=[n]),_M(e,t,n))}function ik(){return void 0}function rk(e,t,n,i){const r=n[i];if(r&&sk(r,e))return r;const s=t();return s.memo=e.slice(),s.cacheIndex=i,n[i]=s}function sk(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&nM&&nM.push(e),!0}const ok="3.5.13",ak=Rx,lk=qI,uk=fA,ck=yA,dk={createComponentInstance:kM,setupComponent:zM,renderComponentRoot:PO,setCurrentRenderingInstance:AA,isVNode:dM,normalizeVNode:wM,getComponentPublicInstance:qM,ensureValidVNode:cC,pushWarningContext:function(e){zI.push(e)},popWarningContext:function(){zI.pop()}},hk=null,pk=null,fk=null; /** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ -let dk;const hk="undefined"!=typeof window&&window.trustedTypes;if(hk)try{dk=hk.createPolicy("vue",{createHTML:e=>e})}catch(e){}const pk=dk?e=>dk.createHTML(e):e=>e,fk="undefined"!=typeof document?document:null,mk=fk&&fk.createElement("template"),gk={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?fk.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?fk.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?fk.createElement(e,{is:n}):fk.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>fk.createTextNode(e),createComment:e=>fk.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>fk.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{mk.innerHTML=pk("svg"===i?`${e}`:"mathml"===i?`${e}`:e);const r=mk.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},_k="transition",yk="animation",vk=Symbol("_vtc"),bk={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Tk=Rx({},GA,bk),xk=(e=>(e.displayName="Transition",e.props=Tk,e))((e,{slots:t})=>QM(XA,Ik(e),t)),Ek=(e,t=[])=>{Lx(e)?e.forEach(e=>e(...t)):e&&e(...t)},wk=e=>!!e&&(Lx(e)?e.some(e=>e.length>1):e.length>1);function Ik(e){const t={};for(const n in e)n in bk||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:i,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,f=function(e){if(null==e)return null;if(jx(e))return[Ak(e.enter),Ak(e.leave)];{const t=Ak(e);return[t,t]}}(r),m=f&&f[0],g=f&&f[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:v,onLeave:b,onLeaveCancelled:T,onBeforeAppear:x=_,onAppear:E=y,onAppearCancelled:w=v}=t,I=(e,t,n,i)=>{e._enterCancelled=i,Ck(e,t?c:a),Ck(e,t?u:o),n&&n()},A=(e,t)=>{e._isLeaving=!1,Ck(e,d),Ck(e,p),Ck(e,h),t&&t()},S=e=>(t,n)=>{const r=e?E:y,o=()=>I(t,e,n);Ek(r,[t,o]),Ok(()=>{Ck(t,e?l:s),Sk(t,e?c:a),wk(r)||kk(t,i,m,o)})};return Rx(t,{onBeforeEnter(e){Ek(_,[e]),Sk(e,s),Sk(e,o)},onBeforeAppear(e){Ek(x,[e]),Sk(e,l),Sk(e,u)},onEnter:S(!1),onAppear:S(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>A(e,t);Sk(e,d),e._enterCancelled?(Sk(e,h),Fk()):(Fk(),Sk(e,h)),Ok(()=>{e._isLeaving&&(Ck(e,d),Sk(e,p),wk(b)||kk(e,i,g,n))}),Ek(b,[e,n])},onEnterCancelled(e){I(e,!1,void 0,!0),Ek(v,[e])},onAppearCancelled(e){I(e,!0,void 0,!0),Ek(w,[e])},onLeaveCancelled(e){A(e),Ek(T,[e])}})}function Ak(e){return uE(e)}function Sk(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[vk]||(e[vk]=new Set)).add(t)}function Ck(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));const n=e[vk];n&&(n.delete(t),n.size||(e[vk]=void 0))}function Ok(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Mk=0;function kk(e,t,n,i){const r=e._endId=++Mk,s=()=>{r===e._endId&&i()};if(null!=n)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Rk(e,t);if(!o)return i();const u=o+"end";let c=0;const d=()=>{e.removeEventListener(u,h),s()},h=t=>{t.target===e&&++c>=l&&d()};setTimeout(()=>{c(n[e]||"").split(", "),r=i(`${_k}Delay`),s=i(`${_k}Duration`),o=Nk(r,s),a=i(`${yk}Delay`),l=i(`${yk}Duration`),u=Nk(a,l);let c=null,d=0,h=0;t===_k?o>0&&(c=_k,d=o,h=s.length):t===yk?u>0&&(c=yk,d=u,h=l.length):(d=Math.max(o,u),c=d>0?o>u?_k:yk:null,h=c?c===_k?s.length:l.length:0);return{type:c,timeout:d,propCount:h,hasTransform:c===_k&&/\b(transform|all)(,|$)/.test(i(`${_k}Property`).toString())}}function Nk(e,t){for(;e.lengthDk(t)+Dk(e[n])))}function Dk(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function Fk(){return document.body.offsetHeight}const Lk=Symbol("_vod"),Pk=Symbol("_vsh"),Bk={beforeMount(e,{value:t},{transition:n}){e[Lk]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):$k(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),$k(e,!0),i.enter(e)):i.leave(e,()=>{$k(e,!1)}):$k(e,t))},beforeUnmount(e,{value:t}){$k(e,t)}};function $k(e,t){e.style.display=t?e[Lk]:"none",e[Pk]=!t}const Uk=Symbol("");function Vk(e){const t=OM();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>jk(e,n))};const i=()=>{const i=e(t.proxy);t.ce?jk(t.ce,i):zk(t.subTree,i),n(i)};VS(()=>{sA(i)}),US(()=>{wO(i,Cx,{flush:"post"});const e=new MutationObserver(i);e.observe(t.subTree.el.parentNode,{childList:!0}),YS(()=>e.disconnect())})}function zk(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{zk(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)jk(e.el,t);else if(e.type===WO)e.children.forEach(e=>zk(e,t));else if(e.type===KO){let{el:n,anchor:i}=e;for(;n&&(jk(n,t),n!==i);)n=n.nextSibling}}function jk(e,t){if(1===e.nodeType){const n=e.style;let i="";for(const e in t)n.setProperty(`--${e}`,t[e]),i+=`--${e}: ${t[e]};`;n[Uk]=i}}const Yk=/(^|;)\s*display\s*:/;const Gk=/\s*!important$/;function Hk(e,t,n){if(Lx(n))n.forEach(n=>Hk(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=Xk[t];if(n)return n;let i=eE(t);if("filter"!==i&&i in e)return Xk[t]=i;i=iE(i);for(let n=0;n{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();WI(function(e,t){if(Lx(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=rR(),n}(i,r);Qk(e,n,o,a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const tR=/(?:Once|Passive|Capture)$/;let nR=0;const iR=Promise.resolve(),rR=()=>nR||(iR.then(()=>nR=0),nR=Date.now());const sR=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const oR={}; -/*! #__NO_SIDE_EFFECTS__ */function aR(e,t,n){const i=tS(e,t);Xx(i)&&Rx(i,t);class r extends cR{constructor(e){super(i,e,n)}}return r.def=i,r} -/*! #__NO_SIDE_EFFECTS__ */const lR=(e,t)=>aR(e,t,ZR),uR="undefined"!=typeof HTMLElement?HTMLElement:class{};class cR extends uR{constructor(e,t={},n=KR){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==KR?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof cR){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,nA(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(const t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(e,t=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:n,styles:i}=e;let r;if(n&&!Lx(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=uE(this._props[e])),(r||(r=Object.create(null)))[eE(e)]=!0)}this._numberProps=r,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){__VUE_PROD_DEVTOOLS__&&!e.name&&(e.name="VueElement"),this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const t=this._instance&&this._instance.exposed;if(t)for(const e in t)Fx(this,e)||Object.defineProperty(this,e,{get:()=>yI(t[e])})}_resolveProps(e){const{props:t}=e,n=Lx(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(const e of n.map(eE))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const t=this.hasAttribute(e);let n=t?this.getAttribute(e):oR;const i=eE(e);t&&this._numberProps&&this._numberProps[i]&&(n=uE(n)),this._setProp(i,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,i=!1){if(t!==this._props[e]&&(t===oR?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),i&&this._instance&&this._update(),n)){const n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(nE(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(nE(e),t+""):t||this.removeAttribute(nE(e)),n&&n.observe(this,{attributes:!0})}}_update(){XR(this._createVNode(),this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const t=pM(this._def,Rx(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,Xx(t[0])?Rx({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),nE(e)!==e&&t(nE(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}const n=this._nonce;for(let t=e.length-1;t>=0;t--){const i=document.createElement("style");n&&i.setAttribute("nonce",n),i.textContent=e[t],this.shadowRoot.prepend(i)}}_parseSlots(){const e=this._slots={};let t;for(;t=this.firstChild;){const n=1===t.nodeType&&t.getAttribute("slot")||"default";(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n(delete e.props.mode,e))({name:"TransitionGroup",props:Rx({},Tk,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=OM(),i=jA();let r,s;return zS(()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const i=e.cloneNode(),r=e[vk];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&i.classList.remove(e))});n.split(/\s+/).forEach(e=>e&&i.classList.add(e)),i.style.display="none";const s=1===t.nodeType?t:t.parentNode;s.appendChild(i);const{hasTransform:o}=Rk(i);return s.removeChild(i),o}(r[0].el,n.vnode.el,t))return;r.forEach(bR),r.forEach(TR);const i=r.filter(xR);Fk(),i.forEach(e=>{const n=e.el,i=n.style;Sk(n,t),i.transform=i.webkitTransform=i.transitionDuration="";const r=n[gR]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[gR]=null,Ck(n,t))};n.addEventListener("transitionend",r)})}),()=>{const o=lI(e),a=Ik(o);let l=o.tag||WO;if(r=[],s)for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return Lx(t)?e=>oE(t,e):t};function wR(e){e.target.composing=!0}function IR(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const AR=Symbol("_assign"),SR={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[AR]=ER(r);const s=i||r.props&&"number"===r.props.type;Qk(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=lE(i)),e[AR](i)}),n&&Qk(e,"change",()=>{e.value=e.value.trim()}),t||(Qk(e,"compositionstart",wR),Qk(e,"compositionend",IR),Qk(e,"change",IR))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(e[AR]=ER(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:lE(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}},CR={deep:!0,created(e,t,n){e[AR]=ER(n),Qk(e,"change",()=>{const t=e._modelValue,n=NR(e),i=e.checked,r=e[AR];if(Lx(t)){const e=NE(t,n),s=-1!==e;if(i&&!s)r(t.concat(n));else if(!i&&s){const n=[...t];n.splice(e,1),r(n)}}else if(Bx(t)){const e=new Set(t);i?e.add(n):e.delete(n),r(e)}else r(DR(e,i))})},mounted:OR,beforeUpdate(e,t,n){e[AR]=ER(n),OR(e,t,n)}};function OR(e,{value:t,oldValue:n},i){let r;if(e._modelValue=t,Lx(t))r=NE(t,i.props.value)>-1;else if(Bx(t))r=t.has(i.props.value);else{if(t===n)return;r=RE(t,DR(e,!0))}e.checked!==r&&(e.checked=r)}const MR={created(e,{value:t},n){e.checked=RE(t,n.props.value),e[AR]=ER(n),Qk(e,"change",()=>{e[AR](NR(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[AR]=ER(i),t!==n&&(e.checked=RE(t,i.props.value))}},kR={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const r=Bx(t);Qk(e,"change",()=>{const t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?lE(NR(e)):NR(e));e[AR](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,nA(()=>{e._assigning=!1})}),e[AR]=ER(i)},mounted(e,{value:t}){RR(e,t)},beforeUpdate(e,t,n){e[AR]=ER(n)},updated(e,{value:t}){e._assigning||RR(e,t)}};function RR(e,t){const n=e.multiple,i=Lx(t);if(!n||i||Bx(t)){for(let r=0,s=e.options.length;rString(e)===String(o)):NE(t,o)>-1}else s.selected=t.has(o);else if(RE(NR(s),t))return void(e.selectedIndex!==r&&(e.selectedIndex=r))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function NR(e){return"_value"in e?e._value:e.value}function DR(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const FR={created(e,t,n){PR(e,t,n,null,"created")},mounted(e,t,n){PR(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){PR(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){PR(e,t,n,i,"updated")}};function LR(e,t){switch(e){case"SELECT":return kR;case"TEXTAREA":return SR;default:switch(t){case"checkbox":return CR;case"radio":return MR;default:return SR}}}function PR(e,t,n,i,r){const s=LR(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,i)}const BR=["ctrl","shift","alt","meta"],$R={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>BR.some(n=>e[`${n}Key`]&&!t.includes(n))},UR=(e,t)=>{const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=(n,...i)=>{for(let e=0;e{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=n=>{if(!("key"in n))return;const i=nE(n.key);return t.some(e=>e===i||VR[e]===i)?e(n):void 0})},jR=Rx({patchProp:(e,t,n,i,r,s)=>{const o="svg"===r;"class"===t?function(e,t,n){const i=e[vk];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,o):"style"===t?function(e,t,n){const i=e.style,r=Vx(n);let s=!1;if(n&&!r){if(t)if(Vx(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Hk(i,t,"")}else for(const e in t)null==n[e]&&Hk(i,e,"");for(const e in n)"display"===e&&(s=!0),Hk(i,e,n[e])}else if(r){if(t!==n){const e=i[Uk];e&&(n+=";"+e),i.cssText=n,s=Yk.test(n)}}else t&&e.removeAttribute("style");Lk in e&&(e[Lk]=s?i.display:"",e[Pk]&&(i.display="none"))}(e,n,i):Mx(t)?kx(t)||eR(e,t,0,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&sR(t)&&Ux(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(sR(t)&&Vx(n))return!1;return t in e}(e,t,i,o))?(Zk(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Kk(e,t,i,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&Vx(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),Kk(e,t,i,o)):Zk(e,eE(t),i,0,t)}},gk);let YR,GR=!1;function HR(){return YR||(YR=cO(jR))}function WR(){return YR=GR?YR:dO(jR),GR=!0,YR}const XR=(...e)=>{HR().render(...e)},qR=(...e)=>{WR().hydrate(...e)},KR=(...e)=>{const t=HR().createApp(...e);const{mount:n}=t;return t.mount=e=>{const i=JR(e);if(!i)return;const r=t._component;Ux(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const s=n(i,!1,QR(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t},ZR=(...e)=>{const t=WR().createApp(...e);const{mount:n}=t;return t.mount=e=>{const t=JR(e);if(t)return n(t,!0,QR(t))},t};function QR(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function JR(e){if(Vx(e)){return document.querySelector(e)}return e}let eN=!1;const tN=()=>{eN||(eN=!0,SR.getSSRProps=({value:e})=>({value:e}),MR.getSSRProps=({value:e},t)=>{if(t.props&&RE(t.props.value,e))return{checked:!0}},CR.getSSRProps=({value:e},t)=>{if(Lx(e)){if(t.props&&NE(e,t.props.value)>-1)return{checked:!0}}else if(Bx(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},FR.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=LR(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},Bk.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})},nN=Symbol(""),iN=Symbol(""),rN=Symbol(""),sN=Symbol(""),oN=Symbol(""),aN=Symbol(""),lN=Symbol(""),uN=Symbol(""),cN=Symbol(""),dN=Symbol(""),hN=Symbol(""),pN=Symbol(""),fN=Symbol(""),mN=Symbol(""),gN=Symbol(""),_N=Symbol(""),yN=Symbol(""),vN=Symbol(""),bN=Symbol(""),TN=Symbol(""),xN=Symbol(""),EN=Symbol(""),wN=Symbol(""),IN=Symbol(""),AN=Symbol(""),SN=Symbol(""),CN=Symbol(""),ON=Symbol(""),MN=Symbol(""),kN=Symbol(""),RN=Symbol(""),NN=Symbol(""),DN=Symbol(""),FN=Symbol(""),LN=Symbol(""),PN=Symbol(""),BN=Symbol(""),$N=Symbol(""),UN=Symbol(""),VN={[nN]:"Fragment",[iN]:"Teleport",[rN]:"Suspense",[sN]:"KeepAlive",[oN]:"BaseTransition",[aN]:"openBlock",[lN]:"createBlock",[uN]:"createElementBlock",[cN]:"createVNode",[dN]:"createElementVNode",[hN]:"createCommentVNode",[pN]:"createTextVNode",[fN]:"createStaticVNode",[mN]:"resolveComponent",[gN]:"resolveDynamicComponent",[_N]:"resolveDirective",[yN]:"resolveFilter",[vN]:"withDirectives",[bN]:"renderList",[TN]:"renderSlot",[xN]:"createSlots",[EN]:"toDisplayString",[wN]:"mergeProps",[IN]:"normalizeClass",[AN]:"normalizeStyle",[SN]:"normalizeProps",[CN]:"guardReactiveProps",[ON]:"toHandlers",[MN]:"camelize",[kN]:"capitalize",[RN]:"toHandlerKey",[NN]:"setBlockTracking",[DN]:"pushScopeId",[FN]:"popScopeId",[LN]:"withCtx",[PN]:"unref",[BN]:"isRef",[$N]:"withMemo",[UN]:"isMemoSame"};const zN={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function jN(e,t,n,i,r,s,o,a=!1,l=!1,u=!1,c=zN){return e&&(a?(e.helper(aN),e.helper(JN(e.inSSR,u))):e.helper(QN(e.inSSR,u)),o&&e.helper(vN)),{type:13,tag:t,props:n,children:i,patchFlag:r,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:u,loc:c}}function YN(e,t=zN){return{type:17,loc:t,elements:e}}function GN(e,t=zN){return{type:15,loc:t,properties:e}}function HN(e,t){return{type:16,loc:zN,key:Vx(e)?WN(e,!0):e,value:t}}function WN(e,t=!1,n=zN,i=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:i}}function XN(e,t=zN){return{type:8,loc:t,children:e}}function qN(e,t=[],n=zN){return{type:14,loc:n,callee:e,arguments:t}}function KN(e,t=void 0,n=!1,i=!1,r=zN){return{type:18,params:e,returns:t,newline:n,isSlot:i,loc:r}}function ZN(e,t,n,i=!0){return{type:19,test:e,consequent:t,alternate:n,newline:i,loc:zN}}function QN(e,t){return e||t?cN:dN}function JN(e,t){return e||t?lN:uN}function eD(e,{helper:t,removeHelper:n,inSSR:i}){e.isBlock||(e.isBlock=!0,n(QN(i,e.isComponent)),t(aN),t(JN(i,e.isComponent)))}const tD=new Uint8Array([123,123]),nD=new Uint8Array([125,125]);function iD(e){return e>=97&&e<=122||e>=65&&e<=90}function rD(e){return 32===e||10===e||9===e||12===e||13===e}function sD(e){return 47===e||62===e||rD(e)}function oD(e){const t=new Uint8Array(e.length);for(let n=0;n4===e.type&&e.isStatic;function mD(e){switch(e){case"Teleport":case"teleport":return iN;case"Suspense":case"suspense":return rN;case"KeepAlive":case"keep-alive":return sN;case"BaseTransition":case"base-transition":return oN}}const gD=/^\d|[^\$\w\xA0-\uFFFF]/,_D=e=>!gD.test(e),yD=/[A-Za-z_$\xA0-\uFFFF]/,vD=/[\.\?\w$\xA0-\uFFFF]/,bD=/\s+[.[]\s*|\s*[.[]\s+/g,TD=e=>4===e.type?e.content:e.loc.source,xD=e=>{const t=TD(e).trim().replace(bD,e=>e.trim());let n=0,i=[],r=0,s=0,o=null;for(let e=0;e|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,wD=e=>ED.test(TD(e));function ID(e,t,n=!1){for(let i=0;i4===e.key.type&&e.key.content===i)}return n}function LD(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}const PD=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,BD={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:Ox,isPreTag:Ox,isIgnoreNewlineTag:Ox,isCustomElement:Ox,onError:dD,onWarn:hD,comments:!1,prefixIdentifiers:!1};let $D=BD,UD=null,VD="",zD=null,jD=null,YD="",GD=-1,HD=-1,WD=0,XD=!1,qD=null;const KD=[],ZD=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=tD,this.delimiterClose=nD,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=tD,this.delimiterClose=nD}getPos(e){let t=1,n=e+1;for(let i=this.newlines.length-1;i>=0;i--){const r=this.newlines[i];if(e>r){t=i+2,n=e-r;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?sD(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||rD(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart=e||(28===this.state?this.currentSequence===aD.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(KD,{onerr:yF,ontext(e,t){nF(eF(e,t),e,t)},ontextentity(e,t,n){nF(e,t,n)},oninterpolation(e,t){if(XD)return nF(eF(e,t),e,t);let n=e+ZD.delimiterOpen.length,i=t-ZD.delimiterClose.length;for(;rD(VD.charCodeAt(n));)n++;for(;rD(VD.charCodeAt(i-1));)i--;let r=eF(n,i);r.includes("&")&&(r=$D.decodeEntities(r,!1)),hF({type:5,content:_F(r,!1,pF(n,i)),loc:pF(e,t)})},onopentagname(e,t){const n=eF(e,t);zD={type:1,tag:n,ns:$D.getNamespace(n,KD[0],$D.ns),tagType:0,props:[],children:[],loc:pF(e-1,t),codegenNode:void 0}},onopentagend(e){tF(e)},onclosetag(e,t){const n=eF(e,t);if(!$D.isVoidTag(n)){let i=!1;for(let e=0;e0&&yF(24,KD[0].loc.start.offset);for(let n=0;n<=e;n++){iF(KD.shift(),t,n(7===e.type?e.rawName:e.name)===n)&&yF(2,t)},onattribend(e,t){if(zD&&jD){if(mF(jD.loc,t),0!==e)if(YD.includes("&")&&(YD=$D.decodeEntities(YD,!0)),6===jD.type)"class"===jD.name&&(YD=dF(YD).trim()),1!==e||YD||yF(13,t),jD.value={type:2,content:YD,loc:1===e?pF(GD,HD):pF(GD-1,HD+1)},ZD.inSFCRoot&&"template"===zD.tag&&"lang"===jD.name&&YD&&"html"!==YD&&ZD.enterRCDATA(oD("{const r=t.start.offset+n;return _F(e,!1,pF(r,r+e.length),0,i?1:0)},a={source:o(s.trim(),n.indexOf(s,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let l=r.trim().replace(JD,"").trim();const u=r.indexOf(l),c=l.match(QD);if(c){l=l.replace(QD,"").trim();const e=c[1].trim();let t;if(e&&(t=n.indexOf(e,u+l.length),a.key=o(e,t,!0)),c[2]){const i=c[2].trim();i&&(a.index=o(i,n.indexOf(i,a.key?t+e.length:u+l.length),!0))}}l&&(a.value=o(l,u,!0));return a}(jD.exp));let t=-1;"bind"===jD.name&&(t=jD.modifiers.findIndex(e=>"sync"===e.content))>-1&&cD("COMPILER_V_BIND_SYNC",$D,jD.loc,jD.rawName)&&(jD.name="model",jD.modifiers.splice(t,1))}7===jD.type&&"pre"===jD.name||zD.props.push(jD)}YD="",GD=HD=-1},oncomment(e,t){$D.comments&&hF({type:3,content:eF(e,t),loc:pF(e-4,t+3)})},onend(){const e=VD.length;for(let t=0;t64&&n<91)||mD(e)||$D.isBuiltInComponent&&$D.isBuiltInComponent(e)||$D.isNativeTag&&!$D.isNativeTag(e))return!0;var n;for(let e=0;e6===e.type&&"inline-template"===e.name);n&&cD("COMPILER_INLINE_TEMPLATE",$D,n.loc)&&e.children.length&&(n.value={type:2,content:eF(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:n.loc})}}function rF(e,t){let n=e;for(;VD.charCodeAt(n)!==t&&n>=0;)n--;return n}const sF=new Set(["if","else","else-if","for","slot"]);function oF({tag:e,props:t}){if("template"===e)for(let e=0;e0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{const e=a.codegenNode;if(13===e.type){const t=e.patchFlag;if((void 0===t||512===t||1===t)&&AF(a,n)>=2){const t=SF(a);t&&(e.props=n.hoist(t))}e.dynamicProps&&(e.dynamicProps=n.hoist(e.dynamicProps))}}}else if(12===a.type){if((i?0:EF(a,n))>=2){o.push(a);continue}}if(1===a.type){const t=1===a.tagType;t&&n.scopes.vSlot++,xF(a,e,n,!1,r),t&&n.scopes.vSlot--}else if(11===a.type)xF(a,e,n,1===a.children.length,!0);else if(9===a.type)for(let t=0;te.key===t||e.key.content===t);return n&&n.value}}o.length&&n.transformHoist&&n.transformHoist(s,n,e)}function EF(e,t){const{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;const i=n.get(e);if(void 0!==i)return i;const r=e.codegenNode;if(13!==r.type)return 0;if(r.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0===r.patchFlag){let i=3;const s=AF(e,t);if(0===s)return n.set(e,0),0;s1)for(let r=0;r`_${VN[w.helper(e)]}`,replaceNode(e){w.parent.children[w.childIndex]=w.currentNode=e},removeNode(e){const t=w.parent.children,n=e?t.indexOf(e):w.currentNode?w.childIndex:-1;e&&e!==w.currentNode?w.childIndex>n&&(w.childIndex--,w.onNodeRemoved()):(w.currentNode=null,w.onNodeRemoved()),w.parent.children.splice(n,1)},onNodeRemoved:Cx,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){Vx(e)&&(e=WN(e)),w.hoists.push(e);const t=WN(`_hoisted_${w.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){const i=function(e,t,n=!1,i=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:i,needArraySpread:!1,loc:zN}}(w.cached.length,e,t,n);return w.cached.push(i),i}};return w.filters=new Set,w}function OF(e,t){const n=CF(e,t);MF(e,n),t.hoistStatic&&bF(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:i}=e;if(1===i.length){const n=i[0];if(TF(e,n)&&n.codegenNode){const i=n.codegenNode;13===i.type&&eD(i,t),e.codegenNode=i}else e.codegenNode=n}else if(i.length>1){let i=64;0,e.codegenNode=jN(t,n(nN),void 0,e.children,i,void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0,e.filters=[...n.filters]}function MF(e,t){t.currentNode=e;const{nodeTransforms:n}=t,i=[];for(let r=0;r{n--};for(;nt===e:t=>e.test(t);return(e,i)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some(OD))return;const s=[];for(let o=0;o`${VN[e]}: _${VN[e]}`;function DF(e,t={}){const n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:i=!1,filename:r="template.vue.html",scopeId:s=null,optimizeImports:o=!1,runtimeGlobalName:a="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:c=!1,isTS:d=!1,inSSR:h=!1}){const p={mode:t,prefixIdentifiers:n,sourceMap:i,filename:r,scopeId:s,optimizeImports:o,runtimeGlobalName:a,runtimeModuleName:l,ssrRuntimeModuleName:u,ssr:c,isTS:d,inSSR:h,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${VN[e]}`,push(e,t=-2,n){p.code+=e},indent(){f(++p.indentLevel)},deindent(e=!1){e?--p.indentLevel:f(--p.indentLevel)},newline(){f(p.indentLevel)}};function f(e){p.push("\n"+" ".repeat(e),0)}return p}(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:i,push:r,prefixIdentifiers:s,indent:o,deindent:a,newline:l,scopeId:u,ssr:c}=n,d=Array.from(e.helpers),h=d.length>0,p=!s&&"module"!==i;!function(e,t){const{ssr:n,prefixIdentifiers:i,push:r,newline:s,runtimeModuleName:o,runtimeGlobalName:a,ssrRuntimeModuleName:l}=t,u=a,c=Array.from(e.helpers);if(c.length>0&&(r(`const _Vue = ${u}\n`,-1),e.hoists.length)){r(`const { ${[cN,dN,hN,pN,fN].filter(e=>c.includes(e)).map(NF).join(", ")} } = _Vue\n`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:i}=t;i();for(let r=0;r0)&&l()),e.directives.length&&(FF(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),FF(e.filters,"filter",n),l()),e.temps>0){r("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n",0),l()),c||r("return "),e.codegenNode?BF(e.codegenNode,n):r("null"),p&&(a(),r("}")),a(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function FF(e,t,{helper:n,push:i,newline:r,isTS:s}){const o=n("filter"===t?yN:"component"===t?mN:_N);for(let n=0;n3||!1;t.push("["),n&&t.indent(),PF(e,t,n),n&&t.deindent(),t.push("]")}function PF(e,t,n=!1,i=!0){const{push:r,newline:s}=t;for(let o=0;oe||"null")}([s,o,a,f,u]),t),n(")"),d&&n(")");c&&(n(", "),BF(c,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:i,pure:r}=t,s=Vx(e.callee)?e.callee:i(e.callee);r&&n(RF);n(s+"(",-2,e),PF(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:i,deindent:r,newline:s}=t,{properties:o}=e;if(!o.length)return void n("{}",-2,e);const a=o.length>1||!1;n(a?"{":"{ "),a&&i();for(let e=0;e "),(l||a)&&(n("{"),i());o?(l&&n("return "),Lx(o)?LF(o,t):BF(o,t)):a&&BF(a,t);(l||a)&&(r(),n("}"));u&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:i,alternate:r,newline:s}=e,{push:o,indent:a,deindent:l,newline:u}=t;if(4===n.type){const e=!_D(n.content);e&&o("("),$F(n,t),e&&o(")")}else o("("),BF(n,t),o(")");s&&a(),t.indentLevel++,s||o(" "),o("? "),BF(i,t),t.indentLevel--,s&&u(),s||o(" "),o(": ");const c=19===r.type;c||t.indentLevel++;BF(r,t),c||t.indentLevel--;s&&l(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:i,indent:r,deindent:s,newline:o}=t,{needPauseTracking:a,needArraySpread:l}=e;l&&n("[...(");n(`_cache[${e.index}] || (`),a&&(r(),n(`${i(NN)}(-1`),e.inVOnce&&n(", true"),n("),"),o(),n("("));n(`_cache[${e.index}] = `),BF(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),o(),n(`${i(NN)}(1),`),o(),n(`_cache[${e.index}]`),s());n(")"),l&&n(")]")}(e,t);break;case 21:PF(e.body,t,!0,!1)}}function $F(e,t){const{content:n,isStatic:i}=e;t.push(i?JSON.stringify(n):n,-3,e)}function UF(e,t){for(let n=0;nfunction(e,t,n,i){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const i=t.exp?t.exp.loc:e.loc;n.onError(pD(28,t.loc)),t.exp=WN("true",!1,i)}0;if("if"===t.name){const r=jF(e,t),s={type:9,loc:fF(e.loc),branches:[r]};if(n.replaceNode(s),i)return i(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const o=r[s];if(o&&3===o.type)n.removeNode(o);else{if(!o||2!==o.type||o.content.trim().length){if(o&&9===o.type){"else-if"===t.name&&void 0===o.branches[o.branches.length-1].condition&&n.onError(pD(30,e.loc)),n.removeNode();const r=jF(e,t);0,o.branches.push(r);const s=i&&i(o,r,!1);MF(r,n),s&&s(),n.currentNode=null}else n.onError(pD(30,e.loc));break}n.removeNode(o)}}}}(e,t,n,(e,t,i)=>{const r=n.parent.children;let s=r.indexOf(e),o=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(o+=e.branches.length)}return()=>{if(i)e.codegenNode=YF(t,o,n);else{const i=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);i.alternate=YF(t,o+e.branches.length-1,n)}}}));function jF(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ID(e,"for")?e.children:[e],userKey:AD(e,"key"),isTemplateIf:n}}function YF(e,t,n){return e.condition?ZN(e.condition,GF(e,t,n),qN(n.helper(hN),['""',"true"])):GF(e,t,n)}function GF(e,t,n){const{helper:i}=n,r=HN("key",WN(`${t}`,!1,zN,2)),{children:s}=e,o=s[0];if(1!==s.length||1!==o.type){if(1===s.length&&11===o.type){const e=o.codegenNode;return DD(e,r,n),e}{let t=64;return jN(n,i(nN),GN([r]),s,t,void 0,void 0,!0,!1,!1,e.loc)}}{const e=o.codegenNode,t=14===(a=e).type&&a.callee===$N?a.arguments[1].returns:a;return 13===t.type&&eD(t,n),DD(t,r,n),e}var a}const HF=(e,t,n)=>{const{modifiers:i,loc:r}=e,s=e.arg;let{exp:o}=e;if(o&&4===o.type&&!o.content.trim()&&(o=void 0),!o){if(4!==s.type||!s.isStatic)return n.onError(pD(52,s.loc)),{props:[HN(s,WN("",!0,r))]};WF(e),o=e.exp}return 4!==s.type?(s.children.unshift("("),s.children.push(') || ""')):s.isStatic||(s.content=`${s.content} || ""`),i.some(e=>"camel"===e.content)&&(4===s.type?s.isStatic?s.content=eE(s.content):s.content=`${n.helperString(MN)}(${s.content})`:(s.children.unshift(`${n.helperString(MN)}(`),s.children.push(")"))),n.inSSR||(i.some(e=>"prop"===e.content)&&XF(s,"."),i.some(e=>"attr"===e.content)&&XF(s,"^")),{props:[HN(s,o)]}},WF=(e,t)=>{const n=e.arg,i=eE(n.content);e.exp=WN(i,!1,n.loc)},XF=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},qF=kF("for",(e,t,n)=>{const{helper:i,removeHelper:r}=n;return function(e,t,n,i){if(!t.exp)return void n.onError(pD(31,t.loc));const r=t.forParseResult;if(!r)return void n.onError(pD(32,t.loc));KF(r,n);const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=n,{source:l,value:u,key:c,index:d}=r,h={type:11,loc:t.loc,source:l,valueAlias:u,keyAlias:c,objectIndexAlias:d,parseResult:r,children:MD(e)?e.children:[e]};n.replaceNode(h),a.vFor++;const p=i&&i(h);return()=>{a.vFor--,p&&p()}}(e,t,n,t=>{const s=qN(i(bN),[t.source]),o=MD(e),a=ID(e,"memo"),l=AD(e,"key",!1,!0);l&&7===l.type&&!l.exp&&WF(l);let u=l&&(6===l.type?l.value?WN(l.value.content,!0):void 0:l.exp);const c=l&&u?HN("key",u):null,d=4===t.source.type&&t.source.constType>0,h=d?64:l?128:256;return t.codegenNode=jN(n,i(nN),void 0,s,h,void 0,void 0,!0,!d,!1,e.loc),()=>{let l;const{children:h}=t;const p=1!==h.length||1!==h[0].type,f=kD(e)?e:o&&1===e.children.length&&kD(e.children[0])?e.children[0]:null;if(f?(l=f.codegenNode,o&&c&&DD(l,c,n)):p?l=jN(n,i(nN),c?GN([c]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(l=h[0].codegenNode,o&&c&&DD(l,c,n),l.isBlock!==!d&&(l.isBlock?(r(aN),r(JN(n.inSSR,l.isComponent))):r(QN(n.inSSR,l.isComponent))),l.isBlock=!d,l.isBlock?(i(aN),i(JN(n.inSSR,l.isComponent))):i(QN(n.inSSR,l.isComponent))),a){const e=KN(ZF(t.parseResult,[WN("_cached")]));e.body={type:21,body:[XN(["const _memo = (",a.exp,")"]),XN(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(UN)}(_cached, _memo)) return _cached`]),XN(["const _item = ",l]),WN("_item.memo = _memo"),WN("return _item")],loc:zN},s.arguments.push(e,WN("_cache"),WN(String(n.cached.length))),n.cached.push(null)}else s.arguments.push(KN(ZF(t.parseResult),l,!0))}})});function KF(e,t){e.finalized||(e.finalized=!0)}function ZF({value:e,key:t,index:n},i=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||WN("_".repeat(t+1),!1))}([e,t,n,...i])}const QF=WN("undefined",!1),JF=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=ID(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},eL=(e,t,n,i)=>KN(e,n,!1,!0,n.length?n[0].loc:i);function tL(e,t,n=eL){t.helper(LN);const{children:i,loc:r}=e,s=[],o=[];let a=t.scopes.vSlot>0||t.scopes.vFor>0;const l=ID(e,"slot",!0);if(l){const{arg:e,exp:t}=l;e&&!fD(e)&&(a=!0),s.push(HN(e||WN("default",!0),n(t,void 0,i,r)))}let u=!1,c=!1;const d=[],h=new Set;let p=0;for(let e=0;e{const s=n(e,void 0,i,r);return t.compatConfig&&(s.isNonScopedSlot=!0),HN("default",s)};u?d.length&&d.some(e=>rL(e))&&(c?t.onError(pD(39,d[0].loc)):s.push(e(void 0,d))):s.push(e(void 0,i))}const f=a?2:iL(e.children)?3:1;let m=GN(s.concat(HN("_",WN(f+"",!1))),r);return o.length&&(m=qN(t.helper(xN),[m,YN(o)])),{slots:m,hasDynamicSlots:a}}function nL(e,t,n){const i=[HN("name",e),HN("fn",t)];return null!=n&&i.push(HN("key",WN(String(n),!0))),GN(i)}function iL(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:i}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:i}=e;const r=cL(i),s=AD(e,"is",!1,!0);if(s)if(r||uD("COMPILER_IS_ON_ELEMENT",t)){let e;if(6===s.type?e=s.value&&WN(s.value.content,!0):(e=s.exp,e||(e=WN("is",!1,s.arg.loc))),e)return qN(t.helper(gN),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(i=s.value.content.slice(4));const o=mD(i)||t.isBuiltInComponent(i);if(o)return n||t.helper(o),o;return t.helper(mN),t.components.add(i),LD(i,"component")}(e,t):`"${n}"`;const o=jx(s)&&s.callee===gN;let a,l,u,c,d,h=0,p=o||s===iN||s===rN||!r&&("svg"===n||"foreignObject"===n||"math"===n);if(i.length>0){const n=aL(e,t,void 0,r,o);a=n.props,h=n.patchFlag,c=n.dynamicPropNames;const i=n.directives;d=i&&i.length?YN(i.map(e=>function(e,t){const n=[],i=sL.get(e);i?n.push(t.helperString(i)):(t.helper(_N),t.directives.add(e.name),n.push(LD(e.name,"directive")));const{loc:r}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=WN("true",!1,r);n.push(GN(e.modifiers.map(e=>HN(e,t)),r))}return YN(n,e.loc)}(e,t))):void 0,n.shouldUseBlock&&(p=!0)}if(e.children.length>0){s===sN&&(p=!0,h|=1024);if(r&&s!==iN&&s!==sN){const{slots:n,hasDynamicSlots:i}=tL(e,t);l=n,i&&(h|=1024)}else if(1===e.children.length&&s!==iN){const n=e.children[0],i=n.type,r=5===i||8===i;r&&0===EF(n,t)&&(h|=1),l=r||2===i?n:e.children}else l=e.children}c&&c.length&&(u=function(e){let t="[";for(let n=0,i=e.length;n0;let p=!1,f=0,m=!1,g=!1,_=!1,y=!1,v=!1,b=!1;const T=[],x=e=>{u.length&&(c.push(GN(lL(u),a)),u=[]),e&&c.push(e)},E=()=>{t.scopes.vFor>0&&u.push(HN(WN("ref_for",!0),WN("true")))},w=({key:e,value:n})=>{if(fD(e)){const s=e.content,o=Mx(s);if(!o||i&&!r||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||Kx(s)||(y=!0),o&&Kx(s)&&(b=!0),o&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&EF(n,t)>0)return;"ref"===s?m=!0:"class"===s?g=!0:"style"===s?_=!0:"key"===s||T.includes(s)||T.push(s),!i||"class"!==s&&"style"!==s||T.includes(s)||T.push(s)}else v=!0};for(let r=0;r"prop"===e.content)&&(f|=32);const T=t.directiveTransforms[n];if(T){const{props:n,needRuntime:i}=T(l,e,t);!s&&n.forEach(w),b&&r&&!fD(r)?x(GN(n,a)):u.push(...n),i&&(d.push(l),zx(i)&&sL.set(l,i))}else Zx(n)||(d.push(l),h&&(p=!0))}}let I;if(c.length?(x(),I=c.length>1?qN(t.helper(wN),c,a):c[0]):u.length&&(I=GN(lL(u),a)),v?f|=16:(g&&!i&&(f|=2),_&&!i&&(f|=4),T.length&&(f|=8),y&&(f|=32)),p||0!==f&&32!==f||!(m||b||d.length>0)||(f|=512),!t.inSSR&&I)switch(I.type){case 15:let e=-1,n=-1,i=!1;for(let t=0;t{if(kD(e)){const{children:n,loc:i}=e,{slotName:r,slotProps:s}=function(e,t){let n,i='"default"';const r=[];for(let t=0;t0){const{props:i,directives:s}=aL(e,t,r,!1,!1);n=i,s.length&&t.onError(pD(36,s[0].loc))}return{slotName:i,slotProps:n}}(e,t),o=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),n.length&&(o[3]=KN([],n,!1,!1,i),a=4),t.scopeId&&!t.slotted&&(a=5),o.splice(a),e.codegenNode=qN(t.helper(TN),o,i)}};const hL=(e,t,n,i)=>{const{loc:r,modifiers:s,arg:o}=e;let a;if(e.exp||s.length||n.onError(pD(35,r)),4===o.type)if(o.isStatic){let e=o.content;0,e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`);a=WN(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?rE(eE(e)):`on:${e}`,!0,o.loc)}else a=XN([`${n.helperString(RN)}(`,o,")"]);else a=o,a.children.unshift(`${n.helperString(RN)}(`),a.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let u=n.cacheHandlers&&!l&&!n.inVOnce;if(l){const e=xD(l),t=!(e||wD(l)),n=l.content.includes(";");0,(t||u&&e)&&(l=XN([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let c={props:[HN(a,l||WN("() => {}",!1,r))]};return i&&(c=i(c)),u&&(c.props[0].value=n.cache(c.props[0].value)),c.props.forEach(e=>e.key.isHandlerKey=!0),c},pL=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let i,r=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name])||"template"===e.tag)))for(let e=0;e{if(1===e.type&&ID(e,"once",!0)){if(fL.has(e)||t.inVOnce||t.inSSR)return;return fL.add(e),t.inVOnce=!0,t.helper(NN),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}}},gL=(e,t,n)=>{const{exp:i,arg:r}=e;if(!i)return n.onError(pD(41,e.loc)),_L();const s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return n.onError(pD(44,i.loc)),_L();if(!o.trim()||!xD(i))return n.onError(pD(42,i.loc)),_L();const l=r||WN("modelValue",!0),u=r?fD(r)?`onUpdate:${eE(r.content)}`:XN(['"onUpdate:" + ',r]):"onUpdate:modelValue";let c;c=XN([`${n.isTS?"($event: any)":"$event"} => ((`,i,") = $event)"]);const d=[HN(l,e.exp),HN(u,c)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map(e=>e.content).map(e=>(_D(e)?e:JSON.stringify(e))+": true").join(", "),n=r?fD(r)?`${r.content}Modifiers`:XN([r,' + "Modifiers"']):"modelModifiers";d.push(HN(n,WN(`{ ${t} }`,!1,e.loc,2)))}return _L(d)};function _L(e=[]){return{props:e}}const yL=/[\w).+\-_$\]]/,vL=(e,t)=>{uD("COMPILER_FILTERS",t)&&(5===e.type?bL(e.content,t):1===e.type&&e.props.forEach(e=>{7===e.type&&"for"!==e.name&&e.exp&&bL(e.exp,t)}))};function bL(e,t){if(4===e.type)TL(e,t);else for(let n=0;n=0&&(e=n.charAt(t)," "===e);t--);e&&yL.test(e)||(c=!0)}}else void 0===o?(f=s+1,o=n.slice(0,s).trim()):g();function g(){m.push(n.slice(f,s).trim()),f=s+1}if(void 0===o?o=n.slice(0,s).trim():0!==f&&g(),m.length){for(s=0;s{if(1===e.type){const n=ID(e,"memo");if(!n||EL.has(e))return;return EL.add(e),()=>{const i=e.codegenNode||t.currentNode.codegenNode;i&&13===i.type&&(1!==e.tagType&&eD(i,t),e.codegenNode=qN(t.helper($N),[n.exp,KN(void 0,i),"_cache",String(t.cached.length)]),t.cached.push(null))}}};function IL(e,t={}){const n=t.onError||dD,i="module"===t.mode;!0===t.prefixIdentifiers?n(pD(47)):i&&n(pD(48));t.cacheHandlers&&n(pD(49)),t.scopeId&&!i&&n(pD(50));const r=Rx({},t,{prefixIdentifiers:!1}),s=Vx(e)?vF(e,r):e,[o,a]=[[mL,zF,wL,qF,vL,dL,oL,JF,pL],{on:hL,bind:HF,model:gL}];return OF(s,Rx({},r,{nodeTransforms:[...o,...t.nodeTransforms||[]],directiveTransforms:Rx({},a,t.directiveTransforms||{})})),DF(s,r)}const AL=Symbol(""),SL=Symbol(""),CL=Symbol(""),OL=Symbol(""),ML=Symbol(""),kL=Symbol(""),RL=Symbol(""),NL=Symbol(""),DL=Symbol(""),FL=Symbol("");var LL;let PL;LL={[AL]:"vModelRadio",[SL]:"vModelCheckbox",[CL]:"vModelText",[OL]:"vModelSelect",[ML]:"vModelDynamic",[kL]:"withModifiers",[RL]:"withKeys",[NL]:"vShow",[DL]:"Transition",[FL]:"TransitionGroup"},Object.getOwnPropertySymbols(LL).forEach(e=>{VN[e]=LL[e]});const BL={parseMode:"html",isVoidTag:EE,isNativeTag:e=>bE(e)||TE(e)||xE(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return PL||(PL=document.createElement("div")),t?(PL.innerHTML=`
`,PL.children[0].getAttribute("foo")):(PL.innerHTML=e,PL.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?DL:"TransitionGroup"===e||"transition-group"===e?FL:void 0,getNamespace(e,t,n){let i=t?t.ns:n;if(t&&2===i)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(i=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(i=0);else t&&1===i&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(i=0));if(0===i){if("svg"===e)return 1;if("math"===e)return 2}return i}},$L=(e,t)=>{const n=_E(e);return WN(JSON.stringify(n),!1,t,3)};function UL(e,t){return pD(e,t)}const VL=Ix("passive,once,capture"),zL=Ix("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),jL=Ix("left,right"),YL=Ix("onkeyup,onkeydown,onkeypress"),GL=(e,t)=>fD(e)&&"onclick"===e.content.toLowerCase()?WN(t,!0):4!==e.type?XN(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e;const HL=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()};const WL=[e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:WN("style",!0,t.loc),exp:$L(t.value.content,t.loc),modifiers:[],loc:t.loc})})}],XL={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(UL(53,r)),t.children.length&&(n.onError(UL(54,r)),t.children.length=0),{props:[HN(WN("innerHTML",!0,r),i||WN("",!0))]}},text:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(UL(55,r)),t.children.length&&(n.onError(UL(56,r)),t.children.length=0),{props:[HN(WN("textContent",!0),i?EF(i,n)>0?i:qN(n.helperString(EN),[i],r):WN("",!0))]}},model:(e,t,n)=>{const i=gL(e,t,n);if(!i.props.length||1===t.tagType)return i;e.arg&&n.onError(UL(58,e.arg.loc));const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let o=CL,a=!1;if("input"===r||s){const i=AD(t,"type");if(i){if(7===i.type)o=ML;else if(i.value)switch(i.value.content){case"radio":o=AL;break;case"checkbox":o=SL;break;case"file":a=!0,n.onError(UL(59,e.loc))}}else(function(e){return e.props.some(e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic))})(t)&&(o=ML)}else"select"===r&&(o=OL);a||(i.needRuntime=n.helper(o))}else n.onError(UL(57,e.loc));return i.props=i.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),i},on:(e,t,n)=>hL(e,t,n,t=>{const{modifiers:i}=e;if(!i.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:o,nonKeyModifiers:a,eventOptionModifiers:l}=((e,t,n)=>{const i=[],r=[],s=[];for(let o=0;o{const{exp:i,loc:r}=e;return i||n.onError(UL(61,r)),{props:[],needRuntime:n.helper(NL)}}};const qL=Object.create(null);UM(function(e,t){if(!Vx(e)){if(!e.nodeType)return Cx;e=e.innerHTML}const n=function(e,t){return e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t)}(e,t),i=qL[n];if(i)return i;if("#"===e[0]){const t=document.querySelector(e);0,e=t?t.innerHTML:""}const r=Rx({hoistStatic:!0,onError:void 0,onWarn:Cx},t);r.isCustomElement||"undefined"==typeof customElements||(r.isCustomElement=e=>!!customElements.get(e));const{code:s}=function(e,t={}){return IL(e,Rx({},BL,t,{nodeTransforms:[HL,...WL,...t.nodeTransforms||[]],directiveTransforms:Rx({},XL,t.directiveTransforms||{}),transformHoist:null}))}(e,r),o=new Function("Vue",s)(oe);return o._rc=!0,qL[n]=o});var KL=__webpack_require__(66619),ZL=__webpack_require__.n(KL);const QL={stage:new(ZL().Container),pointer:{x:0,y:0},backgroundSprite:null,sprites:{},texts:{},counter:0,keys:{},state:!1,running:!1,repeatPlay:()=>{},displayTag:!1,processingDisplayEvent:null,successDisplayEvents:[],successProcessingDisplayEvents:[],startTime:performance.now(),timer:0,lastFrameTime:null,lastSecond:null,targetFPS:60,frameCount:0,currentFPS:60,canvasHeight:450,canvasWidth:800,gameLoop:()=>{1==QL.state&&(QL.repeatPlay(),QL.gameLoopDisplay()),QL.timer=performance.now()-QL.startTime},animate:e=>{e-QL.lastFrameTime>=1e3/QL.targetFPS&&(QL.frameCount++,QL.gameLoop(),QL.renderer.render(QL.stage),QL.lastFrameTime=e),e-QL.lastSecond>=1e3&&(QL.currentFPS=QL.frameCount,QL.frameCount=0,QL.lastSecond=e),requestAnimationFrame(QL.animate)}};QL.createBackground=(e,t=0)=>{var n;return 0==t&&(n=new(ZL().Sprite.fromImage)(`../common/media/spriteimg/${e}.png`)),n.name="background",n.anchor.set(.5),n.x=QL.canvasWidth/2,n.y=QL.canvasHeight/2,n.width=QL.canvasWidth,n.height=QL.canvasHeight,n.interactive=!0,n.buttonMode=!0,n.isDown=!1,n.isUp=!0,n.on("mousedown",function(){this.isDown=!0,this.isUp=!1,QL.state&&this.runningMouseDown()}).on("mouseup",function(){this.isDown=!1,this.isUp=!0}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0}),n.runningMouseDown=new Function(""),QL.backgroundSprite&&QL.backgroundSprite.parent&&QL.stage.removeChild(QL.backgroundSprite),QL.backgroundSprite=n,QL.stage.addChildAt(QL.backgroundSprite,0),0},QL.createASprite=(e,t=QL.canvasWidth/2,n=QL.canvasHeight/2,i="",r=0)=>{var s;return""==i&&(i="sprite"+ ++QL.counter),0==r&&(s=new(ZL().Sprite.fromImage)(`../common/media/spriteimg/${e}.png`)),QL.sprites[i]||QL.texts[i]||(s.name=i,s.anchor.set(.5),s.x=t,s.y=n,s.interactive=!0,s.buttonMode=!0,s.isDown=!1,s.isUp=!0,s.on("mousedown",function(e){this.isDown=!0,this.isUp=!1,QL.state?this.runningMouseDown():(this.data=e.data,this.alpha=.5,this.dragging=!0)}).on("mouseup",function(){this.isDown=!1,this.isUp=!0,QL.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0,QL.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mousemove",function(){if(!QL.state&&this.dragging){var e=this.data.getLocalPosition(this.parent);this.position.x=e.x,this.position.y=e.y}}),s.runningMouseDown=new Function(""),s.show=function(){this.visible=!0},s.hide=function(){this.visible=!1},s.enlarge=function(e){const t=this.height/this.width;var n=Math.sqrt(this.height*this.width);n+=e,this.width=Math.sqrt(n*n/t),this.height=this.width*t},s.enlargeTo=function(e){var t=this.height/this.width;this.width=Math.sqrt(e*e/t),this.height=this.width*t},s.expandTo=async function(e,t=1){if(QL.running){QL.displayTag=!0,QL.processingDisplayEvent={sprite:this,targetS:e,totalTime:1e3*t,startTime:performance.now(),displayType:"expand"};var n=new Promise(e=>{if(!1===QL.displayTag)e();else{const t=setInterval(()=>{!1===QL.displayTag&&(clearInterval(t),e())},10)}});return await n}return QL.successProcessingDisplayEvents.push({sprite:this,targetS:e,totalTime:1e3*t,startTime:performance.now(),displayType:"expand"}),0},s.move=function(e){this.x+=e*Math.cos(this.rotation),this.y+=e*Math.sin(this.rotation)},s.moveTo=function(e,t){this.x=e,this.y=t},s.slideTo=async function(e,t,n=1){if(QL.running){QL.displayTag=!0,QL.processingDisplayEvent={sprite:this,targetX:e,targetY:t,totalTime:1e3*n,startTime:performance.now(),displayType:"slide"};var i=new Promise(e=>{const t=setInterval(()=>{!1===QL.displayTag&&(clearInterval(t),e())},10)});return await i}return QL.successProcessingDisplayEvents.push({sprite:this,targetX:e,targetY:t,totalTime:1e3*n,startTime:performance.now(),displayType:"slide"}),0},s.addX=function(e){this.x+=e},s.addY=function(e){this.y+=e},s.rotate=function(e){this.rotation+=Math.PI/180*e},s.rotateTo=function(e){this.rotation=Math.PI/180*e},s.circleTo=async function(e,t=1){if(QL.running){QL.displayTag=!0,QL.processingDisplayEvent={sprite:this,targetDegree:e,totalTime:1e3*t,startTime:performance.now(),displayType:"circle"};var n=new Promise(e=>{if(!1===QL.displayTag)e();else{const t=setInterval(()=>{!1===QL.displayTag&&(clearInterval(t),e())},10)}});return await n}return QL.successProcessingDisplayEvents.push({sprite:this,targetDegree:e,totalTime:1e3*t,startTime:performance.now(),displayType:"circle"}),0},s.hit=function(e){return QL.hitTestRectangle(this,e)},s.outOfScreen=function(){return this.y>=QL.renderer.height||this.y<=0||this.x<=0||this.x>=QL.renderer.width},s.mouseAction=function(e){this.runningMouseDown=e},s.setScale=function(e=0,t=0){0==e&&(e=this.height),0==t&&(t=this.width),this.height=e,this.width=t},s.filterGray=function(){const e=new(ZL().filters.ColorMatrixFilter);e.blackAndWhite(),this.filters=[e]},s.filterBrighter=function(){const e=new(ZL().filters.ColorMatrixFilter);e.brightness(1.25),this.filters=[e]},s.filterOrigin=function(){this.filters=null},QL.stage.addChild(s),QL.sprites[i]=s),i},QL.clearAllSprites=()=>{QL.backgroundSprite&&QL.backgroundSprite.parent&&QL.backgroundSprite.parent.removeChild(QL.backgroundSprite);for(const e in QL.sprites)QL.sprites[e].parent.removeChild(QL.sprites[e]),delete QL.sprites[e];for(const e in QL.texts)QL.texts[e].parent.removeChild(QL.texts[e]),delete QL.texts[e];return QL.counter=0,QL.clearTimer(),0},QL.createText=(e,t=QL.canvasWidth/2,n=QL.canvasHeight/2,i="")=>{if(""==i&&(i="text"+ ++QL.counter),!QL.sprites[i]&&!QL.texts[i]){var r=new(ZL().Text)(e);r.name=i,r.x=t,r.y=n,r.interactive=!0,r.buttonMode=!0,r.on("mousedown",function(e){this.isDown=!0,this.isUp=!1,QL.state?this.runningMouseDown():(this.data=e.data,this.alpha=.5,this.dragging=!0)}).on("mouseup",function(){this.isDown=!1,this.isUp=!0,QL.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0,QL.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mousemove",function(){if(!QL.state&&this.dragging){var e=this.data.getLocalPosition(this.parent);this.position.x=e.x,this.position.y=e.y}}),r.runningMouseDown=new Function(""),r.changeText=function(e){this.text=e},r.show=function(){this.visible=!0},r.hide=function(){this.visible=!1},QL.stage.addChild(r),QL.texts[i]=r}return i},QL.hitTestRectangle=(e,t)=>{let n,i,r,s,o;return n=!1,e.centerX=e.x+e.width/2,e.centerY=e.y+e.height/2,t.centerX=t.x+t.width/2,t.centerY=t.y+t.height/2,e.halfWidth=e.width/2,e.halfHeight=e.height/2,t.halfWidth=t.width/2,t.halfHeight=t.height/2,s=e.centerX-t.centerX,o=e.centerY-t.centerY,i=e.halfWidth+t.halfWidth,r=e.halfHeight+t.halfHeight,n=Math.abs(s){QL.repeatPlay=e},QL.isKeyboardHit=e=>{if(!QL.keys[e]){let t=QL.keyboard(e);QL.keys[e]=t}return QL.keys[e].isDown},QL.keyboardListener=(e,t)=>{if(QL.keys[e])QL.keys[e].press=function(){QL.state&&t()};else{let n=QL.keyboard(e);n.press=function(){QL.state&&t()},QL.keys[e]=n}},QL.keyboard=e=>{let t={};t.value=e,t.isDown=!1,t.isUp=!0,t.press=void 0,t.release=void 0,t.downHandler=e=>{e.key===t.value&&(t.isUp&&t.press&&t.press(),t.isDown=!0,t.isUp=!1,e.preventDefault())},t.upHandler=e=>{e.key===t.value&&(t.isDown&&t.release&&t.release(),t.isDown=!1,t.isUp=!0,e.preventDefault())};const n=t.downHandler.bind(t),i=t.upHandler.bind(t);return window.addEventListener("keydown",n,!1),window.addEventListener("keyup",i,!1),t.unsubscribe=()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",i)},t},QL.clearTimer=()=>{QL.startTime=performance.now()},QL.gameLoopDisplay=()=>{if(QL.processingDisplayEvent){const e=QL.processingDisplayEvent;switch(e.displayType){case"slide":if(performance.now()>=e.totalTime+e.startTime)e.sprite.moveTo(e.targetX,e.targetY),QL.displayTag=!1,QL.processingDisplayEvent=null;else(t=QL.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&(e.sprite.addX((e.targetX-e.sprite.x)/t),e.sprite.addY((e.targetY-e.sprite.y)/t));break;case"expand":if(performance.now()>=e.totalTime+e.startTime)e.sprite.enlargeTo(e.targetS),QL.displayTag=!1,QL.processingDisplayEvent=null;else(t=QL.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&e.sprite.enlarge((e.targetS-Math.sqrt(e.sprite.height*e.sprite.width))/t);break;case"circle":if(performance.now()>=e.totalTime+e.startTime)e.sprite.rotateTo(e.targetDegree),QL.displayTag=!1,QL.processingDisplayEvent=null;else(t=QL.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&e.sprite.rotate((e.targetDegree-180*e.sprite.rotation/Math.PI)/t)}}if(!QL.running&&QL.successProcessingDisplayEvents.length)for(var e=QL.successProcessingDisplayEvents.length-1;e>=0;e--){const n=QL.successProcessingDisplayEvents[e];switch(n.displayType){case"slide":if(performance.now()>=n.totalTime+n.startTime)n.sprite.moveTo(n.targetX,n.targetY),QL.successProcessingDisplayEvents.splice(e,1);else(t=QL.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&(n.sprite.addX((n.targetX-n.sprite.x)/t),n.sprite.addY((n.targetY-n.sprite.y)/t));break;case"expand":if(performance.now()>=n.totalTime+n.startTime)n.sprite.enlargeTo(n.targetS),QL.successProcessingDisplayEvents.splice(e,1);else(t=QL.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&n.sprite.enlarge((n.targetS-Math.sqrt(n.sprite.height*n.sprite.width))/t);break;case"circle":var t;if(performance.now()>=n.totalTime+n.startTime)n.sprite.rotateTo(n.targetDegree),QL.successProcessingDisplayEvents.splice(e,1);else(t=QL.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&n.sprite.rotate((n.targetDegree-180*n.sprite.rotation/Math.PI)/t)}}},QL.changeWidth=e=>{const t=wx()(QL.renderer.view),n=t.width(),i=t.height();t.width(e),t.height(e/n*i)},QL.kill=()=>{QL.state=!1,QL.repeatPlay=new Function;for(let e in QL.keys)QL.keys[e].unsubscribe(),delete QL.keys[e];QL.processingDisplayEvent=null,QL.displayTag=!1,QL.running=!1,QL.clearTimer()},QL.runit=e=>{const t=wx()(e);t.empty(),ZL().SCALE_MODES.DEFAULT=ZL().SCALE_MODES.NEAREST,QL.renderer=ZL().autoDetectRenderer(QL.canvasWidth,QL.canvasHeight,{backgroundColor:16777215}),t.append(QL.renderer.view),QL.pointer={x:0,y:0},QL.stage.sortableChildren=!0,QL.stage.interactive=!0,QL.stage.on("mousemove",(e=ZL().InteractionEvent)=>{QL.pointer.x=e.data.global.x,QL.pointer.y=e.data.global.y}),QL.lastFrameTime=0,QL.running=!0,QL.lastFrameTime||(QL.lastFrameTime=performance.now(),QL.lastSecond=performance.now()),QL.animate(performance.now()),QL.repeatPlay=new Function;for(let e in QL.keys)QL.keys[e].unsubscribe(),delete QL.keys[e];QL.backgroundSprite&&(QL.backgroundSprite.runningMouseDown=new Function);for(let e in QL.sprites)QL.sprites[e].runningMouseDown=new Function;for(let e in QL.texts)QL.texts[e].runningMouseDown=new Function;QL.processingDisplayEvent=null,QL.displayTag=!1,QL.clearTimer(),QL.changeWidth(wx()("body").width()/2),QL.state=!0},window.mixlySprite=QL;const JL=QL;var eP=__webpack_require__(69610);class tP{constructor(e,t){this._pageLoad=new eP.D,this._kernelAvailable=new eP.D,this._loaderId="basthon-loader",this._doNotHideLoader=!0;const n=e.language;if(null!=t&&(this._loaderId=t),"loading"===document.readyState){const e=()=>{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,20211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,95195));this._kernel=new i(e);break;case"js":case"javascript":const{KernelJavaScript:r}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new r(e);break;case"sql":const{KernelSQL:s}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,90592));this._kernel=new s(e);break;case"ocaml":const{KernelOCaml:o}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,50038));this._kernel=new o(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then(()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()}),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(t?"full":"foot"),r=document.createElement("div");r.id=this._loaderId,r.classList.add("darklighted"),r.classList.add("basthon-loader-root"),r.classList.add(i);const s=document.createElement("div");s.classList.add("basthon-loader-container"),s.classList.add(i),r.appendChild(s);const o=document.createElement("div");o.classList.add("basthon-loader-spinner"),o.classList.add(i),o.innerHTML="",s.appendChild(o);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),s.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=e,s.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",s.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(r),this._rootLoader=r;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return o.classList.remove("basthon-loader-spinner"),o.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout(()=>{this._rootLoader=void 0,e.remove()},1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}class nP extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-image.html",new ze.HTMLTemplate('\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["images"],nP);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"images",id:"images",name:Ve.Msg.PYTHON_PYODIDE_IMAGE,title:Ve.Msg.PYTHON_PYODIDE_IMAGE}),e.changeTo("output"),e.get("images")}}constructor(){super();const e=wx()(ze.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let i=e.content,r=null,s=null;switch(e.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver(function(e){e.forEach(e=>e.addedNodes.forEach(e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))}).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),t.append(i);break;case"matplotlib":r=i.querySelector("canvas"),r&&(i=r),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",t.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",t.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),t.append(i.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let i=e.content[n];"image/png"===n&&(i=''),t.append(i);break}break;case"tutor":if(t.append(wx()(e.content.replace("overflow-y%3A%20hidden%3B",""))),s=this.getContent()[0].getElementsByTagName("iframe")[0],null==s)return;s.style.maxHeight=s.style.minHeight="100%",new IntersectionObserver((e,t)=>{const n=e[0];n&&!n.isIntersecting||(s.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())}).observe(s);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const iP=layui;var rP;!function(e){e[e.EPERM=1]="EPERM",e[e.ENOENT=2]="ENOENT",e[e.EINTR=4]="EINTR",e[e.EIO=5]="EIO",e[e.ENXIO=6]="ENXIO",e[e.EBADF=9]="EBADF",e[e.EAGAIN=11]="EAGAIN",e[e.ENOMEM=12]="ENOMEM",e[e.EACCES=13]="EACCES",e[e.EFAULT=14]="EFAULT",e[e.ENOTBLK=15]="ENOTBLK",e[e.EBUSY=16]="EBUSY",e[e.EEXIST=17]="EEXIST",e[e.EXDEV=18]="EXDEV",e[e.ENODEV=19]="ENODEV",e[e.ENOTDIR=20]="ENOTDIR",e[e.EISDIR=21]="EISDIR",e[e.EINVAL=22]="EINVAL",e[e.ENFILE=23]="ENFILE",e[e.EMFILE=24]="EMFILE",e[e.ETXTBSY=26]="ETXTBSY",e[e.EFBIG=27]="EFBIG",e[e.ENOSPC=28]="ENOSPC",e[e.ESPIPE=29]="ESPIPE",e[e.EROFS=30]="EROFS",e[e.EMLINK=31]="EMLINK",e[e.EPIPE=32]="EPIPE",e[e.EDOM=33]="EDOM",e[e.ERANGE=34]="ERANGE",e[e.EDEADLK=35]="EDEADLK",e[e.ENAMETOOLONG=36]="ENAMETOOLONG",e[e.ENOLCK=37]="ENOLCK",e[e.ENOSYS=38]="ENOSYS",e[e.ENOTEMPTY=39]="ENOTEMPTY",e[e.ELOOP=40]="ELOOP",e[e.ENOMSG=42]="ENOMSG",e[e.EBADE=52]="EBADE",e[e.EBADR=53]="EBADR",e[e.EXFULL=54]="EXFULL",e[e.ENOANO=55]="ENOANO",e[e.EBADRQC=56]="EBADRQC",e[e.ENOSTR=60]="ENOSTR",e[e.ENODATA=61]="ENODATA",e[e.ETIME=62]="ETIME",e[e.ENOSR=63]="ENOSR",e[e.ENONET=64]="ENONET",e[e.EREMOTE=66]="EREMOTE",e[e.ENOLINK=67]="ENOLINK",e[e.ECOMM=70]="ECOMM",e[e.EPROTO=71]="EPROTO",e[e.EBADMSG=74]="EBADMSG",e[e.EOVERFLOW=75]="EOVERFLOW",e[e.EBADFD=77]="EBADFD",e[e.ESTRPIPE=86]="ESTRPIPE",e[e.ENOTSOCK=88]="ENOTSOCK",e[e.EDESTADDRREQ=89]="EDESTADDRREQ",e[e.EMSGSIZE=90]="EMSGSIZE",e[e.EPROTOTYPE=91]="EPROTOTYPE",e[e.ENOPROTOOPT=92]="ENOPROTOOPT",e[e.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",e[e.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",e[e.ENOTSUP=95]="ENOTSUP",e[e.ENETDOWN=100]="ENETDOWN",e[e.ENETUNREACH=101]="ENETUNREACH",e[e.ENETRESET=102]="ENETRESET",e[e.ETIMEDOUT=110]="ETIMEDOUT",e[e.ECONNREFUSED=111]="ECONNREFUSED",e[e.EHOSTDOWN=112]="EHOSTDOWN",e[e.EHOSTUNREACH=113]="EHOSTUNREACH",e[e.EALREADY=114]="EALREADY",e[e.EINPROGRESS=115]="EINPROGRESS",e[e.ESTALE=116]="ESTALE",e[e.EREMOTEIO=121]="EREMOTEIO",e[e.EDQUOT=122]="EDQUOT"}(rP||(rP={}));const sP={[rP.EPERM]:"Operation not permitted",[rP.ENOENT]:"No such file or directory",[rP.EINTR]:"Interrupted system call",[rP.EIO]:"Input/output error",[rP.ENXIO]:"No such device or address",[rP.EBADF]:"Bad file descriptor",[rP.EAGAIN]:"Resource temporarily unavailable",[rP.ENOMEM]:"Cannot allocate memory",[rP.EACCES]:"Permission denied",[rP.EFAULT]:"Bad address",[rP.ENOTBLK]:"Block device required",[rP.EBUSY]:"Resource busy or locked",[rP.EEXIST]:"File exists",[rP.EXDEV]:"Invalid cross-device link",[rP.ENODEV]:"No such device",[rP.ENOTDIR]:"File is not a directory",[rP.EISDIR]:"File is a directory",[rP.EINVAL]:"Invalid argument",[rP.ENFILE]:"Too many open files in system",[rP.EMFILE]:"Too many open files",[rP.ETXTBSY]:"Text file busy",[rP.EFBIG]:"File is too big",[rP.ENOSPC]:"No space left on disk",[rP.ESPIPE]:"Illegal seek",[rP.EROFS]:"Cannot modify a read-only file system",[rP.EMLINK]:"Too many links",[rP.EPIPE]:"Broken pipe",[rP.EDOM]:"Numerical argument out of domain",[rP.ERANGE]:"Numerical result out of range",[rP.EDEADLK]:"Resource deadlock would occur",[rP.ENAMETOOLONG]:"File name too long",[rP.ENOLCK]:"No locks available",[rP.ENOSYS]:"Function not implemented",[rP.ENOTEMPTY]:"Directory is not empty",[rP.ELOOP]:"Too many levels of symbolic links",[rP.ENOMSG]:"No message of desired type",[rP.EBADE]:"Invalid exchange",[rP.EBADR]:"Invalid request descriptor",[rP.EXFULL]:"Exchange full",[rP.ENOANO]:"No anode",[rP.EBADRQC]:"Invalid request code",[rP.ENOSTR]:"Device not a stream",[rP.ENODATA]:"No data available",[rP.ETIME]:"Timer expired",[rP.ENOSR]:"Out of streams resources",[rP.ENONET]:"Machine is not on the network",[rP.EREMOTE]:"Object is remote",[rP.ENOLINK]:"Link has been severed",[rP.ECOMM]:"Communication error on send",[rP.EPROTO]:"Protocol error",[rP.EBADMSG]:"Bad message",[rP.EOVERFLOW]:"Value too large for defined data type",[rP.EBADFD]:"File descriptor in bad state",[rP.ESTRPIPE]:"Streams pipe error",[rP.ENOTSOCK]:"Socket operation on non-socket",[rP.EDESTADDRREQ]:"Destination address required",[rP.EMSGSIZE]:"Message too long",[rP.EPROTOTYPE]:"Protocol wrong type for socket",[rP.ENOPROTOOPT]:"Protocol not available",[rP.EPROTONOSUPPORT]:"Protocol not supported",[rP.ESOCKTNOSUPPORT]:"Socket type not supported",[rP.ENOTSUP]:"Operation is not supported",[rP.ENETDOWN]:"Network is down",[rP.ENETUNREACH]:"Network is unreachable",[rP.ENETRESET]:"Network dropped connection on reset",[rP.ETIMEDOUT]:"Connection timed out",[rP.ECONNREFUSED]:"Connection refused",[rP.EHOSTDOWN]:"Host is down",[rP.EHOSTUNREACH]:"No route to host",[rP.EALREADY]:"Operation already in progress",[rP.EINPROGRESS]:"Operation now in progress",[rP.ESTALE]:"Stale file handle",[rP.EREMOTEIO]:"Remote I/O error",[rP.EDQUOT]:"Disk quota exceeded"};class oP extends Error{static fromJSON(e){const t=new oP(e.errno,e.message,e.path,e.syscall);return t.code=e.code,t.stack=e.stack,t}static With(e,t,n){return new oP(rP[e],sP[rP[e]],t,n)}constructor(e,t=sP[e],n,i=""){super(t),this.errno=e,this.path=n,this.syscall=i,this.code=rP[e],this.message=this.code+": "+t+(this.path?`, '${this.path}'`:"")}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}}let aP="/";function lP(e,t){let n="",i=0,r=-1,s=0,o="\0";for(let a=0;a<=e.length;++a){if(a2){const e=n.lastIndexOf("/");-1===e?(n="",i=0):(n=n.slice(0,e),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}if(0!==n.length){n="",i=0,r=a,s=0;continue}}t&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else"."===o&&-1!==s?++s:s=-1}return n}function uP(...e){let t="";for(const n of[...e.reverse(),aP])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;const n=t.startsWith("/");return t=lP(t,!n),n?`/${t}`:t.length?t:"/"}function cP(...e){if(!e.length)return".";const t=e.join("/");return t?.length?function(e){if(!e.length)return".";const t=e.startsWith("/"),n=e.endsWith("/");return(e=lP(e,!t)).length?(n&&(e+="/"),t?`/${e}`:e):t?"/":n?"./":"."}(t):"."}function dP(e){if(0===e.length)return".";const t="/"===e[0];let n=-1,i=!0;for(let t=e.length-1;t>=1;--t)if("/"===e[t]){if(!i){n=t;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)}function hP(e,t){let n=0,i=-1,r=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,o=-1;for(let a=e.length-1;a>=0;--a)if("/"===e[a]){if(!r){n=a+1;break}}else-1===o&&(r=!1,o=a+1),s>=0&&(e[a]===t[s]?-1===--s&&(i=a):(s=-1,i=o));return n===i?i=o:-1===i&&(i=e.length),e.slice(n,i)}for(let t=e.length-1;t>=0;--t)if("/"===e[t]){if(!r){n=t+1;break}}else-1===i&&(r=!1,i=t+1);return-1===i?"":e.slice(n,i)}function pP(e){const t=e.startsWith("/"),n={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;const i=t?1:0;let r=-1,s=0,o=-1,a=!0,l=e.length-1,u=0;for(;l>=i;--l)if("/"!==e[l])-1===o&&(a=!1,o=l+1),"."===e[l]?-1===r?r=l:1!==u&&(u=1):-1!==r&&(u=-1);else if(!a){s=l+1;break}if(-1!==o){const i=0===s&&t?1:s;-1===r||0===u||1===u&&r===o-1&&r===s+1?n.base=n.name=e.slice(i,o):(n.name=e.slice(i,r),n.base=e.slice(i,o),n.ext=e.slice(r,o))}return s>0?n.dir=e.slice(0,s-1):t&&(n.dir="/"),n}const fP=new TextEncoder;function mP(e){if("string"!=typeof e)throw new oP(rP.EINVAL,"Can not encode a non-string");return fP.encode(e)}const gP=new TextDecoder;function _P(e){if(!(e instanceof Uint8Array))throw new oP(rP.EINVAL,"Can not decode a non-Uint8Array");return gP.decode(e)}function yP(e){return JSON.parse(_P(e),(e,t)=>""==e?t:BigInt(t))}function vP(e){return mP(JSON.stringify(e,(e,t)=>""==e?t:t.toString()))}function bP(e,t){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e,8);if(!isNaN(t))return t}if("number"==typeof t)return t;throw new oP(rP.EINVAL,"Invalid mode: "+e?.toString())}function TP(e){if(e instanceof Date)return e;try{return new Date(e)}catch{throw new oP(rP.EINVAL,"Invalid time.")}}function xP(e){if((e=e.toString()).includes("\0"))throw new oP(rP.EINVAL,"Path can not contain null character");if(0==e.length)throw new oP(rP.EINVAL,"Path can not be empty");return uP(e.replaceAll(/[/\\]+/g,"/"))}function EP(e,t="utf8",n,i=0){return"object"!=typeof e||null===e?{encoding:"string"==typeof e?e:t??null,flag:n,mode:i}:{encoding:"string"==typeof e?.encoding?e.encoding:t??null,flag:"string"==typeof e?.flag?e.flag:n,mode:bP("mode"in e?e?.mode:null,i)}}function wP(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const IP={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function AP(e){return{suid:e.uid,sgid:e.gid,euid:e.uid,egid:e.gid,groups:[],...e}}const SP=0,CP=4,OP=2,MP=1,kP=1,RP=2,NP=4,DP=0,FP=1,LP=2,PP=64,BP=128,$P=256,UP=512,VP=1024,zP=65536,jP=262144,YP=131072,GP=1052672,HP=4096,WP=32768,XP=16384,qP=2048,KP=61440,ZP=49152,QP=40960,JP=32768,eB=24576,tB=16384,nB=8192,iB=4096,rB=2048,sB=1024,oB=512,aB=448,lB=256,uB=128,cB=64,dB=56,hB=32,pB=16,fB=8,mB=7,gB=4,_B=2,yB=1,vB=0,bB=2**32-1,TB={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let e,t;const n=new Promise((n,i)=>{e=n,t=i});return{promise:n,resolve:e,reject:t}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class xB{_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}constructor({atimeMs:e,mtimeMs:t,ctimeMs:n,birthtimeMs:i,uid:r,gid:s,size:o,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(e??u),this.mtimeMs=this._convert(t??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(r??0),this.gid=this._convert(s??0),this.size=this._convert(o??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&JP),0==(this.mode&KP)&&(this.mode=this.mode|this._convert(JP))}isFile(){return(this.mode&KP)===JP}isDirectory(){return(this.mode&KP)===tB}isSymbolicLink(){return(this.mode&KP)===QP}isSocket(){return(this.mode&KP)===ZP}isBlockDevice(){return(this.mode&KP)===eB}isCharacterDevice(){return(this.mode&KP)===nB}isFIFO(){return(this.mode&KP)===iB}hasAccess(e,t){const n=t?.credentials||IP;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&lB&&(i|=CP),this.mode&uB&&(i|=OP),this.mode&cB&&(i|=MP)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&hB&&(i|=CP),this.mode&pB&&(i|=OP),this.mode&fB&&(i|=MP)),this.mode&gB&&(i|=CP),this.mode&_B&&(i|=OP),this.mode&yB&&(i|=MP),(i&e)===e}chmod(e){this.mode=this._convert(this.mode&KP|e)}chown(e,t){e=Number(e),t=Number(t),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(t)&&0<=t&&t<2**32&&(this.gid=this._convert(t))}get atimeNs(){return 1000n*BigInt(this.atimeMs)}get mtimeNs(){return 1000n*BigInt(this.mtimeMs)}get ctimeNs(){return 1000n*BigInt(this.ctimeMs)}get birthtimeNs(){return 1000n*BigInt(this.birthtimeMs)}}function EB(e,t,n){!isNaN(t)&&0<=t&&t<2**32&&(e.uid=t),!isNaN(n)&&0<=n&&n<2**32&&(e.gid=n)}class wB extends xB{constructor(){super(...arguments),this._isBigint=!1}}class IB extends xB{constructor(){super(...arguments),this._isBigint=!0}}class AB{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=bB,this.ffree=bB}}class SB{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(bB),this.ffree=BigInt(bB)}}const CB=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function OB(e){if("number"==typeof e)return function(e){switch(e){case DP:return"r";case DP|GP:return"rs";case LP:return"r+";case LP|GP:return"rs+";case UP|PP|FP:return"w";case UP|PP|FP|BP:return"wx";case UP|PP|LP:return"w+";case UP|PP|LP|BP:return"wx+";case VP|PP|FP:return"a";case VP|PP|FP|BP:return"ax";case VP|PP|LP:return"a+";case VP|PP|LP|BP:return"ax+";default:throw new Error("Invalid flag number: "+e)}}(e);if(!CB.includes(e))throw new Error("Invalid flag string: "+e);return e}function MB(e){let t=0;return t<<=1,t+=+kB(e),t<<=1,t+=+RB(e),t<<=1,t}function kB(e){return-1!==e.indexOf("r")||-1!==e.indexOf("+")}function RB(e){return-1!==e.indexOf("w")||-1!==e.indexOf("a")||-1!==e.indexOf("+")}function NB(e){return-1!==e.indexOf("w")}function DB(e){return-1!==e.indexOf("a")}function FB(e){return-1!==e.indexOf("x")}class LB{constructor(e,t){this.fs=e,this.path=t}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class PB extends LB{constructor(e,t,n,i,r=new Uint8Array(new ArrayBuffer(0,e.metadata().noResizableBuffers?{}:{maxByteLength:bB}))){if(super(e,t),this.flag=n,this.stats=i,this._buffer=r,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=r.byteLength){if(kB(this.flag))throw new Error(`Size mismatch: buffer length ${r.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return DB(this.flag)?this.stats.size:this._position}set position(e){this._position=e}async sync(){if(this.closed)throw oP.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw oP.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw oP.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw oP.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(e){if(this.closed)throw oP.With("EBADF",this.path,"File.dispose");if(this.dirty&&!e)throw oP.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw oP.With("EBADF",this.path,"File.stat");return Promise.resolve(new wB(this.stats))}statSync(){if(this.closed)throw oP.With("EBADF",this.path,"File.stat");return new wB(this.stats)}_truncate(e){if(this.closed)throw oP.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!RB(this.flag))throw new oP(rP.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),e>this._buffer.length){const t=new Uint8Array(e-this._buffer.length);return void this._write(t,0,t.length,this._buffer.length)}this.stats.size=e,this._buffer=e?this._buffer.slice(0,e):new Uint8Array}async truncate(e){this._truncate(e),TB.syncImmediately&&await this.sync()}truncateSync(e){this._truncate(e),TB.syncImmediately&&this.syncSync()}_write(e,t=0,n=this.stats.size,i=this.position){if(this.closed)throw oP.With("EBADF",this.path,"File.write");if(!RB(this.flag))throw new oP(rP.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const r=i+n,s=e.slice(t,t+n);if(r>this.stats.size&&(this.stats.size=r,r>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=r)this._buffer.buffer.resize(r);else if(TB.unsafeBufferReplace)this._buffer=s;else{const e=new Uint8Array(new ArrayBuffer(r,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:bB}));e.set(this._buffer),this._buffer=e}return this._buffer.set(s,i),this.stats.mtimeMs=Date.now(),this.position=i+s.byteLength,s.byteLength}async write(e,t,n,i){const r=this._write(e,t,n,i);return TB.syncImmediately&&await this.sync(),r}writeSync(e,t=0,n=this.stats.size,i=this.position){const r=this._write(e,t,n,i);return TB.syncImmediately&&this.syncSync(),r}_read(e,t=0,n=this.stats.size,i){if(this.closed)throw oP.With("EBADF",this.path,"File.read");if(!kB(this.flag))throw new oP(rP.EPERM,"File not opened with a readable mode.");TB.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let r=i+n;r>this.stats.size&&(r=i+Math.max(this.stats.size-i,0)),this._position=r;const s=r-i;return 0==s||new Uint8Array(e.buffer,t,n).set(this._buffer.slice(i,r)),s}async read(e,t,n,i){const r=this._read(e,t,n,i);return TB.syncImmediately&&await this.sync(),{bytesRead:r,buffer:e}}readSync(e,t,n,i){const r=this._read(e,t,n,i);return TB.syncImmediately&&this.syncSync(),r}async chmod(e){if(this.closed)throw oP.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(e>KP?~KP:KP)|e,(TB.syncImmediately||e>KP)&&await this.sync()}chmodSync(e){if(this.closed)throw oP.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(e>KP?~KP:KP)|e,(TB.syncImmediately||e>KP)&&this.syncSync()}async chown(e,t){if(this.closed)throw oP.With("EBADF",this.path,"File.chown");this.dirty=!0,EB(this.stats,e,t),TB.syncImmediately&&await this.sync()}chownSync(e,t){if(this.closed)throw oP.With("EBADF",this.path,"File.chown");this.dirty=!0,EB(this.stats,e,t),TB.syncImmediately&&this.syncSync()}async utimes(e,t){if(this.closed)throw oP.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=e,this.stats.mtime=t,TB.syncImmediately&&await this.sync()}utimesSync(e,t){if(this.closed)throw oP.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=e,this.stats.mtime=t,TB.syncImmediately&&this.syncSync()}}class BB{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...e){}async ready(){}async exists(e){try{return await this.stat(e),!0}catch(e){return"ENOENT"!=e.code}}existsSync(e){try{return this.statSync(e),!0}catch(e){return"ENOENT"!=e.code}}}var $B=__webpack_require__(30228);Symbol.toStringTag,Symbol.iterator;const UB=Intl.NumberFormat("en",{notation:"compact"});UB.format.bind(UB);function VB(e){return e.at(0).toUpperCase()+e.slice(1)}const zB=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],jB=[...zB,...zB.map(e=>VB(e)),"char"],YB=/^(u?int|float)(8|16|32|64)$/i;function GB(e){return"char"==e?"uint8":e.toLowerCase()}function HB(e){return YB.test(e.toString())}function WB(e){return"char"==e||YB.test(e.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function XB(e){const t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(e=>"Symbol.metadata"==e.description);var n;if(n=e,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}function qB(e){return"function"==typeof e&&XB(e)in e&&function(e){return null!=e&&"object"==typeof e&&Symbol.struct_metadata in e}(e[XB(e)])}function KB(e){return null!=e&&"object"==typeof e&&qB(e.constructor)}function ZB(e){if(!KB(e))throw new TypeError(("function"==typeof e?e.name:"object"==typeof e&&e?e.constructor.name:e)+" is not a struct instance")}function QB(e){if(!function(e){return KB(e)||qB(e)}(e))throw new TypeError(("function"==typeof e?e.name:"object"==typeof e&&e?e.constructor.name:e)+" is not a struct")}function JB(e){if("string"==typeof e)return function(e){if(!WB(e))throw new TypeError("Not a valid primitive type: "+e)}(e),+GB(e).match(YB)[2]/8;QB(e);const t=qB(e)?e:e.constructor;return t[XB(t)][Symbol.struct_metadata].size}function e$(e,t){return Math.ceil(e/t)*t}function t$(e={}){return function(t,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const r=new Map;for(const t of n.metadata[Symbol.struct_init]){const{name:n,type:s,length:o}=t;if(!WB(s)&&!qB(s))throw new TypeError("Not a valid type: "+s);r.set(n,{offset:i,type:WB(s)?GB(s):s,length:o}),i+=JB(s)*(o||1),i=e$(i,e.align||1)}return n.metadata[Symbol.struct_metadata]={options:e,members:r,size:i},t}}function n$(e,t){return function(n,i){let r=i.name;if("symbol"==typeof r&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:r,type:e,length:t}),n}}function i$(e){ZB(e);const{options:t,members:n}=e.constructor[XB(e.constructor)][Symbol.struct_metadata],i=new Uint8Array(JB(e)),r=new DataView(i.buffer);for(const[s,{type:o,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+JB(o)*n;let c=a>0?e[s][n]:e[s];if("string"==typeof c&&(c=c.charCodeAt(0)),!HB(o)){i.set(c?i$(c):new Uint8Array(JB(o)),u);continue}const d="set"+VB(o);"setInt64"!=d?"setUint64"!=d?r[d](u,Number(c),!t.bigEndian):r.setBigUint64(u,BigInt(c),!t.bigEndian):r.setBigInt64(u,BigInt(c),!t.bigEndian)}return i}function r$(e,t){ZB(e);const{options:n,members:i}=e.constructor[XB(e.constructor)][Symbol.struct_metadata],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),s=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(const[t,{type:o,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?e[t]:e;const c=l>0?i:t,d=a+JB(o)*i;if("string"==typeof e[t]){e[t]=e[t].slice(0,i)+String.fromCharCode(s.getUint8(d))+e[t].slice(i+1);continue}if(!HB(o)){if(null===u[c]||void 0===u[c])continue;r$(u[c],new Uint8Array(r.slice(d,d+JB(o))));continue}l>0&&(u||=[]);const h="get"+VB(o);"getInt64"!=h?u[c]="getUint64"!=h?s[h](d,!n.bigEndian):s.getBigUint64(d,!n.bigEndian):u[c]=s.getBigInt64(d,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const s$=Object.fromEntries(jB.map(e=>{return[e,(t=e,function(e,n){return"number"==typeof e?n$(t,e):n$(t)(e,n)})];var t}));var o$=function(e,t,n,i,r,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in i)f[m]="access"===m?{}:i[m];for(var m in i.access)f.access[m]=i.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[u],f);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=o(g.get))&&(d.get=a),(a=o(g.set))&&(d.set=a),(a=o(g.init))&&r.unshift(a)}else(a=o(g))&&("field"===l?r.unshift(a):d[u]=a)}c&&Object.defineProperty(c,i.name,d),h=!0},a$=function(e,t,n){for(var i=arguments.length>2,r=0;r{var e,t,n,i,r,s,o,a,l,u,c;let d,h,p,f,m,g,_,y,v,b,T,x,E,w=[t$()],I=[],A=[],S=[],C=[],O=[],M=[],k=[],R=[],N=[],D=[],F=[],L=[],P=[],B=[],$=[],U=[],V=[],z=[],j=[],Y=[],G=[],H=[],W=[];var X=h=class{constructor(e){if(this.data=a$(this,A,void 0),this.size=(a$(this,S),a$(this,C,void 0)),this.mode=(a$(this,O),a$(this,M,void 0)),this.nlink=(a$(this,k),a$(this,R,void 0)),this.uid=(a$(this,N),a$(this,D,void 0)),this.gid=(a$(this,F),a$(this,L,void 0)),this.atimeMs=(a$(this,P),a$(this,B,void 0)),this.birthtimeMs=(a$(this,$),a$(this,U,void 0)),this.mtimeMs=(a$(this,V),a$(this,z,void 0)),this.ctimeMs=(a$(this,j),a$(this,Y,void 0)),this.ino=(a$(this,G),a$(this,H,void 0)),a$(this,W),e){const t=JB(X),n=t-JB("uint64");if(e.byteLength{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;p=[(e=s$).uint64.bind(e)],f=[(t=s$).uint32.bind(t)],m=[(n=s$).uint16.bind(n)],g=[(i=s$).uint32.bind(i)],_=[(r=s$).uint32.bind(r)],y=[(s=s$).uint32.bind(s)],v=[(o=s$).float64.bind(o)],b=[(a=s$).float64.bind(a)],T=[(l=s$).float64.bind(l)],x=[(u=s$).float64.bind(u)],E=[(c=s$).uint64.bind(c)],o$(null,null,p,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:q},A,S),o$(null,null,f,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:q},C,O),o$(null,null,m,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:q},M,k),o$(null,null,g,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:e=>"nlink"in e,get:e=>e.nlink,set:(e,t)=>{e.nlink=t}},metadata:q},R,N),o$(null,null,_,{kind:"field",name:"uid",static:!1,private:!1,access:{has:e=>"uid"in e,get:e=>e.uid,set:(e,t)=>{e.uid=t}},metadata:q},D,F),o$(null,null,y,{kind:"field",name:"gid",static:!1,private:!1,access:{has:e=>"gid"in e,get:e=>e.gid,set:(e,t)=>{e.gid=t}},metadata:q},L,P),o$(null,null,v,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:e=>"atimeMs"in e,get:e=>e.atimeMs,set:(e,t)=>{e.atimeMs=t}},metadata:q},B,$),o$(null,null,b,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:e=>"birthtimeMs"in e,get:e=>e.birthtimeMs,set:(e,t)=>{e.birthtimeMs=t}},metadata:q},U,V),o$(null,null,T,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:e=>"mtimeMs"in e,get:e=>e.mtimeMs,set:(e,t)=>{e.mtimeMs=t}},metadata:q},z,j),o$(null,null,x,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:e=>"ctimeMs"in e,get:e=>e.ctimeMs,set:(e,t)=>{e.ctimeMs=t}},metadata:q},Y,G),o$(null,null,E,{kind:"field",name:"ino",static:!1,private:!1,access:{has:e=>"ino"in e,get:e=>e.ino,set:(e,t)=>{e.ino=t}},metadata:q},H,W),o$(null,d={value:h},w,{kind:"class",name:h.name,metadata:q},null,I),X=h=d.value,q&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),a$(h,I)})(),X=h})();var c$=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},d$=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class h$ extends BB{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(e){super(),this.store=e,this._initialized=!1}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=c$(n,this.store.transaction(),!0),r=pP(e),s=pP(t),o=await this.findInode(i,r.dir,"rename"),a=yP(await this.get(i,o.data,r.dir,"rename"));if(!a[r.base])throw oP.With("ENOENT",e,"rename");const l=a[r.base];if(delete a[r.base],0===(s.dir+"/").indexOf(e+"/"))throw new oP(rP.EBUSY,r.dir);const u=s.dir==r.dir,c=u?o:await this.findInode(i,s.dir,"rename"),d=u?a:yP(await this.get(i,c.data,s.dir,"rename"));if(d[s.base]){const e=new u$(await this.get(i,d[s.base],t,"rename"));if(!e.toStats().isFile())throw oP.With("EPERM",t,"rename");await i.remove(e.data),await i.remove(d[s.base])}d[s.base]=l,await i.set(o.data,vP(a)),await i.set(c.data,vP(d)),await i.commit()}catch(e){n.error=e,n.hasError=!0}finally{const e=d$(n);e&&await e}}renameSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=c$(n,this.store.transaction(),!1),r=pP(e),s=pP(t),o=this.findInodeSync(i,r.dir,"rename"),a=yP(this.getSync(i,o.data,r.dir,"rename"));if(!a[r.base])throw oP.With("ENOENT",e,"rename");const l=a[r.base];if(delete a[r.base],0==(s.dir+"/").indexOf(e+"/"))throw new oP(rP.EBUSY,r.dir);const u=s.dir===r.dir,c=u?o:this.findInodeSync(i,s.dir,"rename"),d=u?a:yP(this.getSync(i,c.data,s.dir,"rename"));if(d[s.base]){const e=new u$(this.getSync(i,d[s.base],t,"rename"));if(!e.toStats().isFile())throw oP.With("EPERM",t,"rename");i.removeSync(e.data),i.removeSync(d[s.base])}d[s.base]=l,i.setSync(o.data,vP(a)),i.setSync(c.data,vP(d)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{d$(n)}}async stat(e){const t={stack:[],error:void 0,hasError:!1};try{const n=c$(t,this.store.transaction(),!0);return(await this.findInode(n,e,"stat")).toStats()}catch(e){t.error=e,t.hasError=!0}finally{const e=d$(t);e&&await e}}statSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=c$(t,this.store.transaction(),!1);return this.findInodeSync(n,e,"stat").toStats()}catch(e){t.error=e,t.hasError=!0}finally{d$(t)}}async createFile(e,t,n){const i=await this.commitNew(e,JP,n,new Uint8Array,"createFile");return new PB(this,e,t,i.toStats(),new Uint8Array)}createFileSync(e,t,n){const i=this.commitNewSync(e,JP,n,new Uint8Array,"createFile");return new PB(this,e,t,i.toStats(),new Uint8Array)}async openFile(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=c$(n,this.store.transaction(),!0),r=await this.findInode(i,e,"openFile"),s=await this.get(i,r.data,e,"openFile");return new PB(this,e,t,r.toStats(),s)}catch(e){n.error=e,n.hasError=!0}finally{const e=d$(n);e&&await e}}openFileSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=c$(n,this.store.transaction(),!1),r=this.findInodeSync(i,e,"openFile"),s=this.getSync(i,r.data,e,"openFile");return new PB(this,e,t,r.toStats(),s)}catch(e){n.error=e,n.hasError=!0}finally{d$(n)}}async unlink(e){return this.remove(e,!1,"unlink")}unlinkSync(e){this.removeSync(e,!1,"unlink")}async rmdir(e){if((await this.readdir(e)).length)throw oP.With("ENOTEMPTY",e,"rmdir");await this.remove(e,!0,"rmdir")}rmdirSync(e){if(this.readdirSync(e).length)throw oP.With("ENOTEMPTY",e,"rmdir");this.removeSync(e,!0,"rmdir")}async mkdir(e,t){await this.commitNew(e,tB,t,mP("{}"),"mkdir")}mkdirSync(e,t){this.commitNewSync(e,tB,t,mP("{}"),"mkdir")}async readdir(e){const t={stack:[],error:void 0,hasError:!1};try{const n=c$(t,this.store.transaction(),!0),i=await this.findInode(n,e,"readdir");return Object.keys(yP(await this.get(n,i.data,e,"readdir")))}catch(e){t.error=e,t.hasError=!0}finally{const e=d$(t);e&&await e}}readdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=c$(t,this.store.transaction(),!1),i=this.findInodeSync(n,e,"readdir");return Object.keys(yP(this.getSync(n,i.data,e,"readdir")))}catch(e){t.error=e,t.hasError=!0}finally{d$(t)}}async sync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=c$(i,this.store.transaction(),!0),s=await this._findInode(r,e,"sync"),o=new u$(await this.get(r,s,e,"sync")),a=o.update(n);await r.set(o.data,t),a&&await r.set(s,i$(o)),await r.commit()}catch(e){i.error=e,i.hasError=!0}finally{const e=d$(i);e&&await e}}syncSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=c$(i,this.store.transaction(),!1),s=this._findInodeSync(r,e,"sync"),o=new u$(this.getSync(r,s,e,"sync")),a=o.update(n);r.setSync(o.data,t),a&&r.setSync(s,i$(o)),r.commitSync()}catch(e){i.error=e,i.hasError=!0}finally{d$(i)}}async link(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=c$(n,this.store.transaction(),!0),r=dP(t),s=await this.findInode(i,r,"link"),o=yP(await this.get(i,s.data,r,"link")),a=await this._findInode(i,e,"link"),l=new u$(await this.get(i,a,e,"link"));l.nlink++,o[hP(t)]=a,i.setSync(a,i$(l)),i.setSync(s.data,vP(o)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{const e=d$(n);e&&await e}}linkSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=c$(n,this.store.transaction(),!1),r=dP(t),s=this.findInodeSync(i,r,"link"),o=yP(this.getSync(i,s.data,r,"link")),a=this._findInodeSync(i,e,"link"),l=new u$(this.getSync(i,a,e,"link"));l.nlink++,o[hP(t)]=a,i.setSync(a,i$(l)),i.setSync(s.data,vP(o)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{d$(n)}}async checkRoot(){const e={stack:[],error:void 0,hasError:!1};try{const t=c$(e,this.store.transaction(),!0);if(await t.get(0n))return;const n=new u$;n.ino=0n,n.mode=511|tB,await t.set(n.data,mP("{}")),await t.set(0n,i$(n)),await t.commit()}catch(t){e.error=t,e.hasError=!0}finally{const t=d$(e);t&&await t}}checkRootSync(){const e={stack:[],error:void 0,hasError:!1};try{const t=c$(e,this.store.transaction(),!1);if(t.getSync(0n))return;const n=new u$;n.ino=0n,n.mode=511|tB,t.setSync(n.data,mP("{}")),t.setSync(0n,i$(n)),t.commitSync()}catch(t){e.error=t,e.hasError=!0}finally{d$(e)}}async _findInode(e,t,n,i=new Set){if(i.has(t))throw new oP(rP.EIO,"Infinite loop detected while finding inode",t);if(i.add(t),"/"==t)return 0n;const{dir:r,base:s}=pP(t),o="/"==r?new u$(await this.get(e,0n,r,n)):await this.findInode(e,r,n,i),a=yP(await this.get(e,o.data,r,n));if(!(s in a))throw oP.With("ENOENT",uP(r,s),n);return a[s]}_findInodeSync(e,t,n,i=new Set){if(i.has(t))throw new oP(rP.EIO,"Infinite loop detected while finding inode",t);if(i.add(t),"/"==t)return 0n;const{dir:r,base:s}=pP(t),o="/"==r?new u$(this.getSync(e,0n,r,n)):this.findInodeSync(e,r,n,i),a=yP(this.getSync(e,o.data,r,n));if(!(s in a))throw oP.With("ENOENT",uP(r,s),n);return a[s]}async findInode(e,t,n,i=new Set){const r=await this._findInode(e,t,n,i);return new u$(await this.get(e,r,t,n))}findInodeSync(e,t,n,i=new Set){const r=this._findInodeSync(e,t,n,i);return new u$(this.getSync(e,r,t,n))}async get(e,t,n,i){const r=await e.get(t);if(!r)throw oP.With("ENOENT",n,i);return r}getSync(e,t,n,i){const r=e.getSync(t);if(!r)throw oP.With("ENOENT",n,i);return r}async allocNew(e,t,n){for(let t=0;t<5;t++){const t=wP();if(!await e.get(t))return t}throw new oP(rP.ENOSPC,"No IDs available",t,n)}allocNewSync(e,t,n){for(let t=0;t<5;t++){const t=wP();if(!e.getSync(t))return t}throw new oP(rP.ENOSPC,"No IDs available",t,n)}async commitNew(e,t,n,i,r){const s={stack:[],error:void 0,hasError:!1};try{if("/"==e)throw oP.With("EEXIST",e,r);const o=c$(s,this.store.transaction(),!0),{dir:a,base:l}=pP(e),u=await this.findInode(o,a,r),c=yP(await this.get(o,u.data,a,r));if(c[l])throw oP.With("EEXIST",e,r);const d=new u$;return d.ino=await this.allocNew(o,e,r),d.data=await this.allocNew(o,e,r),d.mode=n|t,d.uid=u.mode&rB?u.uid:IP.uid,d.gid=u.mode&sB?u.gid:IP.gid,d.size=i.length,await o.set(d.ino,i$(d)),await o.set(d.data,i),c[l]=d.ino,await o.set(u.data,vP(c)),await o.commit(),d}catch(e){s.error=e,s.hasError=!0}finally{const e=d$(s);e&&await e}}commitNewSync(e,t,n,i,r){const s={stack:[],error:void 0,hasError:!1};try{if("/"==e)throw oP.With("EEXIST",e,r);const o=c$(s,this.store.transaction(),!1),{dir:a,base:l}=pP(e),u=this.findInodeSync(o,a,r),c=yP(this.getSync(o,u.data,a,r));if(c[l])throw oP.With("EEXIST",e,r);const d=new u$;return d.ino=this.allocNewSync(o,e,r),d.data=this.allocNewSync(o,e,r),d.size=i.length,d.mode=n|t,d.uid=u.mode&rB?u.uid:IP.uid,d.gid=u.mode&sB?u.gid:IP.gid,o.setSync(d.ino,i$(d)),o.setSync(d.data,i),c[l]=d.ino,o.setSync(u.data,vP(c)),o.commitSync(),d}catch(e){s.error=e,s.hasError=!0}finally{d$(s)}}async remove(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=c$(i,this.store.transaction(),!0),{dir:s,base:o}=pP(e),a=await this.findInode(r,s,n),l=yP(await this.get(r,a.data,s,n));if(!l[o])throw oP.With("ENOENT",e,"remove");const u=l[o],c=new u$(await this.get(r,u,e,n));if(delete l[o],!t&&c.toStats().isDirectory())throw oP.With("EISDIR",e,"remove");await r.set(a.data,vP(l)),--c.nlink<1&&(await r.remove(c.data),await r.remove(u)),await r.commit()}catch(e){i.error=e,i.hasError=!0}finally{const e=d$(i);e&&await e}}removeSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=c$(i,this.store.transaction(),!1),{dir:s,base:o}=pP(e),a=this.findInodeSync(r,s,n),l=yP(this.getSync(r,a.data,s,n)),u=l[o];if(!u)throw oP.With("ENOENT",e,"remove");const c=new u$(this.getSync(r,u,e,n));if(delete l[o],!t&&c.toStats().isDirectory())throw oP.With("EISDIR",e,"remove");r.setSync(a.data,vP(l)),--c.nlink<1&&(r.removeSync(c.data),r.removeSync(u)),r.commitSync()}catch(e){i.error=e,i.hasError=!0}finally{d$(i)}}}class p${constructor(e){this.store=e,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class f$ extends p${async keys(){return this.keysSync()}async get(e){return this.getSync(e)}async set(e,t){return this.setSync(e,t)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class m$ extends f${constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(e){const t=this.store.get(e);return this.stashOldValue(e,t),t}setSync(e,t){return this.markModified(e),this.store.set(e,t)}removeSync(e){this.markModified(e),this.store.delete(e)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const e of this.modifiedKeys){const t=this.originalData.get(e);t?this.store.set(e,t):this.store.delete(e)}this.done=!0}}stashOldValue(e,t){this.originalData.has(e)||this.originalData.set(e,t)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}}class g$ extends Map{constructor(e="tmp"){super(),this.name=e}async sync(){}clearSync(){this.clear()}transaction(){return new m$(this)}}const _$={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:e}){const t=new h$(new g$(e));return t.checkRootSync(),t}},y$=_$;"function"==typeof SuppressedError&&SuppressedError;class v${constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(e){return this.isEnabled&&this.sync.has(e)}get(e){if(this.isEnabled)return this.sync.get(e)}set(e,t){this.isEnabled&&(this.sync.set(e,t),this.async.set(e,Promise.resolve(t)))}hasAsync(e){return this.isEnabled&&this.async.has(e)}getAsync(e){if(this.isEnabled)return this.async.get(e)}setAsync(e,t){this.isEnabled&&(this.async.set(e,t),t.then(t=>this.sync.set(e,t)))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const b$=new v$,T$=new v$;var x$=__webpack_require__(48287);function E$(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,"function"==typeof n?n.bind(t):n]))}const w$=new Map;let I$=100;function A$(e){const t=I$++;return w$.set(t,e),t}function S$(e){if(!w$.has(e))throw new oP(rP.EBADF);return w$.get(e)}const C$=new Map;function O$(e,t){if("/"!==e[0]&&(e="/"+e),e=uP(e),C$.has(e))throw new oP(rP.EINVAL,"Mount point "+e+" is already in use.");C$.set(e,t),T$.clear()}function M$(e){if("/"!==e[0]&&(e="/"+e),e=uP(e),!C$.has(e))throw new oP(rP.EINVAL,"Mount point "+e+" is already unmounted.");C$.delete(e),T$.clear()}function k$(e,t){const n=t?.root||"/";e=xP(cP(n,e));const i=[...C$].sort((e,t)=>e[0].length>t[0].length?-1:1);for(const[t,r]of i)if(t.length<=e.length&&e.startsWith(t))return""===(e=e.slice(t.length>1?t.length:0))&&(e=n),{fs:r,path:e,mountPoint:t,root:n};throw new oP(rP.EIO,"No file system")}async function R$(){await Promise.all([...C$.values()].map(e=>e.ready()))}function N$(e,t){for(const[n,i]of Object.entries(t))e=e?.replaceAll(n,i);return e}function D$(e,t){"string"==typeof e.stack&&(e.stack=N$(e.stack,t));try{e.message=N$(e.message,t)}catch{}return e.path&&(e.path=N$(e.path,t)),e}function F$(e){"/"in e&&M$("/");for(const[t,n]of Object.entries(e))O$(t,n)}function L$(e,t){const n=e.metadata(),i=n.blockSize||4096;return{type:(t?BigInt:Number)(n.type),bsize:(t?BigInt:Number)(i),ffree:(t?BigInt:Number)(n.freeNodes||bB),files:(t?BigInt:Number)(n.totalNodes||bB),bavail:(t?BigInt:Number)(n.freeSpace/i),bfree:(t?BigInt:Number)(n.freeSpace/i),blocks:(t?BigInt:Number)(n.totalSpace/i)}}function P$(e,t){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new oP(rP.EPERM,"Can not chroot() as non-root user");return t&&this?(this.root+=e,this):function(e,t=structuredClone(IP)){const n={root:e,credentials:AP(t)},i=E$(ue,n),r=E$(le,n);return{...n,...i,promises:r}}(cP(this?.root||"/",e),n)}O$("/",y$.create({name:"root"}));class B$ extends $B{off(e,t,n,i){return super.off(e,t,n,i)}removeListener(e,t,n,i){return super.removeListener(e,t,n,i)}constructor(e){super(),this.path=e}setMaxListeners(){throw oP.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw oP.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw oP.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw oP.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw oP.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class $$ extends B${constructor(e,t){super(e),this.options=t,function(e,t){const n=xP(e);V$.has(n)||V$.set(n,new Set);V$.get(n).add(t)}(e.toString(),this)}close(){super.emit("close"),function(e,t){const n=xP(e);V$.has(n)&&(V$.get(n).delete(t),0===V$.get(n).size&&V$.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class U$ extends B${constructor(e,t){super(e),this.options=t,this.start()}onInterval(){try{const n=W$(this.path);e=this.previous,t=n,(e.size!=t.size||+e.atime!=+t.atime||+e.mtime!=+t.mtime||+e.ctime!=+t.ctime||e.mode!=t.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(e){this.emit("error",e)}var e,t}start(){const e=this.options.interval||5e3;try{this.previous=W$(this.path)}catch(e){return void this.emit("error",e)}this.intervalId=setInterval(this.onInterval.bind(this),e),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const V$=new Map;function z$(e,t){if(t=xP(t),V$.has(t))for(const n of V$.get(t))n.emit("change",e,hP(t));let n,i=t;for(;i!==n;)if(n=i,i=dP(i),V$.has(i))for(const n of V$.get(i))n.emit("change",e,t.slice(i.length+("/"==i?0:1)))}var j$=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Y$=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});function G$(e,t){e=xP(e),t=xP(t);const n=k$(e,this),i=k$(t,this);if(TB.checkAccess&&!W$.call(this,dP(e)).hasAccess(OP,this))throw oP.With("EACCES",e,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),z$("rename",e.toString()),void z$("change",t.toString());nU.call(this,t,tU(e)),K$.call(this,e),z$("rename",e.toString())}catch(r){throw D$(r,{[n.path]:e,[i.path]:t})}}function H$(e){e=xP(e);try{const{fs:t,path:n}=k$(AU.call(this,e),this);return t.existsSync(n)}catch(e){if(e.errno==rP.ENOENT)return!1;throw e}}function W$(e,t){e=xP(e);const{fs:n,path:i}=k$(AU.call(this,e),this);try{const e=n.statSync(i);if(TB.checkAccess&&!e.hasAccess(CP,this))throw oP.With("EACCES",i,"stat");return t?.bigint?new IB(e):e}catch(t){throw D$(t,{[i]:e})}}function X$(e,t){e=xP(e);const{fs:n,path:i}=k$(e,this);try{const e=n.statSync(i);return t?.bigint?new IB(e):e}catch(t){throw D$(t,{[i]:e})}}function q$(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const i=j$(n,Z$.call(this,e,"r+"),!1);if(t||(t=0),t<0)throw new oP(rP.EINVAL);i.truncateSync(t)}catch(e){n.error=e,n.hasError=!0}finally{Y$(n)}}function K$(e){e=xP(e);const{fs:t,path:n}=k$(e,this);try{if(TB.checkAccess&&!(b$.get(e)||t.statSync(n)).hasAccess(OP,this))throw oP.With("EACCES",n,"unlink");t.unlinkSync(n),z$("rename",e.toString())}catch(t){throw D$(t,{[n]:e})}}function Z$(e,t,n,i=!0){e=xP(e);const r=bP(n,420),s=OB(t);e=i?AU.call(this,e):e;const{fs:o,path:a}=k$(e,this);let l;try{l=o.statSync(a)}catch{}if(!l){if(!RB(s)&&!DB(s)||"r+"==s)throw oP.With("ENOENT",e,"_open");const t=o.statSync(dP(a));if(TB.checkAccess&&!t.hasAccess(OP,this))throw oP.With("EACCES",dP(e),"_open");if(!t.isDirectory())throw oP.With("ENOTDIR",dP(e),"_open");return o.createFileSync(a,s,r)}if(TB.checkAccess&&(!l.hasAccess(r,this)||!l.hasAccess(MB(s),this)))throw oP.With("EACCES",e,"_open");if(FB(s))throw oP.With("EEXIST",e,"_open");const u=o.openFileSync(a,s);return NB(s)&&u.truncateSync(0),u}function Q$(e,t,n=SP){return A$(Z$.call(this,e,t,n,!0))}function J$(e,t,n){return A$(Z$.call(this,e,t,n,!1))}function eU(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=j$(i,Z$.call(this,e,t,420,n),!1),s=r.statSync(),o=new Uint8Array(s.size);return r.readSync(o,0,s.size,0),o}catch(e){i.error=e,i.hasError=!0}finally{Y$(i)}}function tU(e,t={}){const n=EP(t,null,"r",420);if(!kB(OB(n.flag)))throw new oP(rP.EINVAL,"Flag passed to readFile must allow for reading.");const i=x$.Buffer.from(eU.call(this,"number"==typeof e?S$(e).path:e.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function nU(e,t,n={}){const i={stack:[],error:void 0,hasError:!1};try{const r=EP(n,"utf8","w+",420),s=OB(r.flag);if(!RB(s))throw new oP(rP.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof t&&!r.encoding)throw new oP(rP.EINVAL,"Encoding not specified");const o="string"==typeof t?x$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new oP(rP.EINVAL,"Data not specified");j$(i,Z$.call(this,"number"==typeof e?S$(e).path:e.toString(),s,r.mode,!0),!1).writeSync(o,0,o.byteLength,0),z$("change",e.toString())}catch(e){i.error=e,i.hasError=!0}finally{Y$(i)}}function iU(e,t,n={}){const i={stack:[],error:void 0,hasError:!1};try{const r=EP(n,"utf8","a+",420),s=OB(r.flag);if(!DB(s))throw new oP(rP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!r.encoding)throw new oP(rP.EINVAL,"Encoding not specified");const o="string"==typeof t?x$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);j$(i,Z$.call(this,"number"==typeof e?S$(e).path:e.toString(),s,r.mode,!0),!1).writeSync(o,0,o.byteLength)}catch(e){i.error=e,i.hasError=!0}finally{Y$(i)}}function rU(e,t){const n=S$(e).statSync();return t?.bigint?new IB(n):n}function sU(e){S$(e).closeSync(),w$.delete(e)}function oU(e,t=0){if(t||(t=0),t<0)throw new oP(rP.EINVAL);S$(e).truncateSync(t)}function aU(e){S$(e).syncSync()}function lU(e){S$(e).datasyncSync()}function uU(e,t,n,i,r){let s,o,a,l;if("string"==typeof t){l="number"==typeof n?n:null;const e="string"==typeof i?i:"utf8";o=0,s=x$.Buffer.from(t,e),a=s.byteLength}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=n,a=i,l="number"==typeof r?r:null;const u=S$(e);l??(l=u.position);const c=u.writeSync(s,o,a,l);return z$("change",u.path),c}function cU(e,t,n,i,r){const s=S$(e),o="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,r=n.position),r=Number(r),isNaN(r)&&(r=s.position),s.readSync(t,o,i,r)}function dU(e,t,n){S$(e).chownSync(t,n)}function hU(e,t){const n=bP(t,-1);if(n<0)throw new oP(rP.EINVAL,"Invalid mode.");S$(e).chmodSync(n)}function pU(e,t,n){S$(e).utimesSync(TP(t),TP(n))}function fU(e){e=xP(e);const{fs:t,path:n}=k$(AU.call(this,e),this);try{const i=b$.get(e)||t.statSync(n);if(!i.isDirectory())throw oP.With("ENOTDIR",n,"rmdir");if(TB.checkAccess&&!i.hasAccess(OP,this))throw oP.With("EACCES",n,"rmdir");t.rmdirSync(n),z$("rename",e.toString())}catch(t){throw D$(t,{[n]:e})}}function mU(e,t){t="object"==typeof t?t:{mode:t};const n=bP(t?.mode,511);e=AU.call(this,e);const{fs:i,path:r,root:s}=k$(e,this),o={[r]:e};try{if(!t?.recursive){if(TB.checkAccess&&!i.statSync(dP(r)).hasAccess(OP,this))throw oP.With("EACCES",dP(r),"mkdir");return i.mkdirSync(r,n)}const a=[];for(let t=r,n=e;!i.existsSync(t);t=dP(t),n=dP(n))a.unshift(t),o[t]=n;for(const e of a){if(TB.checkAccess&&!i.statSync(dP(e)).hasAccess(OP,this))throw oP.With("EACCES",dP(e),"mkdir");i.mkdirSync(e,n),z$("rename",e)}return 1==s.length?a[0]:a[0]?.slice(s.length)}catch(e){throw D$(e,o)}}function gU(e,t){t="object"==typeof t?t:{encoding:t},e=xP(e);const{fs:n,path:i}=k$(AU.call(this,e),this);let r;try{const t=b$.get(e)||n.statSync(i);if(b$.set(e,t),TB.checkAccess&&!t.hasAccess(CP,this))throw oP.With("EACCES",i,"readdir");if(!t.isDirectory())throw oP.With("ENOTDIR",i,"readdir");r=n.readdirSync(i)}catch(t){throw D$(t,{[i]:e})}const s=[];for(const o of r){const r=b$.get(cP(e,o))||n.statSync(cP(i,o));if(b$.set(cP(e,o),r),t?.withFileTypes?s.push(new LU(o,r)):"buffer"==t?.encoding?s.push(x$.Buffer.from(o)):s.push(o),r.isDirectory()&&t?.recursive)for(const n of gU.call(this,cP(e,o),{...t,_isIndirect:!0}))n instanceof LU?(n.path=cP(o,n.path),s.push(n)):x$.Buffer.isBuffer(n)?s.push(x$.Buffer.from(cP(o,_P(n)))):s.push(cP(o,n))}return t?._isIndirect||b$.clear(),s}function _U(e,t){if(e=xP(e),TB.checkAccess&&!W$(dP(e)).hasAccess(CP,this))throw oP.With("EACCES",dP(e),"link");if(t=xP(t),TB.checkAccess&&!W$(dP(t)).hasAccess(OP,this))throw oP.With("EACCES",dP(t),"link");const{fs:n,path:i}=k$(e,this),r=k$(t,this);if(n!=r.fs)throw oP.With("EXDEV",t,"link");try{if(TB.checkAccess&&!n.statSync(i).hasAccess(CP,this))throw oP.With("EACCES",i,"link");return n.linkSync(i,t)}catch(n){throw D$(n,{[i]:e,[r.path]:t})}}function yU(e,t,n="file"){if(!["file","dir","junction"].includes(n))throw new oP(rP.EINVAL,"Invalid type: "+n);if(H$.call(this,t))throw oP.With("EEXIST",t.toString(),"symlink");nU.call(this,t,e.toString());Z$.call(this,t,"r+",420,!1).chmodSync(QP)}function vU(e,t){const n=x$.Buffer.from(eU.call(this,e.toString(),"r",!1)),i="object"==typeof t?t?.encoding:t;return"buffer"==i?n:n.toString(i)}function bU(e,t,n){const i=Q$.call(this,e,"r+");dU(i,t,n),sU(i)}function TU(e,t,n){const i=J$.call(this,e,"r+");dU(i,t,n),sU(i)}function xU(e,t){const n=Q$.call(this,e,"r+");hU(n,t),sU(n)}function EU(e,t){const n=J$.call(this,e,"r+");hU(n,t),sU(n)}function wU(e,t,n){const i=Q$.call(this,e,"r+");pU(i,t,n),sU(i)}function IU(e,t,n){const i=J$.call(this,e,"r+");pU(i,t,n),sU(i)}function AU(e,t){e=xP(e);const n=(this?.root||"")+e;if(T$.has(n))return T$.get(n);const{base:i,dir:r}=pP(e),s="/"==r?"/":T$.get((this?.root||"")+r)||AU.call(this,r),o=cP(s,i),{fs:a,path:l}=k$(o,this);try{const i=b$.get(o)||a.statSync(l);if(b$.set(o,i),!i.isSymbolicLink())return T$.set(e,o),o;const r=uP(s,vU.call(this,o,t).toString()),u=T$.get((this?.root||"")+r)||AU.call(this,r);return T$.set(n,u),u}catch(t){if("ENOENT"==t.code)return e;throw D$(t,{[l]:o})}}function SU(e,t=384){if(TB.checkAccess&&!W$.call(this,e).hasAccess(t,this))throw new oP(rP.EACCES)}function CU(e,t){let n;e=xP(e);try{n=b$.get(e)||X$.bind(this)(e)}catch(e){if("ENOENT"!=e.code||!t?.force)throw e}if(n){switch(b$.set(e,n),n.mode&KP){case tB:if(t?.recursive)for(const n of gU.call(this,e,{_isIndirect:!0}))CU.call(this,cP(e,n),{...t,_isIndirect:!0});fU.call(this,e);break;case JP:case QP:case eB:case nB:K$.call(this,e);break;default:throw b$.clear(),new oP(rP.EPERM,"File type not supported",e,"rm")}t?._isIndirect||b$.clear()}}function OU(e,t){const n="object"==typeof t?t?.encoding:t||"utf8",i="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return mU.call(this,i),"buffer"==n?x$.Buffer.from(i):i}function MU(e,t,n){if(e=xP(e),t=xP(t),n&&n&kP&&H$(t))throw new oP(rP.EEXIST,"Destination file already exists.",t,"copyFile");nU.call(this,t,tU(e)),z$("rename",t.toString())}function kU(e,t,n){const i=S$(e);let r=0;for(const e of t)r+=i.readSync(e,0,e.byteLength,n+r);return r}function RU(e,t,n){const i=S$(e);let r=0;for(const e of t)r+=i.writeSync(new Uint8Array(e.buffer),0,e.byteLength,n+r);return r}function NU(e,t){return e=xP(e),new PU(e,this)}function DU(e,t,n){e=xP(e),t=xP(t);const i=X$.call(this,e);if(n?.errorOnExist&&H$.call(this,t))throw new oP(rP.EEXIST,"Destination file or directory already exists.",t,"cp");switch(i.mode&KP){case tB:if(!n?.recursive)throw new oP(rP.EISDIR,e+" is a directory (not copied)",e,"cp");mU.call(this,t,{recursive:!0});for(const i of gU.call(this,e,{withFileTypes:!0}))n.filter&&!n.filter(cP(e,i.name),cP(t,i.name))||DU.call(this,cP(e,i.name),cP(t,i.name),n);break;case JP:case QP:MU.call(this,e,t);break;default:throw new oP(rP.EPERM,"File type not supported",e,"rm")}n?.preserveTimestamps&&wU.call(this,t,i.atime,i.mtime)}function FU(e,t){e=xP(e);const{fs:n}=k$(e,this);return L$(n,t?.bigint)}class LU{get name(){return hP(this.path)}constructor(e,t){this.path=e,this.stats=t}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}}class PU{checkClosed(){if(this.closed)throw new oP(rP.EBADF,"Can not use closed Dir")}constructor(e,t){this.path=e,this.context=t,this.closed=!1}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await iV.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(e){if(!e)return this._read();this._read().then(t=>e(void 0,t))}readSync(){return this.checkClosed(),this._entries??(this._entries=gU.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const e=await this._read();return e?{done:!1,value:e}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var BU=__webpack_require__(86248);class $U extends BU.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(t){e(new oP(rP.EIO,t.toString()))}}}class UU extends BU.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(t){e(new oP(rP.EIO,t.toString()))}}}var VU=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},zU=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class jU{constructor(e,t){this.context=t;const n="number"!=typeof e;this.fd=n?A$(e):e,this.file=n?e:S$(e)}async chown(e,t){await this.file.chown(e,t),z$("change",this.file.path)}async chmod(e){const t=bP(e,-1);if(t<0)throw new oP(rP.EINVAL,"Invalid mode.");await this.file.chmod(t),z$("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(e){if(e||(e=0),e<0)throw new oP(rP.EINVAL);await this.file.truncate(e),z$("change",this.file.path)}async utimes(e,t){await this.file.utimes(TP(e),TP(t)),z$("change",this.file.path)}async appendFile(e,t={}){const n=EP(t,"utf8","a",420);if(!DB(OB(n.flag)))throw new oP(rP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!n.encoding)throw new oP(rP.EINVAL,"Encoding not specified");const i="string"==typeof e?x$.Buffer.from(e,n.encoding):e;await this.file.write(i,0,i.length),z$("change",this.file.path)}read(e,t,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(e,t,n,i)}async readFile(e){const t=EP(e,null,"r",292);if(!kB(OB(t.flag)))throw new oP(rP.EINVAL,"Flag passed must allow for reading.");const{size:n}=await this.stat(),{buffer:i}=await this.file.read(new Uint8Array(n),0,n,0),r=x$.Buffer.from(i);return t.encoding?r.toString(t.encoding):r}readableWebStream(e={}){const t=globalThis;if(!("ReadableStream"in t))throw new oP(rP.ENOSYS,"ReadableStream is missing on globalThis");return new t.ReadableStream({start:async e=>{try{const t=65536,n=1e7;let i=0,r=0,s=NaN;for(;s>0;){const o=await this.read(new Uint8Array(t),0,t,r);if(!o.bytesRead)return void e.close();if(e.enqueue(o.buffer.slice(0,o.bytesRead)),r+=o.bytesRead,++i>=n)throw new oP(rP.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");s=o.bytesRead}}catch(t){e.error(t)}},type:e.type})}readLines(e){throw oP.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){const t=await this.file.stat();if(TB.checkAccess&&!t.hasAccess(CP,this.context))throw oP.With("EACCES",this.file.path,"stat");return e?.bigint?new IB(t):t}async write(e,t,n,i){let r,s,o;if("string"==typeof e){i="number"==typeof t?t:null;const a="string"==typeof n?n:"utf8";s=0,r=x$.Buffer.from(e,a),o=r.length}else r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=t,o=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(r,s,o,i);return z$("change",this.file.path),{buffer:r,bytesWritten:a}}async writeFile(e,t={}){const n=EP(t,"utf8","w",420);if(!RB(OB(n.flag)))throw new oP(rP.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof e&&!n.encoding)throw new oP(rP.EINVAL,"Encoding not specified");const i="string"==typeof e?x$.Buffer.from(e,n.encoding):e;await this.file.write(i,0,i.length,0),z$("change",this.file.path)}async close(){await this.file.close(),w$.delete(this.fd)}async writev(e,t){let n=0;for(const i of e)n+=(await this.write(i,0,i.length,t+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,t){let n=0;for(const i of e)n+=(await this.read(i,0,i.byteLength,t+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){const t=new $U({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:async e=>{try{const n=await this.read(new Uint8Array(e),0,e,this.file.position);t.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(e){t.destroy(e)}}});return t.path=this.file.path,t}createWriteStream(e){const t=new UU({highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:async(e,t,n)=>{try{const{bytesWritten:i}=await this.write(e,null,t);n(i==e.length?null:new Error("Failed to write full chunk"))}catch(e){n(e)}}});return t.path=this.file.path,t}}async function YU(e,t){e=xP(e),t=xP(t);const n=k$(e,this),i=k$(t,this);if(TB.checkAccess&&!(await HU.call(this,dP(e))).hasAccess(OP,this))throw oP.With("EACCES",e,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),z$("rename",e.toString()),void z$("change",t.toString());await JU.call(this,t,await QU(e)),await qU.call(this,e),z$("rename",e.toString())}catch(r){throw D$(r,{[n.path]:e,[i.path]:t})}}async function GU(e){try{const{fs:t,path:n}=k$(await pV.call(this,e),this);return await t.exists(n)}catch(e){if(e instanceof oP&&"ENOENT"==e.code)return!1;throw e}}async function HU(e,t){e=xP(e);const{fs:n,path:i}=k$(await pV.call(this,e),this);try{const e=await n.stat(i);if(TB.checkAccess&&!e.hasAccess(CP,this))throw oP.With("EACCES",i,"stat");return t?.bigint?new IB(e):e}catch(t){throw D$(t,{[i]:e})}}async function WU(e,t){e=xP(e);const{fs:n,path:i}=k$(e,this);try{const e=await n.stat(i);return t?.bigint?new IB(e):e}catch(t){throw D$(t,{[i]:e})}}async function XU(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const i=VU(n,await ZU.call(this,e,"r+"),!0);await i.truncate(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=zU(n);e&&await e}}async function qU(e){e=xP(e);const{fs:t,path:n}=k$(e,this);try{if(TB.checkAccess&&!(await(b$.getAsync(e)||t.stat(n))).hasAccess(OP,this))throw oP.With("EACCES",n,"unlink");await t.unlink(n),z$("rename",e.toString())}catch(t){throw D$(t,{[n]:e})}}async function KU(e,t,n=420,i){e=xP(e);const r=bP(n,420),s=OB(t);e=i?await pV.call(this,e):e;const{fs:o,path:a}=k$(e,this),l=await o.stat(a).catch(()=>null);if(!l){if(!RB(s)&&!DB(s)||"r+"==s)throw oP.With("ENOENT",e,"_open");const t=await o.stat(dP(a));if(TB.checkAccess&&!t.hasAccess(OP,this))throw oP.With("EACCES",dP(e),"_open");if(!t.isDirectory())throw oP.With("ENOTDIR",dP(e),"_open");return new jU(await o.createFile(a,s,r),this)}if(TB.checkAccess&&!l.hasAccess(MB(s),this))throw oP.With("EACCES",e,"_open");if(FB(s))throw oP.With("EEXIST",e,"_open");const u=new jU(await o.openFile(a,s),this);return NB(s)&&await u.truncate(0),u}async function ZU(e,t="r",n=420){return await KU.call(this,e,t,n,!0)}async function QU(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=EP(t,null,"r",420),r=VU(n,"object"==typeof e&&"fd"in e?e:await ZU.call(this,e,i.flag,i.mode),!0);return await r.readFile(i)}catch(e){n.error=e,n.hasError=!0}finally{const e=zU(n);e&&await e}}async function JU(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=EP(n,"utf8","w+",420),s=VU(i,e instanceof jU?e:await ZU.call(this,e.toString(),r.flag,r.mode),!0),o=t;if("string"!=typeof o&&!(o instanceof Uint8Array))throw new oP(rP.EINVAL,"Iterables and streams not supported",s.file.path,"writeFile");await s.writeFile(o,r)}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function eV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=EP(n,"utf8","a",420);if(!DB(OB(r.flag)))throw new oP(rP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!r.encoding)throw new oP(rP.EINVAL,"Encoding not specified");const s="string"==typeof t?x$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=VU(i,"object"==typeof e&&"fd"in e?e:await ZU.call(this,e,r.flag,r.mode),!0);await o.appendFile(s,r)}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function tV(e){e=await pV.call(this,e);const{fs:t,path:n}=k$(e,this);try{const i=await(b$.getAsync(e)||t.stat(n));if(!i)throw oP.With("ENOENT",e,"rmdir");if(!i.isDirectory())throw oP.With("ENOTDIR",n,"rmdir");if(TB.checkAccess&&!i.hasAccess(OP,this))throw oP.With("EACCES",n,"rmdir");await t.rmdir(n),z$("rename",e.toString())}catch(t){throw D$(t,{[n]:e})}}async function nV(e,t){t="object"==typeof t?t:{mode:t};const n=bP(t?.mode,511);e=await pV.call(this,e);const{fs:i,path:r,root:s}=k$(e,this),o={[r]:e};try{if(!t?.recursive){if(TB.checkAccess&&!(await i.stat(dP(r))).hasAccess(OP,this))throw oP.With("EACCES",dP(r),"mkdir");return await i.mkdir(r,n),void z$("rename",e.toString())}const a=[];for(let t=r,n=e;!await i.exists(t);t=dP(t),n=dP(n))a.unshift(t),o[t]=n;for(const e of a){if(TB.checkAccess&&!(await i.stat(dP(e))).hasAccess(OP,this))throw oP.With("EACCES",dP(e),"mkdir");await i.mkdir(e,n),z$("rename",e)}return 1==s.length?a[0]:a[0]?.slice(s.length)}catch(e){throw D$(e,o)}}async function iV(e,t){t="object"==typeof t?t:{encoding:t},e=await pV.call(this,e);const n=t=>{throw D$(t,{[r]:e})},{fs:i,path:r}=k$(e,this),s=b$.getAsync(e)||i.stat(r).catch(n);b$.setAsync(e,s);const o=await s;if(!o)throw oP.With("ENOENT",e,"readdir");if(TB.checkAccess&&!o.hasAccess(CP,this))throw oP.With("EACCES",e,"readdir");if(!o.isDirectory())throw oP.With("ENOTDIR",e,"readdir");const a=await i.readdir(r).catch(n),l=[];return await Promise.all(a.map(async s=>{let o;if(t?.recursive||t?.withFileTypes){const t=b$.getAsync(cP(e,s))||i.stat(cP(r,s)).catch(n);b$.setAsync(cP(e,s),t),o=await t}if(t?.withFileTypes?l.push(new LU(s,o)):"buffer"==t?.encoding?l.push(x$.Buffer.from(s)):l.push(s),t?.recursive&&o?.isDirectory())for(const n of await iV.call(this,cP(e,s),{...t,_isIndirect:!0}))n instanceof LU?(n.path=cP(s,n.path),l.push(n)):x$.Buffer.isBuffer(n)?l.push(x$.Buffer.from(cP(s,_P(n)))):l.push(cP(s,n))})),t?._isIndirect||b$.clear(),l}async function rV(e,t){e=xP(e),t=xP(t);const{fs:n,path:i}=k$(e,this),r=k$(t,this);if(n!=r.fs)throw oP.With("EXDEV",t,"link");try{if(TB.checkAccess&&!(await n.stat(dP(e))).hasAccess(CP,this))throw oP.With("EACCES",dP(i),"link");if(TB.checkAccess&&!(await HU.call(this,dP(t))).hasAccess(OP,this))throw oP.With("EACCES",dP(t),"link");if(TB.checkAccess&&!(await n.stat(i)).hasAccess(CP,this))throw oP.With("EACCES",i,"link");return await n.link(i,r.path)}catch(n){throw D$(n,{[r.path]:t,[i]:e})}}async function sV(e,t,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new oP(rP.EINVAL,"Invalid symlink type: "+n);if(await GU.call(this,t))throw oP.With("EEXIST",t.toString(),"symlink");const r=VU(i,await KU.call(this,t,"w+",420,!1),!0);await r.writeFile(e.toString()),await r.file.chmod(QP)}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function oV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=VU(n,await KU.call(this,xP(e),"r",420,!1),!0),r=await i.readFile(),s="object"==typeof t?t?.encoding:t;return"buffer"==s?r:r.toString(s)}catch(e){n.error=e,n.hasError=!0}finally{const e=zU(n);e&&await e}}async function aV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=VU(i,await ZU.call(this,e,"r+"),!0);await r.chown(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function lV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=VU(i,await KU.call(this,e,"r+",420,!1),!0);await r.chown(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function uV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=VU(n,await ZU.call(this,e,"r+"),!0);await i.chmod(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=zU(n);e&&await e}}async function cV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=VU(n,await KU.call(this,e,"r+",420,!1),!0);await i.chmod(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=zU(n);e&&await e}}async function dV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=VU(i,await ZU.call(this,e,"r+"),!0);await r.utimes(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function hV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=VU(i,await KU.call(this,e,"r+",420,!1),!0);await r.utimes(new Date(t),new Date(n))}catch(e){i.error=e,i.hasError=!0}finally{const e=zU(i);e&&await e}}async function pV(e,t){e=xP(e);const n=(this?.root||"")+e;if(T$.hasAsync(n))return T$.getAsync(n);const{base:i,dir:r}=pP(e),s="/"==r?"/":await(T$.getAsync((this?.root||"")+r)||pV.call(this,r)),o=cP(s,i),{fs:a,path:l}=k$(o,this);try{const t=b$.getAsync(o)||a.stat(l);if(b$.setAsync(o,t),!(await t).isSymbolicLink())return T$.set(e,o),o;const i=uP(s,(await oV.call(this,o)).toString()),r=T$.getAsync((this?.root||"")+i)||pV.call(this,i);return T$.setAsync(n,r),await r}catch(t){if("ENOENT"==t.code)return e;throw D$(t,{[l]:o})}}function fV(e,t={}){return{[Symbol.asyncIterator](){const n=new $$(e.toString(),"string"!=typeof t?t:{encoding:t}),i=[];function r(){n.close();for(const e of i)e({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",(e,t)=>{i.shift()?.({value:{eventType:e,filename:t},done:!1})}),{async next(){const{promise:e,resolve:t}=Promise.withResolvers();return i.push(t),e},return:r,throw:r}}}}async function mV(e,t=SP){if(!TB.checkAccess)return;if(!(await HU.call(this,e)).hasAccess(t,this))throw new oP(rP.EACCES)}async function gV(e,t){e=xP(e);const n=await(b$.getAsync(e)||WU.call(this,e).catch(e=>{if("ENOENT"!=e.code||!t?.force)throw e}));if(n){switch(b$.set(e,n),n.mode&KP){case tB:if(t?.recursive)for(const n of await iV.call(this,e,{_isIndirect:!0}))await gV.call(this,cP(e,n),{...t,_isIndirect:!0});await tV.call(this,e);break;case JP:case QP:case eB:case nB:await qU.call(this,e);break;default:throw b$.clear(),new oP(rP.EPERM,"File type not supported",e,"rm")}t?._isIndirect||b$.clear()}}async function _V(e,t){const n="object"==typeof t?t?.encoding:t||"utf8",i="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await nV.call(this,i),"buffer"==n?x$.Buffer.from(i):i}async function yV(e,t,n){if(e=xP(e),t=xP(t),n&&n&kP&&await GU.call(this,t))throw new oP(rP.EEXIST,"Destination file already exists.",t,"copyFile");await JU.call(this,t,await QU.call(this,e)),z$("rename",t.toString())}function vV(e,t){return e=xP(e),Promise.resolve(new PU(e,this))}async function bV(e,t,n){e=xP(e),t=xP(t);const i=await WU.call(this,e);if(n?.errorOnExist&&await GU.call(this,t))throw new oP(rP.EEXIST,"Destination file or directory already exists.",t,"cp");switch(i.mode&KP){case tB:{if(!n?.recursive)throw new oP(rP.EISDIR,e+" is a directory (not copied)",e,"cp");const[i]=await Promise.all([iV.call(this,e,{withFileTypes:!0}),nV.call(this,t,{recursive:!0})]),r=async i=>{n.filter&&!n.filter(cP(e,i.name),cP(t,i.name))||await bV.call(this,cP(e,i.name),cP(t,i.name),n)};await Promise.all(i.map(r));break}case JP:case QP:await yV.call(this,e,t);break;default:throw new oP(rP.EPERM,"File type not supported",e,"rm")}n?.preserveTimestamps&&await dV.call(this,t,i.atime,i.mtime)}async function TV(e,t){e=xP(e);const{fs:n}=k$(e,this);return Promise.resolve(L$(n,t?.bigint))}const xV=()=>{};function EV(e,t,n=xV){YU.call(this,e,t).then(()=>n()).catch(n)}function wV(e,t=xV){GU.call(this,e).then(t).catch(()=>t(!1))}function IV(e,t,n=xV){n="function"==typeof t?t:n,HU.call(this,e,"function"!=typeof t?t:{}).then(e=>n(void 0,e)).catch(n)}function AV(e,t,n=xV){n="function"==typeof t?t:n,WU.call(this,e,"function"!=typeof t?t:{}).then(e=>n(void 0,e)).catch(n)}function SV(e,t=0,n=xV){n="function"==typeof t?t:n;const i="number"==typeof t?t:0;XU.call(this,e,i).then(()=>n()).catch(n)}function CV(e,t=xV){qU.call(this,e).then(()=>t()).catch(t)}function OV(e,t,n,i=xV){const r=bP(n,420);i="function"==typeof n?n:i,ZU.call(this,e,t,r).then(e=>i(void 0,e.fd)).catch(i)}function MV(e,t,n=xV){n="function"==typeof t?t:n,QU.call(this,e,"function"==typeof t?null:t).then(e=>n(void 0,e)).catch(n)}function kV(e,t,n,i=xV){i="function"==typeof n?n:i,JU.call(this,e,t,"function"!=typeof n?n:null).then(()=>i(void 0)).catch(i)}function RV(e,t,n,i=xV){const r="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,eV.call(this,e,t,r).then(()=>i()).catch(i)}function NV(e,t,n=xV){n="function"==typeof t?t:n,S$(e).stat().then(e=>n(void 0,"object"==typeof t&&t?.bigint?new IB(e):e)).catch(n)}function DV(e,t=xV){const n=S$(e).close();w$.delete(e),n.then(()=>t()).catch(t)}function FV(e,t,n=xV){const i="number"==typeof t?t:0;n="function"==typeof t?t:n;const r=S$(e);if(i<0)throw new oP(rP.EINVAL);r.truncate(i).then(()=>n()).catch(n)}function LV(e,t=xV){S$(e).sync().then(()=>t()).catch(t)}function PV(e,t=xV){S$(e).datasync().then(()=>t()).catch(t)}function BV(e,t,n,i,r,s=xV){let o,a,l,u,c;const d=new jU(e,this);if("string"==typeof t){switch(c="utf8",typeof n){case"function":s=n;break;case"number":u=n,c="string"==typeof i?i:"utf8",s="function"==typeof r?r:s;break;default:return void(s="function"==typeof i?i:"function"==typeof r?r:s)(new oP(rP.EINVAL,"Invalid arguments."))}o=x$.Buffer.from(t),a=0,l=o.length;const e=s;d.write(o,a,l,u).then(({bytesWritten:t})=>e(void 0,t,o.toString(c))).catch(e)}else{o=x$.Buffer.from(t.buffer),a=n,l=i,u="number"==typeof r?r:null;const e="function"==typeof r?r:s;d.write(o,a,l,u).then(({bytesWritten:t})=>e(void 0,t,o)).catch(e)}}function $V(e,t,n,i,r,s=xV){new jU(e,this).read(t,n,i,r).then(({bytesRead:e,buffer:t})=>s(void 0,e,t)).catch(s)}function UV(e,t,n,i=xV){new jU(e,this).chown(t,n).then(()=>i()).catch(i)}function VV(e,t,n){new jU(e,this).chmod(t).then(()=>n()).catch(n)}function zV(e,t,n,i=xV){new jU(e,this).utimes(t,n).then(()=>i()).catch(i)}function jV(e,t=xV){tV.call(this,e).then(()=>t()).catch(t)}function YV(e,t,n=xV){nV.call(this,e,t).then(()=>n()).catch(n)}function GV(e,t,n=xV){n="function"==typeof t?t:n;const i="function"!=typeof t?t:{};iV.call(this,e,i).then(e=>n(void 0,e)).catch(n)}function HV(e,t,n=xV){rV.call(this,e,t).then(()=>n()).catch(n)}function WV(e,t,n,i=xV){const r="string"==typeof n?n:"file";i="function"==typeof n?n:i,sV.call(this,e,t,r).then(()=>i()).catch(i)}function XV(e,t,n=xV){n="function"==typeof t?t:n,oV.call(this,e).then(e=>n(void 0,e)).catch(n)}function qV(e,t,n,i=xV){aV.call(this,e,t,n).then(()=>i()).catch(i)}function KV(e,t,n,i=xV){lV.call(this,e,t,n).then(()=>i()).catch(i)}function ZV(e,t,n=xV){uV.call(this,e,t).then(()=>n()).catch(n)}function QV(e,t,n=xV){cV.call(this,e,t).then(()=>n()).catch(n)}function JV(e,t,n,i=xV){dV.call(this,e,t,n).then(()=>i()).catch(i)}function ez(e,t,n,i=xV){hV.call(this,e,t,n).then(()=>i()).catch(i)}function tz(e,t,n=xV){n="function"==typeof t?t:n,pV.call(this,e,"function"==typeof t?null:t).then(e=>n(void 0,e)).catch(n)}function nz(e,t,n=xV){const i="number"==typeof t?t:CP;n="function"==typeof t?t:n,mV.call(this,e,i).then(()=>n()).catch(n)}const iz=new Map;function rz(e,t,n){const i=xP(e.toString()),r="function"!=typeof t?t:{};if("function"==typeof t&&(n=t),!n)throw new oP(rP.EINVAL,"No listener specified",e.toString(),"watchFile");if(iz.has(i)){const e=iz.get(i);return void(e&&e.listeners.add(n))}const s=new U$(i,r);s.on("change",(e,t)=>{const n=iz.get(i);if(n)for(const i of n.listeners)i(e,t)}),iz.set(i,{watcher:s,listeners:new Set})}function sz(e,t=xV){const n=xP(e.toString()),i=iz.get(n);i&&(t&&t!==xV?i.listeners.delete(t):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),iz.delete(n)))}function oz(e,t,n){const i=new $$(xP(e),"object"==typeof t?t:{});return n="function"==typeof t?t:n,i.on("change",n||xV),i}function az(e,t){const n=this;let i;const r=new $U({highWaterMark:(t="object"==typeof t?t:{encoding:t}).highWaterMark||65536,encoding:t.encoding||"utf8",async read(s){try{i||(i=await ZU.call(n,e,"r",t?.mode));const o=await i.read(new Uint8Array(s),0,s,i.file.position);r.push(o.bytesRead?o.buffer.slice(0,o.bytesRead):null),i.file.position+=o.bytesRead,o.bytesRead||await i.close()}catch(e){await(i?.close()),r.destroy(e)}},destroy(e,t){i?.close().then(()=>t(e)).catch(xV)}});return r.path=e.toString(),r}function lz(e,t){const n=this;let i;t="object"==typeof t?t:{encoding:t};const r=new UU({highWaterMark:t?.highWaterMark,async write(r,s,o){try{i||(i=await ZU.call(n,e,"w",t?.mode||438)),await i.write(r,0,s),o(void 0)}catch(e){await(i?.close()),o(e)}},destroy(e,t){t(e),i?.close().then(()=>t(e)).catch(t)},final(e){i?.close().then(()=>e()).catch(e)}});return r.path=e.toString(),r}function uz(e,t,n=xV){n="function"==typeof t?t:n,gV.call(this,e,"function"==typeof t?void 0:t).then(()=>n(void 0)).catch(n)}function cz(e,t,n=xV){n="function"==typeof t?t:n,_V.call(this,e,"function"!=typeof t?t:null).then(e=>n(void 0,e)).catch(n)}function dz(e,t,n,i=xV){i="function"==typeof n?n:i,yV.call(this,e,t,"function"==typeof n?void 0:n).then(()=>i(void 0)).catch(i)}function hz(e,t,n,i=xV){i="function"==typeof n?n:i,new jU(e,this).readv(t,"function"==typeof n?void 0:n).then(({buffers:e,bytesRead:t})=>i(void 0,t,e)).catch(i)}function pz(e,t,n,i=xV){i="function"==typeof n?n:i,new jU(e,this).writev(t,"function"==typeof n?void 0:n).then(({buffers:e,bytesWritten:t})=>i(void 0,t,e)).catch(i)}function fz(e,t,n=xV){n="function"==typeof t?t:n,vV.call(this,e,"function"==typeof t?void 0:t).then(e=>n(void 0,e)).catch(n)}function mz(e,t,n,i=xV){i="function"==typeof n?n:i,bV.call(this,e,t,"function"==typeof n?void 0:n).then(()=>i(void 0)).catch(i)}function gz(e,t,n=xV){n="function"==typeof t?t:n,TV.call(this,e,"function"==typeof t?void 0:t).then(e=>n(void 0,e)).catch(n)}async function _z(e,t){const n=await ZU.call(this,e.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],t)}var yz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},vz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});function bz(e){return class extends e{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(e=>{const t=()=>this._queueRunning?setTimeout(t):e();t()})}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof h$&&this instanceof h$){const e=this._sync.store.transaction(),t=this.store.transaction(),n=[];for(const i of await t.keys())n.push(t.get(i).then(t=>e.setSync(i,t)));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}}checkSync(e,t){if(this._disableSync)throw new oP(rP.ENOTSUP,"Sync caching has been disabled for this async file system",e,t);if(!this._sync)throw new oP(rP.ENOTSUP,"No sync cache is attached to this async file system",e,t)}renameSync(e,t){this.checkSync(e,"rename"),this._sync.renameSync(e,t),this.queue("rename",e,t)}statSync(e){return this.checkSync(e,"stat"),this._sync.statSync(e)}createFileSync(e,t,n){return this.checkSync(e,"createFile"),this._sync.createFileSync(e,t,n),this.queue("createFile",e,t,n),this.openFileSync(e,t)}openFileSync(e,t){this.checkSync(e,"openFile");const n=this._sync.openFileSync(e,t+"+"),i=n.statSync(),r=new Uint8Array(i.size);return n.readSync(r),new PB(this,e,t,i,r)}unlinkSync(e){this.checkSync(e,"unlinkSync"),this._sync.unlinkSync(e),this.queue("unlink",e)}rmdirSync(e){this.checkSync(e,"rmdir"),this._sync.rmdirSync(e),this.queue("rmdir",e)}mkdirSync(e,t){this.checkSync(e,"mkdir"),this._sync.mkdirSync(e,t),this.queue("mkdir",e,t)}readdirSync(e){return this.checkSync(e,"readdir"),this._sync.readdirSync(e)}linkSync(e,t){this.checkSync(e,"link"),this._sync.linkSync(e,t),this.queue("link",e,t)}syncSync(e,t,n){this.checkSync(e,"sync"),this._sync.syncSync(e,t,n),this.queue("sync",e,t,n)}existsSync(e){return this.checkSync(e,"exists"),this._sync.existsSync(e)}async crossCopy(e){this.checkSync(e,"crossCopy");const t=await this.stat(e);if(!t.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=yz(n,await this.openFile(e,OB("r")),!0),r=yz(n,this._sync.createFileSync(e,OB("w"),t.mode),!1),s=new Uint8Array(t.size);return await i.read(s),void r.writeSync(s,0,t.size)}catch(e){n.error=e,n.hasError=!0}finally{const e=vz(n);e&&await e}}if("/"!==e){const t=await this.stat(e);this._sync.mkdirSync(e,t.mode)}const n=[];for(const t of await this.readdir(e))n.push(this.crossCopy(cP(e,t)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[e,...t]=this._queue.shift();await this[e](...t),await this._next()}queue(...e){this._queue.push(e),this._next()}}}new Map;bz(BB);new Map;Map;Tz=BB;var Tz;var xz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Ez=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class wz{get isLocked(){return this._isLocked}constructor(e){this.previous=e,this.current=Promise.withResolvers(),this._isLocked=!0}async done(){await(this.previous?.done()),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}}class Iz{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const e=new wz(this.currentLock);return this.currentLock=e,e}async lock(e,t){const n=this.currentLock,i=this.addLock(),r=(new Error).stack;return setTimeout(()=>{if(i.isLocked){const n=oP.With("EDEADLK",e,t);throw n.stack+=r?.slice(5),n}},5e3),await(n?.done()),i}lockSync(e,t){if(this.currentLock?.isLocked)throw oP.With("EBUSY",e,t);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,await this.lock(e,"rename"),!1);await this._fs.rename(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}renameSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,this.lockSync(e,"rename"),!1);return this._fs.renameSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}async stat(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,await this.lock(e,"stat"),!1);return await this._fs.stat(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}statSync(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,this.lockSync(e,"stat"),!1);return this._fs.statSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}async openFile(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,await this.lock(e,"openFile"),!1);const i=await this._fs.openFile(e,t);return i.fs=this,i}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}openFileSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,this.lockSync(e,"openFile"),!1);const i=this._fs.openFileSync(e,t);return i.fs=this,i}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}async createFile(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{xz(i,await this.lock(e,"createFile"),!1);const r=await this._fs.createFile(e,t,n);return r.fs=this,r}catch(e){i.error=e,i.hasError=!0}finally{Ez(i)}}createFileSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{xz(i,this.lockSync(e,"createFile"),!1);const r=this._fs.createFileSync(e,t,n);return r.fs=this,r}catch(e){i.error=e,i.hasError=!0}finally{Ez(i)}}async unlink(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,await this.lock(e,"unlink"),!1);await this._fs.unlink(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}unlinkSync(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,this.lockSync(e,"unlink"),!1);return this._fs.unlinkSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}async rmdir(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,await this.lock(e,"rmdir"),!1);await this._fs.rmdir(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}rmdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,this.lockSync(e,"rmdir"),!1);return this._fs.rmdirSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}async mkdir(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,await this.lock(e,"mkdir"),!1);await this._fs.mkdir(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}mkdirSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,this.lockSync(e,"mkdir"),!1);return this._fs.mkdirSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}async readdir(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,await this.lock(e,"readdir"),!1);return await this._fs.readdir(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}readdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,this.lockSync(e,"readdir"),!1);return this._fs.readdirSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}async exists(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,await this.lock(e,"exists"),!1);return await this._fs.exists(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}existsSync(e){const t={stack:[],error:void 0,hasError:!1};try{xz(t,this.lockSync(e,"exists"),!1);return this._fs.existsSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Ez(t)}}async link(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,await this.lock(e,"link"),!1);await this._fs.link(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}linkSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{xz(n,this.lockSync(e,"link"),!1);return this._fs.linkSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Ez(n)}}async sync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{xz(i,await this.lock(e,"sync"),!1);await this._fs.sync(e,t,n)}catch(e){i.error=e,i.hasError=!0}finally{Ez(i)}}syncSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{xz(i,this.lockSync(e,"sync"),!1);return this._fs.syncSync(e,t,n)}catch(e){i.error=e,i.hasError=!0}finally{Ez(i)}}}var Az=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Sz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});const Cz="/.deleted";class Oz extends BB{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:e,readable:t}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=e,this.readable=t,this.writable.metadata().readonly)throw new oP(rP.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:Mz.name}}async sync(e,t,n){await this.copyForWrite(e),await this.writable.exists(e)||await this.writable.createFile(e,"w",420),await this.writable.sync(e,t,n)}syncSync(e,t,n){this.copyForWriteSync(e),this.writable.syncSync(e,t,n)}async _initialize(){if(!this._isInitialized){try{const e=await this.writable.openFile(Cz,OB("r")),{size:t}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(t));this._deleteLog=_P(n)}catch(e){if(e.errno!==rP.ENOENT)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(e){this._deleteLog=e,this._reparseDeletionLog(),await this.updateLog("")}async rename(e,t){this.checkInitialized(),this.checkPath(e),this.checkPath(t),await this.copyForWrite(e);try{await this.writable.rename(e,t)}catch{if(this._deletedFiles.has(e))throw oP.With("ENOENT",e,"rename")}}renameSync(e,t){this.checkInitialized(),this.checkPath(e),this.checkPath(t),this.copyForWriteSync(e);try{this.writable.renameSync(e,t)}catch{if(this._deletedFiles.has(e))throw oP.With("ENOENT",e,"rename")}}async stat(e){this.checkInitialized();try{return await this.writable.stat(e)}catch{if(this._deletedFiles.has(e))throw oP.With("ENOENT",e,"stat");const t=await this.readable.stat(e);return t.mode|=146,t}}statSync(e){this.checkInitialized();try{return this.writable.statSync(e)}catch{if(this._deletedFiles.has(e))throw oP.With("ENOENT",e,"stat");const t=this.readable.statSync(e);return t.mode|=146,t}}async openFile(e,t){if(await this.writable.exists(e))return this.writable.openFile(e,t);const n=await this.readable.openFile(e,OB("r")),i=await n.stat(),{buffer:r}=await n.read(new Uint8Array(i.size));return new PB(this,e,t,i,r)}openFileSync(e,t){if(this.writable.existsSync(e))return this.writable.openFileSync(e,t);const n=this.readable.openFileSync(e,OB("r")),i=n.statSync(),r=new Uint8Array(i.size);return n.readSync(r),new PB(this,e,t,i,r)}async createFile(e,t,n){return this.checkInitialized(),await this.writable.createFile(e,t,n),this.openFile(e,t)}createFileSync(e,t,n){return this.checkInitialized(),this.writable.createFileSync(e,t,n),this.openFileSync(e,t)}async link(e,t){this.checkInitialized(),await this.copyForWrite(e),await this.writable.link(e,t)}linkSync(e,t){this.checkInitialized(),this.copyForWriteSync(e),this.writable.linkSync(e,t)}async unlink(e){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e))throw oP.With("ENOENT",e,"unlink");await this.writable.exists(e)&&await this.writable.unlink(e),await this.exists(e)&&await this.deletePath(e)}unlinkSync(e){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e))throw oP.With("ENOENT",e,"unlink");this.writable.existsSync(e)&&this.writable.unlinkSync(e),this.existsSync(e)&&this.deletePath(e)}async rmdir(e){if(this.checkInitialized(),!await this.exists(e))throw oP.With("ENOENT",e,"rmdir");if(await this.writable.exists(e)&&await this.writable.rmdir(e),await this.exists(e)){if((await this.readdir(e)).length)throw oP.With("ENOTEMPTY",e,"rmdir");await this.deletePath(e)}}rmdirSync(e){if(this.checkInitialized(),!this.existsSync(e))throw oP.With("ENOENT",e,"rmdir");if(this.writable.existsSync(e)&&this.writable.rmdirSync(e),this.existsSync(e)){if(this.readdirSync(e).length)throw oP.With("ENOTEMPTY",e,"rmdir");this.deletePath(e)}}async mkdir(e,t){if(this.checkInitialized(),await this.exists(e))throw oP.With("EEXIST",e,"mkdir");await this.createParentDirectories(e),await this.writable.mkdir(e,t)}mkdirSync(e,t){if(this.checkInitialized(),this.existsSync(e))throw oP.With("EEXIST",e,"mkdir");this.createParentDirectoriesSync(e),this.writable.mkdirSync(e,t)}async readdir(e){this.checkInitialized();const t=[];try{t.push(...await this.writable.readdir(e))}catch{}try{t.push(...(await this.readable.readdir(e)).filter(t=>!this._deletedFiles.has(`${e}/${t}`)))}catch{}const n={};return t.filter(e=>{const t=!n[e];return n[e]=!0,t})}readdirSync(e){this.checkInitialized();let t=[];try{t=t.concat(this.writable.readdirSync(e))}catch{}try{t=t.concat(this.readable.readdirSync(e).filter(t=>!this._deletedFiles.has(`${e}/${t}`)))}catch{}const n={};return t.filter(e=>{const t=!n[e];return n[e]=!0,t})}async deletePath(e){this._deletedFiles.add(e),await this.updateLog(`d${e}\n`)}async updateLog(e){if(this._deleteLog+=e,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const t=await this.writable.openFile(Cz,OB("w"));try{await t.write(mP(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(e){this._deleteLogError=e}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const e of this._deleteLog.split("\n"))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new oP(rP.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const e=this._deleteLogError;throw delete this._deleteLogError,e}checkPath(e){if(e==Cz)throw oP.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e){let t=dP(e);const n=[];for(;!this.writable.existsSync(t);)n.push(t),t=dP(t);for(const e of n.reverse())this.writable.mkdirSync(e,this.statSync(e).mode)}async createParentDirectories(e){let t=dP(e);const n=[];for(;!await this.writable.exists(t);)n.push(t),t=dP(t);for(const e of n.reverse()){const t=await this.stat(e);await this.writable.mkdir(e,t.mode)}}copyForWriteSync(e){if(!this.existsSync(e))throw oP.With("ENOENT",e,"copyForWrite");this.writable.existsSync(dP(e))||this.createParentDirectoriesSync(e),this.writable.existsSync(e)||this.copyToWritableSync(e)}async copyForWrite(e){if(!await this.exists(e))throw oP.With("ENOENT",e,"copyForWrite");if(await this.writable.exists(dP(e))||await this.createParentDirectories(e),!await this.writable.exists(e))return this.copyToWritable(e)}copyToWritableSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(e);if(n.isDirectory())return void this.writable.mkdirSync(e,n.mode);const i=new Uint8Array(n.size);Az(t,this.readable.openFileSync(e,"r"),!1).readSync(i);Az(t,this.writable.createFileSync(e,"w",146|n.mode),!1).writeSync(i)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}async copyToWritable(e){const t={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(e);if(n.isDirectory())return void await this.writable.mkdir(e,n.mode);const i=new Uint8Array(n.size),r=Az(t,await this.readable.openFile(e,"r"),!0);await r.read(i);const s=Az(t,await this.writable.createFile(e,"w",146|n.mode),!0);await s.write(i)}catch(e){t.error=e,t.hasError=!0}finally{const e=Sz(t);e&&await e}}}class Mz extends(function(e){return class extends Iz{constructor(...t){super(),this._fs=new e(...t)}}}(Oz)){}function kz(e,t,n){if(e instanceof oP)return e;const i=e instanceof DOMException?rP[function(e){switch(e.name){case"IndexSizeError":case"HierarchyRequestError":case"InvalidCharacterError":case"InvalidStateError":case"SyntaxError":case"NamespaceError":case"TypeMismatchError":case"ConstraintError":case"VersionError":case"URLMismatchError":case"InvalidNodeTypeError":return"EINVAL";case"WrongDocumentError":return"EXDEV";case"NoModificationAllowedError":case"InvalidModificationError":case"InvalidAccessError":case"SecurityError":case"NotAllowedError":return"EACCES";case"NotFoundError":return"ENOENT";case"NotSupportedError":return"ENOTSUP";case"InUseAttributeError":return"EBUSY";case"NetworkError":return"ENETDOWN";case"AbortError":return"EINTR";case"QuotaExceededError":return"ENOSPC";case"TimeoutError":return"ETIMEDOUT";case"ReadOnlyError":return"EROFS";default:return"EIO"}}(e)]:rP.EIO,r=new oP(i,e.message,t,n);return r.stack=e.stack,r.cause=e.cause,r}globalThis.__zenfs__=ue;class Rz extends(bz(BB)){constructor(e){super(),this._handles=new Map,this._sync=y$.create({name:"accessfs-cache"}),this._handles.set("/",e)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(e,t){await this.writeFile(e,t)}async rename(e,t){const n=await this.getHandle(e);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(e);if(await this.mkdir(t),!n.length)return void await this.unlink(e);for(const i of n)await this.rename(cP(e,i),cP(t,i)),await this.unlink(e);return}if(!(n instanceof FileSystemFileHandle))throw new oP(rP.ENOTSUP,"Not a file or directory handle",e,"rename");const i=await n.getFile().catch(t=>{throw kz(t,e,"rename")}),r=await this.getHandle(dP(t));if(!(r instanceof FileSystemDirectoryHandle))return;const s=await r.getFileHandle(hP(t),{create:!0}).catch(e=>{throw kz(e,t,"rename")}),o=await s.createWritable();await o.write(await i.arrayBuffer()),await o.close(),await this.unlink(e)}async writeFile(e,t){if(t.buffer.resizable)throw new oP(rP.EINVAL,"Resizable buffers can not be written",e,"write");const n=await this.getHandle(dP(e));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(hP(e),{create:!0}),r=await i.createWritable();await r.write(t),await r.close()}async createFile(e,t){return await this.writeFile(e,new Uint8Array),this.openFile(e,t)}async stat(e){const t=await this.getHandle(e);if(!t)throw oP.With("ENOENT",e,"stat");if(t instanceof FileSystemDirectoryHandle)return new wB({mode:511|tB,size:4096});if(t instanceof FileSystemFileHandle){const{lastModified:e,size:n}=await t.getFile();return new wB({mode:511|JP,size:n,mtimeMs:e})}throw new oP(rP.EBADE,"Handle is not a directory or file",e,"stat")}async openFile(e,t){const n=await this.getHandle(e);if(!(n instanceof FileSystemFileHandle))throw oP.With("EISDIR",e,"openFile");const i=await n.getFile().catch(t=>{throw kz(t,e,"openFile")}),r=new Uint8Array(await i.arrayBuffer()),s=new wB({mode:511|JP,size:i.size,mtimeMs:i.lastModified});return new PB(this,e,t,s,r)}async unlink(e){const t=await this.getHandle(dP(e));if(!(t instanceof FileSystemDirectoryHandle))throw oP.With("ENOTDIR",dP(e),"unlink");await t.removeEntry(hP(e),{recursive:!0}).catch(t=>{throw kz(t,e,"unlink")})}async link(e){}async rmdir(e){return this.unlink(e)}async mkdir(e){if(await this.getHandle(e).catch(e=>{if("ENOENT"!=e.code)throw e}))throw oP.With("EEXIST",e,"mkdir");const t=await this.getHandle(dP(e));if(!(t instanceof FileSystemDirectoryHandle))throw oP.With("ENOTDIR",e,"mkdir");await t.getDirectoryHandle(hP(e),{create:!0})}async readdir(e){const t=await this.getHandle(e);if(!(t instanceof FileSystemDirectoryHandle))throw oP.With("ENOTDIR",e,"readdir");const n=[];for await(const e of t.keys())n.push(e);return n}async getHandle(e){if(this._handles.has(e))return this._handles.get(e);let t="/";for(const n of e.split("/").slice(1)){const e=this._handles.get(t);if(!(e instanceof FileSystemDirectoryHandle))throw oP.With("ENOTDIR",t,"getHandle");t=cP(t,n);const i=await e.getDirectoryHandle(n).catch(i=>{switch(i.name){case"TypeMismatchError":return e.getFileHandle(n).catch(e=>{});case"TypeError":throw new oP(rP.ENOENT,i.message,t,"getHandle");default:throw kz(i,t,"getHandle")}});i&&this._handles.set(t,i)}return this._handles.get(e)}}function Nz(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let Dz;function Fz(){return Dz||(Dz=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const i=Nz(n);return(e,n)=>i.then(i=>n(i.transaction(t,e).objectStore(t)))}("keyval-store","keyval")),Dz}class Lz extends Rz{constructor(e){super(e)}async readFile(e){const t=await this.getHandle(e);if(t instanceof window.FileSystemFileHandle){const e=await t.getFile();return await e.text()}return""}}class Pz extends ze.FS{#e=null;#t=new TextEncoder;constructor(){super()}async showDirectoryPicker(){const e=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await e.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(e),this.#e=new Lz(e),e}async loadFS(){let e=await this.getFSCache();if(!e)return null;if("granted"!==await e.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#e=new Lz(e),e}async getFSCache(){return function(e,t=Fz()){return t("readonly",t=>Nz(t.get(e)))}("mixly-pyodide-fs")}async setFSCache(e){await function(e,t,n=Fz()){return n("readwrite",n=>(n.put(t,e),Nz(n.transaction)))}("mixly-pyodide-fs",e)}async createFile(e){return this.#e.createFile(e,"")}async readFile(e){return this.#e.readFile(e)}async writeFile(e,t){const n=this.#t.encode(t);return this.#e.writeFile(e,n)}async isFile(e){const t=await this.#e.stat(e);return!(!t||33279!==t.mode)}async renameFile(e,t){return await this.#e.rename(e,t)}async moveFile(e,t){return this.renameFile(e,t)}async deleteFile(e){return this.#e.unlink(e)}async createDirectory(e){return this.#e.mkdir(e,511)}async readDirectory(e){return await this.#e.readdir(e)}async isDirectory(e){const t=await this.#e.stat(e);return!(!t||16895!==t.mode)}async isDirectoryEmpty(e){const t=await this.readDirectory(e);return!t?.length}async renameDirectory(e,t){return this.#e.rename(e,t)}async moveDirectory(e,t){return this.#e.rename(e,t)}async deleteDirectory(e){return this.#e.rmdir(e)}}class Bz extends ze.FileTree{constructor(){super(new Pz)}async readFolder(e){let t=[];try{const n=this.getFS();if(!await n.isDirectory(e))return t;const i=await n.readDirectory(e);for(let r of i){const i=xx.join(e,r);if(await n.isDirectory(i)){const e=await n.isDirectoryEmpty(i);t.push({type:"folder",id:i,children:!e,title:`/${this.getRootFolderName()}${i}`})}else t.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(e){ze.Debug.error(e)}return t}}class $z extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new ze.HTMLTemplate('\r\n
\r\n
\r\n
\r\n
')),ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new ze.HTMLTemplate('\r\n
\r\n \r\n
')),ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new ze.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["file-system"],$z);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"file-system",id:"file-system",name:Ve.Msg.PYTHON_PYODIDE_FILE_SYSTEM,title:Ve.Msg.PYTHON_PYODIDE_FILE_SYSTEM}),e.changeTo("output"),e.get("file-system")}}#n=null;#i=null;#r=null;#s=null;#o=null;#a=null;#l=null;#u=null;#c=!1;#d=!1;#h=!1;#p=null;constructor(){super();const e=wx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(e),this.#l=new Bz,this.#i=e.children(".file-tree"),this.#s=wx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:Ve.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#i.append(this.#s),this.#a=new ze.StatusBar,this.#r=e.children(".editor"),this.#o=wx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#r.append(this.#o)}#f(){this.#u=new ze.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#u.bind("sizeChanged",()=>{this.resize()}),this.#s.children("button").click(()=>{this.selectFS().catch(ze.Debug.error)}),this.#l.bind("beforeSelectLeaf",e=>{const t=e[0].id,n=this.#a.getFileMode(xx.extname(t));return n?(this.#a.setMode(n),!0):(iP.layer.msg(ze.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)}),this.#l.bind("afterSelectLeaf",async e=>{const t=e[0].id;this.#l.showProgress();const n=this.#l.getFS();try{const e=await n.readFile(t);this.showEditor(),this.#a.setValue(e),this.#a.scrollToTop(),this.#a.focus(),this.setStatus(!1)}catch(e){ze.Debug.error(e),this.hideEditor(),this.#l.deselectAll()}this.#l.hideProgress()}),this.#l.bind("afterCreateNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterDeleteNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterRenameNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterRefreshNode",()=>{this.#l.getSelectedNodeId()||this.hideEditor()});const e=this.#l.getContextMenu().getItem("menu");e.add({weight:7,id:"copy_path",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["fileTree.copyPath"]),callback:(e,{$trigger:t})=>{let n=null;n="root"===t.attr("type")?this.#l.getRootFolderTitle():t.attr("title"),navigator.clipboard.writeText(n).catch(ze.Debug.error)}}}),e.add({weight:14,id:"sep5",preconditionFn:e=>{const t=this.#l.getSelectedNodeId();let n=e.attr("type"),i=e.attr("id");return"file"!==n||t===i},data:"---------"}),e.add({weight:15,id:"refresh",preconditionFn:e=>{const t=this.#l.getSelectedNodeId();let n=e.attr("type"),i=e.attr("id");return"file"!==n||t===i},data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["statusbar.ampy.refresh"]),callback:(e,{$trigger:t})=>{let n=t.attr("type");if("root"===n)this.#l.openRootFolder(),this.#l.refreshFolder("/");else if("folder"===n){let e=t.attr("id");this.#l.openNode(e),this.#l.refreshFolder(e)}else{const e=this.#l.getSelectedNodes();this.#l.runEvent("afterSelectLeaf",e)}}}}),e.add({weight:16,id:"sep6",preconditionFn:e=>{let t=e.attr("type");return["root"].includes(t)},data:"---------"}),e.add({weight:17,id:"exit",preconditionFn:e=>{let t=e.attr("type");return["root"].includes(t)},data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["statusbar.ampy.exit"]),callback:()=>{this.closeFS()}}}),e.remove("copy"),e.remove("cut"),e.remove("paste"),e.remove("sep2");const t=this.#a.getContextMenu().getItem("code");t.empty(),t.add({weight:0,id:"cut",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#a.cut()}}),t.add({weight:1,id:"copy",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#a.copy()}}),t.add({weight:2,id:"paste",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#a.paste()}}),t.add({weight:3,id:"sep1",data:"---------"}),t.add({weight:4,id:"togglecomment",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#a.commentLine()}}),t.add({weight:6,id:"sep2",preconditionFn:()=>this.#h,data:"---------"}),t.add({weight:7,id:"save",preconditionFn:()=>this.#h,data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:n}=this.#a.getEditor();n.addCommand({name:"save",bindKey:"Ctrl-S",exec:async()=>{this.#h&&await this.put()}})}async put(){this.#l.showProgress();const e=this.#l.getSelectedNodeId(),t=this.#l.getFS();try{await t.writeFile(e,this.#a.getValue()),this.setStatus(!1)}catch(e){ze.Debug.error(e)}finally{this.#l.hideProgress()}}showFileTree(){this.#c||(this.#s.detach(),this.#i.empty(),this.#i.append(this.#l.getContent()),this.#c=!0)}hideFileTree(){this.#c&&(this.#l.getContent().detach(),this.#i.empty(),this.#i.append(this.#s),this.#c=!1)}showEditor(){this.#d||(this.#o.detach(),this.#r.empty(),this.#r.append(this.#a.getContent()),this.#d=!0)}hideEditor(){this.#d&&(this.#a.getContent().detach(),this.#r.empty(),this.#r.append(this.#o),this.#d=!1,this.setStatus(!1))}getDrag(){return this.#u}init(){super.init(),this.hideCloseBtn(),this.#a.init(),this.#f();const e=this.#a.getEditor();e.setReadOnly(!1),e.renderer.setShowGutter(!0),e.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),e.on("change",()=>{this.setStatus(!0)}),this.loadFS().catch(ze.Debug.error)}async loadFS(){const e=this.#l.getFS(),t=await e.loadFS();await this.openFS(t)}async selectFS(){const e=this.#l.getFS(),t=await e.showDirectoryPicker();await this.openFS(t)}async openFS(e){if(!e?.name)return;const t="/"+e.name;this.#l.setFolderPath("/"),this.#l.setRootFolderTitle(t),this.#l.setRootFolderName(e.name),this.#l.openRootFolder(),this.showFileTree(),this.#p=await window.pyodide.mountNativeFS(t,e)}closeFS(){const e=this.#l.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(xx.basename(e))){const t=window.pyodide.FS.lookupPath(e,{follow_mount:!1});window.pyodide.FS.isMountpoint(t.node)&&window.pyodide.FS.unmount(e)}this.#l.getFS().setFSCache(null),this.#l.deselectAll(),this.hideFileTree(),this.hideEditor(),this.setStatus(!1)}onMounted(){super.onMounted(),this.#a.onMounted(),this.#l.onMounted()}onUnmounted(){super.onUnmounted(),this.#a.onUnmounted(),this.#l.onUnmounted()}resize(){super.resize(),this.#a.resize(),this.#l.resize()}setStatus(e){this.#h!==e&&(this.#h=e)}getNativeFS(){return this.#p}dispose(){this.#a.dispose(),this.#a=null,this.#l.dispose(),this.#l=null,super.dispose()}}class Uz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-tool.html",new ze.HTMLTemplate('\r\n
\r\n Teachable Machine\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["tool"],Uz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"tool",id:"tool",name:Ve.Msg.PYTHON_PYODIDE_TOOL,title:Ve.Msg.PYTHON_PYODIDE_TOOL}),e.changeTo("output"),e.get("tool")}}constructor(){super();const e=wx()(ze.HTMLTemplate.get("html/statusbar/statusbar-tool.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}onMounted(){}onUnmounted(){}resize(){}}class Vz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-game.html",new ze.HTMLTemplate('\r\n
\r\n
{{d.epoch}}: 0
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["game"],Vz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"game",id:"game",name:Ve.Msg.PYTHON_PYODIDE_GAME,title:Ve.Msg.PYTHON_PYODIDE_GAME}),e.changeTo("output"),e.get("game")}}#m=null;#g=null;#_=null;#y=null;#v=null;#b=null;#T=10;#x=500;#E=[];#w=!1;#I=0;#A=null;constructor(){super();const e=wx()(ze.HTMLTemplate.get("html/statusbar/statusbar-game.html").render({epoch:Ve.Msg.PYTHON_PYODIDE_GAME_EPOCH,start:Ve.Msg.PYTHON_PYODIDE_GAME_START,pause:Ve.Msg.PYTHON_PYODIDE_GAME_PAUSE,random:Ve.Msg.PYTHON_PYODIDE_GAME_RANDOM,reset:Ve.Msg.PYTHON_PYODIDE_GAME_RESET}));this.setContent(e),this.#m=e.find(".start-btn"),this.#g=e.find(".pause-btn"),this.#_=e.find(".random-btn"),this.#y=e.find(".reset-btn"),this.#v=e.find(".generation"),this.#b=e.find(".grid"),this.#S()}#S(){this.#m.click(()=>this.startGame()),this.#g.click(()=>this.pauseGame()),this.#_.click(()=>this.randomInitialize()),this.#y.click(()=>this.resetGame())}initializeGrid(){this.#b.empty(),this.#E=[];for(let e=0;ethis.toggleCell(e,t)),this.#b.append(n)}}this.updateGridDisplay()}toggleCell(e,t){this.#w||(this.#E[e][t]=0===this.#E[e][t]?1:0,this.updateGridDisplay())}updateGridDisplay(){const e=this.#b.children(".cell");for(let t=0;t=0&&s=0&&othis.nextGeneration(),this.#x),this.updateButtons())}pauseGame(){this.#w&&(this.#w=!1,clearInterval(this.#A),this.updateButtons())}randomInitialize(){if(!this.#w){for(let e=0;e{let s=`${e}-${t}`;return n&&(s+=`-${n}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},Gz=Symbol("namespaceContextKey"),Hz=e=>{const t=e||(OM()?GC(Gz,pI(jz)):pI(jz));return ZM(()=>yI(t)||jz)},Wz=(e,t)=>{const n=Hz(t);return{namespace:n,b:(t="")=>Yz(n.value,e,t,"",""),e:t=>t?Yz(n.value,e,"",t,""):"",m:t=>t?Yz(n.value,e,"","",t):"",be:(t,i)=>t&&i?Yz(n.value,e,t,i,""):"",em:(t,i)=>t&&i?Yz(n.value,e,"",t,i):"",bm:(t,i)=>t&&i?Yz(n.value,e,t,"",i):"",bem:(t,i,r)=>t&&i&&r?Yz(n.value,e,t,i,r):"",is:(e,...t)=>{const n=!(t.length>=1)||t[0];return e&&n?`is-${e}`:""},cssVar:e=>{const t={};for(const i in e)e[i]&&(t[`--${n.value}-${i}`]=e[i]);return t},cssVarName:e=>`--${n.value}-${e}`,cssVarBlock:t=>{const i={};for(const r in t)t[r]&&(i[`--${n.value}-${e}-${r}`]=t[r]);return i},cssVarBlockName:t=>`--${n.value}-${e}-${t}`}},Xz=e=>void 0===e,qz=e=>"boolean"==typeof e,Kz=e=>"number"==typeof e,Zz=e=>"undefined"!=typeof Element&&e instanceof Element;var Qz,Jz=Object.defineProperty,ej=Object.defineProperties,tj=Object.getOwnPropertyDescriptors,nj=Object.getOwnPropertySymbols,ij=Object.prototype.hasOwnProperty,rj=Object.prototype.propertyIsEnumerable,sj=(e,t,n)=>t in e?Jz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function oj(e,t){var n;const i=fI();var r,s;return TO(()=>{i.value=e()},(r=((e,t)=>{for(var n in t||(t={}))ij.call(t,n)&&sj(e,n,t[n]);if(nj)for(var n of nj(t))rj.call(t,n)&&sj(e,n,t[n]);return e})({},t),s={flush:null!=(n=null==t?void 0:t.flush)?n:"sync"},ej(r,tj(s)))),tI(i)}const aj="undefined"!=typeof window,lj=(Object.prototype.toString,e=>"function"==typeof e),uj=()=>{},cj=aj&&(null==(Qz=null==window?void 0:window.navigator)?void 0:Qz.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function dj(e){return"function"==typeof e?e():yI(e)}function hj(e,t){return function(...n){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(i).catch(r)})}}function pj(e,t=!0,n=!0,i=!1){let r,s,o=0,a=!0,l=uj;const u=()=>{r&&(clearTimeout(r),r=void 0,l(),l=uj)};return c=>{const d=dj(e),h=Date.now()-o,p=()=>s=c();return u(),d<=0?(o=Date.now(),p()):(h>d&&(n||!a)?(o=Date.now(),p()):t&&(s=new Promise((e,t)=>{l=i?t:e,r=setTimeout(()=>{o=Date.now(),a=!0,e(p()),u()},Math.max(0,d-h))})),n||r||(r=setTimeout(()=>a=!0,d)),a=!1,s)}}function fj(e){return!!zE()&&(jE(e),!0)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function mj(e,t=200,n=!1,i=!0,r=!1){return hj(pj(t,n,i,r),e)}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function gj(e,t,n={}){const{immediate:i=!0}=n,r=pI(!1);let s=null;function o(){s&&(clearTimeout(s),s=null)}function a(){r.value=!1,o()}function l(...n){o(),r.value=!0,s=setTimeout(()=>{r.value=!1,s=null,e(...n)},dj(t))}return i&&(r.value=!0,aj&&l()),fj(a),{isPending:tI(r),start:l,stop:a}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const _j={current:0},yj=pI(0),vj=Symbol("elZIndexContextKey"),bj=Symbol("zIndexContextKey"),Tj=e=>{const t=OM()?GC(vj,_j):_j,n=e||(OM()?GC(bj,void 0):void 0),i=ZM(()=>{const e=yI(n);return Kz(e)?e:2e3}),r=ZM(()=>i.value+yj.value);return!aj&&GC(vj),{initialZIndex:i,currentZIndex:r,nextZIndex:()=>(t.current++,yj.value=t.current,r.value)}};const xj=Array.isArray;const Ej="object"==typeof global&&global&&global.Object===Object&&global;var wj="object"==typeof self&&self&&self.Object===Object&&self;const Ij=Ej||wj||Function("return this")();const Aj=Ij.Symbol;var Sj=Object.prototype,Cj=Sj.hasOwnProperty,Oj=Sj.toString,Mj=Aj?Aj.toStringTag:void 0;const kj=function(e){var t=Cj.call(e,Mj),n=e[Mj];try{e[Mj]=void 0;var i=!0}catch(e){}var r=Oj.call(e);return i&&(t?e[Mj]=n:delete e[Mj]),r};var Rj=Object.prototype.toString;const Nj=function(e){return Rj.call(e)};var Dj=Aj?Aj.toStringTag:void 0;const Fj=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Dj&&Dj in Object(e)?kj(e):Nj(e)};const Lj=function(e){return null!=e&&"object"==typeof e};const Pj=function(e){return"symbol"==typeof e||Lj(e)&&"[object Symbol]"==Fj(e)};var Bj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$j=/^\w*$/;const Uj=function(e,t){if(xj(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Pj(e))||($j.test(e)||!Bj.test(e)||null!=t&&e in Object(t))};const Vj=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const zj=function(e){if(!Vj(e))return!1;var t=Fj(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const jj=Ij["__core-js_shared__"];var Yj=function(){var e=/[^.]+$/.exec(jj&&jj.keys&&jj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const Gj=function(e){return!!Yj&&Yj in e};var Hj=Function.prototype.toString;const Wj=function(e){if(null!=e){try{return Hj.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Xj=/^\[object .+?Constructor\]$/,qj=Function.prototype,Kj=Object.prototype,Zj=qj.toString,Qj=Kj.hasOwnProperty,Jj=RegExp("^"+Zj.call(Qj).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const eY=function(e){return!(!Vj(e)||Gj(e))&&(zj(e)?Jj:Xj).test(Wj(e))};const tY=function(e,t){return null==e?void 0:e[t]};const nY=function(e,t){var n=tY(e,t);return eY(n)?n:void 0};const iY=nY(Object,"create");const rY=function(){this.__data__=iY?iY(null):{},this.size=0};const sY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var oY=Object.prototype.hasOwnProperty;const aY=function(e){var t=this.__data__;if(iY){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return oY.call(t,e)?t[e]:void 0};var lY=Object.prototype.hasOwnProperty;const uY=function(e){var t=this.__data__;return iY?void 0!==t[e]:lY.call(t,e)};const cY=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=iY&&void 0===t?"__lodash_hash_undefined__":t,this};function dY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1};const bY=function(e,t){var n=this.__data__,i=mY(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function TY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t(t,n)=>KY(t,n,yI(e)),KY=(e,t,n)=>WY(n,e,e).replace(/\{(\w+)\}/g,(e,n)=>{var i;return`${null!=(i=null==t?void 0:t[n])?i:`{${n}}`}`}),ZY=Symbol("localeContextKey"),QY=e=>{const t=e||GC(ZY,pI());return(e=>({lang:ZM(()=>yI(e).name),locale:hI(e)?e:pI(e),t:qY(e)}))(ZM(()=>t.value||XY))};const JY=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t{if(!jx(e)||jx(n=e)&&n[eG])return e;var n;const{values:i,required:r,default:s,type:o,validator:a}=e,l=i||a?n=>{let r=!1,o=[];if(i&&(o=Array.from(i),Fx(e,"default")&&o.push(s),r||(r=o.includes(n))),a&&(r||(r=a(n))),!r&&o.length>0){const e=[...new Set(o)].map(e=>JSON.stringify(e)).join(", ");ik(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${e}], got value ${JSON.stringify(n)}.`)}return r}:void 0,u={type:o,required:!!r,validator:l,[eG]:!0};return Fx(e,"default")&&(u.default=s),u},nG=e=>JY(Object.entries(e).map(([e,t])=>[e,tG(t,e)])),iG=["","default","small","large"],rG=tG({type:String,values:iG,required:!1}),sG=Symbol("size"),oG=Symbol("emptyValuesContextKey"),aG=nG({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>(e=Ux(e)?e():e,Lx(e)?e.every(e=>!e):!e)}}),lG=e=>Object.keys(e),uG=pI();function cG(e,t=void 0){const n=OM()?GC(zz,uG):uG;return e?ZM(()=>{var i,r;return null!=(r=null==(i=n.value)?void 0:i[e])?r:t}):n}const dG=(e,t,n=!1)=>{var i;const r=!!OM(),s=r?cG():void 0,o=null!=(i=null==t?void 0:t.provide)?i:r?YC:void 0;if(!o)return;const a=ZM(()=>{const t=yI(e);return(null==s?void 0:s.value)?hG(s.value,t):t});return o(zz,a),o(ZY,ZM(()=>a.value.locale)),o(Gz,ZM(()=>a.value.namespace)),o(bj,ZM(()=>a.value.zIndex)),o(sG,{size:ZM(()=>a.value.size||"")}),o(oG,ZM(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),!n&&uG.value||(uG.value=a.value),a},hG=(e,t)=>{const n=[...new Set([...lG(e),...lG(t)])],i={};for(const r of n)i[r]=void 0!==t[r]?t[r]:e[r];return i},pG=nG({a11y:{type:Boolean,default:!0},locale:{type:Object},size:rG,button:{type:Object},card:{type:Object},dialog:{type:Object},link:{type:Object},experimentalFeatures:{type:Object},keyboardNavigation:{type:Boolean,default:!0},message:{type:Object},zIndex:Number,namespace:{type:String,default:"el"},...aG}),fG={placement:"top"},mG=tS({name:"ElConfigProvider",props:pG,setup(e,{slots:t}){const n=dG(e);return wO(()=>e.message,e=>{var t,i;Object.assign(fG,null!=(i=null==(t=null==n?void 0:n.value)?void 0:t.message)?i:{},null!=e?e:{})},{immediate:!0,deep:!0}),()=>sC(t,"default",{config:null==n?void 0:n.value})}}),gG=(e,t)=>{if(e.install=n=>{for(const i of[e,...Object.values(null!=t?t:{})])n.component(i.name,i)},t)for(const[n,i]of Object.entries(t))e[n]=i;return e},_G=e=>(e.install=Cx,e),yG=gG(mG); +let mk;const gk="undefined"!=typeof window&&window.trustedTypes;if(gk)try{mk=gk.createPolicy("vue",{createHTML:e=>e})}catch(e){}const _k=mk?e=>mk.createHTML(e):e=>e,yk="undefined"!=typeof document?document:null,vk=yk&&yk.createElement("template"),bk={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?yk.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?yk.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?yk.createElement(e,{is:n}):yk.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>yk.createTextNode(e),createComment:e=>yk.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yk.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{vk.innerHTML=_k("svg"===i?`${e}`:"mathml"===i?`${e}`:e);const r=vk.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Tk="transition",xk="animation",Ek=Symbol("_vtc"),wk={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ik=Lx({},qA,wk),Ak=(e=>(e.displayName="Transition",e.props=Ik,e))((e,{slots:t})=>nk(QA,Ok(e),t)),Sk=(e,t=[])=>{Ux(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ck=e=>!!e&&(Ux(e)?e.some(e=>e.length>1):e.length>1);function Ok(e){const t={};for(const n in e)n in wk||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:i,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,f=function(e){if(null==e)return null;if(Wx(e))return[Mk(e.enter),Mk(e.leave)];{const t=Mk(e);return[t,t]}}(r),m=f&&f[0],g=f&&f[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:v,onLeave:b,onLeaveCancelled:T,onBeforeAppear:x=_,onAppear:E=y,onAppearCancelled:w=v}=t,I=(e,t,n,i)=>{e._enterCancelled=i,Rk(e,t?c:a),Rk(e,t?u:o),n&&n()},A=(e,t)=>{e._isLeaving=!1,Rk(e,d),Rk(e,p),Rk(e,h),t&&t()},S=e=>(t,n)=>{const r=e?E:y,o=()=>I(t,e,n);Sk(r,[t,o]),Nk(()=>{Rk(t,e?l:s),kk(t,e?c:a),Ck(r)||Fk(t,i,m,o)})};return Lx(t,{onBeforeEnter(e){Sk(_,[e]),kk(e,s),kk(e,o)},onBeforeAppear(e){Sk(x,[e]),kk(e,l),kk(e,u)},onEnter:S(!1),onAppear:S(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>A(e,t);kk(e,d),e._enterCancelled?(kk(e,h),$k()):($k(),kk(e,h)),Nk(()=>{e._isLeaving&&(Rk(e,d),kk(e,p),Ck(b)||Fk(e,i,g,n))}),Sk(b,[e,n])},onEnterCancelled(e){I(e,!1,void 0,!0),Sk(v,[e])},onAppearCancelled(e){I(e,!0,void 0,!0),Sk(w,[e])},onLeaveCancelled(e){A(e),Sk(T,[e])}})}function Mk(e){return pE(e)}function kk(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ek]||(e[Ek]=new Set)).add(t)}function Rk(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));const n=e[Ek];n&&(n.delete(t),n.size||(e[Ek]=void 0))}function Nk(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Dk=0;function Fk(e,t,n,i){const r=e._endId=++Dk,s=()=>{r===e._endId&&i()};if(null!=n)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Lk(e,t);if(!o)return i();const u=o+"end";let c=0;const d=()=>{e.removeEventListener(u,h),s()},h=t=>{t.target===e&&++c>=l&&d()};setTimeout(()=>{c(n[e]||"").split(", "),r=i(`${Tk}Delay`),s=i(`${Tk}Duration`),o=Pk(r,s),a=i(`${xk}Delay`),l=i(`${xk}Duration`),u=Pk(a,l);let c=null,d=0,h=0;t===Tk?o>0&&(c=Tk,d=o,h=s.length):t===xk?u>0&&(c=xk,d=u,h=l.length):(d=Math.max(o,u),c=d>0?o>u?Tk:xk:null,h=c?c===Tk?s.length:l.length:0);return{type:c,timeout:d,propCount:h,hasTransform:c===Tk&&/\b(transform|all)(,|$)/.test(i(`${Tk}Property`).toString())}}function Pk(e,t){for(;e.lengthBk(t)+Bk(e[n])))}function Bk(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function $k(){return document.body.offsetHeight}const Uk=Symbol("_vod"),Vk=Symbol("_vsh"),zk={beforeMount(e,{value:t},{transition:n}){e[Uk]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):jk(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),jk(e,!0),i.enter(e)):i.leave(e,()=>{jk(e,!1)}):jk(e,t))},beforeUnmount(e,{value:t}){jk(e,t)}};function jk(e,t){e.style.display=t?e[Uk]:"none",e[Vk]=!t}const Yk=Symbol("");function Gk(e){const t=NM();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Wk(e,n))};const i=()=>{const i=e(t.proxy);t.ce?Wk(t.ce,i):Hk(t.subTree,i),n(i)};GS(()=>{uA(i)}),YS(()=>{CO(i,Rx,{flush:"post"});const e=new MutationObserver(i);e.observe(t.subTree.el.parentNode,{childList:!0}),XS(()=>e.disconnect())})}function Hk(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Hk(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)Wk(e.el,t);else if(e.type===ZO)e.children.forEach(e=>Hk(e,t));else if(e.type===eM){let{el:n,anchor:i}=e;for(;n&&(Wk(n,t),n!==i);)n=n.nextSibling}}function Wk(e,t){if(1===e.nodeType){const n=e.style;let i="";for(const e in t)n.setProperty(`--${e}`,t[e]),i+=`--${e}: ${t[e]};`;n[Yk]=i}}const Xk=/(^|;)\s*display\s*:/;const qk=/\s*!important$/;function Kk(e,t,n){if(Ux(n))n.forEach(n=>Kk(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=Qk[t];if(n)return n;let i=rE(t);if("filter"!==i&&i in e)return Qk[t]=i;i=aE(i);for(let n=0;n{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();ZI(function(e,t){if(Ux(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=lR(),n}(i,r);nR(e,n,o,a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const sR=/(?:Once|Passive|Capture)$/;let oR=0;const aR=Promise.resolve(),lR=()=>oR||(aR.then(()=>oR=0),oR=Date.now());const uR=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const cR={}; +/*! #__NO_SIDE_EFFECTS__ */function dR(e,t,n){const i=sS(e,t);Qx(i)&&Lx(i,t);class r extends fR{constructor(e){super(i,e,n)}}return r.def=i,r} +/*! #__NO_SIDE_EFFECTS__ */const hR=(e,t)=>dR(e,t,tN),pR="undefined"!=typeof HTMLElement?HTMLElement:class{};class fR extends pR{constructor(e,t={},n=eN){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==eN?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof fR){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,oA(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(const t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(e,t=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:n,styles:i}=e;let r;if(n&&!Ux(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=pE(this._props[e])),(r||(r=Object.create(null)))[rE(e)]=!0)}this._numberProps=r,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){__VUE_PROD_DEVTOOLS__&&!e.name&&(e.name="VueElement"),this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const t=this._instance&&this._instance.exposed;if(t)for(const e in t)$x(this,e)||Object.defineProperty(this,e,{get:()=>xI(t[e])})}_resolveProps(e){const{props:t}=e,n=Ux(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(const e of n.map(rE))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const t=this.hasAttribute(e);let n=t?this.getAttribute(e):cR;const i=rE(e);t&&this._numberProps&&this._numberProps[i]&&(n=pE(n)),this._setProp(i,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,i=!1){if(t!==this._props[e]&&(t===cR?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),i&&this._instance&&this._update(),n)){const n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(oE(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(oE(e),t+""):t||this.removeAttribute(oE(e)),n&&n.observe(this,{attributes:!0})}}_update(){QR(this._createVNode(),this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const t=_M(this._def,Lx(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,Qx(t[0])?Lx({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),oE(e)!==e&&t(oE(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}const n=this._nonce;for(let t=e.length-1;t>=0;t--){const i=document.createElement("style");n&&i.setAttribute("nonce",n),i.textContent=e[t],this.shadowRoot.prepend(i)}}_parseSlots(){const e=this._slots={};let t;for(;t=this.firstChild;){const n=1===t.nodeType&&t.getAttribute("slot")||"default";(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n(delete e.props.mode,e))({name:"TransitionGroup",props:Lx({},Ik,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=NM(),i=WA();let r,s;return HS(()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const i=e.cloneNode(),r=e[Ek];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&i.classList.remove(e))});n.split(/\s+/).forEach(e=>e&&i.classList.add(e)),i.style.display="none";const s=1===t.nodeType?t:t.parentNode;s.appendChild(i);const{hasTransform:o}=Lk(i);return s.removeChild(i),o}(r[0].el,n.vnode.el,t))return;r.forEach(wR),r.forEach(IR);const i=r.filter(AR);$k(),i.forEach(e=>{const n=e.el,i=n.style;kk(n,t),i.transform=i.webkitTransform=i.transitionDuration="";const r=n[bR]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[bR]=null,Rk(n,t))};n.addEventListener("transitionend",r)})}),()=>{const o=hI(e),a=Ok(o);let l=o.tag||ZO;if(r=[],s)for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return Ux(t)?e=>cE(t,e):t};function CR(e){e.target.composing=!0}function OR(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const MR=Symbol("_assign"),kR={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[MR]=SR(r);const s=i||r.props&&"number"===r.props.type;nR(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=hE(i)),e[MR](i)}),n&&nR(e,"change",()=>{e.value=e.value.trim()}),t||(nR(e,"compositionstart",CR),nR(e,"compositionend",OR),nR(e,"change",OR))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(e[MR]=SR(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:hE(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}},RR={deep:!0,created(e,t,n){e[MR]=SR(n),nR(e,"change",()=>{const t=e._modelValue,n=PR(e),i=e.checked,r=e[MR];if(Ux(t)){const e=PE(t,n),s=-1!==e;if(i&&!s)r(t.concat(n));else if(!i&&s){const n=[...t];n.splice(e,1),r(n)}}else if(zx(t)){const e=new Set(t);i?e.add(n):e.delete(n),r(e)}else r(BR(e,i))})},mounted:NR,beforeUpdate(e,t,n){e[MR]=SR(n),NR(e,t,n)}};function NR(e,{value:t,oldValue:n},i){let r;if(e._modelValue=t,Ux(t))r=PE(t,i.props.value)>-1;else if(zx(t))r=t.has(i.props.value);else{if(t===n)return;r=LE(t,BR(e,!0))}e.checked!==r&&(e.checked=r)}const DR={created(e,{value:t},n){e.checked=LE(t,n.props.value),e[MR]=SR(n),nR(e,"change",()=>{e[MR](PR(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[MR]=SR(i),t!==n&&(e.checked=LE(t,i.props.value))}},FR={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const r=zx(t);nR(e,"change",()=>{const t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?hE(PR(e)):PR(e));e[MR](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,oA(()=>{e._assigning=!1})}),e[MR]=SR(i)},mounted(e,{value:t}){LR(e,t)},beforeUpdate(e,t,n){e[MR]=SR(n)},updated(e,{value:t}){e._assigning||LR(e,t)}};function LR(e,t){const n=e.multiple,i=Ux(t);if(!n||i||zx(t)){for(let r=0,s=e.options.length;rString(e)===String(o)):PE(t,o)>-1}else s.selected=t.has(o);else if(LE(PR(s),t))return void(e.selectedIndex!==r&&(e.selectedIndex=r))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function PR(e){return"_value"in e?e._value:e.value}function BR(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const $R={created(e,t,n){VR(e,t,n,null,"created")},mounted(e,t,n){VR(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){VR(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){VR(e,t,n,i,"updated")}};function UR(e,t){switch(e){case"SELECT":return FR;case"TEXTAREA":return kR;default:switch(t){case"checkbox":return RR;case"radio":return DR;default:return kR}}}function VR(e,t,n,i,r){const s=UR(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,i)}const zR=["ctrl","shift","alt","meta"],jR={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>zR.some(n=>e[`${n}Key`]&&!t.includes(n))},YR=(e,t)=>{const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=(n,...i)=>{for(let e=0;e{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=n=>{if(!("key"in n))return;const i=oE(n.key);return t.some(e=>e===i||GR[e]===i)?e(n):void 0})},WR=Lx({patchProp:(e,t,n,i,r,s)=>{const o="svg"===r;"class"===t?function(e,t,n){const i=e[Ek];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,o):"style"===t?function(e,t,n){const i=e.style,r=Gx(n);let s=!1;if(n&&!r){if(t)if(Gx(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Kk(i,t,"")}else for(const e in t)null==n[e]&&Kk(i,e,"");for(const e in n)"display"===e&&(s=!0),Kk(i,e,n[e])}else if(r){if(t!==n){const e=i[Yk];e&&(n+=";"+e),i.cssText=n,s=Xk.test(n)}}else t&&e.removeAttribute("style");Uk in e&&(e[Uk]=s?i.display:"",e[Vk]&&(i.display="none"))}(e,n,i):Dx(t)?Fx(t)||rR(e,t,0,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&uR(t)&&Yx(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(uR(t)&&Gx(n))return!1;return t in e}(e,t,i,o))?(tR(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||eR(e,t,i,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&Gx(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),eR(e,t,i,o)):tR(e,rE(t),i,0,t)}},bk);let XR,qR=!1;function KR(){return XR||(XR=fO(WR))}function ZR(){return XR=qR?XR:mO(WR),qR=!0,XR}const QR=(...e)=>{KR().render(...e)},JR=(...e)=>{ZR().hydrate(...e)},eN=(...e)=>{const t=KR().createApp(...e);const{mount:n}=t;return t.mount=e=>{const i=iN(e);if(!i)return;const r=t._component;Yx(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const s=n(i,!1,nN(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t},tN=(...e)=>{const t=ZR().createApp(...e);const{mount:n}=t;return t.mount=e=>{const t=iN(e);if(t)return n(t,!0,nN(t))},t};function nN(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function iN(e){if(Gx(e)){return document.querySelector(e)}return e}let rN=!1;const sN=()=>{rN||(rN=!0,kR.getSSRProps=({value:e})=>({value:e}),DR.getSSRProps=({value:e},t)=>{if(t.props&&LE(t.props.value,e))return{checked:!0}},RR.getSSRProps=({value:e},t)=>{if(Ux(e)){if(t.props&&PE(e,t.props.value)>-1)return{checked:!0}}else if(zx(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},$R.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=UR(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},zk.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})},oN=Symbol(""),aN=Symbol(""),lN=Symbol(""),uN=Symbol(""),cN=Symbol(""),dN=Symbol(""),hN=Symbol(""),pN=Symbol(""),fN=Symbol(""),mN=Symbol(""),gN=Symbol(""),_N=Symbol(""),yN=Symbol(""),vN=Symbol(""),bN=Symbol(""),TN=Symbol(""),xN=Symbol(""),EN=Symbol(""),wN=Symbol(""),IN=Symbol(""),AN=Symbol(""),SN=Symbol(""),CN=Symbol(""),ON=Symbol(""),MN=Symbol(""),kN=Symbol(""),RN=Symbol(""),NN=Symbol(""),DN=Symbol(""),FN=Symbol(""),LN=Symbol(""),PN=Symbol(""),BN=Symbol(""),$N=Symbol(""),UN=Symbol(""),VN=Symbol(""),zN=Symbol(""),jN=Symbol(""),YN=Symbol(""),GN={[oN]:"Fragment",[aN]:"Teleport",[lN]:"Suspense",[uN]:"KeepAlive",[cN]:"BaseTransition",[dN]:"openBlock",[hN]:"createBlock",[pN]:"createElementBlock",[fN]:"createVNode",[mN]:"createElementVNode",[gN]:"createCommentVNode",[_N]:"createTextVNode",[yN]:"createStaticVNode",[vN]:"resolveComponent",[bN]:"resolveDynamicComponent",[TN]:"resolveDirective",[xN]:"resolveFilter",[EN]:"withDirectives",[wN]:"renderList",[IN]:"renderSlot",[AN]:"createSlots",[SN]:"toDisplayString",[CN]:"mergeProps",[ON]:"normalizeClass",[MN]:"normalizeStyle",[kN]:"normalizeProps",[RN]:"guardReactiveProps",[NN]:"toHandlers",[DN]:"camelize",[FN]:"capitalize",[LN]:"toHandlerKey",[PN]:"setBlockTracking",[BN]:"pushScopeId",[$N]:"popScopeId",[UN]:"withCtx",[VN]:"unref",[zN]:"isRef",[jN]:"withMemo",[YN]:"isMemoSame"};const HN={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function WN(e,t,n,i,r,s,o,a=!1,l=!1,u=!1,c=HN){return e&&(a?(e.helper(dN),e.helper(iD(e.inSSR,u))):e.helper(nD(e.inSSR,u)),o&&e.helper(EN)),{type:13,tag:t,props:n,children:i,patchFlag:r,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:u,loc:c}}function XN(e,t=HN){return{type:17,loc:t,elements:e}}function qN(e,t=HN){return{type:15,loc:t,properties:e}}function KN(e,t){return{type:16,loc:HN,key:Gx(e)?ZN(e,!0):e,value:t}}function ZN(e,t=!1,n=HN,i=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:i}}function QN(e,t=HN){return{type:8,loc:t,children:e}}function JN(e,t=[],n=HN){return{type:14,loc:n,callee:e,arguments:t}}function eD(e,t=void 0,n=!1,i=!1,r=HN){return{type:18,params:e,returns:t,newline:n,isSlot:i,loc:r}}function tD(e,t,n,i=!0){return{type:19,test:e,consequent:t,alternate:n,newline:i,loc:HN}}function nD(e,t){return e||t?fN:mN}function iD(e,t){return e||t?hN:pN}function rD(e,{helper:t,removeHelper:n,inSSR:i}){e.isBlock||(e.isBlock=!0,n(nD(i,e.isComponent)),t(dN),t(iD(i,e.isComponent)))}const sD=new Uint8Array([123,123]),oD=new Uint8Array([125,125]);function aD(e){return e>=97&&e<=122||e>=65&&e<=90}function lD(e){return 32===e||10===e||9===e||12===e||13===e}function uD(e){return 47===e||62===e||lD(e)}function cD(e){const t=new Uint8Array(e.length);for(let n=0;n4===e.type&&e.isStatic;function vD(e){switch(e){case"Teleport":case"teleport":return aN;case"Suspense":case"suspense":return lN;case"KeepAlive":case"keep-alive":return uN;case"BaseTransition":case"base-transition":return cN}}const bD=/^\d|[^\$\w\xA0-\uFFFF]/,TD=e=>!bD.test(e),xD=/[A-Za-z_$\xA0-\uFFFF]/,ED=/[\.\?\w$\xA0-\uFFFF]/,wD=/\s+[.[]\s*|\s*[.[]\s+/g,ID=e=>4===e.type?e.content:e.loc.source,AD=e=>{const t=ID(e).trim().replace(wD,e=>e.trim());let n=0,i=[],r=0,s=0,o=null;for(let e=0;e|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,CD=e=>SD.test(ID(e));function OD(e,t,n=!1){for(let i=0;i4===e.key.type&&e.key.content===i)}return n}function UD(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}const VD=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,zD={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:Nx,isPreTag:Nx,isIgnoreNewlineTag:Nx,isCustomElement:Nx,onError:mD,onWarn:gD,comments:!1,prefixIdentifiers:!1};let jD=zD,YD=null,GD="",HD=null,WD=null,XD="",qD=-1,KD=-1,ZD=0,QD=!1,JD=null;const eF=[],tF=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=sD,this.delimiterClose=oD,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=sD,this.delimiterClose=oD}getPos(e){let t=1,n=e+1;for(let i=this.newlines.length-1;i>=0;i--){const r=this.newlines[i];if(e>r){t=i+2,n=e-r;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?uD(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||lD(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart=e||(28===this.state?this.currentSequence===dD.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(eF,{onerr:xF,ontext(e,t){oF(rF(e,t),e,t)},ontextentity(e,t,n){oF(e,t,n)},oninterpolation(e,t){if(QD)return oF(rF(e,t),e,t);let n=e+tF.delimiterOpen.length,i=t-tF.delimiterClose.length;for(;lD(GD.charCodeAt(n));)n++;for(;lD(GD.charCodeAt(i-1));)i--;let r=rF(n,i);r.includes("&")&&(r=jD.decodeEntities(r,!1)),gF({type:5,content:TF(r,!1,_F(n,i)),loc:_F(e,t)})},onopentagname(e,t){const n=rF(e,t);HD={type:1,tag:n,ns:jD.getNamespace(n,eF[0],jD.ns),tagType:0,props:[],children:[],loc:_F(e-1,t),codegenNode:void 0}},onopentagend(e){sF(e)},onclosetag(e,t){const n=rF(e,t);if(!jD.isVoidTag(n)){let i=!1;for(let e=0;e0&&xF(24,eF[0].loc.start.offset);for(let n=0;n<=e;n++){aF(eF.shift(),t,n(7===e.type?e.rawName:e.name)===n)&&xF(2,t)},onattribend(e,t){if(HD&&WD){if(vF(WD.loc,t),0!==e)if(XD.includes("&")&&(XD=jD.decodeEntities(XD,!0)),6===WD.type)"class"===WD.name&&(XD=mF(XD).trim()),1!==e||XD||xF(13,t),WD.value={type:2,content:XD,loc:1===e?_F(qD,KD):_F(qD-1,KD+1)},tF.inSFCRoot&&"template"===HD.tag&&"lang"===WD.name&&XD&&"html"!==XD&&tF.enterRCDATA(cD("{const r=t.start.offset+n;return TF(e,!1,_F(r,r+e.length),0,i?1:0)},a={source:o(s.trim(),n.indexOf(s,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let l=r.trim().replace(iF,"").trim();const u=r.indexOf(l),c=l.match(nF);if(c){l=l.replace(nF,"").trim();const e=c[1].trim();let t;if(e&&(t=n.indexOf(e,u+l.length),a.key=o(e,t,!0)),c[2]){const i=c[2].trim();i&&(a.index=o(i,n.indexOf(i,a.key?t+e.length:u+l.length),!0))}}l&&(a.value=o(l,u,!0));return a}(WD.exp));let t=-1;"bind"===WD.name&&(t=WD.modifiers.findIndex(e=>"sync"===e.content))>-1&&fD("COMPILER_V_BIND_SYNC",jD,WD.loc,WD.rawName)&&(WD.name="model",WD.modifiers.splice(t,1))}7===WD.type&&"pre"===WD.name||HD.props.push(WD)}XD="",qD=KD=-1},oncomment(e,t){jD.comments&&gF({type:3,content:rF(e,t),loc:_F(e-4,t+3)})},onend(){const e=GD.length;for(let t=0;t64&&n<91)||vD(e)||jD.isBuiltInComponent&&jD.isBuiltInComponent(e)||jD.isNativeTag&&!jD.isNativeTag(e))return!0;var n;for(let e=0;e6===e.type&&"inline-template"===e.name);n&&fD("COMPILER_INLINE_TEMPLATE",jD,n.loc)&&e.children.length&&(n.value={type:2,content:rF(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:n.loc})}}function lF(e,t){let n=e;for(;GD.charCodeAt(n)!==t&&n>=0;)n--;return n}const uF=new Set(["if","else","else-if","for","slot"]);function cF({tag:e,props:t}){if("template"===e)for(let e=0;e0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{const e=a.codegenNode;if(13===e.type){const t=e.patchFlag;if((void 0===t||512===t||1===t)&&MF(a,n)>=2){const t=kF(a);t&&(e.props=n.hoist(t))}e.dynamicProps&&(e.dynamicProps=n.hoist(e.dynamicProps))}}}else if(12===a.type){if((i?0:SF(a,n))>=2){o.push(a);continue}}if(1===a.type){const t=1===a.tagType;t&&n.scopes.vSlot++,AF(a,e,n,!1,r),t&&n.scopes.vSlot--}else if(11===a.type)AF(a,e,n,1===a.children.length,!0);else if(9===a.type)for(let t=0;te.key===t||e.key.content===t);return n&&n.value}}o.length&&n.transformHoist&&n.transformHoist(s,n,e)}function SF(e,t){const{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;const i=n.get(e);if(void 0!==i)return i;const r=e.codegenNode;if(13!==r.type)return 0;if(r.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0===r.patchFlag){let i=3;const s=MF(e,t);if(0===s)return n.set(e,0),0;s1)for(let r=0;r`_${GN[w.helper(e)]}`,replaceNode(e){w.parent.children[w.childIndex]=w.currentNode=e},removeNode(e){const t=w.parent.children,n=e?t.indexOf(e):w.currentNode?w.childIndex:-1;e&&e!==w.currentNode?w.childIndex>n&&(w.childIndex--,w.onNodeRemoved()):(w.currentNode=null,w.onNodeRemoved()),w.parent.children.splice(n,1)},onNodeRemoved:Rx,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){Gx(e)&&(e=ZN(e)),w.hoists.push(e);const t=ZN(`_hoisted_${w.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){const i=function(e,t,n=!1,i=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:i,needArraySpread:!1,loc:HN}}(w.cached.length,e,t,n);return w.cached.push(i),i}};return w.filters=new Set,w}function NF(e,t){const n=RF(e,t);DF(e,n),t.hoistStatic&&wF(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:i}=e;if(1===i.length){const n=i[0];if(IF(e,n)&&n.codegenNode){const i=n.codegenNode;13===i.type&&rD(i,t),e.codegenNode=i}else e.codegenNode=n}else if(i.length>1){let i=64;0,e.codegenNode=WN(t,n(oN),void 0,e.children,i,void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0,e.filters=[...n.filters]}function DF(e,t){t.currentNode=e;const{nodeTransforms:n}=t,i=[];for(let r=0;r{n--};for(;nt===e:t=>e.test(t);return(e,i)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some(ND))return;const s=[];for(let o=0;o`${GN[e]}: _${GN[e]}`;function BF(e,t={}){const n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:i=!1,filename:r="template.vue.html",scopeId:s=null,optimizeImports:o=!1,runtimeGlobalName:a="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:c=!1,isTS:d=!1,inSSR:h=!1}){const p={mode:t,prefixIdentifiers:n,sourceMap:i,filename:r,scopeId:s,optimizeImports:o,runtimeGlobalName:a,runtimeModuleName:l,ssrRuntimeModuleName:u,ssr:c,isTS:d,inSSR:h,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${GN[e]}`,push(e,t=-2,n){p.code+=e},indent(){f(++p.indentLevel)},deindent(e=!1){e?--p.indentLevel:f(--p.indentLevel)},newline(){f(p.indentLevel)}};function f(e){p.push("\n"+" ".repeat(e),0)}return p}(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:i,push:r,prefixIdentifiers:s,indent:o,deindent:a,newline:l,scopeId:u,ssr:c}=n,d=Array.from(e.helpers),h=d.length>0,p=!s&&"module"!==i;!function(e,t){const{ssr:n,prefixIdentifiers:i,push:r,newline:s,runtimeModuleName:o,runtimeGlobalName:a,ssrRuntimeModuleName:l}=t,u=a,c=Array.from(e.helpers);if(c.length>0&&(r(`const _Vue = ${u}\n`,-1),e.hoists.length)){r(`const { ${[fN,mN,gN,_N,yN].filter(e=>c.includes(e)).map(PF).join(", ")} } = _Vue\n`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:i}=t;i();for(let r=0;r0)&&l()),e.directives.length&&($F(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),$F(e.filters,"filter",n),l()),e.temps>0){r("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n",0),l()),c||r("return "),e.codegenNode?zF(e.codegenNode,n):r("null"),p&&(a(),r("}")),a(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function $F(e,t,{helper:n,push:i,newline:r,isTS:s}){const o=n("filter"===t?xN:"component"===t?vN:TN);for(let n=0;n3||!1;t.push("["),n&&t.indent(),VF(e,t,n),n&&t.deindent(),t.push("]")}function VF(e,t,n=!1,i=!0){const{push:r,newline:s}=t;for(let o=0;oe||"null")}([s,o,a,f,u]),t),n(")"),d&&n(")");c&&(n(", "),zF(c,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:i,pure:r}=t,s=Gx(e.callee)?e.callee:i(e.callee);r&&n(LF);n(s+"(",-2,e),VF(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:i,deindent:r,newline:s}=t,{properties:o}=e;if(!o.length)return void n("{}",-2,e);const a=o.length>1||!1;n(a?"{":"{ "),a&&i();for(let e=0;e "),(l||a)&&(n("{"),i());o?(l&&n("return "),Ux(o)?UF(o,t):zF(o,t)):a&&zF(a,t);(l||a)&&(r(),n("}"));u&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:i,alternate:r,newline:s}=e,{push:o,indent:a,deindent:l,newline:u}=t;if(4===n.type){const e=!TD(n.content);e&&o("("),jF(n,t),e&&o(")")}else o("("),zF(n,t),o(")");s&&a(),t.indentLevel++,s||o(" "),o("? "),zF(i,t),t.indentLevel--,s&&u(),s||o(" "),o(": ");const c=19===r.type;c||t.indentLevel++;zF(r,t),c||t.indentLevel--;s&&l(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:i,indent:r,deindent:s,newline:o}=t,{needPauseTracking:a,needArraySpread:l}=e;l&&n("[...(");n(`_cache[${e.index}] || (`),a&&(r(),n(`${i(PN)}(-1`),e.inVOnce&&n(", true"),n("),"),o(),n("("));n(`_cache[${e.index}] = `),zF(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),o(),n(`${i(PN)}(1),`),o(),n(`_cache[${e.index}]`),s());n(")"),l&&n(")]")}(e,t);break;case 21:VF(e.body,t,!0,!1)}}function jF(e,t){const{content:n,isStatic:i}=e;t.push(i?JSON.stringify(n):n,-3,e)}function YF(e,t){for(let n=0;nfunction(e,t,n,i){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const i=t.exp?t.exp.loc:e.loc;n.onError(_D(28,t.loc)),t.exp=ZN("true",!1,i)}0;if("if"===t.name){const r=WF(e,t),s={type:9,loc:yF(e.loc),branches:[r]};if(n.replaceNode(s),i)return i(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const o=r[s];if(o&&3===o.type)n.removeNode(o);else{if(!o||2!==o.type||o.content.trim().length){if(o&&9===o.type){"else-if"===t.name&&void 0===o.branches[o.branches.length-1].condition&&n.onError(_D(30,e.loc)),n.removeNode();const r=WF(e,t);0,o.branches.push(r);const s=i&&i(o,r,!1);DF(r,n),s&&s(),n.currentNode=null}else n.onError(_D(30,e.loc));break}n.removeNode(o)}}}}(e,t,n,(e,t,i)=>{const r=n.parent.children;let s=r.indexOf(e),o=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(o+=e.branches.length)}return()=>{if(i)e.codegenNode=XF(t,o,n);else{const i=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);i.alternate=XF(t,o+e.branches.length-1,n)}}}));function WF(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!OD(e,"for")?e.children:[e],userKey:MD(e,"key"),isTemplateIf:n}}function XF(e,t,n){return e.condition?tD(e.condition,qF(e,t,n),JN(n.helper(gN),['""',"true"])):qF(e,t,n)}function qF(e,t,n){const{helper:i}=n,r=KN("key",ZN(`${t}`,!1,HN,2)),{children:s}=e,o=s[0];if(1!==s.length||1!==o.type){if(1===s.length&&11===o.type){const e=o.codegenNode;return BD(e,r,n),e}{let t=64;return WN(n,i(oN),qN([r]),s,t,void 0,void 0,!0,!1,!1,e.loc)}}{const e=o.codegenNode,t=14===(a=e).type&&a.callee===jN?a.arguments[1].returns:a;return 13===t.type&&rD(t,n),BD(t,r,n),e}var a}const KF=(e,t,n)=>{const{modifiers:i,loc:r}=e,s=e.arg;let{exp:o}=e;if(o&&4===o.type&&!o.content.trim()&&(o=void 0),!o){if(4!==s.type||!s.isStatic)return n.onError(_D(52,s.loc)),{props:[KN(s,ZN("",!0,r))]};ZF(e),o=e.exp}return 4!==s.type?(s.children.unshift("("),s.children.push(') || ""')):s.isStatic||(s.content=`${s.content} || ""`),i.some(e=>"camel"===e.content)&&(4===s.type?s.isStatic?s.content=rE(s.content):s.content=`${n.helperString(DN)}(${s.content})`:(s.children.unshift(`${n.helperString(DN)}(`),s.children.push(")"))),n.inSSR||(i.some(e=>"prop"===e.content)&&QF(s,"."),i.some(e=>"attr"===e.content)&&QF(s,"^")),{props:[KN(s,o)]}},ZF=(e,t)=>{const n=e.arg,i=rE(n.content);e.exp=ZN(i,!1,n.loc)},QF=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},JF=FF("for",(e,t,n)=>{const{helper:i,removeHelper:r}=n;return function(e,t,n,i){if(!t.exp)return void n.onError(_D(31,t.loc));const r=t.forParseResult;if(!r)return void n.onError(_D(32,t.loc));eL(r,n);const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=n,{source:l,value:u,key:c,index:d}=r,h={type:11,loc:t.loc,source:l,valueAlias:u,keyAlias:c,objectIndexAlias:d,parseResult:r,children:DD(e)?e.children:[e]};n.replaceNode(h),a.vFor++;const p=i&&i(h);return()=>{a.vFor--,p&&p()}}(e,t,n,t=>{const s=JN(i(wN),[t.source]),o=DD(e),a=OD(e,"memo"),l=MD(e,"key",!1,!0);l&&7===l.type&&!l.exp&&ZF(l);let u=l&&(6===l.type?l.value?ZN(l.value.content,!0):void 0:l.exp);const c=l&&u?KN("key",u):null,d=4===t.source.type&&t.source.constType>0,h=d?64:l?128:256;return t.codegenNode=WN(n,i(oN),void 0,s,h,void 0,void 0,!0,!d,!1,e.loc),()=>{let l;const{children:h}=t;const p=1!==h.length||1!==h[0].type,f=FD(e)?e:o&&1===e.children.length&&FD(e.children[0])?e.children[0]:null;if(f?(l=f.codegenNode,o&&c&&BD(l,c,n)):p?l=WN(n,i(oN),c?qN([c]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(l=h[0].codegenNode,o&&c&&BD(l,c,n),l.isBlock!==!d&&(l.isBlock?(r(dN),r(iD(n.inSSR,l.isComponent))):r(nD(n.inSSR,l.isComponent))),l.isBlock=!d,l.isBlock?(i(dN),i(iD(n.inSSR,l.isComponent))):i(nD(n.inSSR,l.isComponent))),a){const e=eD(tL(t.parseResult,[ZN("_cached")]));e.body={type:21,body:[QN(["const _memo = (",a.exp,")"]),QN(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(YN)}(_cached, _memo)) return _cached`]),QN(["const _item = ",l]),ZN("_item.memo = _memo"),ZN("return _item")],loc:HN},s.arguments.push(e,ZN("_cache"),ZN(String(n.cached.length))),n.cached.push(null)}else s.arguments.push(eD(tL(t.parseResult),l,!0))}})});function eL(e,t){e.finalized||(e.finalized=!0)}function tL({value:e,key:t,index:n},i=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||ZN("_".repeat(t+1),!1))}([e,t,n,...i])}const nL=ZN("undefined",!1),iL=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=OD(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},rL=(e,t,n,i)=>eD(e,n,!1,!0,n.length?n[0].loc:i);function sL(e,t,n=rL){t.helper(UN);const{children:i,loc:r}=e,s=[],o=[];let a=t.scopes.vSlot>0||t.scopes.vFor>0;const l=OD(e,"slot",!0);if(l){const{arg:e,exp:t}=l;e&&!yD(e)&&(a=!0),s.push(KN(e||ZN("default",!0),n(t,void 0,i,r)))}let u=!1,c=!1;const d=[],h=new Set;let p=0;for(let e=0;e{const s=n(e,void 0,i,r);return t.compatConfig&&(s.isNonScopedSlot=!0),KN("default",s)};u?d.length&&d.some(e=>lL(e))&&(c?t.onError(_D(39,d[0].loc)):s.push(e(void 0,d))):s.push(e(void 0,i))}const f=a?2:aL(e.children)?3:1;let m=qN(s.concat(KN("_",ZN(f+"",!1))),r);return o.length&&(m=JN(t.helper(AN),[m,XN(o)])),{slots:m,hasDynamicSlots:a}}function oL(e,t,n){const i=[KN("name",e),KN("fn",t)];return null!=n&&i.push(KN("key",ZN(String(n),!0))),qN(i)}function aL(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:i}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:i}=e;const r=fL(i),s=MD(e,"is",!1,!0);if(s)if(r||pD("COMPILER_IS_ON_ELEMENT",t)){let e;if(6===s.type?e=s.value&&ZN(s.value.content,!0):(e=s.exp,e||(e=ZN("is",!1,s.arg.loc))),e)return JN(t.helper(bN),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(i=s.value.content.slice(4));const o=vD(i)||t.isBuiltInComponent(i);if(o)return n||t.helper(o),o;return t.helper(vN),t.components.add(i),UD(i,"component")}(e,t):`"${n}"`;const o=Wx(s)&&s.callee===bN;let a,l,u,c,d,h=0,p=o||s===aN||s===lN||!r&&("svg"===n||"foreignObject"===n||"math"===n);if(i.length>0){const n=dL(e,t,void 0,r,o);a=n.props,h=n.patchFlag,c=n.dynamicPropNames;const i=n.directives;d=i&&i.length?XN(i.map(e=>function(e,t){const n=[],i=uL.get(e);i?n.push(t.helperString(i)):(t.helper(TN),t.directives.add(e.name),n.push(UD(e.name,"directive")));const{loc:r}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=ZN("true",!1,r);n.push(qN(e.modifiers.map(e=>KN(e,t)),r))}return XN(n,e.loc)}(e,t))):void 0,n.shouldUseBlock&&(p=!0)}if(e.children.length>0){s===uN&&(p=!0,h|=1024);if(r&&s!==aN&&s!==uN){const{slots:n,hasDynamicSlots:i}=sL(e,t);l=n,i&&(h|=1024)}else if(1===e.children.length&&s!==aN){const n=e.children[0],i=n.type,r=5===i||8===i;r&&0===SF(n,t)&&(h|=1),l=r||2===i?n:e.children}else l=e.children}c&&c.length&&(u=function(e){let t="[";for(let n=0,i=e.length;n0;let p=!1,f=0,m=!1,g=!1,_=!1,y=!1,v=!1,b=!1;const T=[],x=e=>{u.length&&(c.push(qN(hL(u),a)),u=[]),e&&c.push(e)},E=()=>{t.scopes.vFor>0&&u.push(KN(ZN("ref_for",!0),ZN("true")))},w=({key:e,value:n})=>{if(yD(e)){const s=e.content,o=Dx(s);if(!o||i&&!r||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||eE(s)||(y=!0),o&&eE(s)&&(b=!0),o&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&SF(n,t)>0)return;"ref"===s?m=!0:"class"===s?g=!0:"style"===s?_=!0:"key"===s||T.includes(s)||T.push(s),!i||"class"!==s&&"style"!==s||T.includes(s)||T.push(s)}else v=!0};for(let r=0;r"prop"===e.content)&&(f|=32);const T=t.directiveTransforms[n];if(T){const{props:n,needRuntime:i}=T(l,e,t);!s&&n.forEach(w),b&&r&&!yD(r)?x(qN(n,a)):u.push(...n),i&&(d.push(l),Hx(i)&&uL.set(l,i))}else tE(n)||(d.push(l),h&&(p=!0))}}let I;if(c.length?(x(),I=c.length>1?JN(t.helper(CN),c,a):c[0]):u.length&&(I=qN(hL(u),a)),v?f|=16:(g&&!i&&(f|=2),_&&!i&&(f|=4),T.length&&(f|=8),y&&(f|=32)),p||0!==f&&32!==f||!(m||b||d.length>0)||(f|=512),!t.inSSR&&I)switch(I.type){case 15:let e=-1,n=-1,i=!1;for(let t=0;t{if(FD(e)){const{children:n,loc:i}=e,{slotName:r,slotProps:s}=function(e,t){let n,i='"default"';const r=[];for(let t=0;t0){const{props:i,directives:s}=dL(e,t,r,!1,!1);n=i,s.length&&t.onError(_D(36,s[0].loc))}return{slotName:i,slotProps:n}}(e,t),o=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),n.length&&(o[3]=eD([],n,!1,!1,i),a=4),t.scopeId&&!t.slotted&&(a=5),o.splice(a),e.codegenNode=JN(t.helper(IN),o,i)}};const gL=(e,t,n,i)=>{const{loc:r,modifiers:s,arg:o}=e;let a;if(e.exp||s.length||n.onError(_D(35,r)),4===o.type)if(o.isStatic){let e=o.content;0,e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`);a=ZN(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?lE(rE(e)):`on:${e}`,!0,o.loc)}else a=QN([`${n.helperString(LN)}(`,o,")"]);else a=o,a.children.unshift(`${n.helperString(LN)}(`),a.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let u=n.cacheHandlers&&!l&&!n.inVOnce;if(l){const e=AD(l),t=!(e||CD(l)),n=l.content.includes(";");0,(t||u&&e)&&(l=QN([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let c={props:[KN(a,l||ZN("() => {}",!1,r))]};return i&&(c=i(c)),u&&(c.props[0].value=n.cache(c.props[0].value)),c.props.forEach(e=>e.key.isHandlerKey=!0),c},_L=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let i,r=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name])||"template"===e.tag)))for(let e=0;e{if(1===e.type&&OD(e,"once",!0)){if(yL.has(e)||t.inVOnce||t.inSSR)return;return yL.add(e),t.inVOnce=!0,t.helper(PN),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}}},bL=(e,t,n)=>{const{exp:i,arg:r}=e;if(!i)return n.onError(_D(41,e.loc)),TL();const s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return n.onError(_D(44,i.loc)),TL();if(!o.trim()||!AD(i))return n.onError(_D(42,i.loc)),TL();const l=r||ZN("modelValue",!0),u=r?yD(r)?`onUpdate:${rE(r.content)}`:QN(['"onUpdate:" + ',r]):"onUpdate:modelValue";let c;c=QN([`${n.isTS?"($event: any)":"$event"} => ((`,i,") = $event)"]);const d=[KN(l,e.exp),KN(u,c)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map(e=>e.content).map(e=>(TD(e)?e:JSON.stringify(e))+": true").join(", "),n=r?yD(r)?`${r.content}Modifiers`:QN([r,' + "Modifiers"']):"modelModifiers";d.push(KN(n,ZN(`{ ${t} }`,!1,e.loc,2)))}return TL(d)};function TL(e=[]){return{props:e}}const xL=/[\w).+\-_$\]]/,EL=(e,t)=>{pD("COMPILER_FILTERS",t)&&(5===e.type?wL(e.content,t):1===e.type&&e.props.forEach(e=>{7===e.type&&"for"!==e.name&&e.exp&&wL(e.exp,t)}))};function wL(e,t){if(4===e.type)IL(e,t);else for(let n=0;n=0&&(e=n.charAt(t)," "===e);t--);e&&xL.test(e)||(c=!0)}}else void 0===o?(f=s+1,o=n.slice(0,s).trim()):g();function g(){m.push(n.slice(f,s).trim()),f=s+1}if(void 0===o?o=n.slice(0,s).trim():0!==f&&g(),m.length){for(s=0;s{if(1===e.type){const n=OD(e,"memo");if(!n||SL.has(e))return;return SL.add(e),()=>{const i=e.codegenNode||t.currentNode.codegenNode;i&&13===i.type&&(1!==e.tagType&&rD(i,t),e.codegenNode=JN(t.helper(jN),[n.exp,eD(void 0,i),"_cache",String(t.cached.length)]),t.cached.push(null))}}};function OL(e,t={}){const n=t.onError||mD,i="module"===t.mode;!0===t.prefixIdentifiers?n(_D(47)):i&&n(_D(48));t.cacheHandlers&&n(_D(49)),t.scopeId&&!i&&n(_D(50));const r=Lx({},t,{prefixIdentifiers:!1}),s=Gx(e)?EF(e,r):e,[o,a]=[[vL,HF,CL,JF,EL,mL,cL,iL,_L],{on:gL,bind:KF,model:bL}];return NF(s,Lx({},r,{nodeTransforms:[...o,...t.nodeTransforms||[]],directiveTransforms:Lx({},a,t.directiveTransforms||{})})),BF(s,r)}const ML=Symbol(""),kL=Symbol(""),RL=Symbol(""),NL=Symbol(""),DL=Symbol(""),FL=Symbol(""),LL=Symbol(""),PL=Symbol(""),BL=Symbol(""),$L=Symbol("");var UL;let VL;UL={[ML]:"vModelRadio",[kL]:"vModelCheckbox",[RL]:"vModelText",[NL]:"vModelSelect",[DL]:"vModelDynamic",[FL]:"withModifiers",[LL]:"withKeys",[PL]:"vShow",[BL]:"Transition",[$L]:"TransitionGroup"},Object.getOwnPropertySymbols(UL).forEach(e=>{GN[e]=UL[e]});const zL={parseMode:"html",isVoidTag:SE,isNativeTag:e=>wE(e)||IE(e)||AE(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return VL||(VL=document.createElement("div")),t?(VL.innerHTML=`
`,VL.children[0].getAttribute("foo")):(VL.innerHTML=e,VL.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?BL:"TransitionGroup"===e||"transition-group"===e?$L:void 0,getNamespace(e,t,n){let i=t?t.ns:n;if(t&&2===i)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(i=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(i=0);else t&&1===i&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(i=0));if(0===i){if("svg"===e)return 1;if("math"===e)return 2}return i}},jL=(e,t)=>{const n=TE(e);return ZN(JSON.stringify(n),!1,t,3)};function YL(e,t){return _D(e,t)}const GL=Ox("passive,once,capture"),HL=Ox("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),WL=Ox("left,right"),XL=Ox("onkeyup,onkeydown,onkeypress"),qL=(e,t)=>yD(e)&&"onclick"===e.content.toLowerCase()?ZN(t,!0):4!==e.type?QN(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e;const KL=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()};const ZL=[e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:ZN("style",!0,t.loc),exp:jL(t.value.content,t.loc),modifiers:[],loc:t.loc})})}],QL={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(YL(53,r)),t.children.length&&(n.onError(YL(54,r)),t.children.length=0),{props:[KN(ZN("innerHTML",!0,r),i||ZN("",!0))]}},text:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(YL(55,r)),t.children.length&&(n.onError(YL(56,r)),t.children.length=0),{props:[KN(ZN("textContent",!0),i?SF(i,n)>0?i:JN(n.helperString(SN),[i],r):ZN("",!0))]}},model:(e,t,n)=>{const i=bL(e,t,n);if(!i.props.length||1===t.tagType)return i;e.arg&&n.onError(YL(58,e.arg.loc));const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let o=RL,a=!1;if("input"===r||s){const i=MD(t,"type");if(i){if(7===i.type)o=DL;else if(i.value)switch(i.value.content){case"radio":o=ML;break;case"checkbox":o=kL;break;case"file":a=!0,n.onError(YL(59,e.loc))}}else(function(e){return e.props.some(e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic))})(t)&&(o=DL)}else"select"===r&&(o=NL);a||(i.needRuntime=n.helper(o))}else n.onError(YL(57,e.loc));return i.props=i.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),i},on:(e,t,n)=>gL(e,t,n,t=>{const{modifiers:i}=e;if(!i.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:o,nonKeyModifiers:a,eventOptionModifiers:l}=((e,t,n)=>{const i=[],r=[],s=[];for(let o=0;o{const{exp:i,loc:r}=e;return i||n.onError(YL(61,r)),{props:[],needRuntime:n.helper(PL)}}};const JL=Object.create(null);YM(function(e,t){if(!Gx(e)){if(!e.nodeType)return Rx;e=e.innerHTML}const n=function(e,t){return e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t)}(e,t),i=JL[n];if(i)return i;if("#"===e[0]){const t=document.querySelector(e);0,e=t?t.innerHTML:""}const r=Lx({hoistStatic:!0,onError:void 0,onWarn:Rx},t);r.isCustomElement||"undefined"==typeof customElements||(r.isCustomElement=e=>!!customElements.get(e));const{code:s}=function(e,t={}){return OL(e,Lx({},zL,t,{nodeTransforms:[KL,...ZL,...t.nodeTransforms||[]],directiveTransforms:Lx({},QL,t.directiveTransforms||{}),transformHoist:null}))}(e,r),o=new Function("Vue",s)(oe);return o._rc=!0,JL[n]=o});var eP=__webpack_require__(66619),tP=__webpack_require__.n(eP);const nP={stage:new(tP().Container),pointer:{x:0,y:0},backgroundSprite:null,sprites:{},texts:{},counter:0,keys:{},state:!1,running:!1,repeatPlay:()=>{},displayTag:!1,processingDisplayEvent:null,successDisplayEvents:[],successProcessingDisplayEvents:[],startTime:performance.now(),timer:0,lastFrameTime:null,lastSecond:null,targetFPS:60,frameCount:0,currentFPS:60,canvasHeight:450,canvasWidth:800,gameLoop:()=>{1==nP.state&&(nP.repeatPlay(),nP.gameLoopDisplay()),nP.timer=performance.now()-nP.startTime},animate:e=>{e-nP.lastFrameTime>=1e3/nP.targetFPS&&(nP.frameCount++,nP.gameLoop(),nP.renderer.render(nP.stage),nP.lastFrameTime=e),e-nP.lastSecond>=1e3&&(nP.currentFPS=nP.frameCount,nP.frameCount=0,nP.lastSecond=e),requestAnimationFrame(nP.animate)}};nP.createBackground=(e,t=0)=>{var n;return 0==t&&(n=new(tP().Sprite.fromImage)(`../common/media/spriteimg/${e}.png`)),n.name="background",n.anchor.set(.5),n.x=nP.canvasWidth/2,n.y=nP.canvasHeight/2,n.width=nP.canvasWidth,n.height=nP.canvasHeight,n.interactive=!0,n.buttonMode=!0,n.isDown=!1,n.isUp=!0,n.on("mousedown",function(){this.isDown=!0,this.isUp=!1,nP.state&&this.runningMouseDown()}).on("mouseup",function(){this.isDown=!1,this.isUp=!0}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0}),n.runningMouseDown=new Function(""),nP.backgroundSprite&&nP.backgroundSprite.parent&&nP.stage.removeChild(nP.backgroundSprite),nP.backgroundSprite=n,nP.stage.addChildAt(nP.backgroundSprite,0),0},nP.createASprite=(e,t=nP.canvasWidth/2,n=nP.canvasHeight/2,i="",r=0)=>{var s;return""==i&&(i="sprite"+ ++nP.counter),0==r&&(s=new(tP().Sprite.fromImage)(`../common/media/spriteimg/${e}.png`)),nP.sprites[i]||nP.texts[i]||(s.name=i,s.anchor.set(.5),s.x=t,s.y=n,s.interactive=!0,s.buttonMode=!0,s.isDown=!1,s.isUp=!0,s.on("mousedown",function(e){this.isDown=!0,this.isUp=!1,nP.state?this.runningMouseDown():(this.data=e.data,this.alpha=.5,this.dragging=!0)}).on("mouseup",function(){this.isDown=!1,this.isUp=!0,nP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0,nP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mousemove",function(){if(!nP.state&&this.dragging){var e=this.data.getLocalPosition(this.parent);this.position.x=e.x,this.position.y=e.y}}),s.runningMouseDown=new Function(""),s.show=function(){this.visible=!0},s.hide=function(){this.visible=!1},s.enlarge=function(e){const t=this.height/this.width;var n=Math.sqrt(this.height*this.width);n+=e,this.width=Math.sqrt(n*n/t),this.height=this.width*t},s.enlargeTo=function(e){var t=this.height/this.width;this.width=Math.sqrt(e*e/t),this.height=this.width*t},s.expandTo=async function(e,t=1){if(nP.running){nP.displayTag=!0,nP.processingDisplayEvent={sprite:this,targetS:e,totalTime:1e3*t,startTime:performance.now(),displayType:"expand"};var n=new Promise(e=>{if(!1===nP.displayTag)e();else{const t=setInterval(()=>{!1===nP.displayTag&&(clearInterval(t),e())},10)}});return await n}return nP.successProcessingDisplayEvents.push({sprite:this,targetS:e,totalTime:1e3*t,startTime:performance.now(),displayType:"expand"}),0},s.move=function(e){this.x+=e*Math.cos(this.rotation),this.y+=e*Math.sin(this.rotation)},s.moveTo=function(e,t){this.x=e,this.y=t},s.slideTo=async function(e,t,n=1){if(nP.running){nP.displayTag=!0,nP.processingDisplayEvent={sprite:this,targetX:e,targetY:t,totalTime:1e3*n,startTime:performance.now(),displayType:"slide"};var i=new Promise(e=>{const t=setInterval(()=>{!1===nP.displayTag&&(clearInterval(t),e())},10)});return await i}return nP.successProcessingDisplayEvents.push({sprite:this,targetX:e,targetY:t,totalTime:1e3*n,startTime:performance.now(),displayType:"slide"}),0},s.addX=function(e){this.x+=e},s.addY=function(e){this.y+=e},s.rotate=function(e){this.rotation+=Math.PI/180*e},s.rotateTo=function(e){this.rotation=Math.PI/180*e},s.circleTo=async function(e,t=1){if(nP.running){nP.displayTag=!0,nP.processingDisplayEvent={sprite:this,targetDegree:e,totalTime:1e3*t,startTime:performance.now(),displayType:"circle"};var n=new Promise(e=>{if(!1===nP.displayTag)e();else{const t=setInterval(()=>{!1===nP.displayTag&&(clearInterval(t),e())},10)}});return await n}return nP.successProcessingDisplayEvents.push({sprite:this,targetDegree:e,totalTime:1e3*t,startTime:performance.now(),displayType:"circle"}),0},s.hit=function(e){return nP.hitTestRectangle(this,e)},s.outOfScreen=function(){return this.y>=nP.renderer.height||this.y<=0||this.x<=0||this.x>=nP.renderer.width},s.mouseAction=function(e){this.runningMouseDown=e},s.setScale=function(e=0,t=0){0==e&&(e=this.height),0==t&&(t=this.width),this.height=e,this.width=t},s.filterGray=function(){const e=new(tP().filters.ColorMatrixFilter);e.blackAndWhite(),this.filters=[e]},s.filterBrighter=function(){const e=new(tP().filters.ColorMatrixFilter);e.brightness(1.25),this.filters=[e]},s.filterOrigin=function(){this.filters=null},nP.stage.addChild(s),nP.sprites[i]=s),i},nP.clearAllSprites=()=>{nP.backgroundSprite&&nP.backgroundSprite.parent&&nP.backgroundSprite.parent.removeChild(nP.backgroundSprite);for(const e in nP.sprites)nP.sprites[e].parent.removeChild(nP.sprites[e]),delete nP.sprites[e];for(const e in nP.texts)nP.texts[e].parent.removeChild(nP.texts[e]),delete nP.texts[e];return nP.counter=0,nP.clearTimer(),0},nP.createText=(e,t=nP.canvasWidth/2,n=nP.canvasHeight/2,i="")=>{if(""==i&&(i="text"+ ++nP.counter),!nP.sprites[i]&&!nP.texts[i]){var r=new(tP().Text)(e);r.name=i,r.x=t,r.y=n,r.interactive=!0,r.buttonMode=!0,r.on("mousedown",function(e){this.isDown=!0,this.isUp=!1,nP.state?this.runningMouseDown():(this.data=e.data,this.alpha=.5,this.dragging=!0)}).on("mouseup",function(){this.isDown=!1,this.isUp=!0,nP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0,nP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mousemove",function(){if(!nP.state&&this.dragging){var e=this.data.getLocalPosition(this.parent);this.position.x=e.x,this.position.y=e.y}}),r.runningMouseDown=new Function(""),r.changeText=function(e){this.text=e},r.show=function(){this.visible=!0},r.hide=function(){this.visible=!1},nP.stage.addChild(r),nP.texts[i]=r}return i},nP.hitTestRectangle=(e,t)=>{let n,i,r,s,o;return n=!1,e.centerX=e.x+e.width/2,e.centerY=e.y+e.height/2,t.centerX=t.x+t.width/2,t.centerY=t.y+t.height/2,e.halfWidth=e.width/2,e.halfHeight=e.height/2,t.halfWidth=t.width/2,t.halfHeight=t.height/2,s=e.centerX-t.centerX,o=e.centerY-t.centerY,i=e.halfWidth+t.halfWidth,r=e.halfHeight+t.halfHeight,n=Math.abs(s){nP.repeatPlay=e},nP.isKeyboardHit=e=>{if(!nP.keys[e]){let t=nP.keyboard(e);nP.keys[e]=t}return nP.keys[e].isDown},nP.keyboardListener=(e,t)=>{if(nP.keys[e])nP.keys[e].press=function(){nP.state&&t()};else{let n=nP.keyboard(e);n.press=function(){nP.state&&t()},nP.keys[e]=n}},nP.keyboard=e=>{let t={};t.value=e,t.isDown=!1,t.isUp=!0,t.press=void 0,t.release=void 0,t.downHandler=e=>{e.key===t.value&&(t.isUp&&t.press&&t.press(),t.isDown=!0,t.isUp=!1,e.preventDefault())},t.upHandler=e=>{e.key===t.value&&(t.isDown&&t.release&&t.release(),t.isDown=!1,t.isUp=!0,e.preventDefault())};const n=t.downHandler.bind(t),i=t.upHandler.bind(t);return window.addEventListener("keydown",n,!1),window.addEventListener("keyup",i,!1),t.unsubscribe=()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",i)},t},nP.clearTimer=()=>{nP.startTime=performance.now()},nP.gameLoopDisplay=()=>{if(nP.processingDisplayEvent){const e=nP.processingDisplayEvent;switch(e.displayType){case"slide":if(performance.now()>=e.totalTime+e.startTime)e.sprite.moveTo(e.targetX,e.targetY),nP.displayTag=!1,nP.processingDisplayEvent=null;else(t=nP.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&(e.sprite.addX((e.targetX-e.sprite.x)/t),e.sprite.addY((e.targetY-e.sprite.y)/t));break;case"expand":if(performance.now()>=e.totalTime+e.startTime)e.sprite.enlargeTo(e.targetS),nP.displayTag=!1,nP.processingDisplayEvent=null;else(t=nP.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&e.sprite.enlarge((e.targetS-Math.sqrt(e.sprite.height*e.sprite.width))/t);break;case"circle":if(performance.now()>=e.totalTime+e.startTime)e.sprite.rotateTo(e.targetDegree),nP.displayTag=!1,nP.processingDisplayEvent=null;else(t=nP.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&e.sprite.rotate((e.targetDegree-180*e.sprite.rotation/Math.PI)/t)}}if(!nP.running&&nP.successProcessingDisplayEvents.length)for(var e=nP.successProcessingDisplayEvents.length-1;e>=0;e--){const n=nP.successProcessingDisplayEvents[e];switch(n.displayType){case"slide":if(performance.now()>=n.totalTime+n.startTime)n.sprite.moveTo(n.targetX,n.targetY),nP.successProcessingDisplayEvents.splice(e,1);else(t=nP.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&(n.sprite.addX((n.targetX-n.sprite.x)/t),n.sprite.addY((n.targetY-n.sprite.y)/t));break;case"expand":if(performance.now()>=n.totalTime+n.startTime)n.sprite.enlargeTo(n.targetS),nP.successProcessingDisplayEvents.splice(e,1);else(t=nP.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&n.sprite.enlarge((n.targetS-Math.sqrt(n.sprite.height*n.sprite.width))/t);break;case"circle":var t;if(performance.now()>=n.totalTime+n.startTime)n.sprite.rotateTo(n.targetDegree),nP.successProcessingDisplayEvents.splice(e,1);else(t=nP.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&n.sprite.rotate((n.targetDegree-180*n.sprite.rotation/Math.PI)/t)}}},nP.changeWidth=e=>{const t=Cx()(nP.renderer.view),n=t.width(),i=t.height();t.width(e),t.height(e/n*i)},nP.kill=()=>{nP.state=!1,nP.repeatPlay=new Function;for(let e in nP.keys)nP.keys[e].unsubscribe(),delete nP.keys[e];nP.processingDisplayEvent=null,nP.displayTag=!1,nP.running=!1,nP.clearTimer()},nP.runit=e=>{const t=Cx()(e);t.empty(),tP().SCALE_MODES.DEFAULT=tP().SCALE_MODES.NEAREST,nP.renderer=tP().autoDetectRenderer(nP.canvasWidth,nP.canvasHeight,{backgroundColor:16777215}),t.append(nP.renderer.view),nP.pointer={x:0,y:0},nP.stage.sortableChildren=!0,nP.stage.interactive=!0,nP.stage.on("mousemove",(e=tP().InteractionEvent)=>{nP.pointer.x=e.data.global.x,nP.pointer.y=e.data.global.y}),nP.lastFrameTime=0,nP.running=!0,nP.lastFrameTime||(nP.lastFrameTime=performance.now(),nP.lastSecond=performance.now()),nP.animate(performance.now()),nP.repeatPlay=new Function;for(let e in nP.keys)nP.keys[e].unsubscribe(),delete nP.keys[e];nP.backgroundSprite&&(nP.backgroundSprite.runningMouseDown=new Function);for(let e in nP.sprites)nP.sprites[e].runningMouseDown=new Function;for(let e in nP.texts)nP.texts[e].runningMouseDown=new Function;nP.processingDisplayEvent=null,nP.displayTag=!1,nP.clearTimer(),nP.changeWidth(Cx()("body").width()/2),nP.state=!0},window.mixlySprite=nP;const iP=nP;var rP=__webpack_require__(69610);class sP{constructor(e,t){this._pageLoad=new rP.D,this._kernelAvailable=new rP.D,this._loaderId="basthon-loader",this._doNotHideLoader=!0;const n=e.language;if(null!=t&&(this._loaderId=t),"loading"===document.readyState){const e=()=>{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,20211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,95195));this._kernel=new i(e);break;case"js":case"javascript":const{KernelJavaScript:r}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new r(e);break;case"sql":const{KernelSQL:s}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,90592));this._kernel=new s(e);break;case"ocaml":const{KernelOCaml:o}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,50038));this._kernel=new o(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then(()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()}),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(t?"full":"foot"),r=document.createElement("div");r.id=this._loaderId,r.classList.add("darklighted"),r.classList.add("basthon-loader-root"),r.classList.add(i);const s=document.createElement("div");s.classList.add("basthon-loader-container"),s.classList.add(i),r.appendChild(s);const o=document.createElement("div");o.classList.add("basthon-loader-spinner"),o.classList.add(i),o.innerHTML="",s.appendChild(o);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),s.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=e,s.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",s.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(r),this._rootLoader=r;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return o.classList.remove("basthon-loader-spinner"),o.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout(()=>{this._rootLoader=void 0,e.remove()},1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}class oP extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-image.html",new ze.HTMLTemplate('\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["images"],oP);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"images",id:"images",name:Ve.Msg.PYTHON_PYODIDE_IMAGE,title:Ve.Msg.PYTHON_PYODIDE_IMAGE}),e.changeTo("output"),e.get("images")}}constructor(){super();const e=Cx()(ze.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let i=e.content,r=null,s=null;switch(e.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver(function(e){e.forEach(e=>e.addedNodes.forEach(e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))}).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),t.append(i);break;case"matplotlib":r=i.querySelector("canvas"),r&&(i=r),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",t.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",t.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),t.append(i.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let i=e.content[n];"image/png"===n&&(i=''),t.append(i);break}break;case"tutor":if(t.append(Cx()(e.content.replace("overflow-y%3A%20hidden%3B",""))),s=this.getContent()[0].getElementsByTagName("iframe")[0],null==s)return;s.style.maxHeight=s.style.minHeight="100%",new IntersectionObserver((e,t)=>{const n=e[0];n&&!n.isIntersecting||(s.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())}).observe(s);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const aP=layui;var lP;!function(e){e[e.EPERM=1]="EPERM",e[e.ENOENT=2]="ENOENT",e[e.EINTR=4]="EINTR",e[e.EIO=5]="EIO",e[e.ENXIO=6]="ENXIO",e[e.EBADF=9]="EBADF",e[e.EAGAIN=11]="EAGAIN",e[e.ENOMEM=12]="ENOMEM",e[e.EACCES=13]="EACCES",e[e.EFAULT=14]="EFAULT",e[e.ENOTBLK=15]="ENOTBLK",e[e.EBUSY=16]="EBUSY",e[e.EEXIST=17]="EEXIST",e[e.EXDEV=18]="EXDEV",e[e.ENODEV=19]="ENODEV",e[e.ENOTDIR=20]="ENOTDIR",e[e.EISDIR=21]="EISDIR",e[e.EINVAL=22]="EINVAL",e[e.ENFILE=23]="ENFILE",e[e.EMFILE=24]="EMFILE",e[e.ETXTBSY=26]="ETXTBSY",e[e.EFBIG=27]="EFBIG",e[e.ENOSPC=28]="ENOSPC",e[e.ESPIPE=29]="ESPIPE",e[e.EROFS=30]="EROFS",e[e.EMLINK=31]="EMLINK",e[e.EPIPE=32]="EPIPE",e[e.EDOM=33]="EDOM",e[e.ERANGE=34]="ERANGE",e[e.EDEADLK=35]="EDEADLK",e[e.ENAMETOOLONG=36]="ENAMETOOLONG",e[e.ENOLCK=37]="ENOLCK",e[e.ENOSYS=38]="ENOSYS",e[e.ENOTEMPTY=39]="ENOTEMPTY",e[e.ELOOP=40]="ELOOP",e[e.ENOMSG=42]="ENOMSG",e[e.EBADE=52]="EBADE",e[e.EBADR=53]="EBADR",e[e.EXFULL=54]="EXFULL",e[e.ENOANO=55]="ENOANO",e[e.EBADRQC=56]="EBADRQC",e[e.ENOSTR=60]="ENOSTR",e[e.ENODATA=61]="ENODATA",e[e.ETIME=62]="ETIME",e[e.ENOSR=63]="ENOSR",e[e.ENONET=64]="ENONET",e[e.EREMOTE=66]="EREMOTE",e[e.ENOLINK=67]="ENOLINK",e[e.ECOMM=70]="ECOMM",e[e.EPROTO=71]="EPROTO",e[e.EBADMSG=74]="EBADMSG",e[e.EOVERFLOW=75]="EOVERFLOW",e[e.EBADFD=77]="EBADFD",e[e.ESTRPIPE=86]="ESTRPIPE",e[e.ENOTSOCK=88]="ENOTSOCK",e[e.EDESTADDRREQ=89]="EDESTADDRREQ",e[e.EMSGSIZE=90]="EMSGSIZE",e[e.EPROTOTYPE=91]="EPROTOTYPE",e[e.ENOPROTOOPT=92]="ENOPROTOOPT",e[e.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",e[e.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",e[e.ENOTSUP=95]="ENOTSUP",e[e.ENETDOWN=100]="ENETDOWN",e[e.ENETUNREACH=101]="ENETUNREACH",e[e.ENETRESET=102]="ENETRESET",e[e.ETIMEDOUT=110]="ETIMEDOUT",e[e.ECONNREFUSED=111]="ECONNREFUSED",e[e.EHOSTDOWN=112]="EHOSTDOWN",e[e.EHOSTUNREACH=113]="EHOSTUNREACH",e[e.EALREADY=114]="EALREADY",e[e.EINPROGRESS=115]="EINPROGRESS",e[e.ESTALE=116]="ESTALE",e[e.EREMOTEIO=121]="EREMOTEIO",e[e.EDQUOT=122]="EDQUOT"}(lP||(lP={}));const uP={[lP.EPERM]:"Operation not permitted",[lP.ENOENT]:"No such file or directory",[lP.EINTR]:"Interrupted system call",[lP.EIO]:"Input/output error",[lP.ENXIO]:"No such device or address",[lP.EBADF]:"Bad file descriptor",[lP.EAGAIN]:"Resource temporarily unavailable",[lP.ENOMEM]:"Cannot allocate memory",[lP.EACCES]:"Permission denied",[lP.EFAULT]:"Bad address",[lP.ENOTBLK]:"Block device required",[lP.EBUSY]:"Resource busy or locked",[lP.EEXIST]:"File exists",[lP.EXDEV]:"Invalid cross-device link",[lP.ENODEV]:"No such device",[lP.ENOTDIR]:"File is not a directory",[lP.EISDIR]:"File is a directory",[lP.EINVAL]:"Invalid argument",[lP.ENFILE]:"Too many open files in system",[lP.EMFILE]:"Too many open files",[lP.ETXTBSY]:"Text file busy",[lP.EFBIG]:"File is too big",[lP.ENOSPC]:"No space left on disk",[lP.ESPIPE]:"Illegal seek",[lP.EROFS]:"Cannot modify a read-only file system",[lP.EMLINK]:"Too many links",[lP.EPIPE]:"Broken pipe",[lP.EDOM]:"Numerical argument out of domain",[lP.ERANGE]:"Numerical result out of range",[lP.EDEADLK]:"Resource deadlock would occur",[lP.ENAMETOOLONG]:"File name too long",[lP.ENOLCK]:"No locks available",[lP.ENOSYS]:"Function not implemented",[lP.ENOTEMPTY]:"Directory is not empty",[lP.ELOOP]:"Too many levels of symbolic links",[lP.ENOMSG]:"No message of desired type",[lP.EBADE]:"Invalid exchange",[lP.EBADR]:"Invalid request descriptor",[lP.EXFULL]:"Exchange full",[lP.ENOANO]:"No anode",[lP.EBADRQC]:"Invalid request code",[lP.ENOSTR]:"Device not a stream",[lP.ENODATA]:"No data available",[lP.ETIME]:"Timer expired",[lP.ENOSR]:"Out of streams resources",[lP.ENONET]:"Machine is not on the network",[lP.EREMOTE]:"Object is remote",[lP.ENOLINK]:"Link has been severed",[lP.ECOMM]:"Communication error on send",[lP.EPROTO]:"Protocol error",[lP.EBADMSG]:"Bad message",[lP.EOVERFLOW]:"Value too large for defined data type",[lP.EBADFD]:"File descriptor in bad state",[lP.ESTRPIPE]:"Streams pipe error",[lP.ENOTSOCK]:"Socket operation on non-socket",[lP.EDESTADDRREQ]:"Destination address required",[lP.EMSGSIZE]:"Message too long",[lP.EPROTOTYPE]:"Protocol wrong type for socket",[lP.ENOPROTOOPT]:"Protocol not available",[lP.EPROTONOSUPPORT]:"Protocol not supported",[lP.ESOCKTNOSUPPORT]:"Socket type not supported",[lP.ENOTSUP]:"Operation is not supported",[lP.ENETDOWN]:"Network is down",[lP.ENETUNREACH]:"Network is unreachable",[lP.ENETRESET]:"Network dropped connection on reset",[lP.ETIMEDOUT]:"Connection timed out",[lP.ECONNREFUSED]:"Connection refused",[lP.EHOSTDOWN]:"Host is down",[lP.EHOSTUNREACH]:"No route to host",[lP.EALREADY]:"Operation already in progress",[lP.EINPROGRESS]:"Operation now in progress",[lP.ESTALE]:"Stale file handle",[lP.EREMOTEIO]:"Remote I/O error",[lP.EDQUOT]:"Disk quota exceeded"};class cP extends Error{static fromJSON(e){const t=new cP(e.errno,e.message,e.path,e.syscall);return t.code=e.code,t.stack=e.stack,t}static With(e,t,n){return new cP(lP[e],uP[lP[e]],t,n)}constructor(e,t=uP[e],n,i=""){super(t),this.errno=e,this.path=n,this.syscall=i,this.code=lP[e],this.message=this.code+": "+t+(this.path?`, '${this.path}'`:"")}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}}let dP="/";function hP(e,t){let n="",i=0,r=-1,s=0,o="\0";for(let a=0;a<=e.length;++a){if(a2){const e=n.lastIndexOf("/");-1===e?(n="",i=0):(n=n.slice(0,e),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}if(0!==n.length){n="",i=0,r=a,s=0;continue}}t&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else"."===o&&-1!==s?++s:s=-1}return n}function pP(...e){let t="";for(const n of[...e.reverse(),dP])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;const n=t.startsWith("/");return t=hP(t,!n),n?`/${t}`:t.length?t:"/"}function fP(...e){if(!e.length)return".";const t=e.join("/");return t?.length?function(e){if(!e.length)return".";const t=e.startsWith("/"),n=e.endsWith("/");return(e=hP(e,!t)).length?(n&&(e+="/"),t?`/${e}`:e):t?"/":n?"./":"."}(t):"."}function mP(e){if(0===e.length)return".";const t="/"===e[0];let n=-1,i=!0;for(let t=e.length-1;t>=1;--t)if("/"===e[t]){if(!i){n=t;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)}function gP(e,t){let n=0,i=-1,r=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,o=-1;for(let a=e.length-1;a>=0;--a)if("/"===e[a]){if(!r){n=a+1;break}}else-1===o&&(r=!1,o=a+1),s>=0&&(e[a]===t[s]?-1===--s&&(i=a):(s=-1,i=o));return n===i?i=o:-1===i&&(i=e.length),e.slice(n,i)}for(let t=e.length-1;t>=0;--t)if("/"===e[t]){if(!r){n=t+1;break}}else-1===i&&(r=!1,i=t+1);return-1===i?"":e.slice(n,i)}function _P(e){const t=e.startsWith("/"),n={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;const i=t?1:0;let r=-1,s=0,o=-1,a=!0,l=e.length-1,u=0;for(;l>=i;--l)if("/"!==e[l])-1===o&&(a=!1,o=l+1),"."===e[l]?-1===r?r=l:1!==u&&(u=1):-1!==r&&(u=-1);else if(!a){s=l+1;break}if(-1!==o){const i=0===s&&t?1:s;-1===r||0===u||1===u&&r===o-1&&r===s+1?n.base=n.name=e.slice(i,o):(n.name=e.slice(i,r),n.base=e.slice(i,o),n.ext=e.slice(r,o))}return s>0?n.dir=e.slice(0,s-1):t&&(n.dir="/"),n}const yP=new TextEncoder;function vP(e){if("string"!=typeof e)throw new cP(lP.EINVAL,"Can not encode a non-string");return yP.encode(e)}const bP=new TextDecoder;function TP(e){if(!(e instanceof Uint8Array))throw new cP(lP.EINVAL,"Can not decode a non-Uint8Array");return bP.decode(e)}function xP(e){return JSON.parse(TP(e),(e,t)=>""==e?t:BigInt(t))}function EP(e){return vP(JSON.stringify(e,(e,t)=>""==e?t:t.toString()))}function wP(e,t){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e,8);if(!isNaN(t))return t}if("number"==typeof t)return t;throw new cP(lP.EINVAL,"Invalid mode: "+e?.toString())}function IP(e){if(e instanceof Date)return e;try{return new Date(e)}catch{throw new cP(lP.EINVAL,"Invalid time.")}}function AP(e){if((e=e.toString()).includes("\0"))throw new cP(lP.EINVAL,"Path can not contain null character");if(0==e.length)throw new cP(lP.EINVAL,"Path can not be empty");return pP(e.replaceAll(/[/\\]+/g,"/"))}function SP(e,t="utf8",n,i=0){return"object"!=typeof e||null===e?{encoding:"string"==typeof e?e:t??null,flag:n,mode:i}:{encoding:"string"==typeof e?.encoding?e.encoding:t??null,flag:"string"==typeof e?.flag?e.flag:n,mode:wP("mode"in e?e?.mode:null,i)}}function CP(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const OP={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function MP(e){return{suid:e.uid,sgid:e.gid,euid:e.uid,egid:e.gid,groups:[],...e}}const kP=0,RP=4,NP=2,DP=1,FP=1,LP=2,PP=4,BP=0,$P=1,UP=2,VP=64,zP=128,jP=256,YP=512,GP=1024,HP=65536,WP=262144,XP=131072,qP=1052672,KP=4096,ZP=32768,QP=16384,JP=2048,eB=61440,tB=49152,nB=40960,iB=32768,rB=24576,sB=16384,oB=8192,aB=4096,lB=2048,uB=1024,cB=512,dB=448,hB=256,pB=128,fB=64,mB=56,gB=32,_B=16,yB=8,vB=7,bB=4,TB=2,xB=1,EB=0,wB=2**32-1,IB={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let e,t;const n=new Promise((n,i)=>{e=n,t=i});return{promise:n,resolve:e,reject:t}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class AB{_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}constructor({atimeMs:e,mtimeMs:t,ctimeMs:n,birthtimeMs:i,uid:r,gid:s,size:o,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(e??u),this.mtimeMs=this._convert(t??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(r??0),this.gid=this._convert(s??0),this.size=this._convert(o??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&iB),0==(this.mode&eB)&&(this.mode=this.mode|this._convert(iB))}isFile(){return(this.mode&eB)===iB}isDirectory(){return(this.mode&eB)===sB}isSymbolicLink(){return(this.mode&eB)===nB}isSocket(){return(this.mode&eB)===tB}isBlockDevice(){return(this.mode&eB)===rB}isCharacterDevice(){return(this.mode&eB)===oB}isFIFO(){return(this.mode&eB)===aB}hasAccess(e,t){const n=t?.credentials||OP;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&hB&&(i|=RP),this.mode&pB&&(i|=NP),this.mode&fB&&(i|=DP)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&gB&&(i|=RP),this.mode&_B&&(i|=NP),this.mode&yB&&(i|=DP)),this.mode&bB&&(i|=RP),this.mode&TB&&(i|=NP),this.mode&xB&&(i|=DP),(i&e)===e}chmod(e){this.mode=this._convert(this.mode&eB|e)}chown(e,t){e=Number(e),t=Number(t),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(t)&&0<=t&&t<2**32&&(this.gid=this._convert(t))}get atimeNs(){return 1000n*BigInt(this.atimeMs)}get mtimeNs(){return 1000n*BigInt(this.mtimeMs)}get ctimeNs(){return 1000n*BigInt(this.ctimeMs)}get birthtimeNs(){return 1000n*BigInt(this.birthtimeMs)}}function SB(e,t,n){!isNaN(t)&&0<=t&&t<2**32&&(e.uid=t),!isNaN(n)&&0<=n&&n<2**32&&(e.gid=n)}class CB extends AB{constructor(){super(...arguments),this._isBigint=!1}}class OB extends AB{constructor(){super(...arguments),this._isBigint=!0}}class MB{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=wB,this.ffree=wB}}class kB{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(wB),this.ffree=BigInt(wB)}}const RB=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function NB(e){if("number"==typeof e)return function(e){switch(e){case BP:return"r";case BP|qP:return"rs";case UP:return"r+";case UP|qP:return"rs+";case YP|VP|$P:return"w";case YP|VP|$P|zP:return"wx";case YP|VP|UP:return"w+";case YP|VP|UP|zP:return"wx+";case GP|VP|$P:return"a";case GP|VP|$P|zP:return"ax";case GP|VP|UP:return"a+";case GP|VP|UP|zP:return"ax+";default:throw new Error("Invalid flag number: "+e)}}(e);if(!RB.includes(e))throw new Error("Invalid flag string: "+e);return e}function DB(e){let t=0;return t<<=1,t+=+FB(e),t<<=1,t+=+LB(e),t<<=1,t}function FB(e){return-1!==e.indexOf("r")||-1!==e.indexOf("+")}function LB(e){return-1!==e.indexOf("w")||-1!==e.indexOf("a")||-1!==e.indexOf("+")}function PB(e){return-1!==e.indexOf("w")}function BB(e){return-1!==e.indexOf("a")}function $B(e){return-1!==e.indexOf("x")}class UB{constructor(e,t){this.fs=e,this.path=t}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class VB extends UB{constructor(e,t,n,i,r=new Uint8Array(new ArrayBuffer(0,e.metadata().noResizableBuffers?{}:{maxByteLength:wB}))){if(super(e,t),this.flag=n,this.stats=i,this._buffer=r,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=r.byteLength){if(FB(this.flag))throw new Error(`Size mismatch: buffer length ${r.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return BB(this.flag)?this.stats.size:this._position}set position(e){this._position=e}async sync(){if(this.closed)throw cP.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw cP.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw cP.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw cP.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(e){if(this.closed)throw cP.With("EBADF",this.path,"File.dispose");if(this.dirty&&!e)throw cP.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw cP.With("EBADF",this.path,"File.stat");return Promise.resolve(new CB(this.stats))}statSync(){if(this.closed)throw cP.With("EBADF",this.path,"File.stat");return new CB(this.stats)}_truncate(e){if(this.closed)throw cP.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!LB(this.flag))throw new cP(lP.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),e>this._buffer.length){const t=new Uint8Array(e-this._buffer.length);return void this._write(t,0,t.length,this._buffer.length)}this.stats.size=e,this._buffer=e?this._buffer.slice(0,e):new Uint8Array}async truncate(e){this._truncate(e),IB.syncImmediately&&await this.sync()}truncateSync(e){this._truncate(e),IB.syncImmediately&&this.syncSync()}_write(e,t=0,n=this.stats.size,i=this.position){if(this.closed)throw cP.With("EBADF",this.path,"File.write");if(!LB(this.flag))throw new cP(lP.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const r=i+n,s=e.slice(t,t+n);if(r>this.stats.size&&(this.stats.size=r,r>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=r)this._buffer.buffer.resize(r);else if(IB.unsafeBufferReplace)this._buffer=s;else{const e=new Uint8Array(new ArrayBuffer(r,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:wB}));e.set(this._buffer),this._buffer=e}return this._buffer.set(s,i),this.stats.mtimeMs=Date.now(),this.position=i+s.byteLength,s.byteLength}async write(e,t,n,i){const r=this._write(e,t,n,i);return IB.syncImmediately&&await this.sync(),r}writeSync(e,t=0,n=this.stats.size,i=this.position){const r=this._write(e,t,n,i);return IB.syncImmediately&&this.syncSync(),r}_read(e,t=0,n=this.stats.size,i){if(this.closed)throw cP.With("EBADF",this.path,"File.read");if(!FB(this.flag))throw new cP(lP.EPERM,"File not opened with a readable mode.");IB.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let r=i+n;r>this.stats.size&&(r=i+Math.max(this.stats.size-i,0)),this._position=r;const s=r-i;return 0==s||new Uint8Array(e.buffer,t,n).set(this._buffer.slice(i,r)),s}async read(e,t,n,i){const r=this._read(e,t,n,i);return IB.syncImmediately&&await this.sync(),{bytesRead:r,buffer:e}}readSync(e,t,n,i){const r=this._read(e,t,n,i);return IB.syncImmediately&&this.syncSync(),r}async chmod(e){if(this.closed)throw cP.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(e>eB?~eB:eB)|e,(IB.syncImmediately||e>eB)&&await this.sync()}chmodSync(e){if(this.closed)throw cP.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(e>eB?~eB:eB)|e,(IB.syncImmediately||e>eB)&&this.syncSync()}async chown(e,t){if(this.closed)throw cP.With("EBADF",this.path,"File.chown");this.dirty=!0,SB(this.stats,e,t),IB.syncImmediately&&await this.sync()}chownSync(e,t){if(this.closed)throw cP.With("EBADF",this.path,"File.chown");this.dirty=!0,SB(this.stats,e,t),IB.syncImmediately&&this.syncSync()}async utimes(e,t){if(this.closed)throw cP.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=e,this.stats.mtime=t,IB.syncImmediately&&await this.sync()}utimesSync(e,t){if(this.closed)throw cP.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=e,this.stats.mtime=t,IB.syncImmediately&&this.syncSync()}}class zB{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...e){}async ready(){}async exists(e){try{return await this.stat(e),!0}catch(e){return"ENOENT"!=e.code}}existsSync(e){try{return this.statSync(e),!0}catch(e){return"ENOENT"!=e.code}}}var jB=__webpack_require__(30228);Symbol.toStringTag,Symbol.iterator;const YB=Intl.NumberFormat("en",{notation:"compact"});YB.format.bind(YB);function GB(e){return e.at(0).toUpperCase()+e.slice(1)}const HB=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],WB=[...HB,...HB.map(e=>GB(e)),"char"],XB=/^(u?int|float)(8|16|32|64)$/i;function qB(e){return"char"==e?"uint8":e.toLowerCase()}function KB(e){return XB.test(e.toString())}function ZB(e){return"char"==e||XB.test(e.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function QB(e){const t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(e=>"Symbol.metadata"==e.description);var n;if(n=e,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}function JB(e){return"function"==typeof e&&QB(e)in e&&function(e){return null!=e&&"object"==typeof e&&Symbol.struct_metadata in e}(e[QB(e)])}function e$(e){return null!=e&&"object"==typeof e&&JB(e.constructor)}function t$(e){if(!e$(e))throw new TypeError(("function"==typeof e?e.name:"object"==typeof e&&e?e.constructor.name:e)+" is not a struct instance")}function n$(e){if(!function(e){return e$(e)||JB(e)}(e))throw new TypeError(("function"==typeof e?e.name:"object"==typeof e&&e?e.constructor.name:e)+" is not a struct")}function i$(e){if("string"==typeof e)return function(e){if(!ZB(e))throw new TypeError("Not a valid primitive type: "+e)}(e),+qB(e).match(XB)[2]/8;n$(e);const t=JB(e)?e:e.constructor;return t[QB(t)][Symbol.struct_metadata].size}function r$(e,t){return Math.ceil(e/t)*t}function s$(e={}){return function(t,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const r=new Map;for(const t of n.metadata[Symbol.struct_init]){const{name:n,type:s,length:o}=t;if(!ZB(s)&&!JB(s))throw new TypeError("Not a valid type: "+s);r.set(n,{offset:i,type:ZB(s)?qB(s):s,length:o}),i+=i$(s)*(o||1),i=r$(i,e.align||1)}return n.metadata[Symbol.struct_metadata]={options:e,members:r,size:i},t}}function o$(e,t){return function(n,i){let r=i.name;if("symbol"==typeof r&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:r,type:e,length:t}),n}}function a$(e){t$(e);const{options:t,members:n}=e.constructor[QB(e.constructor)][Symbol.struct_metadata],i=new Uint8Array(i$(e)),r=new DataView(i.buffer);for(const[s,{type:o,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+i$(o)*n;let c=a>0?e[s][n]:e[s];if("string"==typeof c&&(c=c.charCodeAt(0)),!KB(o)){i.set(c?a$(c):new Uint8Array(i$(o)),u);continue}const d="set"+GB(o);"setInt64"!=d?"setUint64"!=d?r[d](u,Number(c),!t.bigEndian):r.setBigUint64(u,BigInt(c),!t.bigEndian):r.setBigInt64(u,BigInt(c),!t.bigEndian)}return i}function l$(e,t){t$(e);const{options:n,members:i}=e.constructor[QB(e.constructor)][Symbol.struct_metadata],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),s=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(const[t,{type:o,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?e[t]:e;const c=l>0?i:t,d=a+i$(o)*i;if("string"==typeof e[t]){e[t]=e[t].slice(0,i)+String.fromCharCode(s.getUint8(d))+e[t].slice(i+1);continue}if(!KB(o)){if(null===u[c]||void 0===u[c])continue;l$(u[c],new Uint8Array(r.slice(d,d+i$(o))));continue}l>0&&(u||=[]);const h="get"+GB(o);"getInt64"!=h?u[c]="getUint64"!=h?s[h](d,!n.bigEndian):s.getBigUint64(d,!n.bigEndian):u[c]=s.getBigInt64(d,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const u$=Object.fromEntries(WB.map(e=>{return[e,(t=e,function(e,n){return"number"==typeof e?o$(t,e):o$(t)(e,n)})];var t}));var c$=function(e,t,n,i,r,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in i)f[m]="access"===m?{}:i[m];for(var m in i.access)f.access[m]=i.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[u],f);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=o(g.get))&&(d.get=a),(a=o(g.set))&&(d.set=a),(a=o(g.init))&&r.unshift(a)}else(a=o(g))&&("field"===l?r.unshift(a):d[u]=a)}c&&Object.defineProperty(c,i.name,d),h=!0},d$=function(e,t,n){for(var i=arguments.length>2,r=0;r{var e,t,n,i,r,s,o,a,l,u,c;let d,h,p,f,m,g,_,y,v,b,T,x,E,w=[s$()],I=[],A=[],S=[],C=[],O=[],M=[],k=[],R=[],N=[],D=[],F=[],L=[],P=[],B=[],$=[],U=[],V=[],z=[],j=[],Y=[],G=[],H=[],W=[];var X=h=class{constructor(e){if(this.data=d$(this,A,void 0),this.size=(d$(this,S),d$(this,C,void 0)),this.mode=(d$(this,O),d$(this,M,void 0)),this.nlink=(d$(this,k),d$(this,R,void 0)),this.uid=(d$(this,N),d$(this,D,void 0)),this.gid=(d$(this,F),d$(this,L,void 0)),this.atimeMs=(d$(this,P),d$(this,B,void 0)),this.birthtimeMs=(d$(this,$),d$(this,U,void 0)),this.mtimeMs=(d$(this,V),d$(this,z,void 0)),this.ctimeMs=(d$(this,j),d$(this,Y,void 0)),this.ino=(d$(this,G),d$(this,H,void 0)),d$(this,W),e){const t=i$(X),n=t-i$("uint64");if(e.byteLength{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;p=[(e=u$).uint64.bind(e)],f=[(t=u$).uint32.bind(t)],m=[(n=u$).uint16.bind(n)],g=[(i=u$).uint32.bind(i)],_=[(r=u$).uint32.bind(r)],y=[(s=u$).uint32.bind(s)],v=[(o=u$).float64.bind(o)],b=[(a=u$).float64.bind(a)],T=[(l=u$).float64.bind(l)],x=[(u=u$).float64.bind(u)],E=[(c=u$).uint64.bind(c)],c$(null,null,p,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:q},A,S),c$(null,null,f,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:q},C,O),c$(null,null,m,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:q},M,k),c$(null,null,g,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:e=>"nlink"in e,get:e=>e.nlink,set:(e,t)=>{e.nlink=t}},metadata:q},R,N),c$(null,null,_,{kind:"field",name:"uid",static:!1,private:!1,access:{has:e=>"uid"in e,get:e=>e.uid,set:(e,t)=>{e.uid=t}},metadata:q},D,F),c$(null,null,y,{kind:"field",name:"gid",static:!1,private:!1,access:{has:e=>"gid"in e,get:e=>e.gid,set:(e,t)=>{e.gid=t}},metadata:q},L,P),c$(null,null,v,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:e=>"atimeMs"in e,get:e=>e.atimeMs,set:(e,t)=>{e.atimeMs=t}},metadata:q},B,$),c$(null,null,b,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:e=>"birthtimeMs"in e,get:e=>e.birthtimeMs,set:(e,t)=>{e.birthtimeMs=t}},metadata:q},U,V),c$(null,null,T,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:e=>"mtimeMs"in e,get:e=>e.mtimeMs,set:(e,t)=>{e.mtimeMs=t}},metadata:q},z,j),c$(null,null,x,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:e=>"ctimeMs"in e,get:e=>e.ctimeMs,set:(e,t)=>{e.ctimeMs=t}},metadata:q},Y,G),c$(null,null,E,{kind:"field",name:"ino",static:!1,private:!1,access:{has:e=>"ino"in e,get:e=>e.ino,set:(e,t)=>{e.ino=t}},metadata:q},H,W),c$(null,d={value:h},w,{kind:"class",name:h.name,metadata:q},null,I),X=h=d.value,q&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),d$(h,I)})(),X=h})();var f$=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},m$=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class g$ extends zB{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(e){super(),this.store=e,this._initialized=!1}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=f$(n,this.store.transaction(),!0),r=_P(e),s=_P(t),o=await this.findInode(i,r.dir,"rename"),a=xP(await this.get(i,o.data,r.dir,"rename"));if(!a[r.base])throw cP.With("ENOENT",e,"rename");const l=a[r.base];if(delete a[r.base],0===(s.dir+"/").indexOf(e+"/"))throw new cP(lP.EBUSY,r.dir);const u=s.dir==r.dir,c=u?o:await this.findInode(i,s.dir,"rename"),d=u?a:xP(await this.get(i,c.data,s.dir,"rename"));if(d[s.base]){const e=new p$(await this.get(i,d[s.base],t,"rename"));if(!e.toStats().isFile())throw cP.With("EPERM",t,"rename");await i.remove(e.data),await i.remove(d[s.base])}d[s.base]=l,await i.set(o.data,EP(a)),await i.set(c.data,EP(d)),await i.commit()}catch(e){n.error=e,n.hasError=!0}finally{const e=m$(n);e&&await e}}renameSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=f$(n,this.store.transaction(),!1),r=_P(e),s=_P(t),o=this.findInodeSync(i,r.dir,"rename"),a=xP(this.getSync(i,o.data,r.dir,"rename"));if(!a[r.base])throw cP.With("ENOENT",e,"rename");const l=a[r.base];if(delete a[r.base],0==(s.dir+"/").indexOf(e+"/"))throw new cP(lP.EBUSY,r.dir);const u=s.dir===r.dir,c=u?o:this.findInodeSync(i,s.dir,"rename"),d=u?a:xP(this.getSync(i,c.data,s.dir,"rename"));if(d[s.base]){const e=new p$(this.getSync(i,d[s.base],t,"rename"));if(!e.toStats().isFile())throw cP.With("EPERM",t,"rename");i.removeSync(e.data),i.removeSync(d[s.base])}d[s.base]=l,i.setSync(o.data,EP(a)),i.setSync(c.data,EP(d)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{m$(n)}}async stat(e){const t={stack:[],error:void 0,hasError:!1};try{const n=f$(t,this.store.transaction(),!0);return(await this.findInode(n,e,"stat")).toStats()}catch(e){t.error=e,t.hasError=!0}finally{const e=m$(t);e&&await e}}statSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=f$(t,this.store.transaction(),!1);return this.findInodeSync(n,e,"stat").toStats()}catch(e){t.error=e,t.hasError=!0}finally{m$(t)}}async createFile(e,t,n){const i=await this.commitNew(e,iB,n,new Uint8Array,"createFile");return new VB(this,e,t,i.toStats(),new Uint8Array)}createFileSync(e,t,n){const i=this.commitNewSync(e,iB,n,new Uint8Array,"createFile");return new VB(this,e,t,i.toStats(),new Uint8Array)}async openFile(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=f$(n,this.store.transaction(),!0),r=await this.findInode(i,e,"openFile"),s=await this.get(i,r.data,e,"openFile");return new VB(this,e,t,r.toStats(),s)}catch(e){n.error=e,n.hasError=!0}finally{const e=m$(n);e&&await e}}openFileSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=f$(n,this.store.transaction(),!1),r=this.findInodeSync(i,e,"openFile"),s=this.getSync(i,r.data,e,"openFile");return new VB(this,e,t,r.toStats(),s)}catch(e){n.error=e,n.hasError=!0}finally{m$(n)}}async unlink(e){return this.remove(e,!1,"unlink")}unlinkSync(e){this.removeSync(e,!1,"unlink")}async rmdir(e){if((await this.readdir(e)).length)throw cP.With("ENOTEMPTY",e,"rmdir");await this.remove(e,!0,"rmdir")}rmdirSync(e){if(this.readdirSync(e).length)throw cP.With("ENOTEMPTY",e,"rmdir");this.removeSync(e,!0,"rmdir")}async mkdir(e,t){await this.commitNew(e,sB,t,vP("{}"),"mkdir")}mkdirSync(e,t){this.commitNewSync(e,sB,t,vP("{}"),"mkdir")}async readdir(e){const t={stack:[],error:void 0,hasError:!1};try{const n=f$(t,this.store.transaction(),!0),i=await this.findInode(n,e,"readdir");return Object.keys(xP(await this.get(n,i.data,e,"readdir")))}catch(e){t.error=e,t.hasError=!0}finally{const e=m$(t);e&&await e}}readdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=f$(t,this.store.transaction(),!1),i=this.findInodeSync(n,e,"readdir");return Object.keys(xP(this.getSync(n,i.data,e,"readdir")))}catch(e){t.error=e,t.hasError=!0}finally{m$(t)}}async sync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=f$(i,this.store.transaction(),!0),s=await this._findInode(r,e,"sync"),o=new p$(await this.get(r,s,e,"sync")),a=o.update(n);await r.set(o.data,t),a&&await r.set(s,a$(o)),await r.commit()}catch(e){i.error=e,i.hasError=!0}finally{const e=m$(i);e&&await e}}syncSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=f$(i,this.store.transaction(),!1),s=this._findInodeSync(r,e,"sync"),o=new p$(this.getSync(r,s,e,"sync")),a=o.update(n);r.setSync(o.data,t),a&&r.setSync(s,a$(o)),r.commitSync()}catch(e){i.error=e,i.hasError=!0}finally{m$(i)}}async link(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=f$(n,this.store.transaction(),!0),r=mP(t),s=await this.findInode(i,r,"link"),o=xP(await this.get(i,s.data,r,"link")),a=await this._findInode(i,e,"link"),l=new p$(await this.get(i,a,e,"link"));l.nlink++,o[gP(t)]=a,i.setSync(a,a$(l)),i.setSync(s.data,EP(o)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{const e=m$(n);e&&await e}}linkSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=f$(n,this.store.transaction(),!1),r=mP(t),s=this.findInodeSync(i,r,"link"),o=xP(this.getSync(i,s.data,r,"link")),a=this._findInodeSync(i,e,"link"),l=new p$(this.getSync(i,a,e,"link"));l.nlink++,o[gP(t)]=a,i.setSync(a,a$(l)),i.setSync(s.data,EP(o)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{m$(n)}}async checkRoot(){const e={stack:[],error:void 0,hasError:!1};try{const t=f$(e,this.store.transaction(),!0);if(await t.get(0n))return;const n=new p$;n.ino=0n,n.mode=511|sB,await t.set(n.data,vP("{}")),await t.set(0n,a$(n)),await t.commit()}catch(t){e.error=t,e.hasError=!0}finally{const t=m$(e);t&&await t}}checkRootSync(){const e={stack:[],error:void 0,hasError:!1};try{const t=f$(e,this.store.transaction(),!1);if(t.getSync(0n))return;const n=new p$;n.ino=0n,n.mode=511|sB,t.setSync(n.data,vP("{}")),t.setSync(0n,a$(n)),t.commitSync()}catch(t){e.error=t,e.hasError=!0}finally{m$(e)}}async _findInode(e,t,n,i=new Set){if(i.has(t))throw new cP(lP.EIO,"Infinite loop detected while finding inode",t);if(i.add(t),"/"==t)return 0n;const{dir:r,base:s}=_P(t),o="/"==r?new p$(await this.get(e,0n,r,n)):await this.findInode(e,r,n,i),a=xP(await this.get(e,o.data,r,n));if(!(s in a))throw cP.With("ENOENT",pP(r,s),n);return a[s]}_findInodeSync(e,t,n,i=new Set){if(i.has(t))throw new cP(lP.EIO,"Infinite loop detected while finding inode",t);if(i.add(t),"/"==t)return 0n;const{dir:r,base:s}=_P(t),o="/"==r?new p$(this.getSync(e,0n,r,n)):this.findInodeSync(e,r,n,i),a=xP(this.getSync(e,o.data,r,n));if(!(s in a))throw cP.With("ENOENT",pP(r,s),n);return a[s]}async findInode(e,t,n,i=new Set){const r=await this._findInode(e,t,n,i);return new p$(await this.get(e,r,t,n))}findInodeSync(e,t,n,i=new Set){const r=this._findInodeSync(e,t,n,i);return new p$(this.getSync(e,r,t,n))}async get(e,t,n,i){const r=await e.get(t);if(!r)throw cP.With("ENOENT",n,i);return r}getSync(e,t,n,i){const r=e.getSync(t);if(!r)throw cP.With("ENOENT",n,i);return r}async allocNew(e,t,n){for(let t=0;t<5;t++){const t=CP();if(!await e.get(t))return t}throw new cP(lP.ENOSPC,"No IDs available",t,n)}allocNewSync(e,t,n){for(let t=0;t<5;t++){const t=CP();if(!e.getSync(t))return t}throw new cP(lP.ENOSPC,"No IDs available",t,n)}async commitNew(e,t,n,i,r){const s={stack:[],error:void 0,hasError:!1};try{if("/"==e)throw cP.With("EEXIST",e,r);const o=f$(s,this.store.transaction(),!0),{dir:a,base:l}=_P(e),u=await this.findInode(o,a,r),c=xP(await this.get(o,u.data,a,r));if(c[l])throw cP.With("EEXIST",e,r);const d=new p$;return d.ino=await this.allocNew(o,e,r),d.data=await this.allocNew(o,e,r),d.mode=n|t,d.uid=u.mode&lB?u.uid:OP.uid,d.gid=u.mode&uB?u.gid:OP.gid,d.size=i.length,await o.set(d.ino,a$(d)),await o.set(d.data,i),c[l]=d.ino,await o.set(u.data,EP(c)),await o.commit(),d}catch(e){s.error=e,s.hasError=!0}finally{const e=m$(s);e&&await e}}commitNewSync(e,t,n,i,r){const s={stack:[],error:void 0,hasError:!1};try{if("/"==e)throw cP.With("EEXIST",e,r);const o=f$(s,this.store.transaction(),!1),{dir:a,base:l}=_P(e),u=this.findInodeSync(o,a,r),c=xP(this.getSync(o,u.data,a,r));if(c[l])throw cP.With("EEXIST",e,r);const d=new p$;return d.ino=this.allocNewSync(o,e,r),d.data=this.allocNewSync(o,e,r),d.size=i.length,d.mode=n|t,d.uid=u.mode&lB?u.uid:OP.uid,d.gid=u.mode&uB?u.gid:OP.gid,o.setSync(d.ino,a$(d)),o.setSync(d.data,i),c[l]=d.ino,o.setSync(u.data,EP(c)),o.commitSync(),d}catch(e){s.error=e,s.hasError=!0}finally{m$(s)}}async remove(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=f$(i,this.store.transaction(),!0),{dir:s,base:o}=_P(e),a=await this.findInode(r,s,n),l=xP(await this.get(r,a.data,s,n));if(!l[o])throw cP.With("ENOENT",e,"remove");const u=l[o],c=new p$(await this.get(r,u,e,n));if(delete l[o],!t&&c.toStats().isDirectory())throw cP.With("EISDIR",e,"remove");await r.set(a.data,EP(l)),--c.nlink<1&&(await r.remove(c.data),await r.remove(u)),await r.commit()}catch(e){i.error=e,i.hasError=!0}finally{const e=m$(i);e&&await e}}removeSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=f$(i,this.store.transaction(),!1),{dir:s,base:o}=_P(e),a=this.findInodeSync(r,s,n),l=xP(this.getSync(r,a.data,s,n)),u=l[o];if(!u)throw cP.With("ENOENT",e,"remove");const c=new p$(this.getSync(r,u,e,n));if(delete l[o],!t&&c.toStats().isDirectory())throw cP.With("EISDIR",e,"remove");r.setSync(a.data,EP(l)),--c.nlink<1&&(r.removeSync(c.data),r.removeSync(u)),r.commitSync()}catch(e){i.error=e,i.hasError=!0}finally{m$(i)}}}class _${constructor(e){this.store=e,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class y$ extends _${async keys(){return this.keysSync()}async get(e){return this.getSync(e)}async set(e,t){return this.setSync(e,t)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class v$ extends y${constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(e){const t=this.store.get(e);return this.stashOldValue(e,t),t}setSync(e,t){return this.markModified(e),this.store.set(e,t)}removeSync(e){this.markModified(e),this.store.delete(e)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const e of this.modifiedKeys){const t=this.originalData.get(e);t?this.store.set(e,t):this.store.delete(e)}this.done=!0}}stashOldValue(e,t){this.originalData.has(e)||this.originalData.set(e,t)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}}class b$ extends Map{constructor(e="tmp"){super(),this.name=e}async sync(){}clearSync(){this.clear()}transaction(){return new v$(this)}}const T$={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:e}){const t=new g$(new b$(e));return t.checkRootSync(),t}},x$=T$;"function"==typeof SuppressedError&&SuppressedError;class E${constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(e){return this.isEnabled&&this.sync.has(e)}get(e){if(this.isEnabled)return this.sync.get(e)}set(e,t){this.isEnabled&&(this.sync.set(e,t),this.async.set(e,Promise.resolve(t)))}hasAsync(e){return this.isEnabled&&this.async.has(e)}getAsync(e){if(this.isEnabled)return this.async.get(e)}setAsync(e,t){this.isEnabled&&(this.async.set(e,t),t.then(t=>this.sync.set(e,t)))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const w$=new E$,I$=new E$;var A$=__webpack_require__(48287);function S$(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,"function"==typeof n?n.bind(t):n]))}const C$=new Map;let O$=100;function M$(e){const t=O$++;return C$.set(t,e),t}function k$(e){if(!C$.has(e))throw new cP(lP.EBADF);return C$.get(e)}const R$=new Map;function N$(e,t){if("/"!==e[0]&&(e="/"+e),e=pP(e),R$.has(e))throw new cP(lP.EINVAL,"Mount point "+e+" is already in use.");R$.set(e,t),I$.clear()}function D$(e){if("/"!==e[0]&&(e="/"+e),e=pP(e),!R$.has(e))throw new cP(lP.EINVAL,"Mount point "+e+" is already unmounted.");R$.delete(e),I$.clear()}function F$(e,t){const n=t?.root||"/";e=AP(fP(n,e));const i=[...R$].sort((e,t)=>e[0].length>t[0].length?-1:1);for(const[t,r]of i)if(t.length<=e.length&&e.startsWith(t))return""===(e=e.slice(t.length>1?t.length:0))&&(e=n),{fs:r,path:e,mountPoint:t,root:n};throw new cP(lP.EIO,"No file system")}async function L$(){await Promise.all([...R$.values()].map(e=>e.ready()))}function P$(e,t){for(const[n,i]of Object.entries(t))e=e?.replaceAll(n,i);return e}function B$(e,t){"string"==typeof e.stack&&(e.stack=P$(e.stack,t));try{e.message=P$(e.message,t)}catch{}return e.path&&(e.path=P$(e.path,t)),e}function $$(e){"/"in e&&D$("/");for(const[t,n]of Object.entries(e))N$(t,n)}function U$(e,t){const n=e.metadata(),i=n.blockSize||4096;return{type:(t?BigInt:Number)(n.type),bsize:(t?BigInt:Number)(i),ffree:(t?BigInt:Number)(n.freeNodes||wB),files:(t?BigInt:Number)(n.totalNodes||wB),bavail:(t?BigInt:Number)(n.freeSpace/i),bfree:(t?BigInt:Number)(n.freeSpace/i),blocks:(t?BigInt:Number)(n.totalSpace/i)}}function V$(e,t){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new cP(lP.EPERM,"Can not chroot() as non-root user");return t&&this?(this.root+=e,this):function(e,t=structuredClone(OP)){const n={root:e,credentials:MP(t)},i=S$(ue,n),r=S$(le,n);return{...n,...i,promises:r}}(fP(this?.root||"/",e),n)}N$("/",x$.create({name:"root"}));class z$ extends jB{off(e,t,n,i){return super.off(e,t,n,i)}removeListener(e,t,n,i){return super.removeListener(e,t,n,i)}constructor(e){super(),this.path=e}setMaxListeners(){throw cP.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw cP.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw cP.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw cP.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw cP.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class j$ extends z${constructor(e,t){super(e),this.options=t,function(e,t){const n=AP(e);G$.has(n)||G$.set(n,new Set);G$.get(n).add(t)}(e.toString(),this)}close(){super.emit("close"),function(e,t){const n=AP(e);G$.has(n)&&(G$.get(n).delete(t),0===G$.get(n).size&&G$.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class Y$ extends z${constructor(e,t){super(e),this.options=t,this.start()}onInterval(){try{const n=Z$(this.path);e=this.previous,t=n,(e.size!=t.size||+e.atime!=+t.atime||+e.mtime!=+t.mtime||+e.ctime!=+t.ctime||e.mode!=t.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(e){this.emit("error",e)}var e,t}start(){const e=this.options.interval||5e3;try{this.previous=Z$(this.path)}catch(e){return void this.emit("error",e)}this.intervalId=setInterval(this.onInterval.bind(this),e),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const G$=new Map;function H$(e,t){if(t=AP(t),G$.has(t))for(const n of G$.get(t))n.emit("change",e,gP(t));let n,i=t;for(;i!==n;)if(n=i,i=mP(i),G$.has(i))for(const n of G$.get(i))n.emit("change",e,t.slice(i.length+("/"==i?0:1)))}var W$=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},X$=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});function q$(e,t){e=AP(e),t=AP(t);const n=F$(e,this),i=F$(t,this);if(IB.checkAccess&&!Z$.call(this,mP(e)).hasAccess(NP,this))throw cP.With("EACCES",e,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),H$("rename",e.toString()),void H$("change",t.toString());oU.call(this,t,sU(e)),eU.call(this,e),H$("rename",e.toString())}catch(r){throw B$(r,{[n.path]:e,[i.path]:t})}}function K$(e){e=AP(e);try{const{fs:t,path:n}=F$(MU.call(this,e),this);return t.existsSync(n)}catch(e){if(e.errno==lP.ENOENT)return!1;throw e}}function Z$(e,t){e=AP(e);const{fs:n,path:i}=F$(MU.call(this,e),this);try{const e=n.statSync(i);if(IB.checkAccess&&!e.hasAccess(RP,this))throw cP.With("EACCES",i,"stat");return t?.bigint?new OB(e):e}catch(t){throw B$(t,{[i]:e})}}function Q$(e,t){e=AP(e);const{fs:n,path:i}=F$(e,this);try{const e=n.statSync(i);return t?.bigint?new OB(e):e}catch(t){throw B$(t,{[i]:e})}}function J$(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const i=W$(n,tU.call(this,e,"r+"),!1);if(t||(t=0),t<0)throw new cP(lP.EINVAL);i.truncateSync(t)}catch(e){n.error=e,n.hasError=!0}finally{X$(n)}}function eU(e){e=AP(e);const{fs:t,path:n}=F$(e,this);try{if(IB.checkAccess&&!(w$.get(e)||t.statSync(n)).hasAccess(NP,this))throw cP.With("EACCES",n,"unlink");t.unlinkSync(n),H$("rename",e.toString())}catch(t){throw B$(t,{[n]:e})}}function tU(e,t,n,i=!0){e=AP(e);const r=wP(n,420),s=NB(t);e=i?MU.call(this,e):e;const{fs:o,path:a}=F$(e,this);let l;try{l=o.statSync(a)}catch{}if(!l){if(!LB(s)&&!BB(s)||"r+"==s)throw cP.With("ENOENT",e,"_open");const t=o.statSync(mP(a));if(IB.checkAccess&&!t.hasAccess(NP,this))throw cP.With("EACCES",mP(e),"_open");if(!t.isDirectory())throw cP.With("ENOTDIR",mP(e),"_open");return o.createFileSync(a,s,r)}if(IB.checkAccess&&(!l.hasAccess(r,this)||!l.hasAccess(DB(s),this)))throw cP.With("EACCES",e,"_open");if($B(s))throw cP.With("EEXIST",e,"_open");const u=o.openFileSync(a,s);return PB(s)&&u.truncateSync(0),u}function nU(e,t,n=kP){return M$(tU.call(this,e,t,n,!0))}function iU(e,t,n){return M$(tU.call(this,e,t,n,!1))}function rU(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=W$(i,tU.call(this,e,t,420,n),!1),s=r.statSync(),o=new Uint8Array(s.size);return r.readSync(o,0,s.size,0),o}catch(e){i.error=e,i.hasError=!0}finally{X$(i)}}function sU(e,t={}){const n=SP(t,null,"r",420);if(!FB(NB(n.flag)))throw new cP(lP.EINVAL,"Flag passed to readFile must allow for reading.");const i=A$.Buffer.from(rU.call(this,"number"==typeof e?k$(e).path:e.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function oU(e,t,n={}){const i={stack:[],error:void 0,hasError:!1};try{const r=SP(n,"utf8","w+",420),s=NB(r.flag);if(!LB(s))throw new cP(lP.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof t&&!r.encoding)throw new cP(lP.EINVAL,"Encoding not specified");const o="string"==typeof t?A$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new cP(lP.EINVAL,"Data not specified");W$(i,tU.call(this,"number"==typeof e?k$(e).path:e.toString(),s,r.mode,!0),!1).writeSync(o,0,o.byteLength,0),H$("change",e.toString())}catch(e){i.error=e,i.hasError=!0}finally{X$(i)}}function aU(e,t,n={}){const i={stack:[],error:void 0,hasError:!1};try{const r=SP(n,"utf8","a+",420),s=NB(r.flag);if(!BB(s))throw new cP(lP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!r.encoding)throw new cP(lP.EINVAL,"Encoding not specified");const o="string"==typeof t?A$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);W$(i,tU.call(this,"number"==typeof e?k$(e).path:e.toString(),s,r.mode,!0),!1).writeSync(o,0,o.byteLength)}catch(e){i.error=e,i.hasError=!0}finally{X$(i)}}function lU(e,t){const n=k$(e).statSync();return t?.bigint?new OB(n):n}function uU(e){k$(e).closeSync(),C$.delete(e)}function cU(e,t=0){if(t||(t=0),t<0)throw new cP(lP.EINVAL);k$(e).truncateSync(t)}function dU(e){k$(e).syncSync()}function hU(e){k$(e).datasyncSync()}function pU(e,t,n,i,r){let s,o,a,l;if("string"==typeof t){l="number"==typeof n?n:null;const e="string"==typeof i?i:"utf8";o=0,s=A$.Buffer.from(t,e),a=s.byteLength}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=n,a=i,l="number"==typeof r?r:null;const u=k$(e);l??(l=u.position);const c=u.writeSync(s,o,a,l);return H$("change",u.path),c}function fU(e,t,n,i,r){const s=k$(e),o="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,r=n.position),r=Number(r),isNaN(r)&&(r=s.position),s.readSync(t,o,i,r)}function mU(e,t,n){k$(e).chownSync(t,n)}function gU(e,t){const n=wP(t,-1);if(n<0)throw new cP(lP.EINVAL,"Invalid mode.");k$(e).chmodSync(n)}function _U(e,t,n){k$(e).utimesSync(IP(t),IP(n))}function yU(e){e=AP(e);const{fs:t,path:n}=F$(MU.call(this,e),this);try{const i=w$.get(e)||t.statSync(n);if(!i.isDirectory())throw cP.With("ENOTDIR",n,"rmdir");if(IB.checkAccess&&!i.hasAccess(NP,this))throw cP.With("EACCES",n,"rmdir");t.rmdirSync(n),H$("rename",e.toString())}catch(t){throw B$(t,{[n]:e})}}function vU(e,t){t="object"==typeof t?t:{mode:t};const n=wP(t?.mode,511);e=MU.call(this,e);const{fs:i,path:r,root:s}=F$(e,this),o={[r]:e};try{if(!t?.recursive){if(IB.checkAccess&&!i.statSync(mP(r)).hasAccess(NP,this))throw cP.With("EACCES",mP(r),"mkdir");return i.mkdirSync(r,n)}const a=[];for(let t=r,n=e;!i.existsSync(t);t=mP(t),n=mP(n))a.unshift(t),o[t]=n;for(const e of a){if(IB.checkAccess&&!i.statSync(mP(e)).hasAccess(NP,this))throw cP.With("EACCES",mP(e),"mkdir");i.mkdirSync(e,n),H$("rename",e)}return 1==s.length?a[0]:a[0]?.slice(s.length)}catch(e){throw B$(e,o)}}function bU(e,t){t="object"==typeof t?t:{encoding:t},e=AP(e);const{fs:n,path:i}=F$(MU.call(this,e),this);let r;try{const t=w$.get(e)||n.statSync(i);if(w$.set(e,t),IB.checkAccess&&!t.hasAccess(RP,this))throw cP.With("EACCES",i,"readdir");if(!t.isDirectory())throw cP.With("ENOTDIR",i,"readdir");r=n.readdirSync(i)}catch(t){throw B$(t,{[i]:e})}const s=[];for(const o of r){const r=w$.get(fP(e,o))||n.statSync(fP(i,o));if(w$.set(fP(e,o),r),t?.withFileTypes?s.push(new UU(o,r)):"buffer"==t?.encoding?s.push(A$.Buffer.from(o)):s.push(o),r.isDirectory()&&t?.recursive)for(const n of bU.call(this,fP(e,o),{...t,_isIndirect:!0}))n instanceof UU?(n.path=fP(o,n.path),s.push(n)):A$.Buffer.isBuffer(n)?s.push(A$.Buffer.from(fP(o,TP(n)))):s.push(fP(o,n))}return t?._isIndirect||w$.clear(),s}function TU(e,t){if(e=AP(e),IB.checkAccess&&!Z$(mP(e)).hasAccess(RP,this))throw cP.With("EACCES",mP(e),"link");if(t=AP(t),IB.checkAccess&&!Z$(mP(t)).hasAccess(NP,this))throw cP.With("EACCES",mP(t),"link");const{fs:n,path:i}=F$(e,this),r=F$(t,this);if(n!=r.fs)throw cP.With("EXDEV",t,"link");try{if(IB.checkAccess&&!n.statSync(i).hasAccess(RP,this))throw cP.With("EACCES",i,"link");return n.linkSync(i,t)}catch(n){throw B$(n,{[i]:e,[r.path]:t})}}function xU(e,t,n="file"){if(!["file","dir","junction"].includes(n))throw new cP(lP.EINVAL,"Invalid type: "+n);if(K$.call(this,t))throw cP.With("EEXIST",t.toString(),"symlink");oU.call(this,t,e.toString());tU.call(this,t,"r+",420,!1).chmodSync(nB)}function EU(e,t){const n=A$.Buffer.from(rU.call(this,e.toString(),"r",!1)),i="object"==typeof t?t?.encoding:t;return"buffer"==i?n:n.toString(i)}function wU(e,t,n){const i=nU.call(this,e,"r+");mU(i,t,n),uU(i)}function IU(e,t,n){const i=iU.call(this,e,"r+");mU(i,t,n),uU(i)}function AU(e,t){const n=nU.call(this,e,"r+");gU(n,t),uU(n)}function SU(e,t){const n=iU.call(this,e,"r+");gU(n,t),uU(n)}function CU(e,t,n){const i=nU.call(this,e,"r+");_U(i,t,n),uU(i)}function OU(e,t,n){const i=iU.call(this,e,"r+");_U(i,t,n),uU(i)}function MU(e,t){e=AP(e);const n=(this?.root||"")+e;if(I$.has(n))return I$.get(n);const{base:i,dir:r}=_P(e),s="/"==r?"/":I$.get((this?.root||"")+r)||MU.call(this,r),o=fP(s,i),{fs:a,path:l}=F$(o,this);try{const i=w$.get(o)||a.statSync(l);if(w$.set(o,i),!i.isSymbolicLink())return I$.set(e,o),o;const r=pP(s,EU.call(this,o,t).toString()),u=I$.get((this?.root||"")+r)||MU.call(this,r);return I$.set(n,u),u}catch(t){if("ENOENT"==t.code)return e;throw B$(t,{[l]:o})}}function kU(e,t=384){if(IB.checkAccess&&!Z$.call(this,e).hasAccess(t,this))throw new cP(lP.EACCES)}function RU(e,t){let n;e=AP(e);try{n=w$.get(e)||Q$.bind(this)(e)}catch(e){if("ENOENT"!=e.code||!t?.force)throw e}if(n){switch(w$.set(e,n),n.mode&eB){case sB:if(t?.recursive)for(const n of bU.call(this,e,{_isIndirect:!0}))RU.call(this,fP(e,n),{...t,_isIndirect:!0});yU.call(this,e);break;case iB:case nB:case rB:case oB:eU.call(this,e);break;default:throw w$.clear(),new cP(lP.EPERM,"File type not supported",e,"rm")}t?._isIndirect||w$.clear()}}function NU(e,t){const n="object"==typeof t?t?.encoding:t||"utf8",i="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return vU.call(this,i),"buffer"==n?A$.Buffer.from(i):i}function DU(e,t,n){if(e=AP(e),t=AP(t),n&&n&FP&&K$(t))throw new cP(lP.EEXIST,"Destination file already exists.",t,"copyFile");oU.call(this,t,sU(e)),H$("rename",t.toString())}function FU(e,t,n){const i=k$(e);let r=0;for(const e of t)r+=i.readSync(e,0,e.byteLength,n+r);return r}function LU(e,t,n){const i=k$(e);let r=0;for(const e of t)r+=i.writeSync(new Uint8Array(e.buffer),0,e.byteLength,n+r);return r}function PU(e,t){return e=AP(e),new VU(e,this)}function BU(e,t,n){e=AP(e),t=AP(t);const i=Q$.call(this,e);if(n?.errorOnExist&&K$.call(this,t))throw new cP(lP.EEXIST,"Destination file or directory already exists.",t,"cp");switch(i.mode&eB){case sB:if(!n?.recursive)throw new cP(lP.EISDIR,e+" is a directory (not copied)",e,"cp");vU.call(this,t,{recursive:!0});for(const i of bU.call(this,e,{withFileTypes:!0}))n.filter&&!n.filter(fP(e,i.name),fP(t,i.name))||BU.call(this,fP(e,i.name),fP(t,i.name),n);break;case iB:case nB:DU.call(this,e,t);break;default:throw new cP(lP.EPERM,"File type not supported",e,"rm")}n?.preserveTimestamps&&CU.call(this,t,i.atime,i.mtime)}function $U(e,t){e=AP(e);const{fs:n}=F$(e,this);return U$(n,t?.bigint)}class UU{get name(){return gP(this.path)}constructor(e,t){this.path=e,this.stats=t}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}}class VU{checkClosed(){if(this.closed)throw new cP(lP.EBADF,"Can not use closed Dir")}constructor(e,t){this.path=e,this.context=t,this.closed=!1}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await aV.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(e){if(!e)return this._read();this._read().then(t=>e(void 0,t))}readSync(){return this.checkClosed(),this._entries??(this._entries=bU.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const e=await this._read();return e?{done:!1,value:e}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var zU=__webpack_require__(86248);class jU extends zU.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(t){e(new cP(lP.EIO,t.toString()))}}}class YU extends zU.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(t){e(new cP(lP.EIO,t.toString()))}}}var GU=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},HU=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class WU{constructor(e,t){this.context=t;const n="number"!=typeof e;this.fd=n?M$(e):e,this.file=n?e:k$(e)}async chown(e,t){await this.file.chown(e,t),H$("change",this.file.path)}async chmod(e){const t=wP(e,-1);if(t<0)throw new cP(lP.EINVAL,"Invalid mode.");await this.file.chmod(t),H$("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(e){if(e||(e=0),e<0)throw new cP(lP.EINVAL);await this.file.truncate(e),H$("change",this.file.path)}async utimes(e,t){await this.file.utimes(IP(e),IP(t)),H$("change",this.file.path)}async appendFile(e,t={}){const n=SP(t,"utf8","a",420);if(!BB(NB(n.flag)))throw new cP(lP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!n.encoding)throw new cP(lP.EINVAL,"Encoding not specified");const i="string"==typeof e?A$.Buffer.from(e,n.encoding):e;await this.file.write(i,0,i.length),H$("change",this.file.path)}read(e,t,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(e,t,n,i)}async readFile(e){const t=SP(e,null,"r",292);if(!FB(NB(t.flag)))throw new cP(lP.EINVAL,"Flag passed must allow for reading.");const{size:n}=await this.stat(),{buffer:i}=await this.file.read(new Uint8Array(n),0,n,0),r=A$.Buffer.from(i);return t.encoding?r.toString(t.encoding):r}readableWebStream(e={}){const t=globalThis;if(!("ReadableStream"in t))throw new cP(lP.ENOSYS,"ReadableStream is missing on globalThis");return new t.ReadableStream({start:async e=>{try{const t=65536,n=1e7;let i=0,r=0,s=NaN;for(;s>0;){const o=await this.read(new Uint8Array(t),0,t,r);if(!o.bytesRead)return void e.close();if(e.enqueue(o.buffer.slice(0,o.bytesRead)),r+=o.bytesRead,++i>=n)throw new cP(lP.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");s=o.bytesRead}}catch(t){e.error(t)}},type:e.type})}readLines(e){throw cP.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){const t=await this.file.stat();if(IB.checkAccess&&!t.hasAccess(RP,this.context))throw cP.With("EACCES",this.file.path,"stat");return e?.bigint?new OB(t):t}async write(e,t,n,i){let r,s,o;if("string"==typeof e){i="number"==typeof t?t:null;const a="string"==typeof n?n:"utf8";s=0,r=A$.Buffer.from(e,a),o=r.length}else r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=t,o=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(r,s,o,i);return H$("change",this.file.path),{buffer:r,bytesWritten:a}}async writeFile(e,t={}){const n=SP(t,"utf8","w",420);if(!LB(NB(n.flag)))throw new cP(lP.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof e&&!n.encoding)throw new cP(lP.EINVAL,"Encoding not specified");const i="string"==typeof e?A$.Buffer.from(e,n.encoding):e;await this.file.write(i,0,i.length,0),H$("change",this.file.path)}async close(){await this.file.close(),C$.delete(this.fd)}async writev(e,t){let n=0;for(const i of e)n+=(await this.write(i,0,i.length,t+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,t){let n=0;for(const i of e)n+=(await this.read(i,0,i.byteLength,t+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){const t=new jU({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:async e=>{try{const n=await this.read(new Uint8Array(e),0,e,this.file.position);t.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(e){t.destroy(e)}}});return t.path=this.file.path,t}createWriteStream(e){const t=new YU({highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:async(e,t,n)=>{try{const{bytesWritten:i}=await this.write(e,null,t);n(i==e.length?null:new Error("Failed to write full chunk"))}catch(e){n(e)}}});return t.path=this.file.path,t}}async function XU(e,t){e=AP(e),t=AP(t);const n=F$(e,this),i=F$(t,this);if(IB.checkAccess&&!(await KU.call(this,mP(e))).hasAccess(NP,this))throw cP.With("EACCES",e,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),H$("rename",e.toString()),void H$("change",t.toString());await iV.call(this,t,await nV(e)),await JU.call(this,e),H$("rename",e.toString())}catch(r){throw B$(r,{[n.path]:e,[i.path]:t})}}async function qU(e){try{const{fs:t,path:n}=F$(await _V.call(this,e),this);return await t.exists(n)}catch(e){if(e instanceof cP&&"ENOENT"==e.code)return!1;throw e}}async function KU(e,t){e=AP(e);const{fs:n,path:i}=F$(await _V.call(this,e),this);try{const e=await n.stat(i);if(IB.checkAccess&&!e.hasAccess(RP,this))throw cP.With("EACCES",i,"stat");return t?.bigint?new OB(e):e}catch(t){throw B$(t,{[i]:e})}}async function ZU(e,t){e=AP(e);const{fs:n,path:i}=F$(e,this);try{const e=await n.stat(i);return t?.bigint?new OB(e):e}catch(t){throw B$(t,{[i]:e})}}async function QU(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const i=GU(n,await tV.call(this,e,"r+"),!0);await i.truncate(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=HU(n);e&&await e}}async function JU(e){e=AP(e);const{fs:t,path:n}=F$(e,this);try{if(IB.checkAccess&&!(await(w$.getAsync(e)||t.stat(n))).hasAccess(NP,this))throw cP.With("EACCES",n,"unlink");await t.unlink(n),H$("rename",e.toString())}catch(t){throw B$(t,{[n]:e})}}async function eV(e,t,n=420,i){e=AP(e);const r=wP(n,420),s=NB(t);e=i?await _V.call(this,e):e;const{fs:o,path:a}=F$(e,this),l=await o.stat(a).catch(()=>null);if(!l){if(!LB(s)&&!BB(s)||"r+"==s)throw cP.With("ENOENT",e,"_open");const t=await o.stat(mP(a));if(IB.checkAccess&&!t.hasAccess(NP,this))throw cP.With("EACCES",mP(e),"_open");if(!t.isDirectory())throw cP.With("ENOTDIR",mP(e),"_open");return new WU(await o.createFile(a,s,r),this)}if(IB.checkAccess&&!l.hasAccess(DB(s),this))throw cP.With("EACCES",e,"_open");if($B(s))throw cP.With("EEXIST",e,"_open");const u=new WU(await o.openFile(a,s),this);return PB(s)&&await u.truncate(0),u}async function tV(e,t="r",n=420){return await eV.call(this,e,t,n,!0)}async function nV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=SP(t,null,"r",420),r=GU(n,"object"==typeof e&&"fd"in e?e:await tV.call(this,e,i.flag,i.mode),!0);return await r.readFile(i)}catch(e){n.error=e,n.hasError=!0}finally{const e=HU(n);e&&await e}}async function iV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=SP(n,"utf8","w+",420),s=GU(i,e instanceof WU?e:await tV.call(this,e.toString(),r.flag,r.mode),!0),o=t;if("string"!=typeof o&&!(o instanceof Uint8Array))throw new cP(lP.EINVAL,"Iterables and streams not supported",s.file.path,"writeFile");await s.writeFile(o,r)}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function rV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=SP(n,"utf8","a",420);if(!BB(NB(r.flag)))throw new cP(lP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!r.encoding)throw new cP(lP.EINVAL,"Encoding not specified");const s="string"==typeof t?A$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=GU(i,"object"==typeof e&&"fd"in e?e:await tV.call(this,e,r.flag,r.mode),!0);await o.appendFile(s,r)}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function sV(e){e=await _V.call(this,e);const{fs:t,path:n}=F$(e,this);try{const i=await(w$.getAsync(e)||t.stat(n));if(!i)throw cP.With("ENOENT",e,"rmdir");if(!i.isDirectory())throw cP.With("ENOTDIR",n,"rmdir");if(IB.checkAccess&&!i.hasAccess(NP,this))throw cP.With("EACCES",n,"rmdir");await t.rmdir(n),H$("rename",e.toString())}catch(t){throw B$(t,{[n]:e})}}async function oV(e,t){t="object"==typeof t?t:{mode:t};const n=wP(t?.mode,511);e=await _V.call(this,e);const{fs:i,path:r,root:s}=F$(e,this),o={[r]:e};try{if(!t?.recursive){if(IB.checkAccess&&!(await i.stat(mP(r))).hasAccess(NP,this))throw cP.With("EACCES",mP(r),"mkdir");return await i.mkdir(r,n),void H$("rename",e.toString())}const a=[];for(let t=r,n=e;!await i.exists(t);t=mP(t),n=mP(n))a.unshift(t),o[t]=n;for(const e of a){if(IB.checkAccess&&!(await i.stat(mP(e))).hasAccess(NP,this))throw cP.With("EACCES",mP(e),"mkdir");await i.mkdir(e,n),H$("rename",e)}return 1==s.length?a[0]:a[0]?.slice(s.length)}catch(e){throw B$(e,o)}}async function aV(e,t){t="object"==typeof t?t:{encoding:t},e=await _V.call(this,e);const n=t=>{throw B$(t,{[r]:e})},{fs:i,path:r}=F$(e,this),s=w$.getAsync(e)||i.stat(r).catch(n);w$.setAsync(e,s);const o=await s;if(!o)throw cP.With("ENOENT",e,"readdir");if(IB.checkAccess&&!o.hasAccess(RP,this))throw cP.With("EACCES",e,"readdir");if(!o.isDirectory())throw cP.With("ENOTDIR",e,"readdir");const a=await i.readdir(r).catch(n),l=[];return await Promise.all(a.map(async s=>{let o;if(t?.recursive||t?.withFileTypes){const t=w$.getAsync(fP(e,s))||i.stat(fP(r,s)).catch(n);w$.setAsync(fP(e,s),t),o=await t}if(t?.withFileTypes?l.push(new UU(s,o)):"buffer"==t?.encoding?l.push(A$.Buffer.from(s)):l.push(s),t?.recursive&&o?.isDirectory())for(const n of await aV.call(this,fP(e,s),{...t,_isIndirect:!0}))n instanceof UU?(n.path=fP(s,n.path),l.push(n)):A$.Buffer.isBuffer(n)?l.push(A$.Buffer.from(fP(s,TP(n)))):l.push(fP(s,n))})),t?._isIndirect||w$.clear(),l}async function lV(e,t){e=AP(e),t=AP(t);const{fs:n,path:i}=F$(e,this),r=F$(t,this);if(n!=r.fs)throw cP.With("EXDEV",t,"link");try{if(IB.checkAccess&&!(await n.stat(mP(e))).hasAccess(RP,this))throw cP.With("EACCES",mP(i),"link");if(IB.checkAccess&&!(await KU.call(this,mP(t))).hasAccess(NP,this))throw cP.With("EACCES",mP(t),"link");if(IB.checkAccess&&!(await n.stat(i)).hasAccess(RP,this))throw cP.With("EACCES",i,"link");return await n.link(i,r.path)}catch(n){throw B$(n,{[r.path]:t,[i]:e})}}async function uV(e,t,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new cP(lP.EINVAL,"Invalid symlink type: "+n);if(await qU.call(this,t))throw cP.With("EEXIST",t.toString(),"symlink");const r=GU(i,await eV.call(this,t,"w+",420,!1),!0);await r.writeFile(e.toString()),await r.file.chmod(nB)}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function cV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=GU(n,await eV.call(this,AP(e),"r",420,!1),!0),r=await i.readFile(),s="object"==typeof t?t?.encoding:t;return"buffer"==s?r:r.toString(s)}catch(e){n.error=e,n.hasError=!0}finally{const e=HU(n);e&&await e}}async function dV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=GU(i,await tV.call(this,e,"r+"),!0);await r.chown(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function hV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=GU(i,await eV.call(this,e,"r+",420,!1),!0);await r.chown(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function pV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=GU(n,await tV.call(this,e,"r+"),!0);await i.chmod(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=HU(n);e&&await e}}async function fV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=GU(n,await eV.call(this,e,"r+",420,!1),!0);await i.chmod(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=HU(n);e&&await e}}async function mV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=GU(i,await tV.call(this,e,"r+"),!0);await r.utimes(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function gV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=GU(i,await eV.call(this,e,"r+",420,!1),!0);await r.utimes(new Date(t),new Date(n))}catch(e){i.error=e,i.hasError=!0}finally{const e=HU(i);e&&await e}}async function _V(e,t){e=AP(e);const n=(this?.root||"")+e;if(I$.hasAsync(n))return I$.getAsync(n);const{base:i,dir:r}=_P(e),s="/"==r?"/":await(I$.getAsync((this?.root||"")+r)||_V.call(this,r)),o=fP(s,i),{fs:a,path:l}=F$(o,this);try{const t=w$.getAsync(o)||a.stat(l);if(w$.setAsync(o,t),!(await t).isSymbolicLink())return I$.set(e,o),o;const i=pP(s,(await cV.call(this,o)).toString()),r=I$.getAsync((this?.root||"")+i)||_V.call(this,i);return I$.setAsync(n,r),await r}catch(t){if("ENOENT"==t.code)return e;throw B$(t,{[l]:o})}}function yV(e,t={}){return{[Symbol.asyncIterator](){const n=new j$(e.toString(),"string"!=typeof t?t:{encoding:t}),i=[];function r(){n.close();for(const e of i)e({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",(e,t)=>{i.shift()?.({value:{eventType:e,filename:t},done:!1})}),{async next(){const{promise:e,resolve:t}=Promise.withResolvers();return i.push(t),e},return:r,throw:r}}}}async function vV(e,t=kP){if(!IB.checkAccess)return;if(!(await KU.call(this,e)).hasAccess(t,this))throw new cP(lP.EACCES)}async function bV(e,t){e=AP(e);const n=await(w$.getAsync(e)||ZU.call(this,e).catch(e=>{if("ENOENT"!=e.code||!t?.force)throw e}));if(n){switch(w$.set(e,n),n.mode&eB){case sB:if(t?.recursive)for(const n of await aV.call(this,e,{_isIndirect:!0}))await bV.call(this,fP(e,n),{...t,_isIndirect:!0});await sV.call(this,e);break;case iB:case nB:case rB:case oB:await JU.call(this,e);break;default:throw w$.clear(),new cP(lP.EPERM,"File type not supported",e,"rm")}t?._isIndirect||w$.clear()}}async function TV(e,t){const n="object"==typeof t?t?.encoding:t||"utf8",i="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await oV.call(this,i),"buffer"==n?A$.Buffer.from(i):i}async function xV(e,t,n){if(e=AP(e),t=AP(t),n&&n&FP&&await qU.call(this,t))throw new cP(lP.EEXIST,"Destination file already exists.",t,"copyFile");await iV.call(this,t,await nV.call(this,e)),H$("rename",t.toString())}function EV(e,t){return e=AP(e),Promise.resolve(new VU(e,this))}async function wV(e,t,n){e=AP(e),t=AP(t);const i=await ZU.call(this,e);if(n?.errorOnExist&&await qU.call(this,t))throw new cP(lP.EEXIST,"Destination file or directory already exists.",t,"cp");switch(i.mode&eB){case sB:{if(!n?.recursive)throw new cP(lP.EISDIR,e+" is a directory (not copied)",e,"cp");const[i]=await Promise.all([aV.call(this,e,{withFileTypes:!0}),oV.call(this,t,{recursive:!0})]),r=async i=>{n.filter&&!n.filter(fP(e,i.name),fP(t,i.name))||await wV.call(this,fP(e,i.name),fP(t,i.name),n)};await Promise.all(i.map(r));break}case iB:case nB:await xV.call(this,e,t);break;default:throw new cP(lP.EPERM,"File type not supported",e,"rm")}n?.preserveTimestamps&&await mV.call(this,t,i.atime,i.mtime)}async function IV(e,t){e=AP(e);const{fs:n}=F$(e,this);return Promise.resolve(U$(n,t?.bigint))}const AV=()=>{};function SV(e,t,n=AV){XU.call(this,e,t).then(()=>n()).catch(n)}function CV(e,t=AV){qU.call(this,e).then(t).catch(()=>t(!1))}function OV(e,t,n=AV){n="function"==typeof t?t:n,KU.call(this,e,"function"!=typeof t?t:{}).then(e=>n(void 0,e)).catch(n)}function MV(e,t,n=AV){n="function"==typeof t?t:n,ZU.call(this,e,"function"!=typeof t?t:{}).then(e=>n(void 0,e)).catch(n)}function kV(e,t=0,n=AV){n="function"==typeof t?t:n;const i="number"==typeof t?t:0;QU.call(this,e,i).then(()=>n()).catch(n)}function RV(e,t=AV){JU.call(this,e).then(()=>t()).catch(t)}function NV(e,t,n,i=AV){const r=wP(n,420);i="function"==typeof n?n:i,tV.call(this,e,t,r).then(e=>i(void 0,e.fd)).catch(i)}function DV(e,t,n=AV){n="function"==typeof t?t:n,nV.call(this,e,"function"==typeof t?null:t).then(e=>n(void 0,e)).catch(n)}function FV(e,t,n,i=AV){i="function"==typeof n?n:i,iV.call(this,e,t,"function"!=typeof n?n:null).then(()=>i(void 0)).catch(i)}function LV(e,t,n,i=AV){const r="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,rV.call(this,e,t,r).then(()=>i()).catch(i)}function PV(e,t,n=AV){n="function"==typeof t?t:n,k$(e).stat().then(e=>n(void 0,"object"==typeof t&&t?.bigint?new OB(e):e)).catch(n)}function BV(e,t=AV){const n=k$(e).close();C$.delete(e),n.then(()=>t()).catch(t)}function $V(e,t,n=AV){const i="number"==typeof t?t:0;n="function"==typeof t?t:n;const r=k$(e);if(i<0)throw new cP(lP.EINVAL);r.truncate(i).then(()=>n()).catch(n)}function UV(e,t=AV){k$(e).sync().then(()=>t()).catch(t)}function VV(e,t=AV){k$(e).datasync().then(()=>t()).catch(t)}function zV(e,t,n,i,r,s=AV){let o,a,l,u,c;const d=new WU(e,this);if("string"==typeof t){switch(c="utf8",typeof n){case"function":s=n;break;case"number":u=n,c="string"==typeof i?i:"utf8",s="function"==typeof r?r:s;break;default:return void(s="function"==typeof i?i:"function"==typeof r?r:s)(new cP(lP.EINVAL,"Invalid arguments."))}o=A$.Buffer.from(t),a=0,l=o.length;const e=s;d.write(o,a,l,u).then(({bytesWritten:t})=>e(void 0,t,o.toString(c))).catch(e)}else{o=A$.Buffer.from(t.buffer),a=n,l=i,u="number"==typeof r?r:null;const e="function"==typeof r?r:s;d.write(o,a,l,u).then(({bytesWritten:t})=>e(void 0,t,o)).catch(e)}}function jV(e,t,n,i,r,s=AV){new WU(e,this).read(t,n,i,r).then(({bytesRead:e,buffer:t})=>s(void 0,e,t)).catch(s)}function YV(e,t,n,i=AV){new WU(e,this).chown(t,n).then(()=>i()).catch(i)}function GV(e,t,n){new WU(e,this).chmod(t).then(()=>n()).catch(n)}function HV(e,t,n,i=AV){new WU(e,this).utimes(t,n).then(()=>i()).catch(i)}function WV(e,t=AV){sV.call(this,e).then(()=>t()).catch(t)}function XV(e,t,n=AV){oV.call(this,e,t).then(()=>n()).catch(n)}function qV(e,t,n=AV){n="function"==typeof t?t:n;const i="function"!=typeof t?t:{};aV.call(this,e,i).then(e=>n(void 0,e)).catch(n)}function KV(e,t,n=AV){lV.call(this,e,t).then(()=>n()).catch(n)}function ZV(e,t,n,i=AV){const r="string"==typeof n?n:"file";i="function"==typeof n?n:i,uV.call(this,e,t,r).then(()=>i()).catch(i)}function QV(e,t,n=AV){n="function"==typeof t?t:n,cV.call(this,e).then(e=>n(void 0,e)).catch(n)}function JV(e,t,n,i=AV){dV.call(this,e,t,n).then(()=>i()).catch(i)}function ez(e,t,n,i=AV){hV.call(this,e,t,n).then(()=>i()).catch(i)}function tz(e,t,n=AV){pV.call(this,e,t).then(()=>n()).catch(n)}function nz(e,t,n=AV){fV.call(this,e,t).then(()=>n()).catch(n)}function iz(e,t,n,i=AV){mV.call(this,e,t,n).then(()=>i()).catch(i)}function rz(e,t,n,i=AV){gV.call(this,e,t,n).then(()=>i()).catch(i)}function sz(e,t,n=AV){n="function"==typeof t?t:n,_V.call(this,e,"function"==typeof t?null:t).then(e=>n(void 0,e)).catch(n)}function oz(e,t,n=AV){const i="number"==typeof t?t:RP;n="function"==typeof t?t:n,vV.call(this,e,i).then(()=>n()).catch(n)}const az=new Map;function lz(e,t,n){const i=AP(e.toString()),r="function"!=typeof t?t:{};if("function"==typeof t&&(n=t),!n)throw new cP(lP.EINVAL,"No listener specified",e.toString(),"watchFile");if(az.has(i)){const e=az.get(i);return void(e&&e.listeners.add(n))}const s=new Y$(i,r);s.on("change",(e,t)=>{const n=az.get(i);if(n)for(const i of n.listeners)i(e,t)}),az.set(i,{watcher:s,listeners:new Set})}function uz(e,t=AV){const n=AP(e.toString()),i=az.get(n);i&&(t&&t!==AV?i.listeners.delete(t):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),az.delete(n)))}function cz(e,t,n){const i=new j$(AP(e),"object"==typeof t?t:{});return n="function"==typeof t?t:n,i.on("change",n||AV),i}function dz(e,t){const n=this;let i;const r=new jU({highWaterMark:(t="object"==typeof t?t:{encoding:t}).highWaterMark||65536,encoding:t.encoding||"utf8",async read(s){try{i||(i=await tV.call(n,e,"r",t?.mode));const o=await i.read(new Uint8Array(s),0,s,i.file.position);r.push(o.bytesRead?o.buffer.slice(0,o.bytesRead):null),i.file.position+=o.bytesRead,o.bytesRead||await i.close()}catch(e){await(i?.close()),r.destroy(e)}},destroy(e,t){i?.close().then(()=>t(e)).catch(AV)}});return r.path=e.toString(),r}function hz(e,t){const n=this;let i;t="object"==typeof t?t:{encoding:t};const r=new YU({highWaterMark:t?.highWaterMark,async write(r,s,o){try{i||(i=await tV.call(n,e,"w",t?.mode||438)),await i.write(r,0,s),o(void 0)}catch(e){await(i?.close()),o(e)}},destroy(e,t){t(e),i?.close().then(()=>t(e)).catch(t)},final(e){i?.close().then(()=>e()).catch(e)}});return r.path=e.toString(),r}function pz(e,t,n=AV){n="function"==typeof t?t:n,bV.call(this,e,"function"==typeof t?void 0:t).then(()=>n(void 0)).catch(n)}function fz(e,t,n=AV){n="function"==typeof t?t:n,TV.call(this,e,"function"!=typeof t?t:null).then(e=>n(void 0,e)).catch(n)}function mz(e,t,n,i=AV){i="function"==typeof n?n:i,xV.call(this,e,t,"function"==typeof n?void 0:n).then(()=>i(void 0)).catch(i)}function gz(e,t,n,i=AV){i="function"==typeof n?n:i,new WU(e,this).readv(t,"function"==typeof n?void 0:n).then(({buffers:e,bytesRead:t})=>i(void 0,t,e)).catch(i)}function _z(e,t,n,i=AV){i="function"==typeof n?n:i,new WU(e,this).writev(t,"function"==typeof n?void 0:n).then(({buffers:e,bytesWritten:t})=>i(void 0,t,e)).catch(i)}function yz(e,t,n=AV){n="function"==typeof t?t:n,EV.call(this,e,"function"==typeof t?void 0:t).then(e=>n(void 0,e)).catch(n)}function vz(e,t,n,i=AV){i="function"==typeof n?n:i,wV.call(this,e,t,"function"==typeof n?void 0:n).then(()=>i(void 0)).catch(i)}function bz(e,t,n=AV){n="function"==typeof t?t:n,IV.call(this,e,"function"==typeof t?void 0:t).then(e=>n(void 0,e)).catch(n)}async function Tz(e,t){const n=await tV.call(this,e.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],t)}var xz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Ez=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});function wz(e){return class extends e{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(e=>{const t=()=>this._queueRunning?setTimeout(t):e();t()})}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof g$&&this instanceof g$){const e=this._sync.store.transaction(),t=this.store.transaction(),n=[];for(const i of await t.keys())n.push(t.get(i).then(t=>e.setSync(i,t)));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}}checkSync(e,t){if(this._disableSync)throw new cP(lP.ENOTSUP,"Sync caching has been disabled for this async file system",e,t);if(!this._sync)throw new cP(lP.ENOTSUP,"No sync cache is attached to this async file system",e,t)}renameSync(e,t){this.checkSync(e,"rename"),this._sync.renameSync(e,t),this.queue("rename",e,t)}statSync(e){return this.checkSync(e,"stat"),this._sync.statSync(e)}createFileSync(e,t,n){return this.checkSync(e,"createFile"),this._sync.createFileSync(e,t,n),this.queue("createFile",e,t,n),this.openFileSync(e,t)}openFileSync(e,t){this.checkSync(e,"openFile");const n=this._sync.openFileSync(e,t+"+"),i=n.statSync(),r=new Uint8Array(i.size);return n.readSync(r),new VB(this,e,t,i,r)}unlinkSync(e){this.checkSync(e,"unlinkSync"),this._sync.unlinkSync(e),this.queue("unlink",e)}rmdirSync(e){this.checkSync(e,"rmdir"),this._sync.rmdirSync(e),this.queue("rmdir",e)}mkdirSync(e,t){this.checkSync(e,"mkdir"),this._sync.mkdirSync(e,t),this.queue("mkdir",e,t)}readdirSync(e){return this.checkSync(e,"readdir"),this._sync.readdirSync(e)}linkSync(e,t){this.checkSync(e,"link"),this._sync.linkSync(e,t),this.queue("link",e,t)}syncSync(e,t,n){this.checkSync(e,"sync"),this._sync.syncSync(e,t,n),this.queue("sync",e,t,n)}existsSync(e){return this.checkSync(e,"exists"),this._sync.existsSync(e)}async crossCopy(e){this.checkSync(e,"crossCopy");const t=await this.stat(e);if(!t.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=xz(n,await this.openFile(e,NB("r")),!0),r=xz(n,this._sync.createFileSync(e,NB("w"),t.mode),!1),s=new Uint8Array(t.size);return await i.read(s),void r.writeSync(s,0,t.size)}catch(e){n.error=e,n.hasError=!0}finally{const e=Ez(n);e&&await e}}if("/"!==e){const t=await this.stat(e);this._sync.mkdirSync(e,t.mode)}const n=[];for(const t of await this.readdir(e))n.push(this.crossCopy(fP(e,t)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[e,...t]=this._queue.shift();await this[e](...t),await this._next()}queue(...e){this._queue.push(e),this._next()}}}new Map;wz(zB);new Map;Map;Iz=zB;var Iz;var Az=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Sz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class Cz{get isLocked(){return this._isLocked}constructor(e){this.previous=e,this.current=Promise.withResolvers(),this._isLocked=!0}async done(){await(this.previous?.done()),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}}class Oz{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const e=new Cz(this.currentLock);return this.currentLock=e,e}async lock(e,t){const n=this.currentLock,i=this.addLock(),r=(new Error).stack;return setTimeout(()=>{if(i.isLocked){const n=cP.With("EDEADLK",e,t);throw n.stack+=r?.slice(5),n}},5e3),await(n?.done()),i}lockSync(e,t){if(this.currentLock?.isLocked)throw cP.With("EBUSY",e,t);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,await this.lock(e,"rename"),!1);await this._fs.rename(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}renameSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,this.lockSync(e,"rename"),!1);return this._fs.renameSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}async stat(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,await this.lock(e,"stat"),!1);return await this._fs.stat(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}statSync(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,this.lockSync(e,"stat"),!1);return this._fs.statSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}async openFile(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,await this.lock(e,"openFile"),!1);const i=await this._fs.openFile(e,t);return i.fs=this,i}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}openFileSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,this.lockSync(e,"openFile"),!1);const i=this._fs.openFileSync(e,t);return i.fs=this,i}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}async createFile(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Az(i,await this.lock(e,"createFile"),!1);const r=await this._fs.createFile(e,t,n);return r.fs=this,r}catch(e){i.error=e,i.hasError=!0}finally{Sz(i)}}createFileSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Az(i,this.lockSync(e,"createFile"),!1);const r=this._fs.createFileSync(e,t,n);return r.fs=this,r}catch(e){i.error=e,i.hasError=!0}finally{Sz(i)}}async unlink(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,await this.lock(e,"unlink"),!1);await this._fs.unlink(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}unlinkSync(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,this.lockSync(e,"unlink"),!1);return this._fs.unlinkSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}async rmdir(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,await this.lock(e,"rmdir"),!1);await this._fs.rmdir(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}rmdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,this.lockSync(e,"rmdir"),!1);return this._fs.rmdirSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}async mkdir(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,await this.lock(e,"mkdir"),!1);await this._fs.mkdir(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}mkdirSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,this.lockSync(e,"mkdir"),!1);return this._fs.mkdirSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}async readdir(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,await this.lock(e,"readdir"),!1);return await this._fs.readdir(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}readdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,this.lockSync(e,"readdir"),!1);return this._fs.readdirSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}async exists(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,await this.lock(e,"exists"),!1);return await this._fs.exists(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}existsSync(e){const t={stack:[],error:void 0,hasError:!1};try{Az(t,this.lockSync(e,"exists"),!1);return this._fs.existsSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Sz(t)}}async link(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,await this.lock(e,"link"),!1);await this._fs.link(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}linkSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Az(n,this.lockSync(e,"link"),!1);return this._fs.linkSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Sz(n)}}async sync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Az(i,await this.lock(e,"sync"),!1);await this._fs.sync(e,t,n)}catch(e){i.error=e,i.hasError=!0}finally{Sz(i)}}syncSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Az(i,this.lockSync(e,"sync"),!1);return this._fs.syncSync(e,t,n)}catch(e){i.error=e,i.hasError=!0}finally{Sz(i)}}}var Mz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},kz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});const Rz="/.deleted";class Nz extends zB{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:e,readable:t}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=e,this.readable=t,this.writable.metadata().readonly)throw new cP(lP.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:Dz.name}}async sync(e,t,n){await this.copyForWrite(e),await this.writable.exists(e)||await this.writable.createFile(e,"w",420),await this.writable.sync(e,t,n)}syncSync(e,t,n){this.copyForWriteSync(e),this.writable.syncSync(e,t,n)}async _initialize(){if(!this._isInitialized){try{const e=await this.writable.openFile(Rz,NB("r")),{size:t}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(t));this._deleteLog=TP(n)}catch(e){if(e.errno!==lP.ENOENT)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(e){this._deleteLog=e,this._reparseDeletionLog(),await this.updateLog("")}async rename(e,t){this.checkInitialized(),this.checkPath(e),this.checkPath(t),await this.copyForWrite(e);try{await this.writable.rename(e,t)}catch{if(this._deletedFiles.has(e))throw cP.With("ENOENT",e,"rename")}}renameSync(e,t){this.checkInitialized(),this.checkPath(e),this.checkPath(t),this.copyForWriteSync(e);try{this.writable.renameSync(e,t)}catch{if(this._deletedFiles.has(e))throw cP.With("ENOENT",e,"rename")}}async stat(e){this.checkInitialized();try{return await this.writable.stat(e)}catch{if(this._deletedFiles.has(e))throw cP.With("ENOENT",e,"stat");const t=await this.readable.stat(e);return t.mode|=146,t}}statSync(e){this.checkInitialized();try{return this.writable.statSync(e)}catch{if(this._deletedFiles.has(e))throw cP.With("ENOENT",e,"stat");const t=this.readable.statSync(e);return t.mode|=146,t}}async openFile(e,t){if(await this.writable.exists(e))return this.writable.openFile(e,t);const n=await this.readable.openFile(e,NB("r")),i=await n.stat(),{buffer:r}=await n.read(new Uint8Array(i.size));return new VB(this,e,t,i,r)}openFileSync(e,t){if(this.writable.existsSync(e))return this.writable.openFileSync(e,t);const n=this.readable.openFileSync(e,NB("r")),i=n.statSync(),r=new Uint8Array(i.size);return n.readSync(r),new VB(this,e,t,i,r)}async createFile(e,t,n){return this.checkInitialized(),await this.writable.createFile(e,t,n),this.openFile(e,t)}createFileSync(e,t,n){return this.checkInitialized(),this.writable.createFileSync(e,t,n),this.openFileSync(e,t)}async link(e,t){this.checkInitialized(),await this.copyForWrite(e),await this.writable.link(e,t)}linkSync(e,t){this.checkInitialized(),this.copyForWriteSync(e),this.writable.linkSync(e,t)}async unlink(e){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e))throw cP.With("ENOENT",e,"unlink");await this.writable.exists(e)&&await this.writable.unlink(e),await this.exists(e)&&await this.deletePath(e)}unlinkSync(e){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e))throw cP.With("ENOENT",e,"unlink");this.writable.existsSync(e)&&this.writable.unlinkSync(e),this.existsSync(e)&&this.deletePath(e)}async rmdir(e){if(this.checkInitialized(),!await this.exists(e))throw cP.With("ENOENT",e,"rmdir");if(await this.writable.exists(e)&&await this.writable.rmdir(e),await this.exists(e)){if((await this.readdir(e)).length)throw cP.With("ENOTEMPTY",e,"rmdir");await this.deletePath(e)}}rmdirSync(e){if(this.checkInitialized(),!this.existsSync(e))throw cP.With("ENOENT",e,"rmdir");if(this.writable.existsSync(e)&&this.writable.rmdirSync(e),this.existsSync(e)){if(this.readdirSync(e).length)throw cP.With("ENOTEMPTY",e,"rmdir");this.deletePath(e)}}async mkdir(e,t){if(this.checkInitialized(),await this.exists(e))throw cP.With("EEXIST",e,"mkdir");await this.createParentDirectories(e),await this.writable.mkdir(e,t)}mkdirSync(e,t){if(this.checkInitialized(),this.existsSync(e))throw cP.With("EEXIST",e,"mkdir");this.createParentDirectoriesSync(e),this.writable.mkdirSync(e,t)}async readdir(e){this.checkInitialized();const t=[];try{t.push(...await this.writable.readdir(e))}catch{}try{t.push(...(await this.readable.readdir(e)).filter(t=>!this._deletedFiles.has(`${e}/${t}`)))}catch{}const n={};return t.filter(e=>{const t=!n[e];return n[e]=!0,t})}readdirSync(e){this.checkInitialized();let t=[];try{t=t.concat(this.writable.readdirSync(e))}catch{}try{t=t.concat(this.readable.readdirSync(e).filter(t=>!this._deletedFiles.has(`${e}/${t}`)))}catch{}const n={};return t.filter(e=>{const t=!n[e];return n[e]=!0,t})}async deletePath(e){this._deletedFiles.add(e),await this.updateLog(`d${e}\n`)}async updateLog(e){if(this._deleteLog+=e,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const t=await this.writable.openFile(Rz,NB("w"));try{await t.write(vP(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(e){this._deleteLogError=e}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const e of this._deleteLog.split("\n"))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new cP(lP.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const e=this._deleteLogError;throw delete this._deleteLogError,e}checkPath(e){if(e==Rz)throw cP.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e){let t=mP(e);const n=[];for(;!this.writable.existsSync(t);)n.push(t),t=mP(t);for(const e of n.reverse())this.writable.mkdirSync(e,this.statSync(e).mode)}async createParentDirectories(e){let t=mP(e);const n=[];for(;!await this.writable.exists(t);)n.push(t),t=mP(t);for(const e of n.reverse()){const t=await this.stat(e);await this.writable.mkdir(e,t.mode)}}copyForWriteSync(e){if(!this.existsSync(e))throw cP.With("ENOENT",e,"copyForWrite");this.writable.existsSync(mP(e))||this.createParentDirectoriesSync(e),this.writable.existsSync(e)||this.copyToWritableSync(e)}async copyForWrite(e){if(!await this.exists(e))throw cP.With("ENOENT",e,"copyForWrite");if(await this.writable.exists(mP(e))||await this.createParentDirectories(e),!await this.writable.exists(e))return this.copyToWritable(e)}copyToWritableSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(e);if(n.isDirectory())return void this.writable.mkdirSync(e,n.mode);const i=new Uint8Array(n.size);Mz(t,this.readable.openFileSync(e,"r"),!1).readSync(i);Mz(t,this.writable.createFileSync(e,"w",146|n.mode),!1).writeSync(i)}catch(e){t.error=e,t.hasError=!0}finally{kz(t)}}async copyToWritable(e){const t={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(e);if(n.isDirectory())return void await this.writable.mkdir(e,n.mode);const i=new Uint8Array(n.size),r=Mz(t,await this.readable.openFile(e,"r"),!0);await r.read(i);const s=Mz(t,await this.writable.createFile(e,"w",146|n.mode),!0);await s.write(i)}catch(e){t.error=e,t.hasError=!0}finally{const e=kz(t);e&&await e}}}class Dz extends(function(e){return class extends Oz{constructor(...t){super(),this._fs=new e(...t)}}}(Nz)){}function Fz(e,t,n){if(e instanceof cP)return e;const i=e instanceof DOMException?lP[function(e){switch(e.name){case"IndexSizeError":case"HierarchyRequestError":case"InvalidCharacterError":case"InvalidStateError":case"SyntaxError":case"NamespaceError":case"TypeMismatchError":case"ConstraintError":case"VersionError":case"URLMismatchError":case"InvalidNodeTypeError":return"EINVAL";case"WrongDocumentError":return"EXDEV";case"NoModificationAllowedError":case"InvalidModificationError":case"InvalidAccessError":case"SecurityError":case"NotAllowedError":return"EACCES";case"NotFoundError":return"ENOENT";case"NotSupportedError":return"ENOTSUP";case"InUseAttributeError":return"EBUSY";case"NetworkError":return"ENETDOWN";case"AbortError":return"EINTR";case"QuotaExceededError":return"ENOSPC";case"TimeoutError":return"ETIMEDOUT";case"ReadOnlyError":return"EROFS";default:return"EIO"}}(e)]:lP.EIO,r=new cP(i,e.message,t,n);return r.stack=e.stack,r.cause=e.cause,r}globalThis.__zenfs__=ue;class Lz extends(wz(zB)){constructor(e){super(),this._handles=new Map,this._sync=x$.create({name:"accessfs-cache"}),this._handles.set("/",e)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(e,t){await this.writeFile(e,t)}async rename(e,t){const n=await this.getHandle(e);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(e);if(await this.mkdir(t),!n.length)return void await this.unlink(e);for(const i of n)await this.rename(fP(e,i),fP(t,i)),await this.unlink(e);return}if(!(n instanceof FileSystemFileHandle))throw new cP(lP.ENOTSUP,"Not a file or directory handle",e,"rename");const i=await n.getFile().catch(t=>{throw Fz(t,e,"rename")}),r=await this.getHandle(mP(t));if(!(r instanceof FileSystemDirectoryHandle))return;const s=await r.getFileHandle(gP(t),{create:!0}).catch(e=>{throw Fz(e,t,"rename")}),o=await s.createWritable();await o.write(await i.arrayBuffer()),await o.close(),await this.unlink(e)}async writeFile(e,t){if(t.buffer.resizable)throw new cP(lP.EINVAL,"Resizable buffers can not be written",e,"write");const n=await this.getHandle(mP(e));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(gP(e),{create:!0}),r=await i.createWritable();await r.write(t),await r.close()}async createFile(e,t){return await this.writeFile(e,new Uint8Array),this.openFile(e,t)}async stat(e){const t=await this.getHandle(e);if(!t)throw cP.With("ENOENT",e,"stat");if(t instanceof FileSystemDirectoryHandle)return new CB({mode:511|sB,size:4096});if(t instanceof FileSystemFileHandle){const{lastModified:e,size:n}=await t.getFile();return new CB({mode:511|iB,size:n,mtimeMs:e})}throw new cP(lP.EBADE,"Handle is not a directory or file",e,"stat")}async openFile(e,t){const n=await this.getHandle(e);if(!(n instanceof FileSystemFileHandle))throw cP.With("EISDIR",e,"openFile");const i=await n.getFile().catch(t=>{throw Fz(t,e,"openFile")}),r=new Uint8Array(await i.arrayBuffer()),s=new CB({mode:511|iB,size:i.size,mtimeMs:i.lastModified});return new VB(this,e,t,s,r)}async unlink(e){const t=await this.getHandle(mP(e));if(!(t instanceof FileSystemDirectoryHandle))throw cP.With("ENOTDIR",mP(e),"unlink");await t.removeEntry(gP(e),{recursive:!0}).catch(t=>{throw Fz(t,e,"unlink")})}async link(e){}async rmdir(e){return this.unlink(e)}async mkdir(e){if(await this.getHandle(e).catch(e=>{if("ENOENT"!=e.code)throw e}))throw cP.With("EEXIST",e,"mkdir");const t=await this.getHandle(mP(e));if(!(t instanceof FileSystemDirectoryHandle))throw cP.With("ENOTDIR",e,"mkdir");await t.getDirectoryHandle(gP(e),{create:!0})}async readdir(e){const t=await this.getHandle(e);if(!(t instanceof FileSystemDirectoryHandle))throw cP.With("ENOTDIR",e,"readdir");const n=[];for await(const e of t.keys())n.push(e);return n}async getHandle(e){if(this._handles.has(e))return this._handles.get(e);let t="/";for(const n of e.split("/").slice(1)){const e=this._handles.get(t);if(!(e instanceof FileSystemDirectoryHandle))throw cP.With("ENOTDIR",t,"getHandle");t=fP(t,n);const i=await e.getDirectoryHandle(n).catch(i=>{switch(i.name){case"TypeMismatchError":return e.getFileHandle(n).catch(e=>{});case"TypeError":throw new cP(lP.ENOENT,i.message,t,"getHandle");default:throw Fz(i,t,"getHandle")}});i&&this._handles.set(t,i)}return this._handles.get(e)}}function Pz(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let Bz;function $z(){return Bz||(Bz=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const i=Pz(n);return(e,n)=>i.then(i=>n(i.transaction(t,e).objectStore(t)))}("keyval-store","keyval")),Bz}class Uz extends Lz{constructor(e){super(e)}async readFile(e){const t=await this.getHandle(e);if(t instanceof window.FileSystemFileHandle){const e=await t.getFile();return await e.text()}return""}}class Vz extends ze.FS{#e=null;#t=new TextEncoder;constructor(){super()}async showDirectoryPicker(){const e=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await e.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(e),this.#e=new Uz(e),e}async loadFS(){let e=await this.getFSCache();if(!e)return null;if("granted"!==await e.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#e=new Uz(e),e}async getFSCache(){return function(e,t=$z()){return t("readonly",t=>Pz(t.get(e)))}("mixly-pyodide-fs")}async setFSCache(e){await function(e,t,n=$z()){return n("readwrite",n=>(n.put(t,e),Pz(n.transaction)))}("mixly-pyodide-fs",e)}async createFile(e){return this.#e.createFile(e,"")}async readFile(e){return this.#e.readFile(e)}async writeFile(e,t){const n=this.#t.encode(t);return this.#e.writeFile(e,n)}async isFile(e){const t=await this.#e.stat(e);return!(!t||33279!==t.mode)}async renameFile(e,t){return await this.#e.rename(e,t)}async moveFile(e,t){return this.renameFile(e,t)}async deleteFile(e){return this.#e.unlink(e)}async createDirectory(e){return this.#e.mkdir(e,511)}async readDirectory(e){return await this.#e.readdir(e)}async isDirectory(e){const t=await this.#e.stat(e);return!(!t||16895!==t.mode)}async isDirectoryEmpty(e){const t=await this.readDirectory(e);return!t?.length}async renameDirectory(e,t){return this.#e.rename(e,t)}async moveDirectory(e,t){return this.#e.rename(e,t)}async deleteDirectory(e){return this.#e.rmdir(e)}}class zz extends ze.FileTree{constructor(){super(new Vz)}async readFolder(e){let t=[];try{const n=this.getFS();if(!await n.isDirectory(e))return t;const i=await n.readDirectory(e);for(let r of i){const i=Ax.join(e,r);if(await n.isDirectory(i)){const e=await n.isDirectoryEmpty(i);t.push({type:"folder",id:i,children:!e,title:`/${this.getRootFolderName()}${i}`})}else t.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(e){ze.Debug.error(e)}return t}}class jz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new ze.HTMLTemplate('\r\n
\r\n
\r\n
\r\n
')),ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new ze.HTMLTemplate('\r\n
\r\n \r\n
')),ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new ze.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["file-system"],jz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"file-system",id:"file-system",name:Ve.Msg.PYTHON_PYODIDE_FILE_SYSTEM,title:Ve.Msg.PYTHON_PYODIDE_FILE_SYSTEM}),e.changeTo("output"),e.get("file-system")}}#n=null;#i=null;#r=null;#s=null;#o=null;#a=null;#l=null;#u=null;#c=!1;#d=!1;#h=!1;#p=null;constructor(){super();const e=Cx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(e),this.#l=new zz,this.#i=e.children(".file-tree"),this.#s=Cx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:Ve.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#i.append(this.#s),this.#a=new ze.StatusBar,this.#r=e.children(".editor"),this.#o=Cx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#r.append(this.#o)}#f(){this.#u=new ze.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#u.bind("sizeChanged",()=>{this.resize()}),this.#s.children("button").click(()=>{this.selectFS().catch(ze.Debug.error)}),this.#l.bind("beforeSelectLeaf",e=>{const t=e[0].id,n=this.#a.getFileMode(Ax.extname(t));return n?(this.#a.setMode(n),!0):(aP.layer.msg(ze.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)}),this.#l.bind("afterSelectLeaf",async e=>{const t=e[0].id;this.#l.showProgress();const n=this.#l.getFS();try{const e=await n.readFile(t);this.showEditor(),this.#a.setValue(e),this.#a.scrollToTop(),this.#a.focus(),this.setStatus(!1)}catch(e){ze.Debug.error(e),this.hideEditor(),this.#l.deselectAll()}this.#l.hideProgress()}),this.#l.bind("afterCreateNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterDeleteNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterRenameNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterRefreshNode",()=>{this.#l.getSelectedNodeId()||this.hideEditor()});const e=this.#l.getContextMenu().getItem("menu");e.add({weight:7,id:"copy_path",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["fileTree.copyPath"]),callback:(e,{$trigger:t})=>{let n=null;n="root"===t.attr("type")?this.#l.getRootFolderTitle():t.attr("title"),navigator.clipboard.writeText(n).catch(ze.Debug.error)}}}),e.add({weight:14,id:"sep5",preconditionFn:e=>{const t=this.#l.getSelectedNodeId();let n=e.attr("type"),i=e.attr("id");return"file"!==n||t===i},data:"---------"}),e.add({weight:15,id:"refresh",preconditionFn:e=>{const t=this.#l.getSelectedNodeId();let n=e.attr("type"),i=e.attr("id");return"file"!==n||t===i},data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["statusbar.ampy.refresh"]),callback:(e,{$trigger:t})=>{let n=t.attr("type");if("root"===n)this.#l.openRootFolder(),this.#l.refreshFolder("/");else if("folder"===n){let e=t.attr("id");this.#l.openNode(e),this.#l.refreshFolder(e)}else{const e=this.#l.getSelectedNodes();this.#l.runEvent("afterSelectLeaf",e)}}}}),e.add({weight:16,id:"sep6",preconditionFn:e=>{let t=e.attr("type");return["root"].includes(t)},data:"---------"}),e.add({weight:17,id:"exit",preconditionFn:e=>{let t=e.attr("type");return["root"].includes(t)},data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["statusbar.ampy.exit"]),callback:()=>{this.closeFS()}}}),e.remove("copy"),e.remove("cut"),e.remove("paste"),e.remove("sep2");const t=this.#a.getContextMenu().getItem("code");t.empty(),t.add({weight:0,id:"cut",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#a.cut()}}),t.add({weight:1,id:"copy",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#a.copy()}}),t.add({weight:2,id:"paste",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#a.paste()}}),t.add({weight:3,id:"sep1",data:"---------"}),t.add({weight:4,id:"togglecomment",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#a.commentLine()}}),t.add({weight:6,id:"sep2",preconditionFn:()=>this.#h,data:"---------"}),t.add({weight:7,id:"save",preconditionFn:()=>this.#h,data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:n}=this.#a.getEditor();n.addCommand({name:"save",bindKey:"Ctrl-S",exec:async()=>{this.#h&&await this.put()}})}async put(){this.#l.showProgress();const e=this.#l.getSelectedNodeId(),t=this.#l.getFS();try{await t.writeFile(e,this.#a.getValue()),this.setStatus(!1)}catch(e){ze.Debug.error(e)}finally{this.#l.hideProgress()}}showFileTree(){this.#c||(this.#s.detach(),this.#i.empty(),this.#i.append(this.#l.getContent()),this.#c=!0)}hideFileTree(){this.#c&&(this.#l.getContent().detach(),this.#i.empty(),this.#i.append(this.#s),this.#c=!1)}showEditor(){this.#d||(this.#o.detach(),this.#r.empty(),this.#r.append(this.#a.getContent()),this.#d=!0)}hideEditor(){this.#d&&(this.#a.getContent().detach(),this.#r.empty(),this.#r.append(this.#o),this.#d=!1,this.setStatus(!1))}getDrag(){return this.#u}init(){super.init(),this.hideCloseBtn(),this.#a.init(),this.#f();const e=this.#a.getEditor();e.setReadOnly(!1),e.renderer.setShowGutter(!0),e.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),e.on("change",()=>{this.setStatus(!0)}),this.loadFS().catch(ze.Debug.error)}async loadFS(){const e=this.#l.getFS(),t=await e.loadFS();await this.openFS(t)}async selectFS(){const e=this.#l.getFS(),t=await e.showDirectoryPicker();await this.openFS(t)}async openFS(e){if(!e?.name)return;const t="/"+e.name;this.#l.setFolderPath("/"),this.#l.setRootFolderTitle(t),this.#l.setRootFolderName(e.name),this.#l.openRootFolder(),this.showFileTree(),this.#p=await window.pyodide.mountNativeFS(t,e)}closeFS(){const e=this.#l.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(Ax.basename(e))){const t=window.pyodide.FS.lookupPath(e,{follow_mount:!1});window.pyodide.FS.isMountpoint(t.node)&&window.pyodide.FS.unmount(e)}this.#l.getFS().setFSCache(null),this.#l.deselectAll(),this.hideFileTree(),this.hideEditor(),this.setStatus(!1)}onMounted(){super.onMounted(),this.#a.onMounted(),this.#l.onMounted()}onUnmounted(){super.onUnmounted(),this.#a.onUnmounted(),this.#l.onUnmounted()}resize(){super.resize(),this.#a.resize(),this.#l.resize()}setStatus(e){this.#h!==e&&(this.#h=e)}getNativeFS(){return this.#p}dispose(){this.#a.dispose(),this.#a=null,this.#l.dispose(),this.#l=null,super.dispose()}}class Yz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-tool.html",new ze.HTMLTemplate('\r\n
\r\n Teachable Machine\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["tool"],Yz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"tool",id:"tool",name:Ve.Msg.PYTHON_PYODIDE_TOOL,title:Ve.Msg.PYTHON_PYODIDE_TOOL}),e.changeTo("output"),e.get("tool")}}constructor(){super();const e=Cx()(ze.HTMLTemplate.get("html/statusbar/statusbar-tool.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}onMounted(){}onUnmounted(){}resize(){}}class Gz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-game.html",new ze.HTMLTemplate('\r\n
\r\n
{{d.epoch}}: 0
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["game"],Gz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"game",id:"game",name:Ve.Msg.PYTHON_PYODIDE_GAME,title:Ve.Msg.PYTHON_PYODIDE_GAME}),e.changeTo("output"),e.get("game")}}#m=null;#g=null;#_=null;#y=null;#v=null;#b=null;#T=10;#x=500;#E=[];#w=!1;#I=0;#A=null;constructor(){super();const e=Cx()(ze.HTMLTemplate.get("html/statusbar/statusbar-game.html").render({epoch:Ve.Msg.PYTHON_PYODIDE_GAME_EPOCH,start:Ve.Msg.PYTHON_PYODIDE_GAME_START,pause:Ve.Msg.PYTHON_PYODIDE_GAME_PAUSE,random:Ve.Msg.PYTHON_PYODIDE_GAME_RANDOM,reset:Ve.Msg.PYTHON_PYODIDE_GAME_RESET}));this.setContent(e),this.#m=e.find(".start-btn"),this.#g=e.find(".pause-btn"),this.#_=e.find(".random-btn"),this.#y=e.find(".reset-btn"),this.#v=e.find(".generation"),this.#b=e.find(".grid"),this.#S()}#S(){this.#m.click(()=>this.startGame()),this.#g.click(()=>this.pauseGame()),this.#_.click(()=>this.randomInitialize()),this.#y.click(()=>this.resetGame())}initializeGrid(){this.#b.empty(),this.#E=[];for(let e=0;ethis.toggleCell(e,t)),this.#b.append(n)}}this.updateGridDisplay()}toggleCell(e,t){this.#w||(this.#E[e][t]=0===this.#E[e][t]?1:0,this.updateGridDisplay())}updateGridDisplay(){const e=this.#b.children(".cell");for(let t=0;t=0&&s=0&&othis.nextGeneration(),this.#x),this.updateButtons())}pauseGame(){this.#w&&(this.#w=!1,clearInterval(this.#A),this.updateButtons())}randomInitialize(){if(!this.#w){for(let e=0;e{let s=`${e}-${t}`;return n&&(s+=`-${n}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},qz=Symbol("namespaceContextKey"),Kz=e=>{const t=e||(NM()?qC(qz,_I(Wz)):_I(Wz));return tk(()=>xI(t)||Wz)},Zz=(e,t)=>{const n=Kz(t);return{namespace:n,b:(t="")=>Xz(n.value,e,t,"",""),e:t=>t?Xz(n.value,e,"",t,""):"",m:t=>t?Xz(n.value,e,"","",t):"",be:(t,i)=>t&&i?Xz(n.value,e,t,i,""):"",em:(t,i)=>t&&i?Xz(n.value,e,"",t,i):"",bm:(t,i)=>t&&i?Xz(n.value,e,t,"",i):"",bem:(t,i,r)=>t&&i&&r?Xz(n.value,e,t,i,r):"",is:(e,...t)=>{const n=!(t.length>=1)||t[0];return e&&n?`is-${e}`:""},cssVar:e=>{const t={};for(const i in e)e[i]&&(t[`--${n.value}-${i}`]=e[i]);return t},cssVarName:e=>`--${n.value}-${e}`,cssVarBlock:t=>{const i={};for(const r in t)t[r]&&(i[`--${n.value}-${e}-${r}`]=t[r]);return i},cssVarBlockName:t=>`--${n.value}-${e}-${t}`}},Qz=e=>void 0===e,Jz=e=>"boolean"==typeof e,ej=e=>"number"==typeof e,tj=e=>"undefined"!=typeof Element&&e instanceof Element;var nj,ij=Object.defineProperty,rj=Object.defineProperties,sj=Object.getOwnPropertyDescriptors,oj=Object.getOwnPropertySymbols,aj=Object.prototype.hasOwnProperty,lj=Object.prototype.propertyIsEnumerable,uj=(e,t,n)=>t in e?ij(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function cj(e,t){var n;const i=yI();var r,s;return IO(()=>{i.value=e()},(r=((e,t)=>{for(var n in t||(t={}))aj.call(t,n)&&uj(e,n,t[n]);if(oj)for(var n of oj(t))lj.call(t,n)&&uj(e,n,t[n]);return e})({},t),s={flush:null!=(n=null==t?void 0:t.flush)?n:"sync"},rj(r,sj(s)))),sI(i)}const dj="undefined"!=typeof window,hj=(Object.prototype.toString,e=>"function"==typeof e),pj=()=>{},fj=dj&&(null==(nj=null==window?void 0:window.navigator)?void 0:nj.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function mj(e){return"function"==typeof e?e():xI(e)}function gj(e,t){return function(...n){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(i).catch(r)})}}function _j(e,t=!0,n=!0,i=!1){let r,s,o=0,a=!0,l=pj;const u=()=>{r&&(clearTimeout(r),r=void 0,l(),l=pj)};return c=>{const d=mj(e),h=Date.now()-o,p=()=>s=c();return u(),d<=0?(o=Date.now(),p()):(h>d&&(n||!a)?(o=Date.now(),p()):t&&(s=new Promise((e,t)=>{l=i?t:e,r=setTimeout(()=>{o=Date.now(),a=!0,e(p()),u()},Math.max(0,d-h))})),n||r||(r=setTimeout(()=>a=!0,d)),a=!1,s)}}function yj(e){return!!HE()&&(WE(e),!0)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function vj(e,t=200,n=!1,i=!0,r=!1){return gj(_j(t,n,i,r),e)}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function bj(e,t,n={}){const{immediate:i=!0}=n,r=_I(!1);let s=null;function o(){s&&(clearTimeout(s),s=null)}function a(){r.value=!1,o()}function l(...n){o(),r.value=!0,s=setTimeout(()=>{r.value=!1,s=null,e(...n)},mj(t))}return i&&(r.value=!0,dj&&l()),yj(a),{isPending:sI(r),start:l,stop:a}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const Tj={current:0},xj=_I(0),Ej=Symbol("elZIndexContextKey"),wj=Symbol("zIndexContextKey"),Ij=e=>{const t=NM()?qC(Ej,Tj):Tj,n=e||(NM()?qC(wj,void 0):void 0),i=tk(()=>{const e=xI(n);return ej(e)?e:2e3}),r=tk(()=>i.value+xj.value);return!dj&&qC(Ej),{initialZIndex:i,currentZIndex:r,nextZIndex:()=>(t.current++,xj.value=t.current,r.value)}};const Aj=Array.isArray;const Sj="object"==typeof global&&global&&global.Object===Object&&global;var Cj="object"==typeof self&&self&&self.Object===Object&&self;const Oj=Sj||Cj||Function("return this")();const Mj=Oj.Symbol;var kj=Object.prototype,Rj=kj.hasOwnProperty,Nj=kj.toString,Dj=Mj?Mj.toStringTag:void 0;const Fj=function(e){var t=Rj.call(e,Dj),n=e[Dj];try{e[Dj]=void 0;var i=!0}catch(e){}var r=Nj.call(e);return i&&(t?e[Dj]=n:delete e[Dj]),r};var Lj=Object.prototype.toString;const Pj=function(e){return Lj.call(e)};var Bj=Mj?Mj.toStringTag:void 0;const $j=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bj&&Bj in Object(e)?Fj(e):Pj(e)};const Uj=function(e){return null!=e&&"object"==typeof e};const Vj=function(e){return"symbol"==typeof e||Uj(e)&&"[object Symbol]"==$j(e)};var zj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jj=/^\w*$/;const Yj=function(e,t){if(Aj(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Vj(e))||(jj.test(e)||!zj.test(e)||null!=t&&e in Object(t))};const Gj=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Hj=function(e){if(!Gj(e))return!1;var t=$j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Wj=Oj["__core-js_shared__"];var Xj=function(){var e=/[^.]+$/.exec(Wj&&Wj.keys&&Wj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const qj=function(e){return!!Xj&&Xj in e};var Kj=Function.prototype.toString;const Zj=function(e){if(null!=e){try{return Kj.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Qj=/^\[object .+?Constructor\]$/,Jj=Function.prototype,eY=Object.prototype,tY=Jj.toString,nY=eY.hasOwnProperty,iY=RegExp("^"+tY.call(nY).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const rY=function(e){return!(!Gj(e)||qj(e))&&(Hj(e)?iY:Qj).test(Zj(e))};const sY=function(e,t){return null==e?void 0:e[t]};const oY=function(e,t){var n=sY(e,t);return rY(n)?n:void 0};const aY=oY(Object,"create");const lY=function(){this.__data__=aY?aY(null):{},this.size=0};const uY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var cY=Object.prototype.hasOwnProperty;const dY=function(e){var t=this.__data__;if(aY){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return cY.call(t,e)?t[e]:void 0};var hY=Object.prototype.hasOwnProperty;const pY=function(e){var t=this.__data__;return aY?void 0!==t[e]:hY.call(t,e)};const fY=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=aY&&void 0===t?"__lodash_hash_undefined__":t,this};function mY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1};const wY=function(e,t){var n=this.__data__,i=vY(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function IY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t(t,n)=>eG(t,n,xI(e)),eG=(e,t,n)=>ZY(n,e,e).replace(/\{(\w+)\}/g,(e,n)=>{var i;return`${null!=(i=null==t?void 0:t[n])?i:`{${n}}`}`}),tG=Symbol("localeContextKey"),nG=e=>{const t=e||qC(tG,_I());return(e=>({lang:tk(()=>xI(e).name),locale:gI(e)?e:_I(e),t:JY(e)}))(tk(()=>t.value||QY))};const iG=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t{if(!Wx(e)||Wx(n=e)&&n[rG])return e;var n;const{values:i,required:r,default:s,type:o,validator:a}=e,l=i||a?n=>{let r=!1,o=[];if(i&&(o=Array.from(i),$x(e,"default")&&o.push(s),r||(r=o.includes(n))),a&&(r||(r=a(n))),!r&&o.length>0){const e=[...new Set(o)].map(e=>JSON.stringify(e)).join(", ");ak(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${e}], got value ${JSON.stringify(n)}.`)}return r}:void 0,u={type:o,required:!!r,validator:l,[rG]:!0};return $x(e,"default")&&(u.default=s),u},oG=e=>iG(Object.entries(e).map(([e,t])=>[e,sG(t,e)])),aG=["","default","small","large"],lG=sG({type:String,values:aG,required:!1}),uG=Symbol("size"),cG=Symbol("emptyValuesContextKey"),dG=oG({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>(e=Yx(e)?e():e,Ux(e)?e.every(e=>!e):!e)}}),hG=e=>Object.keys(e),pG=_I();function fG(e,t=void 0){const n=NM()?qC(Hz,pG):pG;return e?tk(()=>{var i,r;return null!=(r=null==(i=n.value)?void 0:i[e])?r:t}):n}const mG=(e,t,n=!1)=>{var i;const r=!!NM(),s=r?fG():void 0,o=null!=(i=null==t?void 0:t.provide)?i:r?XC:void 0;if(!o)return;const a=tk(()=>{const t=xI(e);return(null==s?void 0:s.value)?gG(s.value,t):t});return o(Hz,a),o(tG,tk(()=>a.value.locale)),o(qz,tk(()=>a.value.namespace)),o(wj,tk(()=>a.value.zIndex)),o(uG,{size:tk(()=>a.value.size||"")}),o(cG,tk(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),!n&&pG.value||(pG.value=a.value),a},gG=(e,t)=>{const n=[...new Set([...hG(e),...hG(t)])],i={};for(const r of n)i[r]=void 0!==t[r]?t[r]:e[r];return i},_G=oG({a11y:{type:Boolean,default:!0},locale:{type:Object},size:lG,button:{type:Object},card:{type:Object},dialog:{type:Object},link:{type:Object},experimentalFeatures:{type:Object},keyboardNavigation:{type:Boolean,default:!0},message:{type:Object},zIndex:Number,namespace:{type:String,default:"el"},...dG}),yG={placement:"top"},vG=sS({name:"ElConfigProvider",props:_G,setup(e,{slots:t}){const n=mG(e);return CO(()=>e.message,e=>{var t,i;Object.assign(yG,null!=(i=null==(t=null==n?void 0:n.value)?void 0:t.message)?i:{},null!=e?e:{})},{immediate:!0,deep:!0}),()=>uC(t,"default",{config:null==n?void 0:n.value})}}),bG=(e,t)=>{if(e.install=n=>{for(const i of[e,...Object.values(null!=t?t:{})])n.component(i.name,i)},t)for(const[n,i]of Object.entries(t))e[n]=i;return e},TG=e=>(e.install=Rx,e),xG=bG(vG); /*! Element Plus Icons Vue v2.3.2 */ -var vG=tS({name:"ArrowDown",__name:"arrow-down",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),bG=vG,TG=tS({name:"ArrowLeft",__name:"arrow-left",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}),xG=TG,EG=tS({name:"ArrowRight",__name:"arrow-right",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}),wG=EG,IG=tS({name:"ArrowUp",__name:"arrow-up",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}),AG=IG,SG=tS({name:"Camera",__name:"camera",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"})]))}),CG=SG,OG=tS({name:"Check",__name:"check",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}),MG=OG,kG=tS({name:"CircleCheck",__name:"circle-check",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),hM("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}),RG=kG,NG=tS({name:"CircleCloseFilled",__name:"circle-close-filled",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}),DG=NG,FG=tS({name:"CircleClose",__name:"circle-close",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),hM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),LG=FG,PG=tS({name:"CirclePlusFilled",__name:"circle-plus-filled",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"})]))}),BG=PG,$G=tS({name:"CirclePlus",__name:"circle-plus",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"}),hM("path",{fill:"currentColor",d:"M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0"}),hM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),UG=$G,VG=tS({name:"Close",__name:"close",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),zG=VG,jG=tS({name:"Delete",__name:"delete",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}),YG=jG,GG=tS({name:"Document",__name:"document",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}),HG=GG,WG=tS({name:"EditPen",__name:"edit-pen",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}),XG=WG,qG=tS({name:"FullScreen",__name:"full-screen",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}),KG=qG,ZG=tS({name:"Hide",__name:"hide",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),hM("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}),QG=ZG,JG=tS({name:"InfoFilled",__name:"info-filled",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),eH=JG,tH=tS({name:"Loading",__name:"loading",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}),nH=tH,iH=tS({name:"More",__name:"more",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"})]))}),rH=iH,sH=tS({name:"RefreshLeft",__name:"refresh-left",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}),oH=tS({name:"RefreshRight",__name:"refresh-right",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"})]))}),aH=tS({name:"ScaleToOriginal",__name:"scale-to-original",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"})]))}),lH=tS({name:"SuccessFilled",__name:"success-filled",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}),uH=tS({name:"View",__name:"view",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),cH=tS({name:"WarningFilled",__name:"warning-filled",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}),dH=tS({name:"Warning",__name:"warning",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}),hH=tS({name:"ZoomIn",__name:"zoom-in",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}),pH=tS({name:"ZoomOut",__name:"zoom-out",setup:e=>(e,t)=>(JO(),sM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[hM("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))});function fH(e){var t;const n=dj(e);return null!=(t=null==n?void 0:n.$el)?t:n}const mH=aj?window:void 0;aj&&window.document,aj&&window.navigator,aj&&window.location;function gH(...e){let t,n,i,r;if("string"==typeof e[0]||Array.isArray(e[0])?([n,i,r]=e,t=mH):[t,n,i,r]=e,!t)return uj;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(e=>e()),s.length=0},a=wO(()=>[fH(t),dj(r)],([e,t])=>{o(),e&&s.push(...n.flatMap(n=>i.map(i=>((e,t,n,i)=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)))(e,n,i,t))))},{immediate:!0,flush:"post"}),l=()=>{a(),o()};return fj(l),l}let _H=!1;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function yH(e,t=!1){const n=pI(),i=()=>n.value=Boolean(e());return i(),function(e,t=!0){OM()?US(e):t?e():nA(e)}(i,t),n}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function vH(e){return JSON.parse(JSON.stringify(e))}const bH="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},TH="__vueuse_ssr_handlers__";bH[TH]=bH[TH]||{};bH[TH];Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var xH=Object.getOwnPropertySymbols,EH=Object.prototype.hasOwnProperty,wH=Object.prototype.propertyIsEnumerable;function IH(e,t,n={}){const i=n,{window:r=mH}=i,s=((e,t)=>{var n={};for(var i in e)EH.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&xH)for(var i of xH(e))t.indexOf(i)<0&&wH.call(e,i)&&(n[i]=e[i]);return n})(i,["window"]);let o;const a=yH(()=>r&&"ResizeObserver"in r),l=()=>{o&&(o.disconnect(),o=void 0)},u=wO(()=>fH(e),e=>{l(),a.value&&r&&e&&(o=new ResizeObserver(t),o.observe(e,s))},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return fj(c),{isSupported:a,stop:c}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function AH(e,t={width:0,height:0},n={}){const{window:i=mH,box:r="content-box"}=n,s=ZM(()=>{var t,n;return null==(n=null==(t=fH(e))?void 0:t.namespaceURI)?void 0:n.includes("svg")}),o=pI(t.width),a=pI(t.height);return IH(e,([t])=>{const n="border-box"===r?t.borderBoxSize:"content-box"===r?t.contentBoxSize:t.devicePixelContentBoxSize;if(i&&s.value){const t=fH(e);if(t){const e=i.getComputedStyle(t);o.value=parseFloat(e.width),a.value=parseFloat(e.height)}}else if(n){const e=Array.isArray(n)?n:[n];o.value=e.reduce((e,{inlineSize:t})=>e+t,0),a.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,a.value=t.contentRect.height},n),wO(()=>fH(e),e=>{o.value=e?t.width:0,a.value=e?t.height:0}),{width:o,height:a}}new Map;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var SH,CH;(CH=SH||(SH={})).UP="UP",CH.RIGHT="RIGHT",CH.DOWN="DOWN",CH.LEFT="LEFT",CH.NONE="NONE";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var OH=Object.defineProperty,MH=Object.getOwnPropertySymbols,kH=Object.prototype.hasOwnProperty,RH=Object.prototype.propertyIsEnumerable,NH=(e,t,n)=>t in e?OH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))kH.call(t,n)&&NH(e,n,t[n]);if(MH)for(var n of MH(t))RH.call(t,n)&&NH(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function DH(e,t,n,i={}){var r,s,o;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d}=i,h=OM(),p=n||(null==h?void 0:h.emit)||(null==(r=null==h?void 0:h.$emit)?void 0:r.bind(h))||(null==(o=null==(s=null==h?void 0:h.proxy)?void 0:s.$emit)?void 0:o.bind(null==h?void 0:h.proxy));let f=u;t||(t="modelValue"),f=u||f||`update:${t.toString()}`;const m=e=>a?lj(a)?a(e):vH(e):e,g=()=>void 0!==e[t]?m(e[t]):d;if(l){const n=pI(g());return wO(()=>e[t],e=>n.value=m(e)),wO(n,n=>{(n!==e[t]||c)&&p(f,n)},{deep:c}),n}return ZM({get:()=>g(),set(e){p(f,e)}})}const FH=nG({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:[String,Object,Array]},offset:{type:Array,default:[0,0]},badgeClass:{type:String}});var LH=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n};function PH(e,t="px"){return e?Kz(e)||Vx(n=e)&&!Number.isNaN(Number(n))?`${e}${t}`:Vx(e)?e:void 0:"";var n}const BH=tS({name:"ElBadge"}),$H=tS({...BH,props:FH,setup(e,{expose:t}){const n=e,i=Wz("badge"),r=ZM(()=>n.isDot?"":Kz(n.value)&&Kz(n.max)&&n.max{var e,t,i,r,s;return[{backgroundColor:n.color,marginRight:PH(-(null!=(t=null==(e=n.offset)?void 0:e[0])?t:0)),marginTop:PH(null!=(r=null==(i=n.offset)?void 0:i[1])?r:0)},null!=(s=n.badgeStyle)?s:{}]});return t({content:r}),(e,t)=>(JO(),sM("div",{class:yE(yI(i).b())},[sC(e.$slots,"default"),pM(xk,{name:`${yI(i).namespace.value}-zoom-in-center`,persisted:""},{default:AA(()=>[SA(hM("sup",{class:yE([yI(i).e("content"),yI(i).em("content",e.type),yI(i).is("fixed",!!e.$slots.default),yI(i).is("dot",e.isDot),yI(i).is("hide-zero",!e.showZero&&0===n.value),e.badgeClass]),style:pE(yI(s))},[sC(e.$slots,"content",{value:yI(r)},()=>[_M(FE(yI(r)),1)])],6),[[Bk,!e.hidden&&(yI(r)||e.isDot||e.$slots.content)]])]),_:3},8,["name"])],2))}});const UH=gG(LH($H,[["__file","badge.vue"]])),VH=nG({size:{type:[Number,String]},color:{type:String}}),zH=tS({name:"ElIcon",inheritAttrs:!1});const jH=gG(LH(tS({...zH,props:VH,setup(e){const t=e,n=Wz("icon"),i=ZM(()=>{const{size:e,color:n}=t;return e||n?{fontSize:Xz(e)?void 0:PH(e),"--color":n}:{}});return(e,t)=>(JO(),sM("i",EM({class:yI(n).b(),style:yI(i)},e.$attrs),[sC(e.$slots,"default")],16))}}),[["__file","icon.vue"]])),YH=[String,Object,Function],GH={Close:zG,SuccessFilled:lH,InfoFilled:eH,WarningFilled:cH,CircleCloseFilled:DG},HH={primary:eH,success:lH,warning:cH,error:DG,info:eH},WH={validating:nH,success:RG,error:LG},XH=["primary","success","info","warning","error"],qH=["top","top-left","top-right","bottom","bottom-left","bottom-right"],KH="top",ZH={customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:aj?document.body:void 0},QH=nG({customClass:{type:String,default:ZH.customClass},dangerouslyUseHTMLString:{type:Boolean,default:ZH.dangerouslyUseHTMLString},duration:{type:Number,default:ZH.duration},icon:{type:YH,default:ZH.icon},id:{type:String,default:ZH.id},message:{type:[String,Object,Function],default:ZH.message},onClose:{type:Function,default:ZH.onClose},showClose:{type:Boolean,default:ZH.showClose},type:{type:String,values:XH,default:ZH.type},plain:{type:Boolean,default:ZH.plain},offset:{type:Number,default:ZH.offset},placement:{type:String,values:qH,default:ZH.placement},zIndex:{type:Number,default:ZH.zIndex},grouping:{type:Boolean,default:ZH.grouping},repeatNum:{type:Number,default:ZH.repeatNum}}),JH=eI({}),eW=(e,t)=>{const{prev:n}=((e,t)=>{const n=JH[t]||[],i=n.findIndex(t=>t.id===e),r=n[i];let s;return i>0&&(s=n[i-1]),{current:r,prev:s}})(e,t);return n?n.vm.exposed.bottom.value:0},tW={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},nW=tS({name:"ElMessage"}),iW=tS({...nW,props:QH,emits:{destroy:()=>!0},setup(e,{expose:t,emit:n}){const i=e,{Close:r}=GH,s=pI(!1),{ns:o,zIndex:a}=function(e,t){const n=cG(),i=Wz(e,ZM(()=>{var e;return(null==(e=n.value)?void 0:e.namespace)||jz})),r=QY(ZM(()=>{var e;return null==(e=n.value)?void 0:e.locale})),s=Tj(ZM(()=>{var e;return(null==(e=n.value)?void 0:e.zIndex)||2e3})),o=ZM(()=>{var e;return yI(t)||(null==(e=n.value)?void 0:e.size)||""});return dG(ZM(()=>yI(n)||{})),{ns:i,locale:r,zIndex:s,size:o}}("message"),{currentZIndex:l,nextZIndex:u}=a,c=pI(),d=pI(!1),h=pI(0);let p;const f=ZM(()=>i.type?"error"===i.type?"danger":i.type:"info"),m=ZM(()=>{const e=i.type;return{[o.bm("icon",e)]:e&&HH[e]}}),g=ZM(()=>i.icon||HH[i.type]||""),_=ZM(()=>i.placement||KH),y=ZM(()=>eW(i.id,_.value)),v=ZM(()=>((e,t,n)=>(JH[n]||[]).findIndex(t=>t.id===e)>0?16:t)(i.id,i.offset,_.value)+y.value),b=ZM(()=>h.value+v.value),T=ZM(()=>_.value.includes("left")?o.is("left"):_.value.includes("right")?o.is("right"):o.is("center")),x=ZM(()=>_.value.startsWith("top")?"top":"bottom"),E=ZM(()=>({[x.value]:`${v.value}px`,zIndex:l.value}));function w(){0!==i.duration&&({stop:p}=gj(()=>{A()},i.duration))}function I(){null==p||p()}function A(){d.value=!1,nA(()=>{var e;s.value||(null==(e=i.onClose)||e.call(i),n("destroy"))})}return US(()=>{w(),u(),d.value=!0}),wO(()=>i.repeatNum,()=>{I(),w()}),gH(document,"keydown",function({code:e}){e===tW.esc&&A()}),IH(c,()=>{h.value=c.value.getBoundingClientRect().height}),t({visible:d,bottom:b,close:A}),(e,t)=>(JO(),oM(xk,{name:yI(o).b("fade"),onBeforeEnter:e=>s.value=!0,onBeforeLeave:e.onClose,onAfterLeave:t=>e.$emit("destroy"),persisted:""},{default:AA(()=>[SA(hM("div",{id:e.id,ref_key:"messageRef",ref:c,class:yE([yI(o).b(),{[yI(o).m(e.type)]:e.type},yI(o).is("closable",e.showClose),yI(o).is("plain",e.plain),yI(o).is("bottom","bottom"===yI(x)),yI(T),e.customClass]),style:pE(yI(E)),role:"alert",onMouseenter:I,onMouseleave:w},[e.repeatNum>1?(JO(),oM(yI(UH),{key:0,value:e.repeatNum,type:yI(f),class:yE(yI(o).e("badge"))},null,8,["value","type","class"])):vM("v-if",!0),yI(g)?(JO(),oM(yI(jH),{key:1,class:yE([yI(o).e("icon"),yI(m)])},{default:AA(()=>[(JO(),oM(JS(yI(g))))]),_:1},8,["class"])):vM("v-if",!0),sC(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(JO(),sM(WO,{key:1},[vM(" Caution here, message could've been compromised, never use user's input as message "),hM("p",{class:yE(yI(o).e("content")),innerHTML:e.message},null,10,["innerHTML"])],2112)):(JO(),sM("p",{key:0,class:yE(yI(o).e("content"))},FE(e.message),3))]),e.showClose?(JO(),oM(yI(jH),{key:2,class:yE(yI(o).e("closeBtn")),onClick:UR(A,["stop"])},{default:AA(()=>[pM(yI(r))]),_:1},8,["class","onClick"])):vM("v-if",!0)],46,["id"]),[[Bk,d.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var rW=LH(iW,[["__file","message.vue"]]);class sW extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function oW(e,t){throw new sW(`[${e}] ${t}`)}let aW=1;const lW=e=>{const t=!e||Vx(e)||aM(e)||Ux(e)?{message:e}:e,n={...ZH,...t};return(e=>{if(e.appendTo){if(Vx(e.appendTo)){let t=document.querySelector(e.appendTo);Zz(t)||(t=document.body),e.appendTo=t}}else e.appendTo=document.body})(n),(e=>{!e.placement&&Vx(fG.placement)&&fG.placement&&(e.placement=fG.placement),e.placement||(e.placement=KH),qH.includes(e.placement)||(e.placement,e.placement=KH)})(n),qz(fG.grouping)&&!n.grouping&&(n.grouping=fG.grouping),Kz(fG.duration)&&3e3===n.duration&&(n.duration=fG.duration),Kz(fG.offset)&&16===n.offset&&(n.offset=fG.offset),qz(fG.showClose)&&!n.showClose&&(n.showClose=fG.showClose),qz(fG.plain)&&!n.plain&&(n.plain=fG.plain),n},uW=({appendTo:e,...t},n)=>{const i="message_"+aW++,r=t.onClose,s=document.createElement("div"),o={...t,id:i,onClose:()=>{null==r||r(),(e=>{const t=e.props.placement||KH,n=JH[t],i=n.indexOf(e);if(-1===i)return;n.splice(i,1);const{handler:r}=e;r.close()})(c)},onDestroy:()=>{XR(null,s)}},a=pM(rW,o,Ux(o.message)||aM(o.message)?{default:Ux(o.message)?o.message:()=>o.message}:null);a.appContext=n||cW._context,XR(a,s),e.appendChild(s.firstElementChild);const l=a.component,u={close:()=>{l.exposed.close()}},c={id:i,vnode:a,vm:l,handler:u,props:a.component.props};return c},cW=(e={},t)=>{if(!aj)return{close:()=>{}};const n=lW(e),i=(r=n.placement||KH,JH[r]||(JH[r]=eI([])),JH[r]);var r;if(n.grouping&&i.length){const e=i.find(({vnode:e})=>{var t;return(null==(t=e.props)?void 0:t.message)===n.message});if(e)return e.props.repeatNum+=1,e.props.type=n.type,e.handler}if(Kz(fG.max)&&i.length>=fG.max)return{close:()=>{}};const s=uW(n,t);return i.push(s),s.handler};XH.forEach(e=>{cW[e]=(t={},n)=>{const i=lW(t);return cW({...i,type:e},n)}}),cW.closeAll=function(e){for(const t in JH)if(Fx(JH,t)){const n=[...JH[t]];for(const t of n)e&&e!==t.props.type||t.handler.close()}},cW.closeAllByPlacement=function(e){if(!JH[e])return;[...JH[e]].forEach(e=>e.handler.close())},cW._context=null;const dW=((e,t)=>(e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e))(cW,"$message"),hW=nG({layout:{type:String,default:"horizontal",values:["horizontal","vertical"]},lazy:Boolean}),pW=Symbol("splitterRootContextKey");function fW(e){return Number(e.slice(0,-1))/100}function mW(e){return Number(e.slice(0,-2))}function gW(e){return Vx(e)&&e.endsWith("%")}function _W(e){return Vx(e)&&e.endsWith("px")}function yW(e,t,n,i){function r(e,n){return gW(e)?fW(e)*t.value||0:_W(e)?mW(e):null!=e?e:n}const s=pI(0),o=pI(null);let a=[],l=Cx;const u=ZM(()=>e.value.map(e=>[e.min,e.max]));wO(i,()=>{if(s.value){const e=new MouseEvent("mouseup",{bubbles:!0});window.dispatchEvent(e)}});const c=[];return{lazyOffset:s,onMoveStart:e=>{s.value=0,o.value={index:e,confirmed:!1},a=n.value},onMoving:(n,c)=>{var d,h;let p=null;if(!(o.value&&o.value.confirmed||0===c))if(c>0)p=n,o.value={index:n,confirmed:!0};else for(let e=n;e>=0;e-=1)if(a[e]>0){p=e,o.value={index:e,confirmed:!0};break}const f=null!=(h=null!=p?p:null==(d=o.value)?void 0:d.index)?h:n,m=[...a],g=f+1,_=r(u.value[f][0],0),y=r(u.value[g][0],0),v=r(u.value[f][1],t.value||0),b=r(u.value[g][1],t.value||0);let T=c;m[f]+T<_&&(T=_-m[f]),m[g]-Tv&&(T=v-m[f]),m[g]-T>b&&(T=m[g]-b),m[f]+=T,m[g]-=T,s.value=T,l=()=>{e.value.forEach((e,t)=>{e.size=m[t]}),l=Cx},i.value||l()},onMoveEnd:()=>{i.value&&l(),s.value=0,o.value=null,a=[]},movingIndex:o,onCollapse:(t,i)=>{c.length||c.push(...n.value);const r=n.value,s="start"===i?t:t+1,o="start"===i?t+1:t,a=r[s],l=r[o];if(0!==a&&0!==l)r[s]=0,r[o]+=a,c[t]=a;else{const e=a+l,n=c[t],i=e-n;r[o]=n,r[s]=i}e.value.forEach((e,t)=>{e.size=r[t]})}}}const vW=e=>{const t=Lx(e)?e:[e],n=[];return t.forEach(e=>{var t;Lx(e)?n.push(...vW(e)):aM(e)&&(null==(t=e.component)?void 0:t.subTree)?n.push(e,...vW(e.component.subTree)):aM(e)&&Lx(e.children)?n.push(...vW(e.children)):aM(e)&&2===e.shapeFlag?n.push(...vW(e.type())):n.push(e)}),n},bW=(e,t)=>{const n=fI({}),i=fI([]),r=new WeakMap,s=()=>{i.value=((e,t,n)=>{const i=vW(e.subTree).filter(e=>{var n;return aM(e)&&(null==(n=e.type)?void 0:n.name)===t&&!!e.component});return i.map(e=>e.component.uid).map(e=>n[e]).filter(e=>!!e)})(e,t,n.value)},o=e=>e.render(),a=tS({setup:(e,{slots:t})=>()=>(s(),t.default?QM(o,{render:t.default}):null)});return{children:i,addChild:e=>{n.value[e.uid]=e,_I(n),US(()=>{const t=e.getVnode().el,i=t.parentNode;if(!r.has(i)){r.set(i,[]);const e=i.insertBefore.bind(i);i.insertBefore=(t,s)=>(r.get(i).some(e=>t===e||s===e)&&_I(n),e(t,s))}r.get(i).push(t)})},removeChild:e=>{delete n.value[e.uid],_I(n);const t=e.getVnode().el,i=t.parentNode,s=r.get(i),o=s.indexOf(t);s.splice(o,1)},ChildrenSorter:a}},TW=tS({name:"ElSplitter"}),xW=tS({...TW,props:hW,emits:["resizeStart","resize","resizeEnd","collapse"],setup(e,{emit:t}){const n=e,i=Wz("splitter"),r=SI(n,"layout"),s=SI(n,"lazy"),{containerEl:o,containerSize:a}=function(e){const t=pI(),{width:n,height:i}=AH(t);return{containerEl:t,containerSize:ZM(()=>"horizontal"===e.value?n.value:i.value)}}(r),{removeChild:l,children:u,addChild:c,ChildrenSorter:d}=bW(OM(),"ElSplitterPanel");wO(u,()=>{u.value.forEach((e,t)=>{e.setIndex(t)})});const{percentSizes:h,pxSizes:p}=function(e,t){const n=ZM(()=>e.value.map(e=>e.size)),i=ZM(()=>e.value.length),r=pI([]);wO([n,i,t],()=>{var n;let s=[],o=0;for(let r=0;re+(t||0),0);if(a>1||!o){const e=1/a;s=s.map(t=>void 0===t?0:t*e)}else{const e=(1-a)/o;s=s.map(t=>void 0===t?e:t)}r.value=s});const s=e=>e*t.value,o=ZM(()=>r.value.map(s));return{percentSizes:r,pxSizes:o}}(u,a),{lazyOffset:f,movingIndex:m,onMoveStart:g,onMoving:_,onMoveEnd:y,onCollapse:v}=yW(u,a,p,s),b=ZM(()=>({[`--${i.b()}-bar-offset`]:s.value?`${f.value}px`:void 0}));return YC(pW,Jw({panels:u,percentSizes:h,pxSizes:p,layout:r,lazy:s,movingIndex:m,containerSize:a,onMoveStart:e=>{g(e),t("resizeStart",e,p.value)},onMoving:(e,n)=>{_(e,n),s.value||t("resize",e,p.value)},onMoveEnd:async e=>{y(),await nA(),t("resizeEnd",e,p.value)},onCollapse:(e,n)=>{v(e,n),t("collapse",e,n,p.value)},registerPanel:c,unregisterPanel:l})),(e,t)=>(JO(),sM("div",{ref_key:"containerEl",ref:o,class:yE([yI(i).b(),yI(i).e(yI(r))]),style:pE(yI(b))},[sC(e.$slots,"default"),pM(yI(d)),vM(" Prevent iframe touch events from breaking "),yI(m)?(JO(),sM("div",{key:0,class:yE([yI(i).e("mask"),yI(i).e(`mask-${yI(r)}`)])},null,2)):vM("v-if",!0)],6))}});var EW=LH(xW,[["__file","splitter.vue"]]);function wW(e,t,n,i){return!!((null==e?void 0:e.collapsible.end)&&t>0)||!!((null==n?void 0:n.collapsible.start)&&0===i&&t>0)}const IW=tS({name:"ElSplitterBar"}),AW=tS({...IW,props:{index:{type:Number,required:!0},layout:{type:String,values:["horizontal","vertical"],default:"horizontal"},resizable:{type:Boolean,default:!0},lazy:Boolean,startCollapsible:Boolean,endCollapsible:Boolean},emits:["moveStart","moving","moveEnd","collapse"],setup(e,{emit:t}){const n=e,i=Wz("splitter-bar"),r=ZM(()=>"horizontal"===n.layout),s=ZM(()=>r.value?{width:0}:{height:0}),o=ZM(()=>({width:r.value?"16px":"100%",height:r.value?"100%":"16px",cursor:n.resizable?r.value?"ew-resize":"ns-resize":"auto",touchAction:"none"})),a=ZM(()=>{const e=i.e("dragger");return{[`${e}-horizontal`]:r.value,[`${e}-vertical`]:!r.value,[`${e}-active`]:!!l.value}}),l=pI(null),u=e=>{n.resizable&&(l.value=[e.pageX,e.pageY],t("moveStart",n.index),window.addEventListener("mouseup",p),window.addEventListener("mousemove",d))},c=e=>{if(n.resizable&&1===e.touches.length){e.preventDefault();const i=e.touches[0];l.value=[i.pageX,i.pageY],t("moveStart",n.index),window.addEventListener("touchend",f),window.addEventListener("touchmove",h)}},d=e=>{const{pageX:i,pageY:s}=e,o=i-l.value[0],a=s-l.value[1],u=r.value?o:a;t("moving",n.index,u)},h=e=>{if(1===e.touches.length){e.preventDefault();const i=e.touches[0],s=i.pageX-l.value[0],o=i.pageY-l.value[1],a=r.value?s:o;t("moving",n.index,a)}},p=()=>{l.value=null,window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),t("moveEnd",n.index)},f=()=>{l.value=null,window.removeEventListener("touchend",f),window.removeEventListener("touchmove",h),t("moveEnd",n.index)},m=ZM(()=>r.value?xG:AG),g=ZM(()=>r.value?wG:bG);return(n,r)=>(JO(),sM("div",{class:yE([yI(i).b()]),style:pE(yI(s))},[e.startCollapsible?(JO(),sM("div",{key:0,class:yE([yI(i).e("collapse-icon"),yI(i).e(`${e.layout}-collapse-icon-start`)]),onClick:n=>t("collapse",e.index,"start")},[sC(n.$slots,"start-collapsible",{},()=>[(JO(),oM(JS(yI(m)),{style:{width:"12px",height:"12px"}}))])],10,["onClick"])):vM("v-if",!0),hM("div",{class:yE([yI(i).e("dragger"),yI(a),yI(i).is("disabled",!e.resizable),yI(i).is("lazy",e.resizable&&e.lazy)]),style:pE(yI(o)),onMousedown:u,onTouchstart:c},null,38),e.endCollapsible?(JO(),sM("div",{key:1,class:yE([yI(i).e("collapse-icon"),yI(i).e(`${e.layout}-collapse-icon-end`)]),onClick:n=>t("collapse",e.index,"end")},[sC(n.$slots,"end-collapsible",{},()=>[(JO(),oM(JS(yI(g)),{style:{width:"12px",height:"12px"}}))])],10,["onClick"])):vM("v-if",!0)],6))}});var SW=LH(AW,[["__file","split-bar.vue"]]);const CW=nG({min:{type:[String,Number]},max:{type:[String,Number]},size:{type:[String,Number]},resizable:{type:Boolean,default:!0},collapsible:Boolean}),OW="ElSplitterPanel",MW=tS({name:OW}),kW=tS({...MW,props:CW,emits:["update:size"],setup(e,{emit:t}){const n=e,i=Wz("splitter-panel"),r=GC(pW);r||oW(OW,"usage: ");const{panels:s,layout:o,lazy:a,containerSize:l,pxSizes:u}=wI(r),{registerPanel:c,unregisterPanel:d,onCollapse:h,onMoveEnd:p,onMoveStart:f,onMoving:m}=r,g=pI(),_=OM(),y=_.uid,v=pI(0),b=ZM(()=>s.value[v.value]),T=ZM(()=>{var e;return b.value&&null!=(e=u.value[v.value])?e:0}),x=ZM(()=>{var e;return b.value&&null!=(e=u.value[v.value+1])?e:0}),E=ZM(()=>b.value?s.value[v.value+1]:null),w=ZM(()=>{var e;return!!E.value&&(n.resizable&&(null==(e=E.value)?void 0:e.resizable)&&(0!==T.value||!n.min)&&(0!==x.value||!E.value.min))}),I=ZM(()=>!!b.value&&v.value!==s.value.length-1),A=ZM(()=>wW(b.value,T.value,E.value,x.value)),S=ZM(()=>wW(E.value,x.value,b.value,T.value));function C(e){return gW(e)?fW(e)*l.value||0:_W(e)?mW(e):null!=e?e:0}let O=!1;wO(()=>n.size,()=>{if(!O&&b.value){if(!l.value)return void(b.value.size=n.size);const e=C(n.size),i=C(n.max),r=C(n.min),s=Math.min(Math.max(e,r||0),i||e);s!==e&&t("update:size",s),b.value.size=s}}),wO(()=>{var e;return null==(e=b.value)?void 0:e.size},e=>{e!==n.size&&(O=!0,t("update:size",e),nA(()=>O=!1))}),wO(()=>n.resizable,e=>{b.value&&(b.value.resizable=e)});const M=Jw({el:g.value,uid:y,getVnode:()=>_.vnode,setIndex:e=>{v.value=e},...n,collapsible:ZM(()=>{return(e=n.collapsible)&&jx(e)?e:{start:!!e,end:!!e};var e})});return c(M),jS(()=>d(M)),(e,t)=>(JO(),sM(WO,null,[hM("div",EM({ref_key:"panelEl",ref:g,class:[yI(i).b()],style:{flexBasis:`${yI(T)}px`}},e.$attrs),[sC(e.$slots,"default")],16),yI(I)?(JO(),oM(SW,{key:0,index:v.value,layout:yI(o),lazy:yI(a),resizable:yI(w),"start-collapsible":yI(A),"end-collapsible":yI(S),onMoveStart:yI(f),onMoving:yI(m),onMoveEnd:yI(p),onCollapse:yI(h)},{"start-collapsible":AA(()=>[sC(e.$slots,"start-collapsible")]),"end-collapsible":AA(()=>[sC(e.$slots,"end-collapsible")]),_:3},8,["index","layout","lazy","resizable","start-collapsible","end-collapsible","onMoveStart","onMoving","onMoveEnd","onCollapse"])):vM("v-if",!0)],64))}});var RW=LH(kW,[["__file","split-panel.vue"]]);const NW=gG(EW,{SplitPanel:RW}),DW=_G(RW),FW=Symbol("buttonGroupContextKey"),LW={prefix:Math.floor(1e4*Math.random()),current:0},PW=Symbol("elIdInjection"),BW=()=>OM()?GC(PW,LW):LW,$W=e=>{const t=BW(),n=Hz();return oj(()=>yI(e)||`${n.value}-id-${t.prefix}-${t.current++}`)},UW=Symbol("formContextKey"),VW=Symbol("formItemContextKey"),zW=()=>({form:GC(UW,void 0),formItem:GC(VW,void 0)}),jW=(e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:i})=>{n||(n=pI(!1)),i||(i=pI(!1));const r=OM(),s=pI();let o;const a=ZM(()=>{var n;return!!(!e.label&&!e.ariaLabel&&t&&t.inputIds&&(null==(n=t.inputIds)?void 0:n.length)<=1)});return US(()=>{o=wO([SI(e,"id"),n],([e,n])=>{const o=null!=e?e:n?void 0:$W().value;o!==s.value&&((null==t?void 0:t.removeInputId)&&!(()=>{let e=null==r?void 0:r.parent;for(;e;){if("ElFormItem"===e.type.name)return!1;if("ElLabelWrap"===e.type.name)return!0;e=e.parent}return!1})()&&(s.value&&t.removeInputId(s.value),(null==i?void 0:i.value)||n||!o||t.addInputId(o)),s.value=o)},{immediate:!0})}),YS(()=>{o&&o(),(null==t?void 0:t.removeInputId)&&s.value&&t.removeInputId(s.value)}),{isLabeledByFormItem:a,inputId:s}},YW=e=>{const t=OM();return ZM(()=>{var n,i;return null==(i=null==(n=null==t?void 0:t.proxy)?void 0:n.$props)?void 0:i[e]})},GW=(e,t={})=>{const n=pI(void 0),i=t.prop?n:YW("size"),r=t.global?n:(()=>{const e=GC(sG,{});return ZM(()=>yI(e.size)||"")})(),s=t.form?{size:void 0}:GC(UW,void 0),o=t.formItem?{size:void 0}:GC(VW,void 0);return ZM(()=>i.value||yI(e)||(null==o?void 0:o.size)||(null==s?void 0:s.size)||r.value||"")},HW=e=>{const t=YW("disabled"),n=GC(UW,void 0);return ZM(()=>t.value||yI(e)||(null==n?void 0:n.disabled)||!1)},WW=(e,t)=>{(({from:e,replacement:t,scope:n,version:i,ref:r,type:s="API"},o)=>{wO(()=>yI(o),e=>{},{immediate:!0})})({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},ZM(()=>"text"===e.type));const n=GC(FW,void 0),i=cG("button"),{form:r}=zW(),s=GW(ZM(()=>null==n?void 0:n.size)),o=HW(),a=pI(),l=bC(),u=ZM(()=>{var t;return e.type||(null==n?void 0:n.type)||(null==(t=i.value)?void 0:t.type)||""}),c=ZM(()=>{var t,n,r;return null!=(r=null!=(n=e.autoInsertSpace)?n:null==(t=i.value)?void 0:t.autoInsertSpace)&&r}),d=ZM(()=>{var t,n,r;return null!=(r=null!=(n=e.plain)?n:null==(t=i.value)?void 0:t.plain)&&r}),h=ZM(()=>{var t,n,r;return null!=(r=null!=(n=e.round)?n:null==(t=i.value)?void 0:t.round)&&r}),p=ZM(()=>{var t,n,r;return null!=(r=null!=(n=e.text)?n:null==(t=i.value)?void 0:t.text)&&r}),f=ZM(()=>"button"===e.tag?{ariaDisabled:o.value||e.loading,disabled:o.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),m=ZM(()=>{var e;const t=null==(e=l.default)?void 0:e.call(l);if(c.value&&1===(null==t?void 0:t.length)){const e=t[0];if((null==e?void 0:e.type)===XO){const t=e.children;return/^\p{Unified_Ideograph}{2}$/u.test(t.trim())}}return!1});return{_disabled:o,_size:s,_type:u,_ref:a,_props:f,_plain:d,_round:h,_text:p,shouldAddSpace:m,handleClick:n=>{o.value||e.loading?n.stopPropagation():("reset"===e.nativeType&&(null==r||r.resetFields()),t("click",n))}}},XW=nG({size:rG,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:YH},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:YH,default:()=>nH},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:[String,Object],default:"button"}}),qW={click:e=>e instanceof MouseEvent};function KW(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function ZW(e){return Math.min(1,Math.max(0,e))}function QW(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function JW(e){return e<=1?"".concat(100*Number(e),"%"):e}function eX(e){return 1===e.length?"0"+e:String(e)}function tX(e,t,n){e=KW(e,255),t=KW(t,255),n=KW(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),s=0,o=0,a=(i+r)/2;if(i===r)o=0,s=0;else{var l=i-r;switch(o=a>.5?l/(2-i-r):l/(i+r),i){case e:s=(t-n)/l+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iX(e,t,n){e=KW(e,255),t=KW(t,255),n=KW(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),s=0,o=i,a=i-r,l=0===i?0:a/i;if(i===r)s=0;else{switch(i){case e:s=(t-n)/a+(t>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var r=uX(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=n.format)&&void 0!==i?i:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,i=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=QW(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=iX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=iX(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=tX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=tX(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),rX(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,i,r){var s=[eX(Math.round(e).toString(16)),eX(Math.round(t).toString(16)),eX(Math.round(n).toString(16)),eX(sX(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*KW(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*KW(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+rX(this.r,this.g,this.b,!1),t=0,n=Object.entries(lX);t=0;return t||!i||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=ZW(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=ZW(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=ZW(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=ZW(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var i=this.toRgb(),r=new e(t).toRgb(),s=n/100;return new e({r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var i=this.toHsl(),r=360/n,s=[this];for(i.h=(i.h-(r*t>>1)+720)%360;--t;)i.h=(i.h+r)%360,s.push(new e(i));return s},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),i=n.h,r=n.s,s=n.v,o=[],a=1/t;t--;)o.push(new e({h:i,s:r,v:s})),s=(s+a)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),i=new e(t).toRgb(),r=n.a+i.a*(1-n.a);return new e({r:(n.r*n.a+i.r*i.a*(1-n.a))/r,g:(n.g*n.a+i.g*i.a*(1-n.a))/r,b:(n.b*n.a+i.b*i.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),i=n.h,r=[this],s=360/t,o=1;o{let i={},r=e.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new mX(r),a=e.dark?o.tint(20).toString():gX(o,20);if(e.plain)i=n.cssVarBlock({"bg-color":e.dark?gX(o,90):o.tint(90).toString(),"text-color":r,"border-color":e.dark?gX(o,50):o.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(i[n.cssVarBlockName("disabled-bg-color")]=e.dark?gX(o,90):o.tint(90).toString(),i[n.cssVarBlockName("disabled-text-color")]=e.dark?gX(o,50):o.tint(50).toString(),i[n.cssVarBlockName("disabled-border-color")]=e.dark?gX(o,80):o.tint(80).toString());else{const s=e.dark?gX(o,30):o.tint(30).toString(),l=o.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(i=n.cssVarBlock({"bg-color":r,"text-color":l,"border-color":r,"hover-bg-color":s,"hover-text-color":l,"hover-border-color":s,"active-bg-color":a,"active-border-color":a}),t.value){const t=e.dark?gX(o,50):o.tint(50).toString();i[n.cssVarBlockName("disabled-bg-color")]=t,i[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,i[n.cssVarBlockName("disabled-border-color")]=t}}}return i})}(i),s=Wz("button"),{_ref:o,_size:a,_type:l,_disabled:u,_props:c,_plain:d,_round:h,_text:p,shouldAddSpace:f,handleClick:m}=WW(i,n),g=ZM(()=>[s.b(),s.m(l.value),s.m(a.value),s.is("disabled",u.value),s.is("loading",i.loading),s.is("plain",d.value),s.is("round",h.value),s.is("circle",i.circle),s.is("text",p.value),s.is("link",i.link),s.is("has-bg",i.bg)]);return t({ref:o,size:a,type:l,disabled:u,shouldAddSpace:f}),(e,t)=>(JO(),oM(JS(e.tag),EM({ref_key:"_ref",ref:o},yI(c),{class:yI(g),style:yI(r),onClick:yI(m)}),{default:AA(()=>[e.loading?(JO(),sM(WO,{key:0},[e.$slots.loading?sC(e.$slots,"loading",{key:0}):(JO(),oM(yI(jH),{key:1,class:yE(yI(s).is("loading"))},{default:AA(()=>[(JO(),oM(JS(e.loadingIcon)))]),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?(JO(),oM(yI(jH),{key:1},{default:AA(()=>[e.icon?(JO(),oM(JS(e.icon),{key:0})):sC(e.$slots,"icon",{key:1})]),_:3})):vM("v-if",!0),e.$slots.default?(JO(),sM("span",{key:2,class:yE({[yI(s).em("text","expand")]:yI(f)})},[sC(e.$slots,"default")],2)):vM("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var vX=LH(yX,[["__file","button.vue"]]);const bX={size:XW.size,type:XW.type},TX=tS({name:"ElButtonGroup"});var xX=LH(tS({...TX,props:bX,setup(e){const t=e;YC(FW,Jw({size:SI(t,"size"),type:SI(t,"type")}));const n=Wz("button");return(e,t)=>(JO(),sM("div",{class:yE(yI(n).b("group"))},[sC(e.$slots,"default")],2))}}),[["__file","button-group.vue"]]);const EX=gG(vX,{ButtonGroup:xX}),wX=(_G(xX),nG({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:[String,Object,Array],default:""},headerClass:String,bodyClass:String,footerClass:String,shadow:{type:String,values:["always","hover","never"],default:void 0}})),IX=(Symbol("cardContextKey"),tS({name:"ElCard"})),AX=tS({...IX,props:wX,setup(e){const t=cG("card"),n=Wz("card");return(e,i)=>{var r;return JO(),sM("div",{class:yE([yI(n).b(),yI(n).is(`${e.shadow||(null==(r=yI(t))?void 0:r.shadow)||"always"}-shadow`)])},[e.$slots.header||e.header?(JO(),sM("div",{key:0,class:yE([yI(n).e("header"),e.headerClass])},[sC(e.$slots,"header",{},()=>[_M(FE(e.header),1)])],2)):vM("v-if",!0),hM("div",{class:yE([yI(n).e("body"),e.bodyClass]),style:pE(e.bodyStyle)},[sC(e.$slots,"default")],6),e.$slots.footer||e.footer?(JO(),sM("div",{key:1,class:yE([yI(n).e("footer"),e.footerClass])},[sC(e.$slots,"footer",{},()=>[_M(FE(e.footer),1)])],2)):vM("v-if",!0)],2)}}});const SX=gG(LH(AX,[["__file","card.vue"]]));var CX=__webpack_require__(4213),OX=__webpack_require__(71710),MX=__webpack_require__.n(OX);const kX=function(e){return null==e};let RX;const NX={height:"0",visibility:"hidden",overflow:aj&&/firefox/i.test(window.navigator.userAgent)?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},DX=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"];function FX(e,t=1,n){var i,r;RX||(RX=document.createElement("textarea"),(null!=(i=e.parentNode)?i:document.body).appendChild(RX));const{paddingSize:s,borderSize:o,boxSizing:a,contextStyle:l}=function(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),i=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:DX.map(e=>[e,t.getPropertyValue(e)]),paddingSize:i,borderSize:r,boxSizing:n}}(e);l.forEach(([e,t])=>null==RX?void 0:RX.style.setProperty(e,t)),Object.entries(NX).forEach(([e,t])=>null==RX?void 0:RX.style.setProperty(e,t,"important")),RX.value=e.value||e.placeholder||"";let u=RX.scrollHeight;const c={};"border-box"===a?u+=o:"content-box"===a&&(u-=s),RX.value="";const d=RX.scrollHeight-s;if(Kz(t)){let e=d*t;"border-box"===a&&(e=e+s+o),u=Math.max(e,u),c.minHeight=`${e}px`}if(Kz(n)){let e=d*n;"border-box"===a&&(e=e+s+o),u=Math.min(e,u)}return c.height=`${u}px`,null==(r=RX.parentNode)||r.removeChild(RX),RX=void 0,c}var LX=function(){try{var e=nY(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const PX=LX;const BX=function(e,t,n){"__proto__"==t&&PX?PX(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var $X=Object.prototype.hasOwnProperty;const UX=function(e,t,n){var i=e[t];$X.call(e,t)&&fY(i,n)&&(void 0!==n||t in e)||BX(e,t,n)};var VX=/^(?:0|[1-9]\d*)$/;const zX=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&VX.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};const QX=function(e,t,n){for(var i=-1,r=(t=YY(t,e)).length,s=!1;++i0&&i(l)?n>1?e(l,n-1,i,r,s):tq(s,l):r||(s[s.length]=l)}return s};const sq=function(e){return(null==e?0:e.length)?rq(e,1):[]};const oq=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var aq=Math.max;const lq=function(e,t,n){return t=aq(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=aq(i.length-t,0),o=Array(s);++r0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}};const fq=pq(dq);const mq=function(e){return fq(lq(e,void 0,sq),e+"")};var gq=mq(function(e,t){return null==e?{}:eq(e,t)});const _q=gq,yq=nG({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),vq=e=>_q(yq,e),bq="update:modelValue",Tq="change",xq="input",Eq=nG({id:{type:String,default:void 0},size:rG,disabled:Boolean,modelValue:{type:[String,Number,Object],default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:YH,default:LG},showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:YH},prefixIcon:{type:YH},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Object,Array,String],default:()=>({})},autofocus:Boolean,rows:{type:Number,default:2},...vq(["ariaLabel"]),inputmode:{type:String,default:void 0},name:String}),wq={[bq]:e=>Vx(e),input:e=>Vx(e),change:e=>Vx(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Iq=["class","style"],Aq=/^on[A-Z]/,Sq=(e={})=>{const{excludeListeners:t=!1,excludeKeys:n}=e,i=ZM(()=>((null==n?void 0:n.value)||[]).concat(Iq)),r=OM();return ZM(r?()=>{var e;return JY(Object.entries(null==(e=r.proxy)?void 0:e.$attrs).filter(([e])=>!(i.value.includes(e)||t&&Aq.test(e))))}:()=>({}))},Cq=e=>"undefined"!=typeof Element&&e instanceof Element,Oq=e=>{if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return!("hidden"===e.type||"file"===e.type);case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Mq=(e,t)=>{if(!e||!e.focus)return;let n=!1;!Cq(e)||Oq(e)||e.getAttribute("tabindex")||(e.setAttribute("tabindex","-1"),n=!0),e.focus(t),Cq(e)&&n&&e.removeAttribute("tabindex")};const kq=tS({name:"ElInput",inheritAttrs:!1}),Rq=tS({...kq,props:Eq,emits:wq,setup(e,{expose:t,emit:n}){const i=e,r=TC(),s=Sq(),o=bC(),a=ZM(()=>["textarea"===i.type?m.b():f.b(),f.m(h.value),f.is("disabled",p.value),f.is("exceed",B.value),{[f.b("group")]:o.prepend||o.append,[f.m("prefix")]:o.prefix||i.prefixIcon,[f.m("suffix")]:o.suffix||i.suffixIcon||i.clearable||i.showPassword,[f.bm("suffix","password-clear")]:D.value&&F.value,[f.b("hidden")]:"hidden"===i.type},r.class]),l=ZM(()=>[f.e("wrapper"),f.is("focus",w.value)]),{form:u,formItem:c}=zW(),{inputId:d}=jW(i,{formItemContext:c}),h=GW(),p=HW(),f=Wz("input"),m=Wz("textarea"),g=fI(),_=fI(),y=pI(!1),v=pI(!1),b=pI(),T=fI(i.inputStyle),x=ZM(()=>g.value||_.value),{wrapperRef:E,isFocused:w,handleFocus:I,handleBlur:A}=function(e,{disabled:t,beforeFocus:n,afterFocus:i,beforeBlur:r,afterBlur:s}={}){const o=OM(),{emit:a}=o,l=fI(),u=pI(!1),c=e=>{const r=!!Ux(n)&&n(e);yI(t)||u.value||r||(u.value=!0,a("focus",e),null==i||i())},d=e=>{var n;const i=!!Ux(r)&&r(e);yI(t)||e.relatedTarget&&(null==(n=l.value)?void 0:n.contains(e.relatedTarget))||i||(u.value=!1,a("blur",e),null==s||s())};return wO([l,()=>yI(t)],([e,t])=>{e&&(t?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1"))}),gH(l,"focus",c,!0),gH(l,"blur",d,!0),gH(l,"click",n=>{var i,r;yI(t)||Oq(n.target)||(null==(i=l.value)?void 0:i.contains(document.activeElement))&&l.value!==document.activeElement||null==(r=e.value)||r.focus()},!0),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:d}}(x,{disabled:p,afterBlur(){var e;i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"blur").catch(e=>{}))}}),S=ZM(()=>{var e;return null!=(e=null==u?void 0:u.statusIcon)&&e}),C=ZM(()=>(null==c?void 0:c.validateState)||""),O=ZM(()=>C.value&&WH[C.value]),M=ZM(()=>v.value?uH:QG),k=ZM(()=>[r.style]),R=ZM(()=>[i.inputStyle,T.value,{resize:i.resize}]),N=ZM(()=>kX(i.modelValue)?"":String(i.modelValue)),D=ZM(()=>i.clearable&&!p.value&&!i.readonly&&!!N.value&&(w.value||y.value)),F=ZM(()=>i.showPassword&&!p.value&&!!N.value),L=ZM(()=>i.showWordLimit&&!!i.maxlength&&("text"===i.type||"textarea"===i.type)&&!p.value&&!i.readonly&&!i.showPassword),P=ZM(()=>N.value.length),B=ZM(()=>!!L.value&&P.value>Number(i.maxlength)),$=ZM(()=>!!o.suffix||!!i.suffixIcon||D.value||i.showPassword||L.value||!!C.value&&S.value),[U,V]=function(e){let t;return[function(){if(null==e.value)return;const{selectionStart:n,selectionEnd:i,value:r}=e.value;if(null==n||null==i)return;const s=r.slice(0,Math.max(0,n)),o=r.slice(Math.max(0,i));t={selectionStart:n,selectionEnd:i,value:r,beforeTxt:s,afterTxt:o}},function(){if(null==e.value||null==t)return;const{value:n}=e.value,{beforeTxt:i,afterTxt:r,selectionStart:s}=t;if(null==i||null==r||null==s)return;let o=n.length;if(n.endsWith(r))o=n.length-r.length;else if(n.startsWith(i))o=i.length;else{const e=i[s-1],t=n.indexOf(e,s-1);-1!==t&&(o=t+1)}e.value.setSelectionRange(o,o)}]}(g);IH(_,e=>{if(j(),!L.value||"both"!==i.resize)return;const t=e[0],{width:n}=t.contentRect;b.value={right:`calc(100% - ${n+15+6}px)`}});const z=()=>{const{type:e,autosize:t}=i;if(aj&&"textarea"===e&&_.value)if(t){const e=jx(t)?t.minRows:void 0,n=jx(t)?t.maxRows:void 0,i=FX(_.value,e,n);T.value={overflowY:"hidden",...i},nA(()=>{_.value.offsetHeight,T.value=i})}else T.value={minHeight:FX(_.value).minHeight}},j=(e=>{let t=!1;return()=>{var n;if(t||!i.autosize)return;null===(null==(n=_.value)?void 0:n.offsetParent)||(setTimeout(e),t=!0)}})(z),Y=()=>{const e=x.value,t=i.formatter?i.formatter(N.value):N.value;e&&e.value!==t&&(e.value=t)},G=async e=>{U();let{value:t}=e.target;i.formatter&&i.parser&&(t=i.parser(t)),W.value||(t!==N.value?(n(bq,t),n(xq,t),await nA(),Y(),V()):Y())},H=e=>{let{value:t}=e.target;i.formatter&&i.parser&&(t=i.parser(t)),n(Tq,t)},{isComposing:W,handleCompositionStart:X,handleCompositionUpdate:q,handleCompositionEnd:K}=function({afterComposition:e,emit:t}){const n=pI(!1),i=e=>{var i;null==t||t("compositionupdate",e);const r=null==(i=e.target)?void 0:i.value,s=r[r.length-1]||"";n.value=!(e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e))(s)},r=i=>{null==t||t("compositionend",i),n.value&&(n.value=!1,nA(()=>e(i)))};return{isComposing:n,handleComposition:e=>{"compositionend"===e.type?r(e):i(e)},handleCompositionStart:e=>{null==t||t("compositionstart",e),n.value=!0},handleCompositionUpdate:i,handleCompositionEnd:r}}({emit:n,afterComposition:G}),Z=()=>{U(),v.value=!v.value,setTimeout(V)},Q=e=>{y.value=!1,n("mouseleave",e)},J=e=>{y.value=!0,n("mouseenter",e)},ee=e=>{n("keydown",e)},te=()=>{n(bq,""),n(Tq,""),n("clear"),n(xq,"")};return wO(()=>i.modelValue,()=>{var e;nA(()=>z()),i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"change").catch(e=>{}))}),wO(N,()=>Y()),wO(()=>i.type,async()=>{await nA(),Y(),z()}),US(()=>{!i.formatter&&i.parser,Y(),nA(z)}),t({input:g,textarea:_,ref:x,textareaStyle:R,autosize:SI(i,"autosize"),isComposing:W,focus:()=>{var e;return null==(e=x.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=x.value)?void 0:e.blur()},select:()=>{var e;null==(e=x.value)||e.select()},clear:te,resizeTextarea:z}),(e,t)=>(JO(),sM("div",{class:yE([yI(a),{[yI(f).bm("group","append")]:e.$slots.append,[yI(f).bm("group","prepend")]:e.$slots.prepend}]),style:pE(yI(k)),onMouseenter:J,onMouseleave:Q},[vM(" input "),"textarea"!==e.type?(JO(),sM(WO,{key:0},[vM(" prepend slot "),e.$slots.prepend?(JO(),sM("div",{key:0,class:yE(yI(f).be("group","prepend"))},[sC(e.$slots,"prepend")],2)):vM("v-if",!0),hM("div",{ref_key:"wrapperRef",ref:E,class:yE(yI(l))},[vM(" prefix slot "),e.$slots.prefix||e.prefixIcon?(JO(),sM("span",{key:0,class:yE(yI(f).e("prefix"))},[hM("span",{class:yE(yI(f).e("prefix-inner"))},[sC(e.$slots,"prefix"),e.prefixIcon?(JO(),oM(yI(jH),{key:0,class:yE(yI(f).e("icon"))},{default:AA(()=>[(JO(),oM(JS(e.prefixIcon)))]),_:1},8,["class"])):vM("v-if",!0)],2)],2)):vM("v-if",!0),hM("input",EM({id:yI(d),ref_key:"input",ref:g,class:yI(f).e("inner")},yI(s),{name:e.name,minlength:e.minlength,maxlength:e.maxlength,type:e.showPassword?v.value?"text":"password":e.type,disabled:yI(p),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:yI(X),onCompositionupdate:yI(q),onCompositionend:yI(K),onInput:G,onChange:H,onKeydown:ee}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),vM(" suffix slot "),yI($)?(JO(),sM("span",{key:1,class:yE(yI(f).e("suffix"))},[hM("span",{class:yE(yI(f).e("suffix-inner"))},[yI(D)&&yI(F)&&yI(L)?vM("v-if",!0):(JO(),sM(WO,{key:0},[sC(e.$slots,"suffix"),e.suffixIcon?(JO(),oM(yI(jH),{key:0,class:yE(yI(f).e("icon"))},{default:AA(()=>[(JO(),oM(JS(e.suffixIcon)))]),_:1},8,["class"])):vM("v-if",!0)],64)),yI(D)?(JO(),oM(yI(jH),{key:1,class:yE([yI(f).e("icon"),yI(f).e("clear")]),onMousedown:UR(yI(Cx),["prevent"]),onClick:te},{default:AA(()=>[(JO(),oM(JS(e.clearIcon)))]),_:1},8,["class","onMousedown"])):vM("v-if",!0),yI(F)?(JO(),oM(yI(jH),{key:2,class:yE([yI(f).e("icon"),yI(f).e("password")]),onClick:Z},{default:AA(()=>[(JO(),oM(JS(yI(M))))]),_:1},8,["class"])):vM("v-if",!0),yI(L)?(JO(),sM("span",{key:3,class:yE(yI(f).e("count"))},[hM("span",{class:yE(yI(f).e("count-inner"))},FE(yI(P))+" / "+FE(e.maxlength),3)],2)):vM("v-if",!0),yI(C)&&yI(O)&&yI(S)?(JO(),oM(yI(jH),{key:4,class:yE([yI(f).e("icon"),yI(f).e("validateIcon"),yI(f).is("loading","validating"===yI(C))])},{default:AA(()=>[(JO(),oM(JS(yI(O))))]),_:1},8,["class"])):vM("v-if",!0)],2)],2)):vM("v-if",!0)],2),vM(" append slot "),e.$slots.append?(JO(),sM("div",{key:1,class:yE(yI(f).be("group","append"))},[sC(e.$slots,"append")],2)):vM("v-if",!0)],64)):(JO(),sM(WO,{key:1},[vM(" textarea "),hM("textarea",EM({id:yI(d),ref_key:"textarea",ref:_,class:[yI(m).e("inner"),yI(f).is("focus",yI(w))]},yI(s),{minlength:e.minlength,maxlength:e.maxlength,tabindex:e.tabindex,disabled:yI(p),readonly:e.readonly,autocomplete:e.autocomplete,style:yI(R),"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,onCompositionstart:yI(X),onCompositionupdate:yI(q),onCompositionend:yI(K),onInput:G,onFocus:yI(I),onBlur:yI(A),onChange:H,onKeydown:ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),yI(L)?(JO(),sM("span",{key:0,style:pE(b.value),class:yE(yI(f).e("count"))},FE(yI(P))+" / "+FE(e.maxlength),7)):vM("v-if",!0)],64))],38))}});const Nq=gG(LH(Rq,[["__file","input.vue"]])),Dq=Symbol("popper"),Fq=Symbol("popperContent"),Lq=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],Pq=nG({role:{type:String,values:Lq,default:"tooltip"}}),Bq=tS({name:"ElPopper",inheritAttrs:!1});const $q=gG(LH(tS({...Bq,props:Pq,setup(e,{expose:t}){const n=e,i={triggerRef:pI(),popperInstanceRef:pI(),contentRef:pI(),referenceRef:pI(),role:ZM(()=>n.role)};return t(i),YC(Dq,i),(e,t)=>sC(e.$slots,"default")}}),[["__file","popper.vue"]])),Uq=Symbol("elTooltip");var Vq="top",zq="bottom",jq="right",Yq="left",Gq="auto",Hq=[Vq,zq,jq,Yq],Wq="start",Xq="end",qq="viewport",Kq="popper",Zq=Hq.reduce(function(e,t){return e.concat([t+"-"+Wq,t+"-"+Xq])},[]),Qq=[].concat(Hq,[Gq]).reduce(function(e,t){return e.concat([t,t+"-"+Wq,t+"-"+Xq])},[]),Jq=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function eK(e){return e?(e.nodeName||"").toLowerCase():null}function tK(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function nK(e){return e instanceof tK(e).Element||e instanceof Element}function iK(e){return e instanceof tK(e).HTMLElement||e instanceof HTMLElement}function rK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof tK(e).ShadowRoot||e instanceof ShadowRoot)}var sK={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!iK(r)||!eK(r)||(Object.assign(r.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});!iK(i)||!eK(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]};function oK(e){return e.split("-")[0]}var aK=Math.max,lK=Math.min,uK=Math.round;function cK(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),i=1,r=1;if(iK(e)&&t){var s=e.offsetHeight,o=e.offsetWidth;o>0&&(i=uK(n.width)/o||1),s>0&&(r=uK(n.height)/s||1)}return{width:n.width/i,height:n.height/r,top:n.top/r,right:n.right/i,bottom:n.bottom/r,left:n.left/i,x:n.left/i,y:n.top/r}}function dK(e){var t=cK(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function hK(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rK(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function pK(e){return tK(e).getComputedStyle(e)}function fK(e){return["table","td","th"].indexOf(eK(e))>=0}function mK(e){return((nK(e)?e.ownerDocument:e.document)||window.document).documentElement}function gK(e){return"html"===eK(e)?e:e.assignedSlot||e.parentNode||(rK(e)?e.host:null)||mK(e)}function _K(e){return iK(e)&&"fixed"!==pK(e).position?e.offsetParent:null}function yK(e){for(var t=tK(e),n=_K(e);n&&fK(n)&&"static"===pK(n).position;)n=_K(n);return n&&("html"===eK(n)||"body"===eK(n)&&"static"===pK(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&iK(e)&&"fixed"===pK(e).position)return null;var n=gK(e);for(rK(n)&&(n=n.host);iK(n)&&["html","body"].indexOf(eK(n))<0;){var i=pK(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function vK(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function bK(e,t,n){return aK(e,lK(t,n))}function TK(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function xK(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var EK={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=oK(n.placement),l=vK(a),u=[Yq,jq].indexOf(a)>=0?"height":"width";if(s&&o){var c=function(e,t){return TK("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:xK(e,Hq))}(r.padding,n),d=dK(s),h="y"===l?Vq:Yq,p="y"===l?zq:jq,f=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],m=o[l]-n.rects.reference[l],g=yK(s),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,v=c[h],b=_-d[u]-c[p],T=_/2-d[u]/2+y,x=bK(v,T,b),E=l;n.modifiersData[i]=((t={})[E]=x,t.centerOffset=x-T,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"==typeof i&&!(i=t.elements.popper.querySelector(i))||!hK(t.elements.popper,i)||(t.elements.arrow=i))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wK(e){return e.split("-")[1]}var IK={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AK(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,m=void 0===f?0:f,g="function"==typeof c?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var _=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),v=Yq,b=Vq,T=window;if(u){var x=yK(n),E="clientHeight",w="clientWidth";if(x===tK(n)&&("static"!==pK(x=mK(n)).position&&"absolute"===a&&(E="scrollHeight",w="scrollWidth")),r===Vq||(r===Yq||r===jq)&&s===Xq)b=zq,m-=(d&&x===T&&T.visualViewport?T.visualViewport.height:x[E])-i.height,m*=l?1:-1;if(r===Yq||(r===Vq||r===zq)&&s===Xq)v=jq,p-=(d&&x===T&&T.visualViewport?T.visualViewport.width:x[w])-i.width,p*=l?1:-1}var I,A=Object.assign({position:a},u&&IK),S=!0===c?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:uK(t*i)/i||0,y:uK(n*i)/i||0}}({x:p,y:m}):{x:p,y:m};return p=S.x,m=S.y,l?Object.assign({},A,((I={})[b]=y?"0":"",I[v]=_?"0":"",I.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I)):Object.assign({},A,((t={})[b]=y?m+"px":"",t[v]=_?p+"px":"",t.transform="",t))}var SK={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,l=void 0===a||a,u={placement:oK(t.placement),variation:wK(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,AK(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,AK(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},CK={passive:!0};var OK={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=void 0===r||r,o=i.resize,a=void 0===o||o,l=tK(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&u.forEach(function(e){e.addEventListener("scroll",n.update,CK)}),a&&l.addEventListener("resize",n.update,CK),function(){s&&u.forEach(function(e){e.removeEventListener("scroll",n.update,CK)}),a&&l.removeEventListener("resize",n.update,CK)}},data:{}},MK={left:"right",right:"left",bottom:"top",top:"bottom"};function kK(e){return e.replace(/left|right|bottom|top/g,function(e){return MK[e]})}var RK={start:"end",end:"start"};function NK(e){return e.replace(/start|end/g,function(e){return RK[e]})}function DK(e){var t=tK(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function FK(e){return cK(mK(e)).left+DK(e).scrollLeft}function LK(e){var t=pK(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function PK(e){return["html","body","#document"].indexOf(eK(e))>=0?e.ownerDocument.body:iK(e)&&LK(e)?e:PK(gK(e))}function BK(e,t){var n;void 0===t&&(t=[]);var i=PK(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),s=tK(i),o=r?[s].concat(s.visualViewport||[],LK(i)?i:[]):i,a=t.concat(o);return r?a:a.concat(BK(gK(o)))}function $K(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function UK(e,t){return t===qq?$K(function(e){var t=tK(e),n=mK(e),i=t.visualViewport,r=n.clientWidth,s=n.clientHeight,o=0,a=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:r,height:s,x:o+FK(e),y:a}}(e)):nK(t)?function(e){var t=cK(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):$K(function(e){var t,n=mK(e),i=DK(e),r=null==(t=e.ownerDocument)?void 0:t.body,s=aK(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=aK(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+FK(e),l=-i.scrollTop;return"rtl"===pK(r||n).direction&&(a+=aK(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(mK(e)))}function VK(e,t,n){var i="clippingParents"===t?function(e){var t=BK(gK(e)),n=["absolute","fixed"].indexOf(pK(e).position)>=0&&iK(e)?yK(e):e;return nK(n)?t.filter(function(e){return nK(e)&&hK(e,n)&&"body"!==eK(e)}):[]}(e):[].concat(t),r=[].concat(i,[n]),s=r[0],o=r.reduce(function(t,n){var i=UK(e,n);return t.top=aK(i.top,t.top),t.right=lK(i.right,t.right),t.bottom=lK(i.bottom,t.bottom),t.left=aK(i.left,t.left),t},UK(e,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function zK(e){var t,n=e.reference,i=e.element,r=e.placement,s=r?oK(r):null,o=r?wK(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(s){case Vq:t={x:a,y:n.y-i.height};break;case zq:t={x:a,y:n.y+n.height};break;case jq:t={x:n.x+n.width,y:l};break;case Yq:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var u=s?vK(s):null;if(null!=u){var c="y"===u?"height":"width";switch(o){case Wq:t[u]=t[u]-(n[c]/2-i[c]/2);break;case Xq:t[u]=t[u]+(n[c]/2-i[c]/2)}}return t}function jK(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,l=void 0===a?qq:a,u=n.elementContext,c=void 0===u?Kq:u,d=n.altBoundary,h=void 0!==d&&d,p=n.padding,f=void 0===p?0:p,m=TK("number"!=typeof f?f:xK(f,Hq)),g=c===Kq?"reference":Kq,_=e.rects.popper,y=e.elements[h?g:c],v=VK(nK(y)?y:y.contextElement||mK(e.elements.popper),o,l),b=cK(e.elements.reference),T=zK({reference:b,element:_,strategy:"absolute",placement:r}),x=$K(Object.assign({},_,T)),E=c===Kq?x:b,w={top:v.top-E.top+m.top,bottom:E.bottom-v.bottom+m.bottom,left:v.left-E.left+m.left,right:E.right-v.right+m.right},I=e.modifiersData.offset;if(c===Kq&&I){var A=I[r];Object.keys(w).forEach(function(e){var t=[jq,zq].indexOf(e)>=0?1:-1,n=[Vq,zq].indexOf(e)>=0?"y":"x";w[e]+=A[n]*t})}return w}var YK={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0===o||o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,_=oK(g),y=l||(_===g||!f?[kK(g)]:function(e){if(oK(e)===Gq)return[];var t=kK(e);return[NK(e),t,NK(t)]}(g)),v=[g].concat(y).reduce(function(e,n){return e.concat(oK(n)===Gq?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Qq:l,c=wK(i),d=c?a?Zq:Zq.filter(function(e){return wK(e)===c}):Hq,h=d.filter(function(e){return u.indexOf(e)>=0});0===h.length&&(h=d);var p=h.reduce(function(t,n){return t[n]=jK(e,{placement:n,boundary:r,rootBoundary:s,padding:o})[oK(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)},[]),b=t.rects.reference,T=t.rects.popper,x=new Map,E=!0,w=v[0],I=0;I=0,M=O?"width":"height",k=jK(t,{placement:A,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),R=O?C?jq:Yq:C?zq:Vq;b[M]>T[M]&&(R=kK(R));var N=kK(R),D=[];if(s&&D.push(k[S]<=0),a&&D.push(k[R]<=0,k[N]<=0),D.every(function(e){return e})){w=A,E=!1;break}x.set(A,D)}if(E)for(var F=function(e){var t=v.find(function(t){var n=x.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,"break"},L=f?3:1;L>0;L--){if("break"===F(L))break}t.placement!==w&&(t.modifiersData[i]._skip=!0,t.placement=w,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function GK(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function HK(e){return[Vq,jq,zq,Yq].some(function(t){return e[t]>=0})}var WK={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=jK(t,{elementContext:"reference"}),a=jK(t,{altBoundary:!0}),l=GK(o,i),u=GK(a,r,s),c=HK(l),d=HK(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};var XK={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=void 0===r?[0,0]:r,o=Qq.reduce(function(e,n){return e[n]=function(e,t,n){var i=oK(e),r=[Yq,Vq].indexOf(i)>=0?-1:1,s="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[Yq,jq].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,s),e},{}),a=o[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[i]=o}};var qK={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=zK({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var KK={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0!==o&&o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,h=n.tether,p=void 0===h||h,f=n.tetherOffset,m=void 0===f?0:f,g=jK(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),_=oK(t.placement),y=wK(t.placement),v=!y,b=vK(_),T=function(e){return"x"===e?"y":"x"}(b),x=t.modifiersData.popperOffsets,E=t.rects.reference,w=t.rects.popper,I="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,A="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,C={x:0,y:0};if(x){if(s){var O,M="y"===b?Vq:Yq,k="y"===b?zq:jq,R="y"===b?"height":"width",N=x[b],D=N+g[M],F=N-g[k],L=p?-w[R]/2:0,P=y===Wq?E[R]:w[R],B=y===Wq?-w[R]:-E[R],$=t.elements.arrow,U=p&&$?dK($):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=V[M],j=V[k],Y=bK(0,E[R],U[R]),G=v?E[R]/2-L-Y-z-A.mainAxis:P-Y-z-A.mainAxis,H=v?-E[R]/2+L+Y+j+A.mainAxis:B+Y+j+A.mainAxis,W=t.elements.arrow&&yK(t.elements.arrow),X=W?"y"===b?W.clientTop||0:W.clientLeft||0:0,q=null!=(O=null==S?void 0:S[b])?O:0,K=N+H-q,Z=bK(p?lK(D,N+G-q-X):D,N,p?aK(F,K):F);x[b]=Z,C[b]=Z-N}if(a){var Q,J="x"===b?Vq:Yq,ee="x"===b?zq:jq,te=x[T],ne="y"===T?"height":"width",ie=te+g[J],re=te-g[ee],se=-1!==[Vq,Yq].indexOf(_),oe=null!=(Q=null==S?void 0:S[T])?Q:0,ae=se?ie:te-E[ne]-w[ne]-oe+A.altAxis,le=se?te+E[ne]+w[ne]-oe-A.altAxis:re,ue=p&&se?function(e,t,n){var i=bK(e,t,n);return i>n?n:i}(ae,te,le):bK(p?ae:ie,te,p?le:re);x[T]=ue,C[T]=ue-te}t.modifiersData[i]=C}},requiresIfExists:["offset"]};function ZK(e,t,n){void 0===n&&(n=!1);var i=iK(t),r=iK(t)&&function(e){var t=e.getBoundingClientRect(),n=uK(t.width)/e.offsetWidth||1,i=uK(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),s=mK(t),o=cK(e,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==eK(t)||LK(s))&&(a=function(e){return e!==tK(e)&&iK(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):DK(e)}(t)),iK(t)?((l=cK(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=FK(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function QK(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||r(e)}),i}function JK(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var eZ={placement:"bottom",modifiers:[],strategy:"absolute"};function tZ(){for(var e=arguments.length,t=new Array(e),n=0;n({})},strategy:{type:String,values:["fixed","absolute"],default:"absolute"}}),oZ=nG({...sZ,...rZ,id:String,style:{type:[String,Array,Object]},className:{type:[String,Array,Object]},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:[String,Array,Object]},popperStyle:{type:[String,Array,Object]},referenceEl:{type:Object},triggerTargetEl:{type:Object},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...vq(["ariaLabel"])}),aZ={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},lZ=nG({to:{type:[String,Object],required:!0},disabled:Boolean});function uZ(){let e;const t=()=>window.clearTimeout(e);return fj(()=>t()),{registerTimeout:(n,i)=>{t(),e=window.setTimeout(n,i)},cancelTimeout:t}}const cZ=nG({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),dZ=nG({...cZ,...oZ,appendTo:{type:lZ.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Boolean,default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...vq(["ariaLabel"])}),hZ=nG({virtualRef:{type:Object},virtualTriggering:Boolean,onMouseenter:{type:Function},onMouseleave:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onContextmenu:{type:Function},id:String,open:Boolean}),pZ=nG({...hZ,disabled:Boolean,trigger:{type:[String,Array],default:"hover"},triggerKeys:{type:Array,default:()=>[tW.enter,tW.numpadEnter,tW.space]},focusOnTarget:Boolean}),fZ=tG({type:Boolean,default:null}),mZ=tG({type:Function}),gZ=e=>{const t=`update:${e}`,n=`onUpdate:${e}`,i=[t];return{useModelToggle:({indicator:i,toggleReason:r,shouldHideWhenRouteChanges:s,shouldProceed:o,onShow:a,onHide:l})=>{const u=OM(),{emit:c}=u,d=u.props,h=ZM(()=>Ux(d[n])),p=ZM(()=>null===d[e]),f=e=>{!0!==i.value&&(i.value=!0,r&&(r.value=e),Ux(a)&&a(e))},m=e=>{!1!==i.value&&(i.value=!1,r&&(r.value=e),Ux(l)&&l(e))},g=e=>{if(!0===d.disabled||Ux(o)&&!o())return;const n=h.value&&aj;n&&c(t,!0),!p.value&&n||f(e)},_=e=>{if(!0===d.disabled||!aj)return;const n=h.value&&aj;n&&c(t,!1),!p.value&&n||m(e)},y=e=>{qz(e)&&(d.disabled&&e?h.value&&c(t,!1):i.value!==e&&(e?f():m()))};return wO(()=>d[e],y),s&&void 0!==u.appContext.config.globalProperties.$route&&wO(()=>({...u.proxy.$route}),()=>{s.value&&i.value&&_()}),US(()=>{y(d[e])}),{hide:_,show:g,toggle:()=>{i.value?_():g()},hasUpdateHandler:h}},useModelToggleProps:{[e]:fZ,[n]:mZ},useModelToggleEmits:i}},{useModelToggle:_Z,useModelToggleProps:yZ,useModelToggleEmits:vZ}=gZ("modelValue"),{useModelToggleProps:bZ,useModelToggleEmits:TZ,useModelToggle:xZ}=gZ("visible"),EZ=nG({...Pq,...bZ,...dZ,...pZ,...rZ,showArrow:{type:Boolean,default:!0}}),wZ=[...TZ,"before-show","before-hide","show","hide","open","close"],IZ=(e,t,n)=>i=>{((e,t)=>Lx(e)?e.includes(t):e===t)(yI(e),t)&&n(i)},AZ=Symbol("elForwardRef"),SZ=tS({name:"ElOnlyChild",setup(e,{slots:t,attrs:n}){var i;const r=GC(AZ),s=(o=null!=(i=null==r?void 0:r.setForwardRef)?i:Cx,{mounted(e){o(e)},updated(e){o(e)},unmounted(){o(null)}});var o;return()=>{var e;const i=null==(e=t.default)?void 0:e.call(t,n);if(!i)return null;const[r,o]=CZ(i);return r?SA(gM(r,n),[[s]]):null}}});function CZ(e){if(!e)return[null,0];const t=e,n=t.filter(e=>e.type!==qO).length;for(const e of t){if(jx(e))switch(e.type){case qO:continue;case XO:case"svg":return[OZ(e),n];case WO:return CZ(e.children);default:return[e,n]}return[OZ(e),n]}return[null,0]}function OZ(e){const t=Wz("only-child");return pM("span",{class:t.e("content")},[e])}const MZ=tS({name:"ElPopperTrigger",inheritAttrs:!1}),kZ=tS({...MZ,props:hZ,setup(e,{expose:t}){const n=e,{role:i,triggerRef:r}=GC(Dq,void 0);var s;s=r,YC(AZ,{setForwardRef:e=>{s.value=e}});const o=ZM(()=>l.value?n.id:void 0),a=ZM(()=>{if(i&&"tooltip"===i.value)return n.open&&n.id?n.id:void 0}),l=ZM(()=>{if(i&&"tooltip"!==i.value)return i.value}),u=ZM(()=>l.value?`${n.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return US(()=>{wO(()=>n.virtualRef,e=>{e&&(r.value=fH(e))},{immediate:!0}),wO(r,(e,t)=>{null==c||c(),c=void 0,Zz(e)&&(d.forEach(i=>{var r;const s=n[i];s&&(e.addEventListener(i.slice(2).toLowerCase(),s,["onFocus","onBlur"].includes(i)),null==(r=null==t?void 0:t.removeEventListener)||r.call(t,i.slice(2).toLowerCase(),s,["onFocus","onBlur"].includes(i)))}),Oq(e)&&(c=wO([o,a,l,u],t=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((n,i)=>{kX(t[i])?e.removeAttribute(n):e.setAttribute(n,t[i])})},{immediate:!0}))),Zz(t)&&Oq(t)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(e=>t.removeAttribute(e))},{immediate:!0})}),jS(()=>{if(null==c||c(),c=void 0,r.value&&Zz(r.value)){const e=r.value;d.forEach(t=>{const i=n[t];i&&e.removeEventListener(t.slice(2).toLowerCase(),i,["onFocus","onBlur"].includes(t))}),r.value=void 0}}),t({triggerRef:r}),(e,t)=>e.virtualTriggering?vM("v-if",!0):(JO(),oM(yI(SZ),EM({key:0},e.$attrs,{"aria-controls":yI(o),"aria-describedby":yI(a),"aria-expanded":yI(u),"aria-haspopup":yI(l)}),{default:AA(()=>[sC(e.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var RZ=LH(kZ,[["__file","trigger.vue"]]);const NZ=(e,t,{checkForDefaultPrevented:n=!0}={})=>i=>{const r=null==e?void 0:e(i);if(!1===n||!r)return null==t?void 0:t(i)},DZ=e=>t=>"mouse"===t.pointerType?e(t):void 0,FZ=tS({name:"ElTooltipTrigger"}),LZ=tS({...FZ,props:pZ,setup(e,{expose:t}){const n=e,i=Wz("tooltip"),{controlled:r,id:s,open:o,onOpen:a,onClose:l,onToggle:u}=GC(Uq,void 0),c=pI(null),d=()=>{if(yI(r)||n.disabled)return!0},h=SI(n,"trigger"),p=NZ(d,IZ(h,"hover",e=>{a(e),n.focusOnTarget&&e.target&&nA(()=>{Mq(e.target,{preventScroll:!0})})})),f=NZ(d,IZ(h,"hover",l)),m=NZ(d,IZ(h,"click",e=>{0===e.button&&u(e)})),g=NZ(d,IZ(h,"focus",a)),_=NZ(d,IZ(h,"focus",l)),y=NZ(d,IZ(h,"contextmenu",e=>{e.preventDefault(),u(e)})),v=NZ(d,e=>{const{code:t}=e;n.triggerKeys.includes(t)&&(e.preventDefault(),u(e))});return t({triggerRef:c}),(e,t)=>(JO(),oM(yI(RZ),{id:yI(s),"virtual-ref":e.virtualRef,open:yI(o),"virtual-triggering":e.virtualTriggering,class:yE(yI(i).e("trigger")),onBlur:yI(_),onClick:yI(m),onContextmenu:yI(y),onFocus:yI(g),onMouseenter:yI(p),onMouseleave:yI(f),onKeydown:yI(v)},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var PZ=LH(LZ,[["__file","trigger.vue"]]);const BZ=gG(LH(tS({__name:"teleport",props:lZ,setup:e=>(e,t)=>e.disabled?sC(e.$slots,"default",{key:0}):(JO(),oM(BA,{key:1,to:e.to},[sC(e.$slots,"default")],8,["to"]))}),[["__file","teleport.vue"]])),$Z=()=>{const e=Hz(),t=BW(),n=ZM(()=>`${e.value}-popper-container-${t.prefix}`),i=ZM(()=>`#${n.value}`);return{id:n,selector:i}},UZ=()=>{const{id:e,selector:t}=$Z();return $S(()=>{aj&&(document.body.querySelector(t.value)||(e=>{const t=document.createElement("div");t.id=e,document.body.appendChild(t)})(e.value))}),{id:e,selector:t}},VZ="focus-trap.focus-after-trapped",zZ="focus-trap.focus-after-released",jZ={cancelable:!0,bubbles:!1},YZ={cancelable:!0,bubbles:!1},GZ="focusAfterTrapped",HZ="focusAfterReleased",WZ=Symbol("elFocusTrap"),XZ=pI(),qZ=pI(0),KZ=pI(0);let ZZ=0;const QZ=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},JZ=(e,t)=>{for(const n of e)if(!eQ(n,t))return n},eQ=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},tQ=(e,t)=>{if(e){const n=document.activeElement;Mq(e,{preventScroll:!0}),KZ.value=window.performance.now(),e!==n&&(e=>e instanceof HTMLInputElement&&"select"in e)(e)&&t&&e.select()}};function nQ(e,t){const n=[...e],i=e.indexOf(t);return-1!==i&&n.splice(i,1),n}const iQ=(()=>{let e=[];return{push:t=>{const n=e[0];n&&t!==n&&n.pause(),e=nQ(e,t),e.unshift(t)},remove:t=>{var n,i;e=nQ(e,t),null==(i=null==(n=e[0])?void 0:n.resume)||i.call(n)}}})(),rQ=()=>{XZ.value="pointer",qZ.value=window.performance.now()},sQ=()=>{XZ.value="keyboard",qZ.value=window.performance.now()},oQ=()=>(US(()=>{0===ZZ&&(document.addEventListener("mousedown",rQ),document.addEventListener("touchstart",rQ),document.addEventListener("keydown",sQ)),ZZ++}),jS(()=>{ZZ--,ZZ<=0&&(document.removeEventListener("mousedown",rQ),document.removeEventListener("touchstart",rQ),document.removeEventListener("keydown",sQ))}),{focusReason:XZ,lastUserFocusTimestamp:qZ,lastAutomatedFocusTimestamp:KZ}),aQ=e=>new CustomEvent("focus-trap.focusout-prevented",{...YZ,detail:e});let lQ=[];const uQ=e=>{e.code===tW.esc&&lQ.forEach(t=>t(e))},cQ=tS({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[GZ,HZ,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=pI();let i,r;const{focusReason:s}=oQ();var o;o=n=>{e.trapped&&!a.paused&&t("release-requested",n)},US(()=>{0===lQ.length&&document.addEventListener("keydown",uQ),aj&&lQ.push(o)}),jS(()=>{lQ=lQ.filter(e=>e!==o),0===lQ.length&&aj&&document.removeEventListener("keydown",uQ)});const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=n=>{if(!e.loop&&!e.trapped)return;if(a.paused)return;const{code:i,altKey:r,ctrlKey:o,metaKey:l,currentTarget:u,shiftKey:c}=n,{loop:d}=e,h=i===tW.tab&&!r&&!o&&!l,p=document.activeElement;if(h&&p){const e=u,[i,r]=(e=>{const t=QZ(e);return[JZ(t,e),JZ(t.reverse(),e)]})(e);if(i&&r)if(c||p!==r){if(c&&[i,e].includes(p)){const e=aQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&tQ(r,!0))}}else{const e=aQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&tQ(i,!0))}else if(p===e){const e=aQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||n.preventDefault()}}};YC(WZ,{focusTrapRef:n,onKeydown:l}),wO(()=>e.focusTrapEl,e=>{e&&(n.value=e)},{immediate:!0}),wO([n],([e],[t])=>{e&&(e.addEventListener("keydown",l),e.addEventListener("focusin",d),e.addEventListener("focusout",h)),t&&(t.removeEventListener("keydown",l),t.removeEventListener("focusin",d),t.removeEventListener("focusout",h))});const u=e=>{t(GZ,e)},c=e=>t(HZ,e),d=s=>{const o=yI(n);if(!o)return;const l=s.target,u=s.relatedTarget,c=l&&o.contains(l);if(!e.trapped){u&&o.contains(u)||(i=u)}c&&t("focusin",s),a.paused||e.trapped&&(c?r=l:tQ(r,!0))},h=i=>{const o=yI(n);if(!a.paused&&o)if(e.trapped){const n=i.relatedTarget;kX(n)||o.contains(n)||setTimeout(()=>{if(!a.paused&&e.trapped){const e=aQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||tQ(r,!0)}},0)}else{const e=i.target;e&&o.contains(e)||t("focusout",i)}};async function p(){await nA();const t=yI(n);if(t){iQ.push(a);const n=t.contains(document.activeElement)?i:document.activeElement;i=n;if(!t.contains(n)){const i=new Event(VZ,jZ);t.addEventListener(VZ,u),t.dispatchEvent(i),i.defaultPrevented||nA(()=>{let i=e.focusStartEl;Vx(i)||(tQ(i),document.activeElement!==i&&(i="first")),"first"===i&&((e,t=!1)=>{const n=document.activeElement;for(const i of e)if(tQ(i,t),document.activeElement!==n)return})(QZ(t),!0),document.activeElement!==n&&"container"!==i||tQ(t)})}}}function f(){const e=yI(n);if(e){e.removeEventListener(VZ,u);const t=new CustomEvent(zZ,{...jZ,detail:{focusReason:s.value}});e.addEventListener(zZ,c),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=s.value&&qZ.value>KZ.value&&!e.contains(document.activeElement)||tQ(null!=i?i:document.body),e.removeEventListener(zZ,c),iQ.remove(a),i=null,r=null}}return US(()=>{e.trapped&&p(),wO(()=>e.trapped,e=>{e?p():f()})}),jS(()=>{e.trapped&&f(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",h),n.value=void 0)}),{onKeydown:l}}});var dQ=LH(cQ,[["render",function(e,t,n,i,r,s){return sC(e.$slots,"default",{handleKeydown:e.onKeydown})}],["__file","focus-trap.vue"]]);const hQ=function(e){return void 0===e},pQ=(e,t=[])=>{const{placement:n,strategy:i,popperOptions:r}=e,s={placement:n,strategy:i,...r,modifiers:[...fQ(e),...t]};return function(e,t){t&&(e.modifiers=[...e.modifiers,...null!=t?t:[]])}(s,null==r?void 0:r.modifiers),s};function fQ(e){const{offset:t,gpuAcceleration:n,fallbackPlacements:i}=e;return[{name:"offset",options:{offset:[0,null!=t?t:12]}},{name:"preventOverflow",options:{padding:{top:0,bottom:0,left:0,right:0}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:n}}]}const mQ=(e,t,n={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:e})=>{const t=function(e){const t=Object.keys(e.elements),n=JY(t.map(t=>[t,e.styles[t]||{}])),i=JY(t.map(t=>[t,e.attributes[t]]));return{styles:n,attributes:i}}(e);Object.assign(o.value,t)},requires:["computeStyles"]},r=ZM(()=>{const{onFirstUpdate:e,placement:t,strategy:r,modifiers:s}=yI(n);return{onFirstUpdate:e,placement:t||"bottom",strategy:r||"absolute",modifiers:[...s||[],i,{name:"applyStyles",enabled:!1}]}}),s=fI(),o=pI({styles:{popper:{position:yI(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return wO(r,e=>{const t=yI(s);t&&t.setOptions(e)},{deep:!0}),wO([e,t],([e,t])=>{a(),e&&t&&(s.value=iZ(e,t,yI(r)))}),jS(()=>{a()}),{state:ZM(()=>{var e;return{...(null==(e=yI(s))?void 0:e.state)||{}}}),styles:ZM(()=>yI(o).styles),attributes:ZM(()=>yI(o).attributes),update:()=>{var e;return null==(e=yI(s))?void 0:e.update()},forceUpdate:()=>{var e;return null==(e=yI(s))?void 0:e.forceUpdate()},instanceRef:ZM(()=>yI(s))}};const gQ=e=>{const{popperInstanceRef:t,contentRef:n,triggerRef:i,role:r}=GC(Dq,void 0),s=pI(),o=ZM(()=>e.arrowOffset),a=ZM(()=>({name:"eventListeners",enabled:!!e.visible})),l=ZM(()=>{var e;const t=yI(s),n=null!=(e=yI(o))?e:0;return{name:"arrow",enabled:!hQ(t),options:{element:t,padding:n}}}),u=ZM(()=>({onFirstUpdate:()=>{f()},...pQ(e,[yI(l),yI(a)])})),c=ZM(()=>(e=>{if(aj)return fH(e)})(e.referenceEl)||yI(i)),{attributes:d,state:h,styles:p,update:f,forceUpdate:m,instanceRef:g}=mQ(c,n,u);return wO(g,e=>t.value=e,{flush:"sync"}),US(()=>{wO(()=>{var e,t;return null==(t=null==(e=yI(c))?void 0:e.getBoundingClientRect)?void 0:t.call(e)},()=>{f()})}),{attributes:d,arrowRef:s,contentRef:n,instanceRef:g,state:h,styles:p,role:r,forceUpdate:m,update:f}},_Q=tS({name:"ElPopperContent"}),yQ=tS({..._Q,props:oZ,emits:aZ,setup(e,{expose:t,emit:n}){const i=e,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:l,onFocusoutPrevented:u,onReleaseRequested:c}=((e,t)=>{const n=pI(!1),i=pI();return{focusStartRef:i,trapped:n,onFocusAfterReleased:e=>{var n;"pointer"!==(null==(n=e.detail)?void 0:n.focusReason)&&(i.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:t=>{e.visible&&!n.value&&(t.target&&(i.value=t.target),n.value=!0)},onFocusoutPrevented:t=>{e.trapping||("pointer"===t.detail.focusReason&&t.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,t("close")}}})(i,n),{attributes:d,arrowRef:h,contentRef:p,styles:f,instanceRef:m,role:g,update:_}=gQ(i),{ariaModal:y,arrowStyle:v,contentAttrs:b,contentClass:T,contentStyle:x,updateZIndex:E}=((e,{attributes:t,styles:n,role:i})=>{const{nextZIndex:r}=Tj(),s=Wz("popper"),o=ZM(()=>yI(t).popper),a=pI(Kz(e.zIndex)?e.zIndex:r()),l=ZM(()=>[s.b(),s.is("pure",e.pure),s.is(e.effect),e.popperClass]),u=ZM(()=>[{zIndex:yI(a)},yI(n).popper,e.popperStyle||{}]);return{ariaModal:ZM(()=>"dialog"===i.value?"false":void 0),arrowStyle:ZM(()=>yI(n).arrow||{}),contentAttrs:o,contentClass:l,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=Kz(e.zIndex)?e.zIndex:r()}}})(i,{styles:f,attributes:d,role:g}),w=GC(VW,void 0);let I;YC(Fq,{arrowStyle:v,arrowRef:h}),w&&YC(VW,{...w,addInputId:Cx,removeInputId:Cx});const A=(e=!0)=>{_(),e&&E()},S=()=>{A(!1),i.visible&&i.focusOnShow?s.value=!0:!1===i.visible&&(s.value=!1)};return US(()=>{wO(()=>i.triggerTargetEl,(e,t)=>{null==I||I(),I=void 0;const n=yI(e||p.value),r=yI(t||p.value);Zz(n)&&(I=wO([g,()=>i.ariaLabel,y,()=>i.id],e=>{["role","aria-label","aria-modal","id"].forEach((t,i)=>{kX(e[i])?n.removeAttribute(t):n.setAttribute(t,e[i])})},{immediate:!0})),r!==n&&Zz(r)&&["role","aria-label","aria-modal","id"].forEach(e=>{r.removeAttribute(e)})},{immediate:!0}),wO(()=>i.visible,S,{immediate:!0})}),jS(()=>{null==I||I(),I=void 0}),t({popperContentRef:p,popperInstanceRef:m,updatePopper:A,contentStyle:x}),(e,t)=>(JO(),sM("div",EM({ref_key:"contentRef",ref:p},yI(b),{style:yI(x),class:yI(T),tabindex:"-1",onMouseenter:t=>e.$emit("mouseenter",t),onMouseleave:t=>e.$emit("mouseleave",t)}),[pM(yI(dQ),{trapped:yI(s),"trap-on-focus-in":!0,"focus-trap-el":yI(p),"focus-start-el":yI(r),onFocusAfterTrapped:yI(a),onFocusAfterReleased:yI(o),onFocusin:yI(l),onFocusoutPrevented:yI(u),onReleaseRequested:yI(c)},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var vQ=LH(yQ,[["__file","content.vue"]]);const bQ=tS({name:"ElTooltipContent",inheritAttrs:!1}),TQ=tS({...bQ,props:dZ,setup(e,{expose:t}){const n=e,{selector:i}=$Z(),r=Wz("tooltip"),s=pI(),o=oj(()=>{var e;return null==(e=s.value)?void 0:e.popperContentRef});let a;const{controlled:l,id:u,open:c,trigger:d,onClose:h,onOpen:p,onShow:f,onHide:m,onBeforeShow:g,onBeforeHide:_}=GC(Uq,void 0),y=ZM(()=>n.transition||`${r.namespace.value}-fade-in-linear`),v=ZM(()=>n.persistent);jS(()=>{null==a||a()});const b=ZM(()=>!!yI(v)||yI(c)),T=ZM(()=>!n.disabled&&yI(c)),x=ZM(()=>n.appendTo||i.value),E=ZM(()=>{var e;return null!=(e=n.style)?e:{}}),w=pI(!0),I=()=>{m(),N()&&Mq(document.body,{preventScroll:!0}),w.value=!0},A=()=>{if(yI(l))return!0},S=NZ(A,()=>{n.enterable&&"hover"===yI(d)&&p()}),C=NZ(A,()=>{"hover"===yI(d)&&h()}),O=()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e),null==g||g()},M=()=>{null==_||_()},k=()=>{f()},R=()=>{n.virtualTriggering||h()},N=e=>{var t;const n=null==(t=s.value)?void 0:t.popperContentRef,i=(null==e?void 0:e.relatedTarget)||document.activeElement;return null==n?void 0:n.contains(i)};return wO(()=>yI(c),e=>{e?(w.value=!1,a=function(e,t,n={}){const{window:i=mH,ignore:r=[],capture:s=!0,detectIframe:o=!1}=n;if(!i)return;cj&&!_H&&(_H=!0,Array.from(i.document.body.children).forEach(e=>e.addEventListener("click",uj)));let a=!0;const l=e=>r.some(t=>{if("string"==typeof t)return Array.from(i.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{const n=fH(t);return n&&(e.target===n||e.composedPath().includes(n))}}),u=[gH(i,"click",n=>{const i=fH(e);i&&i!==n.target&&!n.composedPath().includes(i)&&(0===n.detail&&(a=!l(n)),a?t(n):a=!0)},{passive:!0,capture:s}),gH(i,"pointerdown",t=>{const n=fH(e);n&&(a=!t.composedPath().includes(n)&&!l(t))},{passive:!0}),o&&gH(i,"blur",n=>{var r;const s=fH(e);"IFRAME"!==(null==(r=i.document.activeElement)?void 0:r.tagName)||(null==s?void 0:s.contains(i.document.activeElement))||t(n)})].filter(Boolean);return()=>u.forEach(e=>e())}(o,()=>{if(yI(l))return;var e;(e=yI(d),e||0===e?Lx(e)?e:[e]:[]).every(e=>"hover"!==e&&"focus"!==e)&&h()})):null==a||a()},{flush:"post"}),wO(()=>n.content,()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e)}),t({contentRef:s,isFocusInsideContent:N}),(e,t)=>(JO(),oM(yI(BZ),{disabled:!e.teleported,to:yI(x)},{default:AA(()=>[yI(b)||!w.value?(JO(),oM(xk,{key:0,name:yI(y),appear:!yI(v),onAfterLeave:I,onBeforeEnter:O,onAfterEnter:k,onBeforeLeave:M,persisted:""},{default:AA(()=>[SA(pM(yI(vQ),EM({id:yI(u),ref_key:"contentRef",ref:s},e.$attrs,{"aria-label":e.ariaLabel,"aria-hidden":w.value,"boundaries-padding":e.boundariesPadding,"fallback-placements":e.fallbackPlacements,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,placement:e.placement,"popper-options":e.popperOptions,"arrow-offset":e.arrowOffset,strategy:e.strategy,effect:e.effect,enterable:e.enterable,pure:e.pure,"popper-class":e.popperClass,"popper-style":[e.popperStyle,yI(E)],"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,visible:yI(T),"z-index":e.zIndex,onMouseenter:yI(S),onMouseleave:yI(C),onBlur:R,onClose:yI(h)}),{default:AA(()=>[sC(e.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"]),[[Bk,yI(T)]])]),_:3},8,["name","appear"])):vM("v-if",!0)]),_:3},8,["disabled","to"]))}});var xQ=LH(TQ,[["__file","content.vue"]]);const EQ=tS({name:"ElPopperArrow",inheritAttrs:!1});var wQ=LH(tS({...EQ,setup(e,{expose:t}){const n=Wz("popper"),{arrowRef:i,arrowStyle:r}=GC(Fq,void 0);return jS(()=>{i.value=void 0}),t({arrowRef:i}),(e,t)=>(JO(),sM("span",{ref_key:"arrowRef",ref:i,class:yE(yI(n).e("arrow")),style:pE(yI(r)),"data-popper-arrow":""},null,6))}}),[["__file","arrow.vue"]]);const IQ=tS({name:"ElTooltip"}),AQ=tS({...IQ,props:EZ,emits:wZ,setup(e,{expose:t,emit:n}){const i=e;UZ();const r=Wz("tooltip"),s=$W(),o=pI(),a=pI(),l=()=>{var e;const t=yI(o);t&&(null==(e=t.popperInstanceRef)||e.update())},u=pI(!1),c=pI(),{show:d,hide:h,hasUpdateHandler:p}=xZ({indicator:u,toggleReason:c}),{onOpen:f,onClose:m}=(({showAfter:e,hideAfter:t,autoClose:n,open:i,close:r})=>{const{registerTimeout:s}=uZ(),{registerTimeout:o,cancelTimeout:a}=uZ();return{onOpen:(t,a=yI(e))=>{s(()=>{i(t);const e=yI(n);Kz(e)&&e>0&&o(()=>{r(t)},e)},a)},onClose:(e,n=yI(t))=>{a(),s(()=>{r(e)},n)}}})({showAfter:SI(i,"showAfter"),hideAfter:SI(i,"hideAfter"),autoClose:SI(i,"autoClose"),open:d,close:h}),g=ZM(()=>qz(i.visible)&&!p.value),_=ZM(()=>[r.b(),i.popperClass]);YC(Uq,{controlled:g,id:s,open:tI(u),trigger:SI(i,"trigger"),onOpen:f,onClose:m,onToggle:e=>{yI(u)?m(e):f(e)},onShow:()=>{n("show",c.value)},onHide:()=>{n("hide",c.value)},onBeforeShow:()=>{n("before-show",c.value)},onBeforeHide:()=>{n("before-hide",c.value)},updatePopper:l}),wO(()=>i.disabled,e=>{e&&u.value&&(u.value=!1)});return RS(()=>u.value&&h()),t({popperRef:o,contentRef:a,isFocusInsideContent:e=>{var t;return null==(t=a.value)?void 0:t.isFocusInsideContent(e)},updatePopper:l,onOpen:f,onClose:m,hide:h}),(e,t)=>(JO(),oM(yI($q),{ref_key:"popperRef",ref:o,role:e.role},{default:AA(()=>[pM(PZ,{disabled:e.disabled,trigger:e.trigger,"trigger-keys":e.triggerKeys,"virtual-ref":e.virtualRef,"virtual-triggering":e.virtualTriggering,"focus-on-target":e.focusOnTarget},{default:AA(()=>[e.$slots.default?sC(e.$slots,"default",{key:0}):vM("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering","focus-on-target"]),pM(xQ,{ref_key:"contentRef",ref:a,"aria-label":e.ariaLabel,"boundaries-padding":e.boundariesPadding,content:e.content,disabled:e.disabled,effect:e.effect,enterable:e.enterable,"fallback-placements":e.fallbackPlacements,"hide-after":e.hideAfter,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,persistent:e.persistent,"popper-class":yI(_),"popper-style":e.popperStyle,placement:e.placement,"popper-options":e.popperOptions,"arrow-offset":e.arrowOffset,pure:e.pure,"raw-content":e.rawContent,"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,"show-after":e.showAfter,strategy:e.strategy,teleported:e.teleported,transition:e.transition,"virtual-triggering":e.virtualTriggering,"z-index":e.zIndex,"append-to":e.appendTo},{default:AA(()=>[sC(e.$slots,"content",{},()=>[e.rawContent?(JO(),sM("span",{key:0,innerHTML:e.content},null,8,["innerHTML"])):(JO(),sM("span",{key:1},FE(e.content),1))]),e.showArrow?(JO(),oM(yI(wQ),{key:0})):vM("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});const SQ=gG(LH(AQ,[["__file","tooltip.vue"]])),CQ={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},OQ=Symbol("scrollbarContextKey"),MQ=nG({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),kQ=tS({__name:"thumb",props:MQ,setup(e){const t=e,n=GC(OQ),i=Wz("scrollbar");n||oW("Thumb","can not inject scrollbar context");const r=pI(),s=pI(),o=pI({}),a=pI(!1);let l=!1,u=!1,c=0,d=0,h=aj?document.onselectstart:null;const p=ZM(()=>CQ[t.vertical?"vertical":"horizontal"]),f=ZM(()=>(({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}))({size:t.size,move:t.move,bar:p.value})),m=ZM(()=>r.value[p.value.offset]**2/n.wrapElement[p.value.scrollSize]/t.ratio/s.value[p.value.offset]),g=e=>{var t;if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;null==(t=window.getSelection())||t.removeAllRanges(),y(e);const n=e.currentTarget;n&&(o.value[p.value.axis]=n[p.value.offset]-(e[p.value.client]-n.getBoundingClientRect()[p.value.direction]))},_=e=>{if(!s.value||!r.value||!n.wrapElement)return;const t=100*(Math.abs(e.target.getBoundingClientRect()[p.value.direction]-e[p.value.client])-s.value[p.value.offset]/2)*m.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=t*n.wrapElement[p.value.scrollSize]/100},y=e=>{e.stopImmediatePropagation(),l=!0,c=n.wrapElement.scrollHeight,d=n.wrapElement.scrollWidth,document.addEventListener("mousemove",v),document.addEventListener("mouseup",b),h=document.onselectstart,document.onselectstart=()=>!1},v=e=>{if(!r.value||!s.value)return;if(!1===l)return;const t=o.value[p.value.axis];if(!t)return;const i=100*(-1*(r.value.getBoundingClientRect()[p.value.direction]-e[p.value.client])-(s.value[p.value.offset]-t))*m.value/r.value[p.value.offset];"scrollLeft"===p.value.scroll?n.wrapElement[p.value.scroll]=i*d/100:n.wrapElement[p.value.scroll]=i*c/100},b=()=>{l=!1,o.value[p.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b),T(),u&&(a.value=!1)};jS(()=>{T(),document.removeEventListener("mouseup",b)});const T=()=>{document.onselectstart!==h&&(document.onselectstart=h)};return gH(SI(n,"scrollbarElement"),"mousemove",()=>{u=!1,a.value=!!t.size}),gH(SI(n,"scrollbarElement"),"mouseleave",()=>{u=!0,a.value=l}),(e,t)=>(JO(),oM(xk,{name:yI(i).b("fade"),persisted:""},{default:AA(()=>[SA(hM("div",{ref_key:"instance",ref:r,class:yE([yI(i).e("bar"),yI(i).is(yI(p).key)]),onMousedown:_,onClick:UR(()=>{},["stop"])},[hM("div",{ref_key:"thumb",ref:s,class:yE(yI(i).e("thumb")),style:pE(yI(f)),onMousedown:g},null,38)],42,["onClick"]),[[Bk,e.always||a.value]])]),_:1},8,["name"]))}});var RQ=LH(kQ,[["__file","thumb.vue"]]);const NQ=tS({__name:"bar",props:nG({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),setup(e,{expose:t}){const n=e,i=GC(OQ),r=pI(0),s=pI(0),o=pI(""),a=pI(""),l=pI(1),u=pI(1);return t({handleScroll:e=>{if(e){const t=e.offsetHeight-4,n=e.offsetWidth-4;s.value=100*e.scrollTop/t*l.value,r.value=100*e.scrollLeft/n*u.value}},update:()=>{const e=null==i?void 0:i.wrapElement;if(!e)return;const t=e.offsetHeight-4,r=e.offsetWidth-4,s=t**2/e.scrollHeight,c=r**2/e.scrollWidth,d=Math.max(s,n.minSize),h=Math.max(c,n.minSize);l.value=s/(t-s)/(d/(t-d)),u.value=c/(r-c)/(h/(r-h)),a.value=d+4(JO(),sM(WO,null,[pM(RQ,{move:r.value,ratio:u.value,size:o.value,always:e.always},null,8,["move","ratio","size","always"]),pM(RQ,{move:s.value,ratio:l.value,size:a.value,vertical:"",always:e.always},null,8,["move","ratio","size","always"])],64))}});var DQ=LH(NQ,[["__file","bar.vue"]]);const FQ=nG({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:[String,Object,Array],default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...vq(["ariaLabel","ariaOrientation"])}),LQ={"end-reached":e=>["left","right","top","bottom"].includes(e),scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Kz)},PQ=tS({name:"ElScrollbar"}),BQ=tS({...PQ,props:FQ,emits:LQ,setup(e,{expose:t,emit:n}){const i=e,r=Wz("scrollbar");let s,o,a,l=0,u=0,c="";const d={bottom:!1,top:!1,right:!1,left:!1},h=pI(),p=pI(),f=pI(),m=pI(),g=ZM(()=>{const e={};return i.height&&(e.height=PH(i.height)),i.maxHeight&&(e.maxHeight=PH(i.maxHeight)),[i.wrapStyle,e]}),_=ZM(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),y=ZM(()=>[r.e("view"),i.viewClass]),v={top:"bottom",bottom:"top",left:"right",right:"left"},b=()=>{var e;if(p.value){null==(e=m.value)||e.handleScroll(p.value);const t=l,r=u;l=p.value.scrollTop,u=p.value.scrollLeft;const s={bottom:l+p.value.clientHeight>=p.value.scrollHeight-i.distance,top:l<=i.distance&&0!==t,right:u+p.value.clientWidth>=p.value.scrollWidth-i.distance&&r!==u,left:u<=i.distance&&0!==r};if(n("scroll",{scrollTop:l,scrollLeft:u}),t!==l&&(c=l>t?"bottom":"top"),r!==u&&(c=u>r?"right":"left"),i.distance>0){if((e=>{var t;return null!=(t=d[e])&&t})(c))return;(e=>{const t=v[c];if(!t)return;const n=e[c],i=e[t];n&&!d[c]&&(d[c]=!0),!i&&d[t]&&(d[t]=!1)})(s)}s[c]&&n("end-reached",c)}};const T=()=>{var e;null==(e=m.value)||e.update(),d[c]=!1};return wO(()=>i.noresize,e=>{e?(null==s||s(),null==o||o(),null==a||a()):(({stop:s}=IH(f,T)),({stop:o}=IH(p,T)),a=gH("resize",T))},{immediate:!0}),wO(()=>[i.maxHeight,i.height],()=>{i.native||nA(()=>{var e;T(),p.value&&(null==(e=m.value)||e.handleScroll(p.value))})}),YC(OQ,Jw({scrollbarElement:h,wrapElement:p})),kS(()=>{p.value&&(p.value.scrollTop=l,p.value.scrollLeft=u)}),US(()=>{i.native||nA(()=>{T()})}),zS(()=>T()),t({wrapRef:p,update:T,scrollTo:function(e,t){jx(e)?p.value.scrollTo(e):Kz(e)&&Kz(t)&&p.value.scrollTo(e,t)},setScrollTop:e=>{Kz(e)&&(p.value.scrollTop=e)},setScrollLeft:e=>{Kz(e)&&(p.value.scrollLeft=e)},handleScroll:b}),(e,t)=>(JO(),sM("div",{ref_key:"scrollbarRef",ref:h,class:yE(yI(r).b())},[hM("div",{ref_key:"wrapRef",ref:p,class:yE(yI(_)),style:pE(yI(g)),tabindex:e.tabindex,onScroll:b},[(JO(),oM(JS(e.tag),{id:e.id,ref_key:"resizeRef",ref:f,class:yE(yI(y)),style:pE(e.viewStyle),role:e.role,"aria-label":e.ariaLabel,"aria-orientation":e.ariaOrientation},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),e.native?vM("v-if",!0):(JO(),oM(DQ,{key:0,ref_key:"barRef",ref:m,always:e.always,"min-size":e.minSize},null,8,["always","min-size"]))],2))}});const $Q=gG(LH(BQ,[["__file","scrollbar.vue"]]));var UQ=LH(tS({inheritAttrs:!1}),[["render",function(e,t,n,i,r,s){return sC(e.$slots,"default")}],["__file","collection.vue"]]);var VQ=LH(tS({name:"ElCollectionItem",inheritAttrs:!1}),[["render",function(e,t,n,i,r,s){return sC(e.$slots,"default")}],["__file","collection-item.vue"]]);const zQ="data-el-collection-item",jQ=e=>{const t=`El${e}Collection`,n=`${t}Item`,i=Symbol(t),r=Symbol(n),s={...UQ,name:t,setup(){const e=pI(),t=new Map;YC(i,{itemMap:t,getItems:()=>{const n=yI(e);if(!n)return[];const i=Array.from(n.querySelectorAll(`[${zQ}]`));return[...t.values()].sort((e,t)=>i.indexOf(e.ref)-i.indexOf(t.ref))},collectionRef:e})}},o={...VQ,name:n,setup(e,{attrs:t}){const n=pI(),s=GC(i,void 0);YC(r,{collectionItemRef:n}),US(()=>{const e=yI(n);e&&s.itemMap.set(e,{ref:e,...t})}),jS(()=>{const e=yI(n);s.itemMap.delete(e)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},YQ=nG({style:{type:[String,Array,Object]},currentTabId:{type:String},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:String},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:GQ,ElCollectionItem:HQ,COLLECTION_INJECTION_KEY:WQ,COLLECTION_ITEM_INJECTION_KEY:XQ}=jQ("RovingFocusGroup"),qQ=Symbol("elRovingFocusGroup"),KQ=Symbol("elRovingFocusGroupItem"),ZQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},QQ=(e,t,n)=>{const i=((e,t)=>{if("rtl"!==t)return e;switch(e){case tW.right:return tW.left;case tW.left:return tW.right;default:return e}})(e.code,n);if(!("vertical"===t&&[tW.left,tW.right].includes(i)||"horizontal"===t&&[tW.up,tW.down].includes(i)))return ZQ[i]},JQ=e=>{const{activeElement:t}=document;for(const n of e){if(n===t)return;if(n.focus(),t!==document.activeElement)return}},eJ="currentTabIdChange",tJ="rovingFocusGroup.entryFocus",nJ={bubbles:!1,cancelable:!0},iJ=tS({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:YQ,emits:[eJ,"entryFocus"],setup(e,{emit:t}){var n;const i=pI(null!=(n=e.currentTabId||e.defaultCurrentTabId)?n:null),r=pI(!1),s=pI(!1),o=pI(),{getItems:a}=GC(WQ,void 0),l=ZM(()=>[{outline:"none"},e.style]),u=NZ(t=>{var n;null==(n=e.onMousedown)||n.call(e,t)},()=>{s.value=!0}),c=NZ(t=>{var n;null==(n=e.onFocus)||n.call(e,t)},e=>{const t=!yI(s),{target:n,currentTarget:o}=e;if(n===o&&t&&!yI(r)){const e=new Event(tJ,nJ);if(null==o||o.dispatchEvent(e),!e.defaultPrevented){const e=a().filter(e=>e.focusable),t=[e.find(e=>e.active),e.find(e=>e.id===yI(i)),...e].filter(Boolean).map(e=>e.ref);JQ(t)}}s.value=!1}),d=NZ(t=>{var n;null==(n=e.onBlur)||n.call(e,t)},()=>{r.value=!1});YC(qQ,{currentTabbedId:tI(i),loop:SI(e,"loop"),tabIndex:ZM(()=>yI(r)?-1:0),rovingFocusGroupRef:o,rovingFocusGroupRootStyle:l,orientation:SI(e,"orientation"),dir:SI(e,"dir"),onItemFocus:e=>{t(eJ,e)},onItemShiftTab:()=>{r.value=!0},onBlur:d,onFocus:c,onMousedown:u}),wO(()=>e.currentTabId,e=>{i.value=null!=e?e:null}),gH(o,tJ,(...e)=>{t("entryFocus",...e)})}});var rJ=LH(tS({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:GQ,ElRovingFocusGroupImpl:LH(iJ,[["render",function(e,t,n,i,r,s){return sC(e.$slots,"default")}],["__file","roving-focus-group-impl.vue"]])}}),[["render",function(e,t,n,i,r,s){const o=ZS("el-roving-focus-group-impl"),a=ZS("el-focus-group-collection");return JO(),oM(a,null,{default:AA(()=>[pM(o,vE(mM(e.$attrs)),{default:AA(()=>[sC(e.$slots,"default")]),_:3},16)]),_:3})}],["__file","roving-focus-group.vue"]]);const sJ=nG({trigger:pZ.trigger,triggerKeys:{type:Array,default:()=>[tW.enter,tW.numpadEnter,tW.space,tW.down]},virtualTriggering:pZ.virtualTriggering,virtualRef:pZ.virtualRef,effect:{...dZ.effect,default:"light"},type:{type:String},placement:{type:String,default:"bottom"},popperOptions:{type:Object,default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:[Number,String],default:0},maxHeight:{type:[Number,String],default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,values:Lq,default:"menu"},buttonProps:{type:Object},teleported:dZ.teleported,persistent:{type:Boolean,default:!0}}),oJ=nG({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:YH}}),aJ=nG({onKeydown:{type:Function}}),lJ=[tW.down,tW.pageDown,tW.home],uJ=[tW.up,tW.pageUp,tW.end],cJ=[...lJ,...uJ],{ElCollection:dJ,ElCollectionItem:hJ,COLLECTION_INJECTION_KEY:pJ,COLLECTION_ITEM_INJECTION_KEY:fJ}=jQ("Dropdown"),mJ=Symbol("elDropdown"),gJ="elDropdown";const _J=function(){if(!arguments.length)return[];var e=arguments[0];return xj(e)?e:[e]},{ButtonGroup:yJ}=EX,vJ=tS({name:"ElDropdown",components:{ElButton:EX,ElButtonGroup:yJ,ElScrollbar:$Q,ElDropdownCollection:dJ,ElTooltip:SQ,ElRovingFocusGroup:rJ,ElOnlyChild:SZ,ElIcon:jH,ArrowDown:bG},props:sJ,emits:["visible-change","click","command"],setup(e,{emit:t}){const n=OM(),i=Wz("dropdown"),{t:r}=QY(),s=pI(),o=pI(),a=pI(),l=pI(),u=pI(null),c=pI(null),d=pI(!1),h=ZM(()=>({maxHeight:PH(e.maxHeight)})),p=ZM(()=>[i.m(_.value)]),f=ZM(()=>_J(e.trigger)),m=$W().value,g=ZM(()=>e.id||m);const _=GW();YC(mJ,{contentRef:l,role:ZM(()=>e.role),triggerId:g,isUsingKeyboard:d,onItemEnter:function(){},onItemLeave:function(){const e=yI(l);f.value.includes("hover")&&(null==e||e.focus({preventScroll:!0})),c.value=null}}),YC(gJ,{instance:n,dropdownSize:_,handleClick:function(){var e;null==(e=a.value)||e.onClose(void 0,0)},commandHandler:function(...e){t("command",...e)},trigger:SI(e,"trigger"),hideOnClick:SI(e,"hideOnClick")});return{t:r,ns:i,scrollbar:u,wrapStyle:h,dropdownTriggerKls:p,dropdownSize:_,triggerId:g,currentTabId:c,handleCurrentTabIdChange:function(e){c.value=e},handlerMainButtonClick:e=>{t("click",e)},handleEntryFocus:function(e){d.value||(e.preventDefault(),e.stopImmediatePropagation())},handleClose:function(){var e;null==(e=a.value)||e.onClose()},handleOpen:function(){var e;null==(e=a.value)||e.onOpen()},handleBeforeShowTooltip:function(){t("visible-change",!0)},handleShowTooltip:function(e){var t;"keydown"===(null==e?void 0:e.type)&&(null==(t=l.value)||t.focus())},handleBeforeHideTooltip:function(){t("visible-change",!1)},onFocusAfterTrapped:e=>{var t,n;e.preventDefault(),null==(n=null==(t=l.value)?void 0:t.focus)||n.call(t,{preventScroll:!0})},popperRef:a,contentRef:l,triggeringElementRef:s,referenceElementRef:o}}});var bJ=LH(vJ,[["render",function(e,t,n,i,r,s){var o,a;const l=ZS("el-dropdown-collection"),u=ZS("el-roving-focus-group"),c=ZS("el-scrollbar"),d=ZS("el-only-child"),h=ZS("el-tooltip"),p=ZS("el-button"),f=ZS("arrow-down"),m=ZS("el-icon"),g=ZS("el-button-group");return JO(),sM("div",{class:yE([e.ns.b(),e.ns.is("disabled",e.disabled)])},[pM(h,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":null==(o=e.referenceElementRef)?void 0:o.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-arrow":e.showArrow,"show-after":"hover"===e.trigger?e.showTimeout:0,"hide-after":"hover"===e.trigger?e.hideTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":null!=(a=e.virtualRef)?a:e.triggeringElementRef,"virtual-triggering":e.virtualTriggering||e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"","focus-on-target":"",persistent:e.persistent,onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},rC({content:AA(()=>[pM(c,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:AA(()=>[pM(u,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:AA(()=>[pM(l,null,{default:AA(()=>[sC(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:AA(()=>[pM(d,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","persistent","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(JO(),oM(g,{key:0},{default:AA(()=>[pM(p,EM({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:AA(()=>[sC(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),pM(p,EM({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:AA(()=>[pM(m,{class:yE(e.ns.e("icon"))},{default:AA(()=>[pM(f)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):vM("v-if",!0)],2)}],["__file","dropdown.vue"]]);const TJ=tS({components:{ElRovingFocusCollectionItem:HQ},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:n,loop:i,onItemFocus:r,onItemShiftTab:s}=GC(qQ,void 0),{getItems:o}=GC(WQ,void 0),a=$W(),l=pI(),u=NZ(e=>{t("mousedown",e)},t=>{e.focusable?r(yI(a)):t.preventDefault()}),c=NZ(e=>{t("focus",e)},()=>{r(yI(a))}),d=NZ(e=>{t("keydown",e)},e=>{const{code:t,shiftKey:n,target:r,currentTarget:a}=e;if(t===tW.tab&&n)return void s();if(r!==a)return;const l=QQ(e);if(l){e.preventDefault();let t=o().filter(e=>e.focusable).map(e=>e.ref);switch(l){case"last":t.reverse();break;case"prev":case"next":{"prev"===l&&t.reverse();const e=t.indexOf(a);t=i.value?((e,t)=>e.map((n,i)=>e[(i+t)%e.length]))(t,e+1):t.slice(e+1);break}}nA(()=>{JQ(t)})}}),h=ZM(()=>n.value===yI(a));return YC(KQ,{rovingFocusGroupItemRef:l,tabIndex:ZM(()=>yI(h)?0:-1),handleMousedown:u,handleFocus:c,handleKeydown:d}),{id:a,handleKeydown:d,handleFocus:c,handleMousedown:u}}});var xJ=LH(TJ,[["render",function(e,t,n,i,r,s){const o=ZS("el-roving-focus-collection-item");return JO(),oM(o,{id:e.id,focusable:e.focusable,active:e.active},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["id","focusable","active"])}],["__file","roving-focus-item.vue"]]);const EJ=(...e)=>t=>{e.forEach(e=>{Ux(e)?e(t):e.value=t})},wJ=tS({name:"DropdownItemImpl",components:{ElIcon:jH},props:oJ,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:t}){const n=Wz("dropdown"),{role:i}=GC(mJ,void 0),{collectionItemRef:r}=GC(fJ,void 0),{collectionItemRef:s}=GC(XQ,void 0),{rovingFocusGroupItemRef:o,tabIndex:a,handleFocus:l,handleKeydown:u,handleMousedown:c}=GC(KQ,void 0),d=EJ(r,s,o),h=ZM(()=>"menu"===i.value?"menuitem":"navigation"===i.value?"link":"button"),p=NZ(e=>{if([tW.enter,tW.numpadEnter,tW.space].includes(e.code))return e.preventDefault(),e.stopImmediatePropagation(),t("clickimpl",e),!0},u);return{ns:n,itemRef:d,dataset:{[zQ]:""},role:h,tabIndex:a,handleFocus:l,handleKeydown:p,handleMousedown:c}}});const IJ=()=>{const e=GC(gJ,{}),t=ZM(()=>null==e?void 0:e.dropdownSize);return{elDropdown:e,_elDropdownSize:t}},AJ=tS({name:"ElDropdownItem",components:{ElDropdownCollectionItem:hJ,ElRovingFocusItem:xJ,ElDropdownItemImpl:LH(wJ,[["render",function(e,t,n,i,r,s){const o=ZS("el-icon");return JO(),sM(WO,null,[e.divided?(JO(),sM("li",{key:0,role:"separator",class:yE(e.ns.bem("menu","item","divided"))},null,2)):vM("v-if",!0),hM("li",EM({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:t=>e.$emit("clickimpl",t),onFocus:e.handleFocus,onKeydown:UR(e.handleKeydown,["self"]),onMousedown:e.handleMousedown,onPointermove:t=>e.$emit("pointermove",t),onPointerleave:t=>e.$emit("pointerleave",t)}),[e.icon?(JO(),oM(o,{key:0},{default:AA(()=>[(JO(),oM(JS(e.icon)))]),_:1})):vM("v-if",!0),sC(e.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}],["__file","dropdown-item-impl.vue"]])},inheritAttrs:!1,props:oJ,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:n}){const{elDropdown:i}=IJ(),r=OM(),s=pI(null),o=ZM(()=>{var e,t;return null!=(t=null==(e=yI(s))?void 0:e.textContent)?t:""}),{onItemEnter:a,onItemLeave:l}=GC(mJ,void 0),u=NZ(e=>(t("pointermove",e),e.defaultPrevented),DZ(t=>{if(e.disabled)return void l(t);const n=t.currentTarget;n===document.activeElement||n.contains(document.activeElement)||(a(t),t.defaultPrevented||null==n||n.focus({preventScroll:!0}))})),c=NZ(e=>(t("pointerleave",e),e.defaultPrevented),DZ(l)),d=NZ(n=>{if(!e.disabled)return t("click",n),"keydown"!==n.type&&n.defaultPrevented},t=>{var n,s,o;e.disabled?t.stopImmediatePropagation():((null==(n=null==i?void 0:i.hideOnClick)?void 0:n.value)&&(null==(s=i.handleClick)||s.call(i)),null==(o=i.commandHandler)||o.call(i,e.command,r,t))});return{handleClick:d,handlePointerMove:u,handlePointerLeave:c,textContent:o,propsAndAttrs:ZM(()=>({...e,...n}))}}});var SJ=LH(AJ,[["render",function(e,t,n,i,r,s){var o;const a=ZS("el-dropdown-item-impl"),l=ZS("el-roving-focus-item"),u=ZS("el-dropdown-collection-item");return JO(),oM(u,{disabled:e.disabled,"text-value":null!=(o=e.textValue)?o:e.textContent},{default:AA(()=>[pM(l,{focusable:!e.disabled},{default:AA(()=>[pM(a,EM(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:AA(()=>[sC(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}],["__file","dropdown-item.vue"]]);const CJ=tS({name:"ElDropdownMenu",props:aJ,setup(e){const t=Wz("dropdown"),{_elDropdownSize:n}=IJ(),i=n.value,{focusTrapRef:r,onKeydown:s}=GC(WZ,void 0),{contentRef:o,role:a,triggerId:l}=GC(mJ,void 0),{collectionRef:u,getItems:c}=GC(pJ,void 0),{rovingFocusGroupRef:d,rovingFocusGroupRootStyle:h,tabIndex:p,onBlur:f,onFocus:m,onMousedown:g}=GC(qQ,void 0),{collectionRef:_}=GC(WQ,void 0),y=ZM(()=>[t.b("menu"),t.bm("menu",null==i?void 0:i.value)]),v=EJ(o,u,r,d,_),b=NZ(t=>{var n;null==(n=e.onKeydown)||n.call(e,t)},e=>{const{currentTarget:t,code:n,target:i}=e;if(t.contains(i),tW.tab===n&&e.stopImmediatePropagation(),e.preventDefault(),i!==yI(o)||!cJ.includes(n))return;const r=c().filter(e=>!e.disabled).map(e=>e.ref);uJ.includes(n)&&r.reverse(),JQ(r)});return{size:i,rovingFocusGroupRootStyle:h,tabIndex:p,dropdownKls:y,role:a,triggerId:l,dropdownListWrapperRef:v,handleKeydown:e=>{b(e),s(e)},onBlur:f,onFocus:m,onMousedown:g}}});var OJ=LH(CJ,[["render",function(e,t,n,i,r,s){return JO(),sM("ul",{ref:e.dropdownListWrapperRef,class:yE(e.dropdownKls),style:pE(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:e.onBlur,onFocus:e.onFocus,onKeydown:UR(e.handleKeydown,["self"]),onMousedown:UR(e.onMousedown,["self"])},[sC(e.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}],["__file","dropdown-menu.vue"]]);const MJ=gG(bJ,{DropdownItem:SJ,DropdownMenu:OJ}),kJ=_G(SJ),RJ=_G(OJ),NJ=Symbol("uploadContextKey"),DJ=nG({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:e=>e>=0&&e<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:Boolean,duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:Boolean,width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},striped:Boolean,stripedFlow:Boolean,format:{type:Function,default:e=>`${e}%`}}),FJ=tS({name:"ElProgress"}),LJ=tS({...FJ,props:DJ,setup(e){const t=e,n={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},i=Wz("progress"),r=ZM(()=>{const e={width:`${t.percentage}%`,animationDuration:`${t.duration}s`},n=_(t.percentage);return n.includes("gradient")?e.background=n:e.backgroundColor=n,e}),s=ZM(()=>(t.strokeWidth/t.width*100).toFixed(1)),o=ZM(()=>["circle","dashboard"].includes(t.type)?Number.parseInt(""+(50-Number.parseFloat(s.value)/2),10):0),a=ZM(()=>{const e=o.value,n="dashboard"===t.type;return`\n M 50 50\n m 0 ${n?"":"-"}${e}\n a ${e} ${e} 0 1 1 0 ${n?"-":""}${2*e}\n a ${e} ${e} 0 1 1 0 ${n?"":"-"}${2*e}\n `}),l=ZM(()=>2*Math.PI*o.value),u=ZM(()=>"dashboard"===t.type?.75:1),c=ZM(()=>`${-1*l.value*(1-u.value)/2}px`),d=ZM(()=>({strokeDasharray:`${l.value*u.value}px, ${l.value}px`,strokeDashoffset:c.value})),h=ZM(()=>({strokeDasharray:`${l.value*u.value*(t.percentage/100)}px, ${l.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),p=ZM(()=>{let e;return e=t.color?_(t.percentage):n[t.status]||n.default,e}),f=ZM(()=>"warning"===t.status?cH:"line"===t.type?"success"===t.status?RG:LG:"success"===t.status?MG:zG),m=ZM(()=>"line"===t.type?12+.4*t.strokeWidth:.111111*t.width+2),g=ZM(()=>t.format(t.percentage));const _=e=>{var n;const{color:i}=t;if(Ux(i))return i(e);if(Vx(i))return i;{const t=function(e){const t=100/e.length;return e.map((e,n)=>Vx(e)?{color:e,percentage:(n+1)*t}:e).sort((e,t)=>e.percentage-t.percentage)}(i);for(const n of t)if(n.percentage>e)return n.color;return null==(n=t[t.length-1])?void 0:n.color}};return(e,t)=>(JO(),sM("div",{class:yE([yI(i).b(),yI(i).m(e.type),yI(i).is(e.status),{[yI(i).m("without-text")]:!e.showText,[yI(i).m("text-inside")]:e.textInside}]),role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"},["line"===e.type?(JO(),sM("div",{key:0,class:yE(yI(i).b("bar"))},[hM("div",{class:yE(yI(i).be("bar","outer")),style:pE({height:`${e.strokeWidth}px`})},[hM("div",{class:yE([yI(i).be("bar","inner"),{[yI(i).bem("bar","inner","indeterminate")]:e.indeterminate},{[yI(i).bem("bar","inner","striped")]:e.striped},{[yI(i).bem("bar","inner","striped-flow")]:e.stripedFlow}]),style:pE(yI(r))},[(e.showText||e.$slots.default)&&e.textInside?(JO(),sM("div",{key:0,class:yE(yI(i).be("bar","innerText"))},[sC(e.$slots,"default",{percentage:e.percentage},()=>[hM("span",null,FE(yI(g)),1)])],2)):vM("v-if",!0)],6)],6)],2)):(JO(),sM("div",{key:1,class:yE(yI(i).b("circle")),style:pE({height:`${e.width}px`,width:`${e.width}px`})},[(JO(),sM("svg",{viewBox:"0 0 100 100"},[hM("path",{class:yE(yI(i).be("circle","track")),d:yI(a),stroke:`var(${yI(i).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":e.strokeLinecap,"stroke-width":yI(s),fill:"none",style:pE(yI(d))},null,14,["d","stroke","stroke-linecap","stroke-width"]),hM("path",{class:yE(yI(i).be("circle","path")),d:yI(a),stroke:yI(p),fill:"none",opacity:e.percentage?1:0,"stroke-linecap":e.strokeLinecap,"stroke-width":yI(s),style:pE(yI(h))},null,14,["d","stroke","opacity","stroke-linecap","stroke-width"])]))],6)),!e.showText&&!e.$slots.default||e.textInside?vM("v-if",!0):(JO(),sM("div",{key:2,class:yE(yI(i).e("text")),style:pE({fontSize:`${yI(m)}px`})},[sC(e.$slots,"default",{percentage:e.percentage},()=>[e.status?(JO(),oM(yI(jH),{key:1},{default:AA(()=>[(JO(),oM(JS(yI(f))))]),_:1})):(JO(),sM("span",{key:0},FE(yI(g)),1))])],6))],10,["aria-valuenow"]))}});const PJ=gG(LH(LJ,[["__file","progress.vue"]]));class BJ extends Error{constructor(e,t,n,i){super(e),this.name="UploadAjaxError",this.status=t,this.method=n,this.url=i}}function $J(e,t,n){let i;return i=n.response?`${n.response.error||n.response}`:n.responseText?`${n.responseText}`:`fail to ${t.method} ${e} ${n.status}`,new BJ(i,n.status,t.method,e)}const UJ=["text","picture","picture-card"];let VJ=1;const zJ=()=>Date.now()+VJ++,jJ=nG({action:{type:String,default:"#"},headers:{type:Object},method:{type:String,default:"post"},data:{type:[Object,Function,Promise],default:()=>({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:UJ,default:"text"},httpRequest:{type:Function,default:e=>{"undefined"==typeof XMLHttpRequest&&oW("ElUpload","XMLHttpRequest is undefined");const t=new XMLHttpRequest,n=e.action;t.upload&&t.upload.addEventListener("progress",t=>{const n=t;n.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(n)});const i=new FormData;if(e.data)for(const[t,n]of Object.entries(e.data))Lx(n)&&n.length?i.append(t,...n):i.append(t,n);i.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError($J(n,e,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError($J(n,e,t));e.onSuccess(function(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}(t))}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const r=e.headers||{};if(r instanceof Headers)r.forEach((e,n)=>t.setRequestHeader(n,e));else for(const[e,n]of Object.entries(r))kX(n)||t.setRequestHeader(e,String(n));return t.send(i),t}},disabled:Boolean,limit:Number}),YJ=nG({...jJ,beforeUpload:{type:Function,default:Cx},beforeRemove:{type:Function},onRemove:{type:Function,default:Cx},onChange:{type:Function,default:Cx},onPreview:{type:Function,default:Cx},onSuccess:{type:Function,default:Cx},onProgress:{type:Function,default:Cx},onError:{type:Function,default:Cx},onExceed:{type:Function,default:Cx},crossorigin:{type:String}}),GJ=nG({files:{type:Array,default:()=>[]},disabled:Boolean,handlePreview:{type:Function,default:Cx},listType:{type:String,values:UJ,default:"text"},crossorigin:{type:String}}),HJ=tS({name:"ElUploadList"}),WJ=tS({...HJ,props:GJ,emits:{remove:e=>!!e},setup(e,{emit:t}){const n=e,{t:i}=QY(),r=Wz("upload"),s=Wz("icon"),o=Wz("list"),a=HW(),l=pI(!1),u=ZM(()=>[r.b("list"),r.bm("list",n.listType),r.is("disabled",n.disabled)]),c=e=>{t("remove",e)};return(e,t)=>(JO(),oM(vR,{tag:"ul",class:yE(yI(u)),name:yI(o).b()},{default:AA(()=>[(JO(!0),sM(WO,null,iC(e.files,(t,n)=>(JO(),sM("li",{key:t.uid||t.name,class:yE([yI(r).be("list","item"),yI(r).is(t.status),{focusing:l.value}]),tabindex:"0",onKeydown:zR(e=>!yI(a)&&c(t),["delete"]),onFocus:e=>l.value=!0,onBlur:e=>l.value=!1,onClick:e=>l.value=!1},[sC(e.$slots,"default",{file:t,index:n},()=>["picture"===e.listType||"uploading"!==t.status&&"picture-card"===e.listType?(JO(),sM("img",{key:0,class:yE(yI(r).be("list","item-thumbnail")),src:t.url,crossorigin:e.crossorigin,alt:""},null,10,["src","crossorigin"])):vM("v-if",!0),"uploading"===t.status||"picture-card"!==e.listType?(JO(),sM("div",{key:1,class:yE(yI(r).be("list","item-info"))},[hM("a",{class:yE(yI(r).be("list","item-name")),onClick:UR(n=>e.handlePreview(t),["prevent"])},[pM(yI(jH),{class:yE(yI(s).m("document"))},{default:AA(()=>[pM(yI(HG))]),_:1},8,["class"]),hM("span",{class:yE(yI(r).be("list","item-file-name")),title:t.name},FE(t.name),11,["title"])],10,["onClick"]),"uploading"===t.status?(JO(),oM(yI(PJ),{key:0,type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:Number(t.percentage),style:pE("picture-card"===e.listType?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vM("v-if",!0)],2)):vM("v-if",!0),hM("label",{class:yE(yI(r).be("list","item-status-label"))},["text"===e.listType?(JO(),oM(yI(jH),{key:0,class:yE([yI(s).m("upload-success"),yI(s).m("circle-check")])},{default:AA(()=>[pM(yI(RG))]),_:1},8,["class"])):["picture-card","picture"].includes(e.listType)?(JO(),oM(yI(jH),{key:1,class:yE([yI(s).m("upload-success"),yI(s).m("check")])},{default:AA(()=>[pM(yI(MG))]),_:1},8,["class"])):vM("v-if",!0)],2),yI(a)?vM("v-if",!0):(JO(),oM(yI(jH),{key:2,class:yE(yI(s).m("close")),onClick:e=>c(t)},{default:AA(()=>[pM(yI(zG))]),_:2},1032,["class","onClick"])),vM(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),vM(" This is a bug which needs to be fixed "),vM(" TODO: Fix the incorrect navigation interaction "),yI(a)?vM("v-if",!0):(JO(),sM("i",{key:3,class:yE(yI(s).m("close-tip"))},FE(yI(i)("el.upload.deleteTip")),3)),"picture-card"===e.listType?(JO(),sM("span",{key:4,class:yE(yI(r).be("list","item-actions"))},[hM("span",{class:yE(yI(r).be("list","item-preview")),onClick:n=>e.handlePreview(t)},[pM(yI(jH),{class:yE(yI(s).m("zoom-in"))},{default:AA(()=>[pM(yI(hH))]),_:1},8,["class"])],10,["onClick"]),yI(a)?vM("v-if",!0):(JO(),sM("span",{key:0,class:yE(yI(r).be("list","item-delete")),onClick:e=>c(t)},[pM(yI(jH),{class:yE(yI(s).m("delete"))},{default:AA(()=>[pM(yI(YG))]),_:1},8,["class"])],10,["onClick"]))],2)):vM("v-if",!0)])],42,["onKeydown","onFocus","onBlur","onClick"]))),128)),sC(e.$slots,"append")]),_:3},8,["class","name"]))}});var XJ=LH(WJ,[["__file","upload-list.vue"]]);const qJ=function(){this.__data__=new xY,this.size=0};const KJ=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const ZJ=function(e){return this.__data__.get(e)};const QJ=function(e){return this.__data__.has(e)};const JJ=function(e,t){var n=this.__data__;if(n instanceof xY){var i=n.__data__;if(!EY||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new RY(i)}return n.set(e,t),this.size=n.size,this};function e0(e){var t=this.__data__=new xY(e);this.size=t.size}e0.prototype.clear=qJ,e0.prototype.delete=KJ,e0.prototype.get=ZJ,e0.prototype.has=QJ,e0.prototype.set=JJ;const t0=e0;const n0=function(e,t){for(var n=-1,i=null==e?0:e.length;++na))return!1;var u=s.get(e),c=s.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,p=2&n?new H1:void 0;for(s.set(e,t),s.set(t,e);++dLx(e)},h2="ElUploadDrag",p2=tS({name:h2}),f2=tS({...p2,props:c2,emits:d2,setup(e,{emit:t}){GC(NJ)||oW(h2,"usage: ");const n=Wz("upload"),i=pI(!1),r=HW(),s=e=>{if(r.value)return;i.value=!1,e.stopPropagation();const n=Array.from(e.dataTransfer.files),s=e.dataTransfer.items||[];n.forEach((e,t)=>{var n;const i=s[t],r=null==(n=null==i?void 0:i.webkitGetAsEntry)?void 0:n.call(i);r&&(e.isDirectory=r.isDirectory)}),t("file",n)},o=()=>{r.value||(i.value=!0)},a=e=>{e.currentTarget.contains(e.relatedTarget)||(i.value=!1)};return(e,t)=>(JO(),sM("div",{class:yE([yI(n).b("dragger"),yI(n).is("dragover",i.value)]),onDrop:UR(s,["prevent"]),onDragover:UR(o,["prevent"]),onDragleave:UR(a,["prevent"])},[sC(e.$slots,"default")],42,["onDrop","onDragover","onDragleave"]))}});var m2=LH(f2,[["__file","upload-dragger.vue"]]);const g2=nG({...jJ,beforeUpload:{type:Function,default:Cx},onRemove:{type:Function,default:Cx},onStart:{type:Function,default:Cx},onSuccess:{type:Function,default:Cx},onProgress:{type:Function,default:Cx},onError:{type:Function,default:Cx},onExceed:{type:Function,default:Cx}}),_2=tS({name:"ElUploadContent",inheritAttrs:!1}),y2=tS({..._2,props:g2,setup(e,{expose:t}){const n=e,i=Wz("upload"),r=HW(),s=fI({}),o=fI(),a=e=>{if(0===e.length)return;const{autoUpload:t,limit:i,fileList:r,multiple:s,onStart:o,onExceed:a}=n;if(i&&r.length+e.length>i)a(e,r);else{s||(e=e.slice(0,1));for(const n of e){const e=n;e.uid=zJ(),o(e),t&&l(e)}}},l=async e=>{if(o.value.value="",!n.beforeUpload)return u(e);let t,i={};try{const r=n.data,s=n.beforeUpload(e);i=Xx(n.data)?z1(n.data):n.data,t=await s,Xx(n.data)&&u2(r,i)&&(i=z1(n.data))}catch(e){t=!1}if(!1===t)return void n.onRemove(e);let r=e;t instanceof Blob&&(r=t instanceof File?t:new File([t],e.name,{type:e.type})),u(Object.assign(r,{uid:e.uid}),i)},u=async(e,t)=>{const{headers:i,data:r,method:o,withCredentials:a,name:l,action:u,onProgress:c,onSuccess:d,onError:h,httpRequest:p}=n;try{t=await(async(e,t)=>Ux(e)?e(t):e)(null!=t?t:r,e)}catch(t){return void n.onRemove(e)}const{uid:f}=e,m={headers:i||{},withCredentials:a,file:e,data:t,method:o,filename:l,action:u,onProgress:t=>{c(t,e)},onSuccess:t=>{d(t,e),delete s.value[f]},onError:t=>{h(t,e),delete s.value[f]}},g=p(m);s.value[f]=g,g instanceof Promise&&g.then(m.onSuccess,m.onError)},c=e=>{const t=e.target.files;t&&a(Array.from(t))},d=()=>{r.value||(o.value.value="",o.value.click())},h=()=>{d()};return t({abort:e=>{const t=(n=s.value,Object.entries(n)).filter(e?([t])=>String(e.uid)===t:()=>!0);var n;t.forEach(([e,t])=>{t instanceof XMLHttpRequest&&t.abort(),delete s.value[e]})},upload:l}),(e,t)=>(JO(),sM("div",{class:yE([yI(i).b(),yI(i).m(e.listType),yI(i).is("drag",e.drag),yI(i).is("disabled",yI(r))]),tabindex:yI(r)?"-1":"0",onClick:d,onKeydown:zR(UR(h,["self"]),["enter","space"])},[e.drag?(JO(),oM(m2,{key:0,disabled:yI(r),onFile:a},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["disabled"])):sC(e.$slots,"default",{key:1}),hM("input",{ref_key:"inputRef",ref:o,class:yE(yI(i).e("input")),name:e.name,disabled:yI(r),multiple:e.multiple,accept:e.accept,type:"file",onChange:c,onClick:UR(()=>{},["stop"])},null,42,["name","disabled","multiple","accept","onClick"])],42,["tabindex","onKeydown"]))}});var v2=LH(y2,[["__file","upload-content.vue"]]);const b2="ElUpload",T2=e=>{var t;(null==(t=e.url)?void 0:t.startsWith("blob:"))&&URL.revokeObjectURL(e.url)},x2=(e,t)=>{const n=DH(e,"fileList",void 0,{passive:!0}),i=e=>n.value.find(t=>t.uid===e.uid);function r(e){var n;null==(n=t.value)||n.abort(e)}function s(e){n.value=n.value.filter(t=>t.uid!==e.uid)}return wO(()=>e.listType,t=>{"picture-card"!==t&&"picture"!==t||(n.value=n.value.map(t=>{const{raw:i,url:r}=t;if(!r&&i)try{t.url=URL.createObjectURL(i)}catch(i){e.onError(i,t,n.value)}return t}))}),wO(n,e=>{for(const t of e)t.uid||(t.uid=zJ()),t.status||(t.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:r,clearFiles:function(e=["ready","uploading","success","fail"]){n.value=n.value.filter(t=>!e.includes(t.status))},handleError:(t,r)=>{const o=i(r);o&&(console.error(t),o.status="fail",s(o),e.onError(t,o,n.value),e.onChange(o,n.value))},handleProgress:(t,r)=>{const s=i(r);s&&(e.onProgress(t,s,n.value),s.status="uploading",s.percentage=Math.round(t.percent))},handleStart:t=>{kX(t.uid)&&(t.uid=zJ());const i={name:t.name,percentage:0,status:"ready",size:t.size,raw:t,uid:t.uid};if("picture-card"===e.listType||"picture"===e.listType)try{i.url=URL.createObjectURL(t)}catch(t){t.message,e.onError(t,i,n.value)}n.value=[...n.value,i],e.onChange(i,n.value)},handleSuccess:(t,r)=>{const s=i(r);s&&(s.status="success",s.response=t,e.onSuccess(t,s,n.value),e.onChange(s,n.value))},handleRemove:async t=>{const o=t instanceof File?i(t):t;o||oW(b2,"file to be removed not found");const a=t=>{r(t),s(t),e.onRemove(t,n.value),T2(t)};if(e.beforeRemove){!1!==await e.beforeRemove(o,n.value)&&a(o)}else a(o)},submit:function(){n.value.filter(({status:e})=>"ready"===e).forEach(({raw:e})=>{var n;return e&&(null==(n=t.value)?void 0:n.upload(e))})},revokeFileObjectURL:T2}},E2=tS({name:"ElUpload"}),w2=tS({...E2,props:YJ,setup(e,{expose:t}){const n=e,i=HW(),r=fI(),{abort:s,submit:o,clearFiles:a,uploadFiles:l,handleStart:u,handleError:c,handleRemove:d,handleSuccess:h,handleProgress:p,revokeFileObjectURL:f}=x2(n,r),m=ZM(()=>"picture-card"===n.listType),g=ZM(()=>({...n,fileList:l.value,onStart:u,onProgress:p,onSuccess:h,onError:c,onRemove:d}));return jS(()=>{l.value.forEach(f)}),YC(NJ,{accept:SI(n,"accept")}),t({abort:s,submit:o,clearFiles:a,handleStart:u,handleRemove:d}),(e,t)=>(JO(),sM("div",null,[yI(m)&&e.showFileList?(JO(),oM(XJ,{key:0,disabled:yI(i),"list-type":e.listType,files:yI(l),crossorigin:e.crossorigin,"handle-preview":e.onPreview,onRemove:yI(d)},rC({append:AA(()=>[pM(v2,EM({ref_key:"uploadRef",ref:r},yI(g)),{default:AA(()=>[e.$slots.trigger?sC(e.$slots,"trigger",{key:0}):vM("v-if",!0),!e.$slots.trigger&&e.$slots.default?sC(e.$slots,"default",{key:1}):vM("v-if",!0)]),_:3},16)]),_:2},[e.$slots.file?{name:"default",fn:AA(({file:t,index:n})=>[sC(e.$slots,"file",{file:t,index:n})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):vM("v-if",!0),!yI(m)||yI(m)&&!e.showFileList?(JO(),oM(v2,EM({key:1,ref_key:"uploadRef",ref:r},yI(g)),{default:AA(()=>[e.$slots.trigger?sC(e.$slots,"trigger",{key:0}):vM("v-if",!0),!e.$slots.trigger&&e.$slots.default?sC(e.$slots,"default",{key:1}):vM("v-if",!0)]),_:3},16)):vM("v-if",!0),e.$slots.trigger?sC(e.$slots,"default",{key:2}):vM("v-if",!0),sC(e.$slots,"tip"),!yI(m)&&e.showFileList?(JO(),oM(XJ,{key:3,disabled:yI(i),"list-type":e.listType,files:yI(l),crossorigin:e.crossorigin,"handle-preview":e.onPreview,onRemove:yI(d)},rC({_:2},[e.$slots.file?{name:"default",fn:AA(({file:t,index:n})=>[sC(e.$slots,"file",{file:t,index:n})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):vM("v-if",!0)]))}});const I2=gG(LH(w2,[["__file","upload.vue"]]));const A2=function(){return Ij.Date.now()};var S2=/\s/;const C2=function(e){for(var t=e.length;t--&&S2.test(e.charAt(t)););return t};var O2=/^\s+/;const M2=function(e){return e?e.slice(0,C2(e)+1).replace(O2,""):e};var k2=/^[-+]0x[0-9a-f]+$/i,R2=/^0b[01]+$/i,N2=/^0o[0-7]+$/i,D2=parseInt;const F2=function(e){if("number"==typeof e)return e;if(Pj(e))return NaN;if(Vj(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vj(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=M2(e);var n=R2.test(e);return n||N2.test(e)?D2(e.slice(2),n?2:8):k2.test(e)?NaN:+e};var L2=Math.max,P2=Math.min;const B2=function(e,t,n){var i,r,s,o,a,l,u=0,c=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,s=r;return i=r=void 0,u=t,o=e.apply(s,n)}function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=s}function m(){var e=A2();if(f(e))return g(e);a=setTimeout(m,function(e){var n=t-(e-l);return d?P2(n,s-(e-u)):n}(e))}function g(e){return a=void 0,h&&i?p(e):(i=r=void 0,o)}function _(){var e=A2(),n=f(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return function(e){return u=e,a=setTimeout(m,t),c?p(e):o}(l);if(d)return clearTimeout(a),a=setTimeout(m,t),p(l)}return void 0===a&&(a=setTimeout(m,t)),o}return t=F2(t)||0,Vj(n)&&(c=!!n.leading,s=(d="maxWait"in n)?L2(F2(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),u=0,i=l=r=a=void 0},_.flush=function(){return void 0===a?o:g(A2())},_};const $2=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Vj(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),B2(e,t,{leading:i,maxWait:t,trailing:r})},U2=nG({urlList:{type:Array,default:()=>[]},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:Boolean,teleported:Boolean,closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:String}}),V2={close:()=>!0,error:e=>e instanceof Event,switch:e=>Kz(e),rotate:e=>Kz(e)},z2=tS({name:"ElImageViewer"}),j2=tS({...z2,props:U2,emits:V2,setup(e,{expose:t,emit:n}){var i;const r=e,s={CONTAIN:{name:"contain",icon:uI(KG)},ORIGINAL:{name:"original",icon:uI(aH)}};let o,a="";const{t:l}=QY(),u=Wz("image-viewer"),{nextZIndex:c}=Tj(),d=pI(),h=pI(),p=VE(),f=ZM(()=>{const{scale:e,minScale:t,maxScale:n}=r;return((e,t,n)=>Math.min(n,Math.max(t,e)))(e,t,n)}),m=pI(!0),g=pI(!1),_=pI(r.initialIndex),y=fI(s.CONTAIN),v=pI({scale:f.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),b=pI(null!=(i=r.zIndex)?i:c()),T=ZM(()=>{const{urlList:e}=r;return e.length<=1}),x=ZM(()=>0===_.value),E=ZM(()=>_.value===r.urlList.length-1),w=ZM(()=>r.urlList[_.value]),I=ZM(()=>[u.e("btn"),u.e("prev"),u.is("disabled",!r.infinite&&x.value)]),A=ZM(()=>[u.e("btn"),u.e("next"),u.is("disabled",!r.infinite&&E.value)]),S=ZM(()=>{const{scale:e,deg:t,offsetX:n,offsetY:i,enableTransition:r}=v.value;let o=n/e,a=i/e;const l=t*Math.PI/180,u=Math.cos(l),c=Math.sin(l);o=o*u+a*c,a=a*u-n/e*c;const d={transform:`scale(${e}) rotate(${t}deg) translate(${o}px, ${a}px)`,transition:r?"transform .3s":""};return y.value.name===s.CONTAIN.name&&(d.maxWidth=d.maxHeight="100%"),d}),C=ZM(()=>`${_.value+1} / ${r.urlList.length}`);function O(){p.stop(),null==o||o(),document.body.style.overflow=a,n("close")}function M(){m.value=!1}function k(e){g.value=!0,m.value=!1,n("error",e),e.target.alt=l("el.image.error")}function R(e){if(m.value||0!==e.button||!d.value)return;v.value.enableTransition=!1;const{offsetX:t,offsetY:n}=v.value,i=e.pageX,r=e.pageY,s=$2(e=>{v.value={...v.value,offsetX:t+e.pageX-i,offsetY:n+e.pageY-r}}),o=gH(document,"mousemove",s);gH(document,"mouseup",()=>{o()}),e.preventDefault()}function N(){v.value={scale:f.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function D(){if(m.value||g.value)return;const e=lG(s),t=Object.values(s),n=y.value.name,i=(t.findIndex(e=>e.name===n)+1)%e.length;y.value=s[e[i]],N()}function F(e){g.value=!1;const t=r.urlList.length;_.value=(e+t)%t}function L(){x.value&&!r.infinite||F(_.value-1)}function P(){E.value&&!r.infinite||F(_.value+1)}function B(e,t={}){if(m.value||g.value)return;const{minScale:i,maxScale:s}=r,{zoomRate:o,rotateDeg:a,enableTransition:l}={zoomRate:r.zoomRate,rotateDeg:90,enableTransition:!0,...t};switch(e){case"zoomOut":v.value.scale>i&&(v.value.scale=Number.parseFloat((v.value.scale/o).toFixed(3)));break;case"zoomIn":v.value.scale0?(e.preventDefault(),!1):void 0}return wO(()=>f.value,e=>{v.value.scale=e}),wO(w,()=>{nA(()=>{const e=h.value;(null==e?void 0:e.complete)||(m.value=!0)})}),wO(_,e=>{N(),n("switch",e)}),US(()=>{!function(){const e=$2(e=>{switch(e.code){case tW.esc:r.closeOnPressEscape&&O();break;case tW.space:D();break;case tW.left:L();break;case tW.up:B("zoomIn");break;case tW.right:P();break;case tW.down:B("zoomOut")}}),t=$2(e=>{B((e.deltaY||e.deltaX)<0?"zoomIn":"zoomOut",{zoomRate:r.zoomRate,enableTransition:!1})});p.run(()=>{gH(document,"keydown",e),gH(document,"wheel",t)})}(),o=gH("wheel",V,{passive:!1}),a=document.body.style.overflow,document.body.style.overflow="hidden"}),t({setActiveItem:F}),(e,t)=>(JO(),oM(yI(BZ),{to:"body",disabled:!e.teleported},{default:AA(()=>[pM(xk,{name:"viewer-fade",appear:""},{default:AA(()=>[hM("div",{ref_key:"wrapper",ref:d,tabindex:-1,class:yE(yI(u).e("wrapper")),style:pE({zIndex:b.value})},[pM(yI(dQ),{loop:"",trapped:"","focus-trap-el":d.value,"focus-start-el":"container",onFocusoutPrevented:$,onReleaseRequested:U},{default:AA(()=>[hM("div",{class:yE(yI(u).e("mask")),onClick:UR(t=>e.hideOnClickModal&&O(),["self"])},null,10,["onClick"]),vM(" CLOSE "),hM("span",{class:yE([yI(u).e("btn"),yI(u).e("close")]),onClick:O},[pM(yI(jH),null,{default:AA(()=>[pM(yI(zG))]),_:1})],2),vM(" ARROW "),yI(T)?vM("v-if",!0):(JO(),sM(WO,{key:0},[hM("span",{class:yE(yI(I)),onClick:L},[pM(yI(jH),null,{default:AA(()=>[pM(yI(xG))]),_:1})],2),hM("span",{class:yE(yI(A)),onClick:P},[pM(yI(jH),null,{default:AA(()=>[pM(yI(wG))]),_:1})],2)],64)),e.$slots.progress||e.showProgress?(JO(),sM("div",{key:1,class:yE([yI(u).e("btn"),yI(u).e("progress")])},[sC(e.$slots,"progress",{activeIndex:_.value,total:e.urlList.length},()=>[_M(FE(yI(C)),1)])],2)):vM("v-if",!0),vM(" ACTIONS "),hM("div",{class:yE([yI(u).e("btn"),yI(u).e("actions")])},[hM("div",{class:yE(yI(u).e("actions__inner"))},[sC(e.$slots,"toolbar",{actions:B,prev:L,next:P,reset:D,activeIndex:_.value,setActiveItem:F},()=>[pM(yI(jH),{onClick:e=>B("zoomOut")},{default:AA(()=>[pM(yI(pH))]),_:1},8,["onClick"]),pM(yI(jH),{onClick:e=>B("zoomIn")},{default:AA(()=>[pM(yI(hH))]),_:1},8,["onClick"]),hM("i",{class:yE(yI(u).e("actions__divider"))},null,2),pM(yI(jH),{onClick:D},{default:AA(()=>[(JO(),oM(JS(yI(y).icon)))]),_:1}),hM("i",{class:yE(yI(u).e("actions__divider"))},null,2),pM(yI(jH),{onClick:e=>B("anticlockwise")},{default:AA(()=>[pM(yI(sH))]),_:1},8,["onClick"]),pM(yI(jH),{onClick:e=>B("clockwise")},{default:AA(()=>[pM(yI(oH))]),_:1},8,["onClick"])])],2)],2),vM(" CANVAS "),hM("div",{class:yE(yI(u).e("canvas"))},[g.value&&e.$slots["viewer-error"]?sC(e.$slots,"viewer-error",{key:0,activeIndex:_.value,src:yI(w)}):(JO(),sM("img",{ref_key:"imgRef",ref:h,key:yI(w),src:yI(w),style:pE(yI(S)),class:yE(yI(u).e("img")),crossorigin:e.crossorigin,onLoad:M,onError:k,onMousedown:R},null,46,["src","crossorigin"]))],2),sC(e.$slots,"default")]),_:3},8,["focus-trap-el"])],6)]),_:3})]),_:3},8,["disabled"]))}});const Y2=gG(LH(j2,[["__file","image-viewer.vue"]])),G2=nG({hideOnClickModal:Boolean,src:{type:String,default:""},fit:{type:String,values:["","contain","cover","fill","none","scale-down"],default:""},loading:{type:String,values:["eager","lazy"]},lazy:Boolean,scrollContainer:{type:[String,Object]},previewSrcList:{type:Array,default:()=>[]},previewTeleported:Boolean,zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:String}}),H2={load:e=>e instanceof Event,error:e=>e instanceof Event,switch:e=>Kz(e),close:()=>!0,show:()=>!0},W2=(e,t)=>{if(!aj)return!1;const n=((e,t)=>{var n;if(!aj||!e||!t)return"";let i=eE(t);"float"===i&&(i="cssFloat");try{const t=e.style[i];if(t)return t;const r=null==(n=document.defaultView)?void 0:n.getComputedStyle(e,"");return r?r[i]:""}catch(t){return e.style[i]}})(e,{undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)]);return["scroll","auto","overlay"].some(e=>n.includes(e))};const X2=tS({name:"ElImage",inheritAttrs:!1}),q2=tS({...X2,props:G2,emits:H2,setup(e,{expose:t,emit:n}){const i=e,{t:r}=QY(),s=Wz("image"),o=TC(),a=ZM(()=>JY(Object.entries(o).filter(([e])=>/^(data-|on[A-Z])/i.test(e)||["id","style"].includes(e)))),l=Sq({excludeListeners:!0,excludeKeys:ZM(()=>Object.keys(a.value))}),u=pI(),c=pI(!1),d=pI(!0),h=pI(!1),p=pI(),f=pI(),m=aj&&"loading"in HTMLImageElement.prototype;let g;const _=ZM(()=>[s.e("inner"),v.value&&s.e("preview"),d.value&&s.is("loading")]),y=ZM(()=>{const{fit:e}=i;return aj&&e?{objectFit:e}:{}}),v=ZM(()=>{const{previewSrcList:e}=i;return Lx(e)&&e.length>0}),b=ZM(()=>{const{previewSrcList:e,initialIndex:t}=i;let n=t;return t>e.length-1&&(n=0),n}),T=ZM(()=>"eager"!==i.loading&&(!m&&"lazy"===i.loading||i.lazy)),x=()=>{aj&&(d.value=!0,c.value=!1,u.value=i.src)};function E(e){d.value=!1,c.value=!1,n("load",e)}function w(e){d.value=!1,c.value=!0,n("error",e)}const I=mj(function(e){e&&(x(),S())},200,!0);async function A(){var e;if(!aj)return;await nA();const{scrollContainer:t}=i;if(Zz(t))f.value=t;else if(Vx(t)&&""!==t)f.value=null!=(e=document.querySelector(t))?e:void 0;else if(p.value){const e=((e,t)=>{if(!aj)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(W2(n,t))return n;n=n.parentNode}return n})(p.value);f.value=e===window?void 0:e}const{stop:n}=function(e,t,n={}){const{root:i,rootMargin:r="0px",threshold:s=.1,window:o=mH}=n,a=yH(()=>o&&"IntersectionObserver"in o);let l=uj;const u=a.value?wO(()=>({el:fH(e),root:fH(i)}),({el:e,root:n})=>{if(l(),!e)return;const i=new IntersectionObserver(t,{root:n,rootMargin:r,threshold:s});i.observe(e),l=()=>{i.disconnect(),l=uj}},{immediate:!0,flush:"post"}):uj,c=()=>{l(),u()};return fj(c),{isSupported:a,stop:c}}(p,([e])=>{I(e.isIntersecting)},{root:f});g=n}function S(){aj&&I&&(null==g||g(),f.value=void 0,g=void 0)}function C(){v.value&&(h.value=!0,n("show"))}function O(){h.value=!1,n("close")}function M(e){n("switch",e)}return wO(()=>i.src,()=>{T.value?(d.value=!0,c.value=!1,S(),A()):x()}),US(()=>{T.value?A():x()}),t({showPreview:C}),(e,t)=>(JO(),sM("div",EM({ref_key:"container",ref:p},yI(a),{class:[yI(s).b(),e.$attrs.class]}),[c.value?sC(e.$slots,"error",{key:0},()=>[hM("div",{class:yE(yI(s).e("error"))},FE(yI(r)("el.image.error")),3)]):(JO(),sM(WO,{key:1},[void 0!==u.value?(JO(),sM("img",EM({key:0},yI(l),{src:u.value,loading:e.loading,style:yI(y),class:yI(_),crossorigin:e.crossorigin,onClick:C,onLoad:E,onError:w}),null,16,["src","loading","crossorigin"])):vM("v-if",!0),d.value?(JO(),sM("div",{key:1,class:yE(yI(s).e("wrapper"))},[sC(e.$slots,"placeholder",{},()=>[hM("div",{class:yE(yI(s).e("placeholder"))},null,2)])],2)):vM("v-if",!0)],64)),yI(v)?(JO(),sM(WO,{key:2},[h.value?(JO(),oM(yI(Y2),{key:0,"z-index":e.zIndex,"initial-index":yI(b),infinite:e.infinite,"zoom-rate":e.zoomRate,"min-scale":e.minScale,"max-scale":e.maxScale,"show-progress":e.showProgress,"url-list":e.previewSrcList,scale:e.scale,crossorigin:e.crossorigin,"hide-on-click-modal":e.hideOnClickModal,teleported:e.previewTeleported,"close-on-press-escape":e.closeOnPressEscape,onClose:O,onSwitch:M},rC({toolbar:AA(t=>[sC(e.$slots,"toolbar",vE(mM(t)))]),default:AA(()=>[e.$slots.viewer?(JO(),sM("div",{key:0},[sC(e.$slots,"viewer")])):vM("v-if",!0)]),_:2},[e.$slots.progress?{name:"progress",fn:AA(t=>[sC(e.$slots,"progress",vE(mM(t)))])}:void 0,e.$slots["viewer-error"]?{name:"viewer-error",fn:AA(t=>[sC(e.$slots,"viewer-error",vE(mM(t)))])}:void 0]),1032,["z-index","initial-index","infinite","zoom-rate","min-scale","max-scale","show-progress","url-list","scale","crossorigin","hide-on-click-modal","teleported","close-on-press-escape"])):vM("v-if",!0)],64)):vM("v-if",!0)],16))}});const K2=gG(LH(q2,[["__file","image.vue"]])),Z2={class:"card-header"},Q2={key:0,class:"disabled-tag",style:{color:"#f56c6c","margin-left":"8px","font-size":"13px"}},J2={class:"el-dropdown-link"},e3={class:"card-content",style:{"flex-direction":"column",display:"flex"}},t3={class:"card-content-info"},n3={style:{display:"flex",gap:"4px"}},i3={__name:"ClassBox",props:{title:{type:String,default:"类别"},picList:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["add-sample","delete-sample","rename-class","delete-class","disable-class","clear-samples"],setup(e,{emit:t}){const n=e,i=t,r=pI(n.title),s=pI(!1),o=pI(r.value),a=pI(null),l=pI(null);function u(){s.value||(s.value=!0,o.value=r.value,nA(()=>{a.value&&a.value.input&&a.value.input.select()}))}function c(){o.value.trim()&&(r.value=o.value.trim(),i("rename-class",r.value)),s.value=!1}function d(){i("add-sample")}function h(){d(),l.value=setInterval(()=>{d()},200)}function p(){l.value&&(clearInterval(l.value),l.value=null)}function f(){i("delete-class")}function m(){i("disable-class")}function g(){i("clear-samples")}function _(){const e=new(MX());n.picList.forEach((t,n)=>{const i=t.split(",")[1];e.file(`sample_${n+1}.png`,i,{base64:!0})}),e.generateAsync({type:"blob"}).then(e=>{(0,CX.saveAs)(e,"samples.zip")})}function y(e){return new Promise((t,n)=>{if("application/zip"===e.type||e.name.endsWith(".zip")){const r=new(MX());r.loadAsync(e).then(e=>{const n=Object.values(e.files).filter(e=>!e.dir&&e.name.match(/\.(png|jpg|jpeg|gif|bmp)$/i));Promise.all(n.map(e=>r.file(e.name).async("blob").then(t=>{const n=new File([t],e.name,{type:t.type}),i=new FileReader;return i.readAsDataURL(n),new Promise(e=>i.onload=e)}))).then(e=>{e.forEach(e=>i("add-sample",e.target.result)),t(!1)})}).catch(n)}else{const r=new FileReader;r.onload=e=>{i("add-sample",e.target.result),t(!1)},r.onerror=n,r.readAsDataURL(e)}})}return wO(()=>n.title,e=>{r.value=e}),(e,t)=>(JO(),oM(yI(SX),{class:"class-box"},{header:AA(()=>[hM("div",Z2,[hM("span",{class:"card-header-title",style:{cursor:"pointer"},onClick:u},[s.value?(JO(),oM(yI(Nq),{key:1,ref_key:"inputRef",ref:a,modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),style:{width:"120px"},onKeyup:zR(c,["enter"]),onBlur:c},null,8,["modelValue"])):(JO(),sM(WO,{key:0},[_M(FE(r.value)+" ",1),pM(yI(jH),{onClick:UR(u,["stop"])},{default:AA(()=>[pM(yI(XG))]),_:1}),n.disabled?(JO(),sM("span",Q2," 禁用 ")):vM("v-if",!0)],64))]),pM(yI(MJ),{class:"card-header-title"},{dropdown:AA(()=>[pM(yI(RJ),{class:"class-box-dropdown"},{default:AA(()=>[pM(yI(kJ),{class:"class-box-dropdown-item",onClick:f},{default:AA(()=>t[1]||(t[1]=[hM("span",{style:{color:"#f56c6c"}},"删除类别",-1)])),_:1}),pM(yI(kJ),{class:"class-box-dropdown-item",onClick:m},{default:AA(()=>[_M(FE(n.disabled?"启用":"禁用")+"类别 ",1)]),_:1}),pM(yI(kJ),{class:"class-box-dropdown-item",disabled:0===n.picList.length,onClick:g},{default:AA(()=>t[2]||(t[2]=[_M(" 清空样本 ")])),_:1},8,["disabled"]),pM(yI(kJ),{class:"class-box-dropdown-item",disabled:0===n.picList.length,onClick:_},{default:AA(()=>t[3]||(t[3]=[_M(" 导出样本 ")])),_:1},8,["disabled"])]),_:1})]),default:AA(()=>[hM("span",J2,[pM(yI(jH),null,{default:AA(()=>[pM(yI(rH))]),_:1})])]),_:1})])]),default:AA(()=>[hM("div",e3,[hM("div",t3,[_M(" 图像样本 "+FE(n.picList.length)+" ",1),hM("div",n3,[pM(yI(EX),{type:"primary",size:"small",disabled:n.disabled,onMousedown:h,onMouseup:p,onMouseleave:p},{default:AA(()=>[t[4]||(t[4]=_M(" 拍摄样本 ")),pM(yI(jH),null,{default:AA(()=>[pM(yI(CG))]),_:1})]),_:1},8,["disabled"]),pM(yI(I2),{"show-file-list":!1,"before-upload":y,accept:"image/*,.zip",disabled:n.disabled},{default:AA(()=>[pM(yI(EX),{plain:"",type:"primary",size:"small",disabled:n.disabled},{default:AA(()=>[t[5]||(t[5]=_M(" 上传样本 ")),pM(yI(jH),null,{default:AA(()=>[pM(yI(UG))]),_:1})]),_:1},8,["disabled"])]),_:1},8,["disabled"])])]),pM(vR,{name:"fade",tag:"div",class:"card-content-img"},{default:AA(()=>[(JO(!0),sM(WO,null,iC(n.picList.slice().reverse(),e=>(JO(),sM("div",{key:e,class:"card-content-img-wrapper",style:{position:"relative",display:"inline-block"}},[pM(yI(K2),{src:e,class:yE(["card-content-img-item",{"img-disabled":n.disabled}])},null,8,["src","class"]),pM(yI(jH),{class:"delete-icon",onClick:t=>function(e){i("delete-sample",e)}(e)},{default:AA(()=>[pM(yI(YG))]),_:2},1032,["onClick"])]))),128))]),_:1})])]),_:1}))}},r3=i3,s3={class:"camera-box"},o3={__name:"CameraBox",setup(e,{expose:t}){const n=pI(null),i=GC("shotList");return US(()=>{navigator.mediaDevices.getUserMedia({video:!0}).then(e=>{n.value&&(n.value.srcObject=e)}).catch(e=>{console.error("无法访问摄像头:",e)})}),t({captureShot:function(){const e=n.value;if(!e)return;const t=e.videoWidth,r=e.videoHeight;let s=0,o=0,a=t,l=r;t>r?(s=(t-r)/2,a=r):r>t&&(o=(r-t)/2,l=t);const u=Math.min(a,l),c=document.createElement("canvas");return c.width=u,c.height=u,c.getContext("2d").drawImage(e,s,o,u,u,0,0,u,u),i.value.push(c.toDataURL("image/png")),c.toDataURL("image/png")}}),(e,t)=>(JO(),sM("div",s3,[hM("video",{id:"webcam",ref_key:"videoRef",ref:n,class:"video-crop",autoplay:"",playsinline:"",muted:"",height:"100%",width:"100%"},null,512)]))}};var a3=__webpack_require__(66262);const l3=(0,a3.A)(o3,[["__scopeId","data-v-da91b390"]]);var u3=__webpack_require__(15838),c3=__webpack_require__(15441),d3=__webpack_require__(29809),h3=__webpack_require__(9258),p3=__webpack_require__(10700); +var EG=sS({name:"ArrowDown",__name:"arrow-down",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),wG=EG,IG=sS({name:"ArrowLeft",__name:"arrow-left",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}),AG=IG,SG=sS({name:"ArrowRight",__name:"arrow-right",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}),CG=SG,OG=sS({name:"ArrowUp",__name:"arrow-up",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}),MG=OG,kG=sS({name:"Camera",__name:"camera",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"})]))}),RG=kG,NG=sS({name:"Check",__name:"check",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}),DG=NG,FG=sS({name:"CircleCheck",__name:"circle-check",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),gM("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}),LG=FG,PG=sS({name:"CircleCloseFilled",__name:"circle-close-filled",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}),BG=PG,$G=sS({name:"CircleClose",__name:"circle-close",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),gM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),UG=$G,VG=sS({name:"CirclePlusFilled",__name:"circle-plus-filled",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"})]))}),zG=VG,jG=sS({name:"CirclePlus",__name:"circle-plus",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"}),gM("path",{fill:"currentColor",d:"M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0"}),gM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),YG=jG,GG=sS({name:"Close",__name:"close",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),HG=GG,WG=sS({name:"Delete",__name:"delete",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}),XG=WG,qG=sS({name:"Document",__name:"document",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}),KG=qG,ZG=sS({name:"EditPen",__name:"edit-pen",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}),QG=ZG,JG=sS({name:"FullScreen",__name:"full-screen",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}),eH=JG,tH=sS({name:"Hide",__name:"hide",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),gM("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}),nH=tH,iH=sS({name:"InfoFilled",__name:"info-filled",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),rH=iH,sH=sS({name:"Loading",__name:"loading",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}),oH=sH,aH=sS({name:"More",__name:"more",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"})]))}),lH=aH,uH=sS({name:"RefreshLeft",__name:"refresh-left",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}),cH=sS({name:"RefreshRight",__name:"refresh-right",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"})]))}),dH=sS({name:"ScaleToOriginal",__name:"scale-to-original",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"})]))}),hH=sS({name:"SuccessFilled",__name:"success-filled",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}),pH=sS({name:"View",__name:"view",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),fH=sS({name:"WarningFilled",__name:"warning-filled",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}),mH=sS({name:"Warning",__name:"warning",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}),gH=sS({name:"ZoomIn",__name:"zoom-in",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}),_H=sS({name:"ZoomOut",__name:"zoom-out",setup:e=>(e,t)=>(iM(),uM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[gM("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))});function yH(e){var t;const n=mj(e);return null!=(t=null==n?void 0:n.$el)?t:n}const vH=dj?window:void 0;dj&&window.document,dj&&window.navigator,dj&&window.location;function bH(...e){let t,n,i,r;if("string"==typeof e[0]||Array.isArray(e[0])?([n,i,r]=e,t=vH):[t,n,i,r]=e,!t)return pj;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(e=>e()),s.length=0},a=CO(()=>[yH(t),mj(r)],([e,t])=>{o(),e&&s.push(...n.flatMap(n=>i.map(i=>((e,t,n,i)=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)))(e,n,i,t))))},{immediate:!0,flush:"post"}),l=()=>{a(),o()};return yj(l),l}let TH=!1;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function xH(e,t=!1){const n=_I(),i=()=>n.value=Boolean(e());return i(),function(e,t=!0){NM()?YS(e):t?e():oA(e)}(i,t),n}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function EH(e){return JSON.parse(JSON.stringify(e))}const wH="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},IH="__vueuse_ssr_handlers__";wH[IH]=wH[IH]||{};wH[IH];Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var AH=Object.getOwnPropertySymbols,SH=Object.prototype.hasOwnProperty,CH=Object.prototype.propertyIsEnumerable;function OH(e,t,n={}){const i=n,{window:r=vH}=i,s=((e,t)=>{var n={};for(var i in e)SH.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&AH)for(var i of AH(e))t.indexOf(i)<0&&CH.call(e,i)&&(n[i]=e[i]);return n})(i,["window"]);let o;const a=xH(()=>r&&"ResizeObserver"in r),l=()=>{o&&(o.disconnect(),o=void 0)},u=CO(()=>yH(e),e=>{l(),a.value&&r&&e&&(o=new ResizeObserver(t),o.observe(e,s))},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return yj(c),{isSupported:a,stop:c}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function MH(e,t={width:0,height:0},n={}){const{window:i=vH,box:r="content-box"}=n,s=tk(()=>{var t,n;return null==(n=null==(t=yH(e))?void 0:t.namespaceURI)?void 0:n.includes("svg")}),o=_I(t.width),a=_I(t.height);return OH(e,([t])=>{const n="border-box"===r?t.borderBoxSize:"content-box"===r?t.contentBoxSize:t.devicePixelContentBoxSize;if(i&&s.value){const t=yH(e);if(t){const e=i.getComputedStyle(t);o.value=parseFloat(e.width),a.value=parseFloat(e.height)}}else if(n){const e=Array.isArray(n)?n:[n];o.value=e.reduce((e,{inlineSize:t})=>e+t,0),a.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,a.value=t.contentRect.height},n),CO(()=>yH(e),e=>{o.value=e?t.width:0,a.value=e?t.height:0}),{width:o,height:a}}new Map;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var kH,RH;(RH=kH||(kH={})).UP="UP",RH.RIGHT="RIGHT",RH.DOWN="DOWN",RH.LEFT="LEFT",RH.NONE="NONE";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var NH=Object.defineProperty,DH=Object.getOwnPropertySymbols,FH=Object.prototype.hasOwnProperty,LH=Object.prototype.propertyIsEnumerable,PH=(e,t,n)=>t in e?NH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))FH.call(t,n)&&PH(e,n,t[n]);if(DH)for(var n of DH(t))LH.call(t,n)&&PH(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function BH(e,t,n,i={}){var r,s,o;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d}=i,h=NM(),p=n||(null==h?void 0:h.emit)||(null==(r=null==h?void 0:h.$emit)?void 0:r.bind(h))||(null==(o=null==(s=null==h?void 0:h.proxy)?void 0:s.$emit)?void 0:o.bind(null==h?void 0:h.proxy));let f=u;t||(t="modelValue"),f=u||f||`update:${t.toString()}`;const m=e=>a?hj(a)?a(e):EH(e):e,g=()=>void 0!==e[t]?m(e[t]):d;if(l){const n=_I(g());return CO(()=>e[t],e=>n.value=m(e)),CO(n,n=>{(n!==e[t]||c)&&p(f,n)},{deep:c}),n}return tk({get:()=>g(),set(e){p(f,e)}})}const $H=oG({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:[String,Object,Array]},offset:{type:Array,default:[0,0]},badgeClass:{type:String}});var UH=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n};function VH(e,t="px"){return e?ej(e)||Gx(n=e)&&!Number.isNaN(Number(n))?`${e}${t}`:Gx(e)?e:void 0:"";var n}const zH=sS({name:"ElBadge"}),jH=sS({...zH,props:$H,setup(e,{expose:t}){const n=e,i=Zz("badge"),r=tk(()=>n.isDot?"":ej(n.value)&&ej(n.max)&&n.max{var e,t,i,r,s;return[{backgroundColor:n.color,marginRight:VH(-(null!=(t=null==(e=n.offset)?void 0:e[0])?t:0)),marginTop:VH(null!=(r=null==(i=n.offset)?void 0:i[1])?r:0)},null!=(s=n.badgeStyle)?s:{}]});return t({content:r}),(e,t)=>(iM(),uM("div",{class:xE(xI(i).b())},[uC(e.$slots,"default"),_M(Ak,{name:`${xI(i).namespace.value}-zoom-in-center`,persisted:""},{default:MA(()=>[kA(gM("sup",{class:xE([xI(i).e("content"),xI(i).em("content",e.type),xI(i).is("fixed",!!e.$slots.default),xI(i).is("dot",e.isDot),xI(i).is("hide-zero",!e.showZero&&0===n.value),e.badgeClass]),style:_E(xI(s))},[uC(e.$slots,"content",{value:xI(r)},()=>[TM($E(xI(r)),1)])],6),[[zk,!e.hidden&&(xI(r)||e.isDot||e.$slots.content)]])]),_:3},8,["name"])],2))}});const YH=bG(UH(jH,[["__file","badge.vue"]])),GH=oG({size:{type:[Number,String]},color:{type:String}}),HH=sS({name:"ElIcon",inheritAttrs:!1});const WH=bG(UH(sS({...HH,props:GH,setup(e){const t=e,n=Zz("icon"),i=tk(()=>{const{size:e,color:n}=t;return e||n?{fontSize:Qz(e)?void 0:VH(e),"--color":n}:{}});return(e,t)=>(iM(),uM("i",SM({class:xI(n).b(),style:xI(i)},e.$attrs),[uC(e.$slots,"default")],16))}}),[["__file","icon.vue"]])),XH=[String,Object,Function],qH={Close:HG,SuccessFilled:hH,InfoFilled:rH,WarningFilled:fH,CircleCloseFilled:BG},KH={primary:rH,success:hH,warning:fH,error:BG,info:rH},ZH={validating:oH,success:LG,error:UG},QH=["primary","success","info","warning","error"],JH=["top","top-left","top-right","bottom","bottom-left","bottom-right"],eW="top",tW={customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:dj?document.body:void 0},nW=oG({customClass:{type:String,default:tW.customClass},dangerouslyUseHTMLString:{type:Boolean,default:tW.dangerouslyUseHTMLString},duration:{type:Number,default:tW.duration},icon:{type:XH,default:tW.icon},id:{type:String,default:tW.id},message:{type:[String,Object,Function],default:tW.message},onClose:{type:Function,default:tW.onClose},showClose:{type:Boolean,default:tW.showClose},type:{type:String,values:QH,default:tW.type},plain:{type:Boolean,default:tW.plain},offset:{type:Number,default:tW.offset},placement:{type:String,values:JH,default:tW.placement},zIndex:{type:Number,default:tW.zIndex},grouping:{type:Boolean,default:tW.grouping},repeatNum:{type:Number,default:tW.repeatNum}}),iW=rI({}),rW=(e,t)=>{const{prev:n}=((e,t)=>{const n=iW[t]||[],i=n.findIndex(t=>t.id===e),r=n[i];let s;return i>0&&(s=n[i-1]),{current:r,prev:s}})(e,t);return n?n.vm.exposed.bottom.value:0},sW={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},oW=sS({name:"ElMessage"}),aW=sS({...oW,props:nW,emits:{destroy:()=>!0},setup(e,{expose:t,emit:n}){const i=e,{Close:r}=qH,s=_I(!1),{ns:o,zIndex:a}=function(e,t){const n=fG(),i=Zz(e,tk(()=>{var e;return(null==(e=n.value)?void 0:e.namespace)||Wz})),r=nG(tk(()=>{var e;return null==(e=n.value)?void 0:e.locale})),s=Ij(tk(()=>{var e;return(null==(e=n.value)?void 0:e.zIndex)||2e3})),o=tk(()=>{var e;return xI(t)||(null==(e=n.value)?void 0:e.size)||""});return mG(tk(()=>xI(n)||{})),{ns:i,locale:r,zIndex:s,size:o}}("message"),{currentZIndex:l,nextZIndex:u}=a,c=_I(),d=_I(!1),h=_I(0);let p;const f=tk(()=>i.type?"error"===i.type?"danger":i.type:"info"),m=tk(()=>{const e=i.type;return{[o.bm("icon",e)]:e&&KH[e]}}),g=tk(()=>i.icon||KH[i.type]||""),_=tk(()=>i.placement||eW),y=tk(()=>rW(i.id,_.value)),v=tk(()=>((e,t,n)=>(iW[n]||[]).findIndex(t=>t.id===e)>0?16:t)(i.id,i.offset,_.value)+y.value),b=tk(()=>h.value+v.value),T=tk(()=>_.value.includes("left")?o.is("left"):_.value.includes("right")?o.is("right"):o.is("center")),x=tk(()=>_.value.startsWith("top")?"top":"bottom"),E=tk(()=>({[x.value]:`${v.value}px`,zIndex:l.value}));function w(){0!==i.duration&&({stop:p}=bj(()=>{A()},i.duration))}function I(){null==p||p()}function A(){d.value=!1,oA(()=>{var e;s.value||(null==(e=i.onClose)||e.call(i),n("destroy"))})}return YS(()=>{w(),u(),d.value=!0}),CO(()=>i.repeatNum,()=>{I(),w()}),bH(document,"keydown",function({code:e}){e===sW.esc&&A()}),OH(c,()=>{h.value=c.value.getBoundingClientRect().height}),t({visible:d,bottom:b,close:A}),(e,t)=>(iM(),cM(Ak,{name:xI(o).b("fade"),onBeforeEnter:e=>s.value=!0,onBeforeLeave:e.onClose,onAfterLeave:t=>e.$emit("destroy"),persisted:""},{default:MA(()=>[kA(gM("div",{id:e.id,ref_key:"messageRef",ref:c,class:xE([xI(o).b(),{[xI(o).m(e.type)]:e.type},xI(o).is("closable",e.showClose),xI(o).is("plain",e.plain),xI(o).is("bottom","bottom"===xI(x)),xI(T),e.customClass]),style:_E(xI(E)),role:"alert",onMouseenter:I,onMouseleave:w},[e.repeatNum>1?(iM(),cM(xI(YH),{key:0,value:e.repeatNum,type:xI(f),class:xE(xI(o).e("badge"))},null,8,["value","type","class"])):EM("v-if",!0),xI(g)?(iM(),cM(xI(WH),{key:1,class:xE([xI(o).e("icon"),xI(m)])},{default:MA(()=>[(iM(),cM(iC(xI(g))))]),_:1},8,["class"])):EM("v-if",!0),uC(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(iM(),uM(ZO,{key:1},[EM(" Caution here, message could've been compromised, never use user's input as message "),gM("p",{class:xE(xI(o).e("content")),innerHTML:e.message},null,10,["innerHTML"])],2112)):(iM(),uM("p",{key:0,class:xE(xI(o).e("content"))},$E(e.message),3))]),e.showClose?(iM(),cM(xI(WH),{key:2,class:xE(xI(o).e("closeBtn")),onClick:YR(A,["stop"])},{default:MA(()=>[_M(xI(r))]),_:1},8,["class","onClick"])):EM("v-if",!0)],46,["id"]),[[zk,d.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var lW=UH(aW,[["__file","message.vue"]]);class uW extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function cW(e,t){throw new uW(`[${e}] ${t}`)}let dW=1;const hW=e=>{const t=!e||Gx(e)||dM(e)||Yx(e)?{message:e}:e,n={...tW,...t};return(e=>{if(e.appendTo){if(Gx(e.appendTo)){let t=document.querySelector(e.appendTo);tj(t)||(t=document.body),e.appendTo=t}}else e.appendTo=document.body})(n),(e=>{!e.placement&&Gx(yG.placement)&&yG.placement&&(e.placement=yG.placement),e.placement||(e.placement=eW),JH.includes(e.placement)||(e.placement,e.placement=eW)})(n),Jz(yG.grouping)&&!n.grouping&&(n.grouping=yG.grouping),ej(yG.duration)&&3e3===n.duration&&(n.duration=yG.duration),ej(yG.offset)&&16===n.offset&&(n.offset=yG.offset),Jz(yG.showClose)&&!n.showClose&&(n.showClose=yG.showClose),Jz(yG.plain)&&!n.plain&&(n.plain=yG.plain),n},pW=({appendTo:e,...t},n)=>{const i="message_"+dW++,r=t.onClose,s=document.createElement("div"),o={...t,id:i,onClose:()=>{null==r||r(),(e=>{const t=e.props.placement||eW,n=iW[t],i=n.indexOf(e);if(-1===i)return;n.splice(i,1);const{handler:r}=e;r.close()})(c)},onDestroy:()=>{QR(null,s)}},a=_M(lW,o,Yx(o.message)||dM(o.message)?{default:Yx(o.message)?o.message:()=>o.message}:null);a.appContext=n||fW._context,QR(a,s),e.appendChild(s.firstElementChild);const l=a.component,u={close:()=>{l.exposed.close()}},c={id:i,vnode:a,vm:l,handler:u,props:a.component.props};return c},fW=(e={},t)=>{if(!dj)return{close:()=>{}};const n=hW(e),i=(r=n.placement||eW,iW[r]||(iW[r]=rI([])),iW[r]);var r;if(n.grouping&&i.length){const e=i.find(({vnode:e})=>{var t;return(null==(t=e.props)?void 0:t.message)===n.message});if(e)return e.props.repeatNum+=1,e.props.type=n.type,e.handler}if(ej(yG.max)&&i.length>=yG.max)return{close:()=>{}};const s=pW(n,t);return i.push(s),s.handler};QH.forEach(e=>{fW[e]=(t={},n)=>{const i=hW(t);return fW({...i,type:e},n)}}),fW.closeAll=function(e){for(const t in iW)if($x(iW,t)){const n=[...iW[t]];for(const t of n)e&&e!==t.props.type||t.handler.close()}},fW.closeAllByPlacement=function(e){if(!iW[e])return;[...iW[e]].forEach(e=>e.handler.close())},fW._context=null;const mW=((e,t)=>(e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e))(fW,"$message"),gW=oG({layout:{type:String,default:"horizontal",values:["horizontal","vertical"]},lazy:Boolean}),_W=Symbol("splitterRootContextKey");function yW(e){return Number(e.slice(0,-1))/100}function vW(e){return Number(e.slice(0,-2))}function bW(e){return Gx(e)&&e.endsWith("%")}function TW(e){return Gx(e)&&e.endsWith("px")}function xW(e,t,n,i){function r(e,n){return bW(e)?yW(e)*t.value||0:TW(e)?vW(e):null!=e?e:n}const s=_I(0),o=_I(null);let a=[],l=Rx;const u=tk(()=>e.value.map(e=>[e.min,e.max]));CO(i,()=>{if(s.value){const e=new MouseEvent("mouseup",{bubbles:!0});window.dispatchEvent(e)}});const c=[];return{lazyOffset:s,onMoveStart:e=>{s.value=0,o.value={index:e,confirmed:!1},a=n.value},onMoving:(n,c)=>{var d,h;let p=null;if(!(o.value&&o.value.confirmed||0===c))if(c>0)p=n,o.value={index:n,confirmed:!0};else for(let e=n;e>=0;e-=1)if(a[e]>0){p=e,o.value={index:e,confirmed:!0};break}const f=null!=(h=null!=p?p:null==(d=o.value)?void 0:d.index)?h:n,m=[...a],g=f+1,_=r(u.value[f][0],0),y=r(u.value[g][0],0),v=r(u.value[f][1],t.value||0),b=r(u.value[g][1],t.value||0);let T=c;m[f]+T<_&&(T=_-m[f]),m[g]-Tv&&(T=v-m[f]),m[g]-T>b&&(T=m[g]-b),m[f]+=T,m[g]-=T,s.value=T,l=()=>{e.value.forEach((e,t)=>{e.size=m[t]}),l=Rx},i.value||l()},onMoveEnd:()=>{i.value&&l(),s.value=0,o.value=null,a=[]},movingIndex:o,onCollapse:(t,i)=>{c.length||c.push(...n.value);const r=n.value,s="start"===i?t:t+1,o="start"===i?t+1:t,a=r[s],l=r[o];if(0!==a&&0!==l)r[s]=0,r[o]+=a,c[t]=a;else{const e=a+l,n=c[t],i=e-n;r[o]=n,r[s]=i}e.value.forEach((e,t)=>{e.size=r[t]})}}}const EW=e=>{const t=Ux(e)?e:[e],n=[];return t.forEach(e=>{var t;Ux(e)?n.push(...EW(e)):dM(e)&&(null==(t=e.component)?void 0:t.subTree)?n.push(e,...EW(e.component.subTree)):dM(e)&&Ux(e.children)?n.push(...EW(e.children)):dM(e)&&2===e.shapeFlag?n.push(...EW(e.type())):n.push(e)}),n},wW=(e,t)=>{const n=yI({}),i=yI([]),r=new WeakMap,s=()=>{i.value=((e,t,n)=>{const i=EW(e.subTree).filter(e=>{var n;return dM(e)&&(null==(n=e.type)?void 0:n.name)===t&&!!e.component});return i.map(e=>e.component.uid).map(e=>n[e]).filter(e=>!!e)})(e,t,n.value)},o=e=>e.render(),a=sS({setup:(e,{slots:t})=>()=>(s(),t.default?nk(o,{render:t.default}):null)});return{children:i,addChild:e=>{n.value[e.uid]=e,TI(n),YS(()=>{const t=e.getVnode().el,i=t.parentNode;if(!r.has(i)){r.set(i,[]);const e=i.insertBefore.bind(i);i.insertBefore=(t,s)=>(r.get(i).some(e=>t===e||s===e)&&TI(n),e(t,s))}r.get(i).push(t)})},removeChild:e=>{delete n.value[e.uid],TI(n);const t=e.getVnode().el,i=t.parentNode,s=r.get(i),o=s.indexOf(t);s.splice(o,1)},ChildrenSorter:a}},IW=sS({name:"ElSplitter"}),AW=sS({...IW,props:gW,emits:["resizeStart","resize","resizeEnd","collapse"],setup(e,{emit:t}){const n=e,i=Zz("splitter"),r=kI(n,"layout"),s=kI(n,"lazy"),{containerEl:o,containerSize:a}=function(e){const t=_I(),{width:n,height:i}=MH(t);return{containerEl:t,containerSize:tk(()=>"horizontal"===e.value?n.value:i.value)}}(r),{removeChild:l,children:u,addChild:c,ChildrenSorter:d}=wW(NM(),"ElSplitterPanel");CO(u,()=>{u.value.forEach((e,t)=>{e.setIndex(t)})});const{percentSizes:h,pxSizes:p}=function(e,t){const n=tk(()=>e.value.map(e=>e.size)),i=tk(()=>e.value.length),r=_I([]);CO([n,i,t],()=>{var n;let s=[],o=0;for(let r=0;re+(t||0),0);if(a>1||!o){const e=1/a;s=s.map(t=>void 0===t?0:t*e)}else{const e=(1-a)/o;s=s.map(t=>void 0===t?e:t)}r.value=s});const s=e=>e*t.value,o=tk(()=>r.value.map(s));return{percentSizes:r,pxSizes:o}}(u,a),{lazyOffset:f,movingIndex:m,onMoveStart:g,onMoving:_,onMoveEnd:y,onCollapse:v}=xW(u,a,p,s),b=tk(()=>({[`--${i.b()}-bar-offset`]:s.value?`${f.value}px`:void 0}));return XC(_W,iI({panels:u,percentSizes:h,pxSizes:p,layout:r,lazy:s,movingIndex:m,containerSize:a,onMoveStart:e=>{g(e),t("resizeStart",e,p.value)},onMoving:(e,n)=>{_(e,n),s.value||t("resize",e,p.value)},onMoveEnd:async e=>{y(),await oA(),t("resizeEnd",e,p.value)},onCollapse:(e,n)=>{v(e,n),t("collapse",e,n,p.value)},registerPanel:c,unregisterPanel:l})),(e,t)=>(iM(),uM("div",{ref_key:"containerEl",ref:o,class:xE([xI(i).b(),xI(i).e(xI(r))]),style:_E(xI(b))},[uC(e.$slots,"default"),_M(xI(d)),EM(" Prevent iframe touch events from breaking "),xI(m)?(iM(),uM("div",{key:0,class:xE([xI(i).e("mask"),xI(i).e(`mask-${xI(r)}`)])},null,2)):EM("v-if",!0)],6))}});var SW=UH(AW,[["__file","splitter.vue"]]);function CW(e,t,n,i){return!!((null==e?void 0:e.collapsible.end)&&t>0)||!!((null==n?void 0:n.collapsible.start)&&0===i&&t>0)}const OW=sS({name:"ElSplitterBar"}),MW=sS({...OW,props:{index:{type:Number,required:!0},layout:{type:String,values:["horizontal","vertical"],default:"horizontal"},resizable:{type:Boolean,default:!0},lazy:Boolean,startCollapsible:Boolean,endCollapsible:Boolean},emits:["moveStart","moving","moveEnd","collapse"],setup(e,{emit:t}){const n=e,i=Zz("splitter-bar"),r=tk(()=>"horizontal"===n.layout),s=tk(()=>r.value?{width:0}:{height:0}),o=tk(()=>({width:r.value?"16px":"100%",height:r.value?"100%":"16px",cursor:n.resizable?r.value?"ew-resize":"ns-resize":"auto",touchAction:"none"})),a=tk(()=>{const e=i.e("dragger");return{[`${e}-horizontal`]:r.value,[`${e}-vertical`]:!r.value,[`${e}-active`]:!!l.value}}),l=_I(null),u=e=>{n.resizable&&(l.value=[e.pageX,e.pageY],t("moveStart",n.index),window.addEventListener("mouseup",p),window.addEventListener("mousemove",d))},c=e=>{if(n.resizable&&1===e.touches.length){e.preventDefault();const i=e.touches[0];l.value=[i.pageX,i.pageY],t("moveStart",n.index),window.addEventListener("touchend",f),window.addEventListener("touchmove",h)}},d=e=>{const{pageX:i,pageY:s}=e,o=i-l.value[0],a=s-l.value[1],u=r.value?o:a;t("moving",n.index,u)},h=e=>{if(1===e.touches.length){e.preventDefault();const i=e.touches[0],s=i.pageX-l.value[0],o=i.pageY-l.value[1],a=r.value?s:o;t("moving",n.index,a)}},p=()=>{l.value=null,window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),t("moveEnd",n.index)},f=()=>{l.value=null,window.removeEventListener("touchend",f),window.removeEventListener("touchmove",h),t("moveEnd",n.index)},m=tk(()=>r.value?AG:MG),g=tk(()=>r.value?CG:wG);return(n,r)=>(iM(),uM("div",{class:xE([xI(i).b()]),style:_E(xI(s))},[e.startCollapsible?(iM(),uM("div",{key:0,class:xE([xI(i).e("collapse-icon"),xI(i).e(`${e.layout}-collapse-icon-start`)]),onClick:n=>t("collapse",e.index,"start")},[uC(n.$slots,"start-collapsible",{},()=>[(iM(),cM(iC(xI(m)),{style:{width:"12px",height:"12px"}}))])],10,["onClick"])):EM("v-if",!0),gM("div",{class:xE([xI(i).e("dragger"),xI(a),xI(i).is("disabled",!e.resizable),xI(i).is("lazy",e.resizable&&e.lazy)]),style:_E(xI(o)),onMousedown:u,onTouchstart:c},null,38),e.endCollapsible?(iM(),uM("div",{key:1,class:xE([xI(i).e("collapse-icon"),xI(i).e(`${e.layout}-collapse-icon-end`)]),onClick:n=>t("collapse",e.index,"end")},[uC(n.$slots,"end-collapsible",{},()=>[(iM(),cM(iC(xI(g)),{style:{width:"12px",height:"12px"}}))])],10,["onClick"])):EM("v-if",!0)],6))}});var kW=UH(MW,[["__file","split-bar.vue"]]);const RW=oG({min:{type:[String,Number]},max:{type:[String,Number]},size:{type:[String,Number]},resizable:{type:Boolean,default:!0},collapsible:Boolean}),NW="ElSplitterPanel",DW=sS({name:NW}),FW=sS({...DW,props:RW,emits:["update:size"],setup(e,{emit:t}){const n=e,i=Zz("splitter-panel"),r=qC(_W);r||cW(NW,"usage: ");const{panels:s,layout:o,lazy:a,containerSize:l,pxSizes:u}=CI(r),{registerPanel:c,unregisterPanel:d,onCollapse:h,onMoveEnd:p,onMoveStart:f,onMoving:m}=r,g=_I(),_=NM(),y=_.uid,v=_I(0),b=tk(()=>s.value[v.value]),T=tk(()=>{var e;return b.value&&null!=(e=u.value[v.value])?e:0}),x=tk(()=>{var e;return b.value&&null!=(e=u.value[v.value+1])?e:0}),E=tk(()=>b.value?s.value[v.value+1]:null),w=tk(()=>{var e;return!!E.value&&(n.resizable&&(null==(e=E.value)?void 0:e.resizable)&&(0!==T.value||!n.min)&&(0!==x.value||!E.value.min))}),I=tk(()=>!!b.value&&v.value!==s.value.length-1),A=tk(()=>CW(b.value,T.value,E.value,x.value)),S=tk(()=>CW(E.value,x.value,b.value,T.value));function C(e){return bW(e)?yW(e)*l.value||0:TW(e)?vW(e):null!=e?e:0}let O=!1;CO(()=>n.size,()=>{if(!O&&b.value){if(!l.value)return void(b.value.size=n.size);const e=C(n.size),i=C(n.max),r=C(n.min),s=Math.min(Math.max(e,r||0),i||e);s!==e&&t("update:size",s),b.value.size=s}}),CO(()=>{var e;return null==(e=b.value)?void 0:e.size},e=>{e!==n.size&&(O=!0,t("update:size",e),oA(()=>O=!1))}),CO(()=>n.resizable,e=>{b.value&&(b.value.resizable=e)});const M=iI({el:g.value,uid:y,getVnode:()=>_.vnode,setIndex:e=>{v.value=e},...n,collapsible:tk(()=>{return(e=n.collapsible)&&Wx(e)?e:{start:!!e,end:!!e};var e})});return c(M),WS(()=>d(M)),(e,t)=>(iM(),uM(ZO,null,[gM("div",SM({ref_key:"panelEl",ref:g,class:[xI(i).b()],style:{flexBasis:`${xI(T)}px`}},e.$attrs),[uC(e.$slots,"default")],16),xI(I)?(iM(),cM(kW,{key:0,index:v.value,layout:xI(o),lazy:xI(a),resizable:xI(w),"start-collapsible":xI(A),"end-collapsible":xI(S),onMoveStart:xI(f),onMoving:xI(m),onMoveEnd:xI(p),onCollapse:xI(h)},{"start-collapsible":MA(()=>[uC(e.$slots,"start-collapsible")]),"end-collapsible":MA(()=>[uC(e.$slots,"end-collapsible")]),_:3},8,["index","layout","lazy","resizable","start-collapsible","end-collapsible","onMoveStart","onMoving","onMoveEnd","onCollapse"])):EM("v-if",!0)],64))}});var LW=UH(FW,[["__file","split-panel.vue"]]);const PW=bG(SW,{SplitPanel:LW}),BW=TG(LW),$W=Symbol("buttonGroupContextKey"),UW={prefix:Math.floor(1e4*Math.random()),current:0},VW=Symbol("elIdInjection"),zW=()=>NM()?qC(VW,UW):UW,jW=e=>{const t=zW(),n=Kz();return cj(()=>xI(e)||`${n.value}-id-${t.prefix}-${t.current++}`)},YW=Symbol("formContextKey"),GW=Symbol("formItemContextKey"),HW=()=>({form:qC(YW,void 0),formItem:qC(GW,void 0)}),WW=(e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:i})=>{n||(n=_I(!1)),i||(i=_I(!1));const r=NM(),s=_I();let o;const a=tk(()=>{var n;return!!(!e.label&&!e.ariaLabel&&t&&t.inputIds&&(null==(n=t.inputIds)?void 0:n.length)<=1)});return YS(()=>{o=CO([kI(e,"id"),n],([e,n])=>{const o=null!=e?e:n?void 0:jW().value;o!==s.value&&((null==t?void 0:t.removeInputId)&&!(()=>{let e=null==r?void 0:r.parent;for(;e;){if("ElFormItem"===e.type.name)return!1;if("ElLabelWrap"===e.type.name)return!0;e=e.parent}return!1})()&&(s.value&&t.removeInputId(s.value),(null==i?void 0:i.value)||n||!o||t.addInputId(o)),s.value=o)},{immediate:!0})}),XS(()=>{o&&o(),(null==t?void 0:t.removeInputId)&&s.value&&t.removeInputId(s.value)}),{isLabeledByFormItem:a,inputId:s}},XW=e=>{const t=NM();return tk(()=>{var n,i;return null==(i=null==(n=null==t?void 0:t.proxy)?void 0:n.$props)?void 0:i[e]})},qW=(e,t={})=>{const n=_I(void 0),i=t.prop?n:XW("size"),r=t.global?n:(()=>{const e=qC(uG,{});return tk(()=>xI(e.size)||"")})(),s=t.form?{size:void 0}:qC(YW,void 0),o=t.formItem?{size:void 0}:qC(GW,void 0);return tk(()=>i.value||xI(e)||(null==o?void 0:o.size)||(null==s?void 0:s.size)||r.value||"")},KW=e=>{const t=XW("disabled"),n=qC(YW,void 0);return tk(()=>t.value||xI(e)||(null==n?void 0:n.disabled)||!1)},ZW=(e,t)=>{(({from:e,replacement:t,scope:n,version:i,ref:r,type:s="API"},o)=>{CO(()=>xI(o),e=>{},{immediate:!0})})({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},tk(()=>"text"===e.type));const n=qC($W,void 0),i=fG("button"),{form:r}=HW(),s=qW(tk(()=>null==n?void 0:n.size)),o=KW(),a=_I(),l=wC(),u=tk(()=>{var t;return e.type||(null==n?void 0:n.type)||(null==(t=i.value)?void 0:t.type)||""}),c=tk(()=>{var t,n,r;return null!=(r=null!=(n=e.autoInsertSpace)?n:null==(t=i.value)?void 0:t.autoInsertSpace)&&r}),d=tk(()=>{var t,n,r;return null!=(r=null!=(n=e.plain)?n:null==(t=i.value)?void 0:t.plain)&&r}),h=tk(()=>{var t,n,r;return null!=(r=null!=(n=e.round)?n:null==(t=i.value)?void 0:t.round)&&r}),p=tk(()=>{var t,n,r;return null!=(r=null!=(n=e.text)?n:null==(t=i.value)?void 0:t.text)&&r}),f=tk(()=>"button"===e.tag?{ariaDisabled:o.value||e.loading,disabled:o.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),m=tk(()=>{var e;const t=null==(e=l.default)?void 0:e.call(l);if(c.value&&1===(null==t?void 0:t.length)){const e=t[0];if((null==e?void 0:e.type)===QO){const t=e.children;return/^\p{Unified_Ideograph}{2}$/u.test(t.trim())}}return!1});return{_disabled:o,_size:s,_type:u,_ref:a,_props:f,_plain:d,_round:h,_text:p,shouldAddSpace:m,handleClick:n=>{o.value||e.loading?n.stopPropagation():("reset"===e.nativeType&&(null==r||r.resetFields()),t("click",n))}}},QW=oG({size:lG,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:XH},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:XH,default:()=>oH},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:[String,Object],default:"button"}}),JW={click:e=>e instanceof MouseEvent};function eX(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function tX(e){return Math.min(1,Math.max(0,e))}function nX(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function iX(e){return e<=1?"".concat(100*Number(e),"%"):e}function rX(e){return 1===e.length?"0"+e:String(e)}function sX(e,t,n){e=eX(e,255),t=eX(t,255),n=eX(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),s=0,o=0,a=(i+r)/2;if(i===r)o=0,s=0;else{var l=i-r;switch(o=a>.5?l/(2-i-r):l/(i+r),i){case e:s=(t-n)/l+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function aX(e,t,n){e=eX(e,255),t=eX(t,255),n=eX(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),s=0,o=i,a=i-r,l=0===i?0:a/i;if(i===r)s=0;else{switch(i){case e:s=(t-n)/a+(t>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var r=pX(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=n.format)&&void 0!==i?i:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,i=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=nX(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=aX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=aX(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=sX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=sX(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),lX(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,i,r){var s=[rX(Math.round(e).toString(16)),rX(Math.round(t).toString(16)),rX(Math.round(n).toString(16)),rX(uX(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*eX(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*eX(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+lX(this.r,this.g,this.b,!1),t=0,n=Object.entries(hX);t=0;return t||!i||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=tX(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=tX(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=tX(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=tX(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var i=this.toRgb(),r=new e(t).toRgb(),s=n/100;return new e({r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var i=this.toHsl(),r=360/n,s=[this];for(i.h=(i.h-(r*t>>1)+720)%360;--t;)i.h=(i.h+r)%360,s.push(new e(i));return s},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),i=n.h,r=n.s,s=n.v,o=[],a=1/t;t--;)o.push(new e({h:i,s:r,v:s})),s=(s+a)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),i=new e(t).toRgb(),r=n.a+i.a*(1-n.a);return new e({r:(n.r*n.a+i.r*i.a*(1-n.a))/r,g:(n.g*n.a+i.g*i.a*(1-n.a))/r,b:(n.b*n.a+i.b*i.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),i=n.h,r=[this],s=360/t,o=1;o{let i={},r=e.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new vX(r),a=e.dark?o.tint(20).toString():bX(o,20);if(e.plain)i=n.cssVarBlock({"bg-color":e.dark?bX(o,90):o.tint(90).toString(),"text-color":r,"border-color":e.dark?bX(o,50):o.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(i[n.cssVarBlockName("disabled-bg-color")]=e.dark?bX(o,90):o.tint(90).toString(),i[n.cssVarBlockName("disabled-text-color")]=e.dark?bX(o,50):o.tint(50).toString(),i[n.cssVarBlockName("disabled-border-color")]=e.dark?bX(o,80):o.tint(80).toString());else{const s=e.dark?bX(o,30):o.tint(30).toString(),l=o.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(i=n.cssVarBlock({"bg-color":r,"text-color":l,"border-color":r,"hover-bg-color":s,"hover-text-color":l,"hover-border-color":s,"active-bg-color":a,"active-border-color":a}),t.value){const t=e.dark?bX(o,50):o.tint(50).toString();i[n.cssVarBlockName("disabled-bg-color")]=t,i[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,i[n.cssVarBlockName("disabled-border-color")]=t}}}return i})}(i),s=Zz("button"),{_ref:o,_size:a,_type:l,_disabled:u,_props:c,_plain:d,_round:h,_text:p,shouldAddSpace:f,handleClick:m}=ZW(i,n),g=tk(()=>[s.b(),s.m(l.value),s.m(a.value),s.is("disabled",u.value),s.is("loading",i.loading),s.is("plain",d.value),s.is("round",h.value),s.is("circle",i.circle),s.is("text",p.value),s.is("link",i.link),s.is("has-bg",i.bg)]);return t({ref:o,size:a,type:l,disabled:u,shouldAddSpace:f}),(e,t)=>(iM(),cM(iC(e.tag),SM({ref_key:"_ref",ref:o},xI(c),{class:xI(g),style:xI(r),onClick:xI(m)}),{default:MA(()=>[e.loading?(iM(),uM(ZO,{key:0},[e.$slots.loading?uC(e.$slots,"loading",{key:0}):(iM(),cM(xI(WH),{key:1,class:xE(xI(s).is("loading"))},{default:MA(()=>[(iM(),cM(iC(e.loadingIcon)))]),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?(iM(),cM(xI(WH),{key:1},{default:MA(()=>[e.icon?(iM(),cM(iC(e.icon),{key:0})):uC(e.$slots,"icon",{key:1})]),_:3})):EM("v-if",!0),e.$slots.default?(iM(),uM("span",{key:2,class:xE({[xI(s).em("text","expand")]:xI(f)})},[uC(e.$slots,"default")],2)):EM("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var EX=UH(xX,[["__file","button.vue"]]);const wX={size:QW.size,type:QW.type},IX=sS({name:"ElButtonGroup"});var AX=UH(sS({...IX,props:wX,setup(e){const t=e;XC($W,iI({size:kI(t,"size"),type:kI(t,"type")}));const n=Zz("button");return(e,t)=>(iM(),uM("div",{class:xE(xI(n).b("group"))},[uC(e.$slots,"default")],2))}}),[["__file","button-group.vue"]]);const SX=bG(EX,{ButtonGroup:AX}),CX=(TG(AX),oG({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:[String,Object,Array],default:""},headerClass:String,bodyClass:String,footerClass:String,shadow:{type:String,values:["always","hover","never"],default:void 0}})),OX=(Symbol("cardContextKey"),sS({name:"ElCard"})),MX=sS({...OX,props:CX,setup(e){const t=fG("card"),n=Zz("card");return(e,i)=>{var r;return iM(),uM("div",{class:xE([xI(n).b(),xI(n).is(`${e.shadow||(null==(r=xI(t))?void 0:r.shadow)||"always"}-shadow`)])},[e.$slots.header||e.header?(iM(),uM("div",{key:0,class:xE([xI(n).e("header"),e.headerClass])},[uC(e.$slots,"header",{},()=>[TM($E(e.header),1)])],2)):EM("v-if",!0),gM("div",{class:xE([xI(n).e("body"),e.bodyClass]),style:_E(e.bodyStyle)},[uC(e.$slots,"default")],6),e.$slots.footer||e.footer?(iM(),uM("div",{key:1,class:xE([xI(n).e("footer"),e.footerClass])},[uC(e.$slots,"footer",{},()=>[TM($E(e.footer),1)])],2)):EM("v-if",!0)],2)}}});const kX=bG(UH(MX,[["__file","card.vue"]]));var RX=__webpack_require__(4213),NX=__webpack_require__(71710),DX=__webpack_require__.n(NX);const FX=function(e){return null==e};let LX;const PX={height:"0",visibility:"hidden",overflow:dj&&/firefox/i.test(window.navigator.userAgent)?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},BX=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"];function $X(e,t=1,n){var i,r;LX||(LX=document.createElement("textarea"),(null!=(i=e.parentNode)?i:document.body).appendChild(LX));const{paddingSize:s,borderSize:o,boxSizing:a,contextStyle:l}=function(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),i=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:BX.map(e=>[e,t.getPropertyValue(e)]),paddingSize:i,borderSize:r,boxSizing:n}}(e);l.forEach(([e,t])=>null==LX?void 0:LX.style.setProperty(e,t)),Object.entries(PX).forEach(([e,t])=>null==LX?void 0:LX.style.setProperty(e,t,"important")),LX.value=e.value||e.placeholder||"";let u=LX.scrollHeight;const c={};"border-box"===a?u+=o:"content-box"===a&&(u-=s),LX.value="";const d=LX.scrollHeight-s;if(ej(t)){let e=d*t;"border-box"===a&&(e=e+s+o),u=Math.max(e,u),c.minHeight=`${e}px`}if(ej(n)){let e=d*n;"border-box"===a&&(e=e+s+o),u=Math.min(e,u)}return c.height=`${u}px`,null==(r=LX.parentNode)||r.removeChild(LX),LX=void 0,c}var UX=function(){try{var e=oY(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const VX=UX;const zX=function(e,t,n){"__proto__"==t&&VX?VX(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var jX=Object.prototype.hasOwnProperty;const YX=function(e,t,n){var i=e[t];jX.call(e,t)&&yY(i,n)&&(void 0!==n||t in e)||zX(e,t,n)};var GX=/^(?:0|[1-9]\d*)$/;const HX=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&GX.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};const nq=function(e,t,n){for(var i=-1,r=(t=XY(t,e)).length,s=!1;++i0&&i(l)?n>1?e(l,n-1,i,r,s):sq(s,l):r||(s[s.length]=l)}return s};const uq=function(e){return(null==e?0:e.length)?lq(e,1):[]};const cq=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var dq=Math.max;const hq=function(e,t,n){return t=dq(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=dq(i.length-t,0),o=Array(s);++r0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}};const yq=_q(mq);const vq=function(e){return yq(hq(e,void 0,uq),e+"")};var bq=vq(function(e,t){return null==e?{}:rq(e,t)});const Tq=bq,xq=oG({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Eq=e=>Tq(xq,e),wq="update:modelValue",Iq="change",Aq="input",Sq=oG({id:{type:String,default:void 0},size:lG,disabled:Boolean,modelValue:{type:[String,Number,Object],default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:XH,default:UG},showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:XH},prefixIcon:{type:XH},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Object,Array,String],default:()=>({})},autofocus:Boolean,rows:{type:Number,default:2},...Eq(["ariaLabel"]),inputmode:{type:String,default:void 0},name:String}),Cq={[wq]:e=>Gx(e),input:e=>Gx(e),change:e=>Gx(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Oq=["class","style"],Mq=/^on[A-Z]/,kq=(e={})=>{const{excludeListeners:t=!1,excludeKeys:n}=e,i=tk(()=>((null==n?void 0:n.value)||[]).concat(Oq)),r=NM();return tk(r?()=>{var e;return iG(Object.entries(null==(e=r.proxy)?void 0:e.$attrs).filter(([e])=>!(i.value.includes(e)||t&&Mq.test(e))))}:()=>({}))},Rq=e=>"undefined"!=typeof Element&&e instanceof Element,Nq=e=>{if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return!("hidden"===e.type||"file"===e.type);case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Dq=(e,t)=>{if(!e||!e.focus)return;let n=!1;!Rq(e)||Nq(e)||e.getAttribute("tabindex")||(e.setAttribute("tabindex","-1"),n=!0),e.focus(t),Rq(e)&&n&&e.removeAttribute("tabindex")};const Fq=sS({name:"ElInput",inheritAttrs:!1}),Lq=sS({...Fq,props:Sq,emits:Cq,setup(e,{expose:t,emit:n}){const i=e,r=IC(),s=kq(),o=wC(),a=tk(()=>["textarea"===i.type?m.b():f.b(),f.m(h.value),f.is("disabled",p.value),f.is("exceed",B.value),{[f.b("group")]:o.prepend||o.append,[f.m("prefix")]:o.prefix||i.prefixIcon,[f.m("suffix")]:o.suffix||i.suffixIcon||i.clearable||i.showPassword,[f.bm("suffix","password-clear")]:D.value&&F.value,[f.b("hidden")]:"hidden"===i.type},r.class]),l=tk(()=>[f.e("wrapper"),f.is("focus",w.value)]),{form:u,formItem:c}=HW(),{inputId:d}=WW(i,{formItemContext:c}),h=qW(),p=KW(),f=Zz("input"),m=Zz("textarea"),g=yI(),_=yI(),y=_I(!1),v=_I(!1),b=_I(),T=yI(i.inputStyle),x=tk(()=>g.value||_.value),{wrapperRef:E,isFocused:w,handleFocus:I,handleBlur:A}=function(e,{disabled:t,beforeFocus:n,afterFocus:i,beforeBlur:r,afterBlur:s}={}){const o=NM(),{emit:a}=o,l=yI(),u=_I(!1),c=e=>{const r=!!Yx(n)&&n(e);xI(t)||u.value||r||(u.value=!0,a("focus",e),null==i||i())},d=e=>{var n;const i=!!Yx(r)&&r(e);xI(t)||e.relatedTarget&&(null==(n=l.value)?void 0:n.contains(e.relatedTarget))||i||(u.value=!1,a("blur",e),null==s||s())};return CO([l,()=>xI(t)],([e,t])=>{e&&(t?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1"))}),bH(l,"focus",c,!0),bH(l,"blur",d,!0),bH(l,"click",n=>{var i,r;xI(t)||Nq(n.target)||(null==(i=l.value)?void 0:i.contains(document.activeElement))&&l.value!==document.activeElement||null==(r=e.value)||r.focus()},!0),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:d}}(x,{disabled:p,afterBlur(){var e;i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"blur").catch(e=>{}))}}),S=tk(()=>{var e;return null!=(e=null==u?void 0:u.statusIcon)&&e}),C=tk(()=>(null==c?void 0:c.validateState)||""),O=tk(()=>C.value&&ZH[C.value]),M=tk(()=>v.value?pH:nH),k=tk(()=>[r.style]),R=tk(()=>[i.inputStyle,T.value,{resize:i.resize}]),N=tk(()=>FX(i.modelValue)?"":String(i.modelValue)),D=tk(()=>i.clearable&&!p.value&&!i.readonly&&!!N.value&&(w.value||y.value)),F=tk(()=>i.showPassword&&!p.value&&!!N.value),L=tk(()=>i.showWordLimit&&!!i.maxlength&&("text"===i.type||"textarea"===i.type)&&!p.value&&!i.readonly&&!i.showPassword),P=tk(()=>N.value.length),B=tk(()=>!!L.value&&P.value>Number(i.maxlength)),$=tk(()=>!!o.suffix||!!i.suffixIcon||D.value||i.showPassword||L.value||!!C.value&&S.value),[U,V]=function(e){let t;return[function(){if(null==e.value)return;const{selectionStart:n,selectionEnd:i,value:r}=e.value;if(null==n||null==i)return;const s=r.slice(0,Math.max(0,n)),o=r.slice(Math.max(0,i));t={selectionStart:n,selectionEnd:i,value:r,beforeTxt:s,afterTxt:o}},function(){if(null==e.value||null==t)return;const{value:n}=e.value,{beforeTxt:i,afterTxt:r,selectionStart:s}=t;if(null==i||null==r||null==s)return;let o=n.length;if(n.endsWith(r))o=n.length-r.length;else if(n.startsWith(i))o=i.length;else{const e=i[s-1],t=n.indexOf(e,s-1);-1!==t&&(o=t+1)}e.value.setSelectionRange(o,o)}]}(g);OH(_,e=>{if(j(),!L.value||"both"!==i.resize)return;const t=e[0],{width:n}=t.contentRect;b.value={right:`calc(100% - ${n+15+6}px)`}});const z=()=>{const{type:e,autosize:t}=i;if(dj&&"textarea"===e&&_.value)if(t){const e=Wx(t)?t.minRows:void 0,n=Wx(t)?t.maxRows:void 0,i=$X(_.value,e,n);T.value={overflowY:"hidden",...i},oA(()=>{_.value.offsetHeight,T.value=i})}else T.value={minHeight:$X(_.value).minHeight}},j=(e=>{let t=!1;return()=>{var n;if(t||!i.autosize)return;null===(null==(n=_.value)?void 0:n.offsetParent)||(setTimeout(e),t=!0)}})(z),Y=()=>{const e=x.value,t=i.formatter?i.formatter(N.value):N.value;e&&e.value!==t&&(e.value=t)},G=async e=>{U();let{value:t}=e.target;i.formatter&&i.parser&&(t=i.parser(t)),W.value||(t!==N.value?(n(wq,t),n(Aq,t),await oA(),Y(),V()):Y())},H=e=>{let{value:t}=e.target;i.formatter&&i.parser&&(t=i.parser(t)),n(Iq,t)},{isComposing:W,handleCompositionStart:X,handleCompositionUpdate:q,handleCompositionEnd:K}=function({afterComposition:e,emit:t}){const n=_I(!1),i=e=>{var i;null==t||t("compositionupdate",e);const r=null==(i=e.target)?void 0:i.value,s=r[r.length-1]||"";n.value=!(e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e))(s)},r=i=>{null==t||t("compositionend",i),n.value&&(n.value=!1,oA(()=>e(i)))};return{isComposing:n,handleComposition:e=>{"compositionend"===e.type?r(e):i(e)},handleCompositionStart:e=>{null==t||t("compositionstart",e),n.value=!0},handleCompositionUpdate:i,handleCompositionEnd:r}}({emit:n,afterComposition:G}),Z=()=>{U(),v.value=!v.value,setTimeout(V)},Q=e=>{y.value=!1,n("mouseleave",e)},J=e=>{y.value=!0,n("mouseenter",e)},ee=e=>{n("keydown",e)},te=()=>{n(wq,""),n(Iq,""),n("clear"),n(Aq,"")};return CO(()=>i.modelValue,()=>{var e;oA(()=>z()),i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"change").catch(e=>{}))}),CO(N,()=>Y()),CO(()=>i.type,async()=>{await oA(),Y(),z()}),YS(()=>{!i.formatter&&i.parser,Y(),oA(z)}),t({input:g,textarea:_,ref:x,textareaStyle:R,autosize:kI(i,"autosize"),isComposing:W,focus:()=>{var e;return null==(e=x.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=x.value)?void 0:e.blur()},select:()=>{var e;null==(e=x.value)||e.select()},clear:te,resizeTextarea:z}),(e,t)=>(iM(),uM("div",{class:xE([xI(a),{[xI(f).bm("group","append")]:e.$slots.append,[xI(f).bm("group","prepend")]:e.$slots.prepend}]),style:_E(xI(k)),onMouseenter:J,onMouseleave:Q},[EM(" input "),"textarea"!==e.type?(iM(),uM(ZO,{key:0},[EM(" prepend slot "),e.$slots.prepend?(iM(),uM("div",{key:0,class:xE(xI(f).be("group","prepend"))},[uC(e.$slots,"prepend")],2)):EM("v-if",!0),gM("div",{ref_key:"wrapperRef",ref:E,class:xE(xI(l))},[EM(" prefix slot "),e.$slots.prefix||e.prefixIcon?(iM(),uM("span",{key:0,class:xE(xI(f).e("prefix"))},[gM("span",{class:xE(xI(f).e("prefix-inner"))},[uC(e.$slots,"prefix"),e.prefixIcon?(iM(),cM(xI(WH),{key:0,class:xE(xI(f).e("icon"))},{default:MA(()=>[(iM(),cM(iC(e.prefixIcon)))]),_:1},8,["class"])):EM("v-if",!0)],2)],2)):EM("v-if",!0),gM("input",SM({id:xI(d),ref_key:"input",ref:g,class:xI(f).e("inner")},xI(s),{name:e.name,minlength:e.minlength,maxlength:e.maxlength,type:e.showPassword?v.value?"text":"password":e.type,disabled:xI(p),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:xI(X),onCompositionupdate:xI(q),onCompositionend:xI(K),onInput:G,onChange:H,onKeydown:ee}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),EM(" suffix slot "),xI($)?(iM(),uM("span",{key:1,class:xE(xI(f).e("suffix"))},[gM("span",{class:xE(xI(f).e("suffix-inner"))},[xI(D)&&xI(F)&&xI(L)?EM("v-if",!0):(iM(),uM(ZO,{key:0},[uC(e.$slots,"suffix"),e.suffixIcon?(iM(),cM(xI(WH),{key:0,class:xE(xI(f).e("icon"))},{default:MA(()=>[(iM(),cM(iC(e.suffixIcon)))]),_:1},8,["class"])):EM("v-if",!0)],64)),xI(D)?(iM(),cM(xI(WH),{key:1,class:xE([xI(f).e("icon"),xI(f).e("clear")]),onMousedown:YR(xI(Rx),["prevent"]),onClick:te},{default:MA(()=>[(iM(),cM(iC(e.clearIcon)))]),_:1},8,["class","onMousedown"])):EM("v-if",!0),xI(F)?(iM(),cM(xI(WH),{key:2,class:xE([xI(f).e("icon"),xI(f).e("password")]),onClick:Z},{default:MA(()=>[(iM(),cM(iC(xI(M))))]),_:1},8,["class"])):EM("v-if",!0),xI(L)?(iM(),uM("span",{key:3,class:xE(xI(f).e("count"))},[gM("span",{class:xE(xI(f).e("count-inner"))},$E(xI(P))+" / "+$E(e.maxlength),3)],2)):EM("v-if",!0),xI(C)&&xI(O)&&xI(S)?(iM(),cM(xI(WH),{key:4,class:xE([xI(f).e("icon"),xI(f).e("validateIcon"),xI(f).is("loading","validating"===xI(C))])},{default:MA(()=>[(iM(),cM(iC(xI(O))))]),_:1},8,["class"])):EM("v-if",!0)],2)],2)):EM("v-if",!0)],2),EM(" append slot "),e.$slots.append?(iM(),uM("div",{key:1,class:xE(xI(f).be("group","append"))},[uC(e.$slots,"append")],2)):EM("v-if",!0)],64)):(iM(),uM(ZO,{key:1},[EM(" textarea "),gM("textarea",SM({id:xI(d),ref_key:"textarea",ref:_,class:[xI(m).e("inner"),xI(f).is("focus",xI(w))]},xI(s),{minlength:e.minlength,maxlength:e.maxlength,tabindex:e.tabindex,disabled:xI(p),readonly:e.readonly,autocomplete:e.autocomplete,style:xI(R),"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,onCompositionstart:xI(X),onCompositionupdate:xI(q),onCompositionend:xI(K),onInput:G,onFocus:xI(I),onBlur:xI(A),onChange:H,onKeydown:ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),xI(L)?(iM(),uM("span",{key:0,style:_E(b.value),class:xE(xI(f).e("count"))},$E(xI(P))+" / "+$E(e.maxlength),7)):EM("v-if",!0)],64))],38))}});const Pq=bG(UH(Lq,[["__file","input.vue"]])),Bq=Symbol("popper"),$q=Symbol("popperContent"),Uq=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],Vq=oG({role:{type:String,values:Uq,default:"tooltip"}}),zq=sS({name:"ElPopper",inheritAttrs:!1});const jq=bG(UH(sS({...zq,props:Vq,setup(e,{expose:t}){const n=e,i={triggerRef:_I(),popperInstanceRef:_I(),contentRef:_I(),referenceRef:_I(),role:tk(()=>n.role)};return t(i),XC(Bq,i),(e,t)=>uC(e.$slots,"default")}}),[["__file","popper.vue"]])),Yq=Symbol("elTooltip");var Gq="top",Hq="bottom",Wq="right",Xq="left",qq="auto",Kq=[Gq,Hq,Wq,Xq],Zq="start",Qq="end",Jq="viewport",eK="popper",tK=Kq.reduce(function(e,t){return e.concat([t+"-"+Zq,t+"-"+Qq])},[]),nK=[].concat(Kq,[qq]).reduce(function(e,t){return e.concat([t,t+"-"+Zq,t+"-"+Qq])},[]),iK=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function rK(e){return e?(e.nodeName||"").toLowerCase():null}function sK(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function oK(e){return e instanceof sK(e).Element||e instanceof Element}function aK(e){return e instanceof sK(e).HTMLElement||e instanceof HTMLElement}function lK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof sK(e).ShadowRoot||e instanceof ShadowRoot)}var uK={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!aK(r)||!rK(r)||(Object.assign(r.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});!aK(i)||!rK(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]};function cK(e){return e.split("-")[0]}var dK=Math.max,hK=Math.min,pK=Math.round;function fK(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),i=1,r=1;if(aK(e)&&t){var s=e.offsetHeight,o=e.offsetWidth;o>0&&(i=pK(n.width)/o||1),s>0&&(r=pK(n.height)/s||1)}return{width:n.width/i,height:n.height/r,top:n.top/r,right:n.right/i,bottom:n.bottom/r,left:n.left/i,x:n.left/i,y:n.top/r}}function mK(e){var t=fK(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function gK(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&lK(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function _K(e){return sK(e).getComputedStyle(e)}function yK(e){return["table","td","th"].indexOf(rK(e))>=0}function vK(e){return((oK(e)?e.ownerDocument:e.document)||window.document).documentElement}function bK(e){return"html"===rK(e)?e:e.assignedSlot||e.parentNode||(lK(e)?e.host:null)||vK(e)}function TK(e){return aK(e)&&"fixed"!==_K(e).position?e.offsetParent:null}function xK(e){for(var t=sK(e),n=TK(e);n&&yK(n)&&"static"===_K(n).position;)n=TK(n);return n&&("html"===rK(n)||"body"===rK(n)&&"static"===_K(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&aK(e)&&"fixed"===_K(e).position)return null;var n=bK(e);for(lK(n)&&(n=n.host);aK(n)&&["html","body"].indexOf(rK(n))<0;){var i=_K(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function EK(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wK(e,t,n){return dK(e,hK(t,n))}function IK(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function AK(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var SK={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=cK(n.placement),l=EK(a),u=[Xq,Wq].indexOf(a)>=0?"height":"width";if(s&&o){var c=function(e,t){return IK("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:AK(e,Kq))}(r.padding,n),d=mK(s),h="y"===l?Gq:Xq,p="y"===l?Hq:Wq,f=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],m=o[l]-n.rects.reference[l],g=xK(s),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,v=c[h],b=_-d[u]-c[p],T=_/2-d[u]/2+y,x=wK(v,T,b),E=l;n.modifiersData[i]=((t={})[E]=x,t.centerOffset=x-T,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"==typeof i&&!(i=t.elements.popper.querySelector(i))||!gK(t.elements.popper,i)||(t.elements.arrow=i))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function CK(e){return e.split("-")[1]}var OK={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MK(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,m=void 0===f?0:f,g="function"==typeof c?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var _=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),v=Xq,b=Gq,T=window;if(u){var x=xK(n),E="clientHeight",w="clientWidth";if(x===sK(n)&&("static"!==_K(x=vK(n)).position&&"absolute"===a&&(E="scrollHeight",w="scrollWidth")),r===Gq||(r===Xq||r===Wq)&&s===Qq)b=Hq,m-=(d&&x===T&&T.visualViewport?T.visualViewport.height:x[E])-i.height,m*=l?1:-1;if(r===Xq||(r===Gq||r===Hq)&&s===Qq)v=Wq,p-=(d&&x===T&&T.visualViewport?T.visualViewport.width:x[w])-i.width,p*=l?1:-1}var I,A=Object.assign({position:a},u&&OK),S=!0===c?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:pK(t*i)/i||0,y:pK(n*i)/i||0}}({x:p,y:m}):{x:p,y:m};return p=S.x,m=S.y,l?Object.assign({},A,((I={})[b]=y?"0":"",I[v]=_?"0":"",I.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I)):Object.assign({},A,((t={})[b]=y?m+"px":"",t[v]=_?p+"px":"",t.transform="",t))}var kK={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,l=void 0===a||a,u={placement:cK(t.placement),variation:CK(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,MK(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,MK(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},RK={passive:!0};var NK={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=void 0===r||r,o=i.resize,a=void 0===o||o,l=sK(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&u.forEach(function(e){e.addEventListener("scroll",n.update,RK)}),a&&l.addEventListener("resize",n.update,RK),function(){s&&u.forEach(function(e){e.removeEventListener("scroll",n.update,RK)}),a&&l.removeEventListener("resize",n.update,RK)}},data:{}},DK={left:"right",right:"left",bottom:"top",top:"bottom"};function FK(e){return e.replace(/left|right|bottom|top/g,function(e){return DK[e]})}var LK={start:"end",end:"start"};function PK(e){return e.replace(/start|end/g,function(e){return LK[e]})}function BK(e){var t=sK(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $K(e){return fK(vK(e)).left+BK(e).scrollLeft}function UK(e){var t=_K(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function VK(e){return["html","body","#document"].indexOf(rK(e))>=0?e.ownerDocument.body:aK(e)&&UK(e)?e:VK(bK(e))}function zK(e,t){var n;void 0===t&&(t=[]);var i=VK(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),s=sK(i),o=r?[s].concat(s.visualViewport||[],UK(i)?i:[]):i,a=t.concat(o);return r?a:a.concat(zK(bK(o)))}function jK(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function YK(e,t){return t===Jq?jK(function(e){var t=sK(e),n=vK(e),i=t.visualViewport,r=n.clientWidth,s=n.clientHeight,o=0,a=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:r,height:s,x:o+$K(e),y:a}}(e)):oK(t)?function(e){var t=fK(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):jK(function(e){var t,n=vK(e),i=BK(e),r=null==(t=e.ownerDocument)?void 0:t.body,s=dK(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=dK(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+$K(e),l=-i.scrollTop;return"rtl"===_K(r||n).direction&&(a+=dK(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(vK(e)))}function GK(e,t,n){var i="clippingParents"===t?function(e){var t=zK(bK(e)),n=["absolute","fixed"].indexOf(_K(e).position)>=0&&aK(e)?xK(e):e;return oK(n)?t.filter(function(e){return oK(e)&&gK(e,n)&&"body"!==rK(e)}):[]}(e):[].concat(t),r=[].concat(i,[n]),s=r[0],o=r.reduce(function(t,n){var i=YK(e,n);return t.top=dK(i.top,t.top),t.right=hK(i.right,t.right),t.bottom=hK(i.bottom,t.bottom),t.left=dK(i.left,t.left),t},YK(e,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function HK(e){var t,n=e.reference,i=e.element,r=e.placement,s=r?cK(r):null,o=r?CK(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(s){case Gq:t={x:a,y:n.y-i.height};break;case Hq:t={x:a,y:n.y+n.height};break;case Wq:t={x:n.x+n.width,y:l};break;case Xq:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var u=s?EK(s):null;if(null!=u){var c="y"===u?"height":"width";switch(o){case Zq:t[u]=t[u]-(n[c]/2-i[c]/2);break;case Qq:t[u]=t[u]+(n[c]/2-i[c]/2)}}return t}function WK(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,l=void 0===a?Jq:a,u=n.elementContext,c=void 0===u?eK:u,d=n.altBoundary,h=void 0!==d&&d,p=n.padding,f=void 0===p?0:p,m=IK("number"!=typeof f?f:AK(f,Kq)),g=c===eK?"reference":eK,_=e.rects.popper,y=e.elements[h?g:c],v=GK(oK(y)?y:y.contextElement||vK(e.elements.popper),o,l),b=fK(e.elements.reference),T=HK({reference:b,element:_,strategy:"absolute",placement:r}),x=jK(Object.assign({},_,T)),E=c===eK?x:b,w={top:v.top-E.top+m.top,bottom:E.bottom-v.bottom+m.bottom,left:v.left-E.left+m.left,right:E.right-v.right+m.right},I=e.modifiersData.offset;if(c===eK&&I){var A=I[r];Object.keys(w).forEach(function(e){var t=[Wq,Hq].indexOf(e)>=0?1:-1,n=[Gq,Hq].indexOf(e)>=0?"y":"x";w[e]+=A[n]*t})}return w}var XK={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0===o||o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,_=cK(g),y=l||(_===g||!f?[FK(g)]:function(e){if(cK(e)===qq)return[];var t=FK(e);return[PK(e),t,PK(t)]}(g)),v=[g].concat(y).reduce(function(e,n){return e.concat(cK(n)===qq?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?nK:l,c=CK(i),d=c?a?tK:tK.filter(function(e){return CK(e)===c}):Kq,h=d.filter(function(e){return u.indexOf(e)>=0});0===h.length&&(h=d);var p=h.reduce(function(t,n){return t[n]=WK(e,{placement:n,boundary:r,rootBoundary:s,padding:o})[cK(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)},[]),b=t.rects.reference,T=t.rects.popper,x=new Map,E=!0,w=v[0],I=0;I=0,M=O?"width":"height",k=WK(t,{placement:A,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),R=O?C?Wq:Xq:C?Hq:Gq;b[M]>T[M]&&(R=FK(R));var N=FK(R),D=[];if(s&&D.push(k[S]<=0),a&&D.push(k[R]<=0,k[N]<=0),D.every(function(e){return e})){w=A,E=!1;break}x.set(A,D)}if(E)for(var F=function(e){var t=v.find(function(t){var n=x.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,"break"},L=f?3:1;L>0;L--){if("break"===F(L))break}t.placement!==w&&(t.modifiersData[i]._skip=!0,t.placement=w,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function qK(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function KK(e){return[Gq,Wq,Hq,Xq].some(function(t){return e[t]>=0})}var ZK={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=WK(t,{elementContext:"reference"}),a=WK(t,{altBoundary:!0}),l=qK(o,i),u=qK(a,r,s),c=KK(l),d=KK(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};var QK={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=void 0===r?[0,0]:r,o=nK.reduce(function(e,n){return e[n]=function(e,t,n){var i=cK(e),r=[Xq,Gq].indexOf(i)>=0?-1:1,s="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[Xq,Wq].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,s),e},{}),a=o[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[i]=o}};var JK={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=HK({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var eZ={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0!==o&&o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,h=n.tether,p=void 0===h||h,f=n.tetherOffset,m=void 0===f?0:f,g=WK(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),_=cK(t.placement),y=CK(t.placement),v=!y,b=EK(_),T=function(e){return"x"===e?"y":"x"}(b),x=t.modifiersData.popperOffsets,E=t.rects.reference,w=t.rects.popper,I="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,A="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,C={x:0,y:0};if(x){if(s){var O,M="y"===b?Gq:Xq,k="y"===b?Hq:Wq,R="y"===b?"height":"width",N=x[b],D=N+g[M],F=N-g[k],L=p?-w[R]/2:0,P=y===Zq?E[R]:w[R],B=y===Zq?-w[R]:-E[R],$=t.elements.arrow,U=p&&$?mK($):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=V[M],j=V[k],Y=wK(0,E[R],U[R]),G=v?E[R]/2-L-Y-z-A.mainAxis:P-Y-z-A.mainAxis,H=v?-E[R]/2+L+Y+j+A.mainAxis:B+Y+j+A.mainAxis,W=t.elements.arrow&&xK(t.elements.arrow),X=W?"y"===b?W.clientTop||0:W.clientLeft||0:0,q=null!=(O=null==S?void 0:S[b])?O:0,K=N+H-q,Z=wK(p?hK(D,N+G-q-X):D,N,p?dK(F,K):F);x[b]=Z,C[b]=Z-N}if(a){var Q,J="x"===b?Gq:Xq,ee="x"===b?Hq:Wq,te=x[T],ne="y"===T?"height":"width",ie=te+g[J],re=te-g[ee],se=-1!==[Gq,Xq].indexOf(_),oe=null!=(Q=null==S?void 0:S[T])?Q:0,ae=se?ie:te-E[ne]-w[ne]-oe+A.altAxis,le=se?te+E[ne]+w[ne]-oe-A.altAxis:re,ue=p&&se?function(e,t,n){var i=wK(e,t,n);return i>n?n:i}(ae,te,le):wK(p?ae:ie,te,p?le:re);x[T]=ue,C[T]=ue-te}t.modifiersData[i]=C}},requiresIfExists:["offset"]};function tZ(e,t,n){void 0===n&&(n=!1);var i=aK(t),r=aK(t)&&function(e){var t=e.getBoundingClientRect(),n=pK(t.width)/e.offsetWidth||1,i=pK(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),s=vK(t),o=fK(e,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==rK(t)||UK(s))&&(a=function(e){return e!==sK(e)&&aK(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):BK(e)}(t)),aK(t)?((l=fK(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=$K(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function nZ(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||r(e)}),i}function iZ(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var rZ={placement:"bottom",modifiers:[],strategy:"absolute"};function sZ(){for(var e=arguments.length,t=new Array(e),n=0;n({})},strategy:{type:String,values:["fixed","absolute"],default:"absolute"}}),cZ=oG({...uZ,...lZ,id:String,style:{type:[String,Array,Object]},className:{type:[String,Array,Object]},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:[String,Array,Object]},popperStyle:{type:[String,Array,Object]},referenceEl:{type:Object},triggerTargetEl:{type:Object},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Eq(["ariaLabel"])}),dZ={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},hZ=oG({to:{type:[String,Object],required:!0},disabled:Boolean});function pZ(){let e;const t=()=>window.clearTimeout(e);return yj(()=>t()),{registerTimeout:(n,i)=>{t(),e=window.setTimeout(n,i)},cancelTimeout:t}}const fZ=oG({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),mZ=oG({...fZ,...cZ,appendTo:{type:hZ.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Boolean,default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Eq(["ariaLabel"])}),gZ=oG({virtualRef:{type:Object},virtualTriggering:Boolean,onMouseenter:{type:Function},onMouseleave:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onContextmenu:{type:Function},id:String,open:Boolean}),_Z=oG({...gZ,disabled:Boolean,trigger:{type:[String,Array],default:"hover"},triggerKeys:{type:Array,default:()=>[sW.enter,sW.numpadEnter,sW.space]},focusOnTarget:Boolean}),yZ=sG({type:Boolean,default:null}),vZ=sG({type:Function}),bZ=e=>{const t=`update:${e}`,n=`onUpdate:${e}`,i=[t];return{useModelToggle:({indicator:i,toggleReason:r,shouldHideWhenRouteChanges:s,shouldProceed:o,onShow:a,onHide:l})=>{const u=NM(),{emit:c}=u,d=u.props,h=tk(()=>Yx(d[n])),p=tk(()=>null===d[e]),f=e=>{!0!==i.value&&(i.value=!0,r&&(r.value=e),Yx(a)&&a(e))},m=e=>{!1!==i.value&&(i.value=!1,r&&(r.value=e),Yx(l)&&l(e))},g=e=>{if(!0===d.disabled||Yx(o)&&!o())return;const n=h.value&&dj;n&&c(t,!0),!p.value&&n||f(e)},_=e=>{if(!0===d.disabled||!dj)return;const n=h.value&&dj;n&&c(t,!1),!p.value&&n||m(e)},y=e=>{Jz(e)&&(d.disabled&&e?h.value&&c(t,!1):i.value!==e&&(e?f():m()))};return CO(()=>d[e],y),s&&void 0!==u.appContext.config.globalProperties.$route&&CO(()=>({...u.proxy.$route}),()=>{s.value&&i.value&&_()}),YS(()=>{y(d[e])}),{hide:_,show:g,toggle:()=>{i.value?_():g()},hasUpdateHandler:h}},useModelToggleProps:{[e]:yZ,[n]:vZ},useModelToggleEmits:i}},{useModelToggle:TZ,useModelToggleProps:xZ,useModelToggleEmits:EZ}=bZ("modelValue"),{useModelToggleProps:wZ,useModelToggleEmits:IZ,useModelToggle:AZ}=bZ("visible"),SZ=oG({...Vq,...wZ,...mZ,..._Z,...lZ,showArrow:{type:Boolean,default:!0}}),CZ=[...IZ,"before-show","before-hide","show","hide","open","close"],OZ=(e,t,n)=>i=>{((e,t)=>Ux(e)?e.includes(t):e===t)(xI(e),t)&&n(i)},MZ=Symbol("elForwardRef"),kZ=sS({name:"ElOnlyChild",setup(e,{slots:t,attrs:n}){var i;const r=qC(MZ),s=(o=null!=(i=null==r?void 0:r.setForwardRef)?i:Rx,{mounted(e){o(e)},updated(e){o(e)},unmounted(){o(null)}});var o;return()=>{var e;const i=null==(e=t.default)?void 0:e.call(t,n);if(!i)return null;const[r,o]=RZ(i);return r?kA(bM(r,n),[[s]]):null}}});function RZ(e){if(!e)return[null,0];const t=e,n=t.filter(e=>e.type!==JO).length;for(const e of t){if(Wx(e))switch(e.type){case JO:continue;case QO:case"svg":return[NZ(e),n];case ZO:return RZ(e.children);default:return[e,n]}return[NZ(e),n]}return[null,0]}function NZ(e){const t=Zz("only-child");return _M("span",{class:t.e("content")},[e])}const DZ=sS({name:"ElPopperTrigger",inheritAttrs:!1}),FZ=sS({...DZ,props:gZ,setup(e,{expose:t}){const n=e,{role:i,triggerRef:r}=qC(Bq,void 0);var s;s=r,XC(MZ,{setForwardRef:e=>{s.value=e}});const o=tk(()=>l.value?n.id:void 0),a=tk(()=>{if(i&&"tooltip"===i.value)return n.open&&n.id?n.id:void 0}),l=tk(()=>{if(i&&"tooltip"!==i.value)return i.value}),u=tk(()=>l.value?`${n.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return YS(()=>{CO(()=>n.virtualRef,e=>{e&&(r.value=yH(e))},{immediate:!0}),CO(r,(e,t)=>{null==c||c(),c=void 0,tj(e)&&(d.forEach(i=>{var r;const s=n[i];s&&(e.addEventListener(i.slice(2).toLowerCase(),s,["onFocus","onBlur"].includes(i)),null==(r=null==t?void 0:t.removeEventListener)||r.call(t,i.slice(2).toLowerCase(),s,["onFocus","onBlur"].includes(i)))}),Nq(e)&&(c=CO([o,a,l,u],t=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((n,i)=>{FX(t[i])?e.removeAttribute(n):e.setAttribute(n,t[i])})},{immediate:!0}))),tj(t)&&Nq(t)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(e=>t.removeAttribute(e))},{immediate:!0})}),WS(()=>{if(null==c||c(),c=void 0,r.value&&tj(r.value)){const e=r.value;d.forEach(t=>{const i=n[t];i&&e.removeEventListener(t.slice(2).toLowerCase(),i,["onFocus","onBlur"].includes(t))}),r.value=void 0}}),t({triggerRef:r}),(e,t)=>e.virtualTriggering?EM("v-if",!0):(iM(),cM(xI(kZ),SM({key:0},e.$attrs,{"aria-controls":xI(o),"aria-describedby":xI(a),"aria-expanded":xI(u),"aria-haspopup":xI(l)}),{default:MA(()=>[uC(e.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var LZ=UH(FZ,[["__file","trigger.vue"]]);const PZ=(e,t,{checkForDefaultPrevented:n=!0}={})=>i=>{const r=null==e?void 0:e(i);if(!1===n||!r)return null==t?void 0:t(i)},BZ=e=>t=>"mouse"===t.pointerType?e(t):void 0,$Z=sS({name:"ElTooltipTrigger"}),UZ=sS({...$Z,props:_Z,setup(e,{expose:t}){const n=e,i=Zz("tooltip"),{controlled:r,id:s,open:o,onOpen:a,onClose:l,onToggle:u}=qC(Yq,void 0),c=_I(null),d=()=>{if(xI(r)||n.disabled)return!0},h=kI(n,"trigger"),p=PZ(d,OZ(h,"hover",e=>{a(e),n.focusOnTarget&&e.target&&oA(()=>{Dq(e.target,{preventScroll:!0})})})),f=PZ(d,OZ(h,"hover",l)),m=PZ(d,OZ(h,"click",e=>{0===e.button&&u(e)})),g=PZ(d,OZ(h,"focus",a)),_=PZ(d,OZ(h,"focus",l)),y=PZ(d,OZ(h,"contextmenu",e=>{e.preventDefault(),u(e)})),v=PZ(d,e=>{const{code:t}=e;n.triggerKeys.includes(t)&&(e.preventDefault(),u(e))});return t({triggerRef:c}),(e,t)=>(iM(),cM(xI(LZ),{id:xI(s),"virtual-ref":e.virtualRef,open:xI(o),"virtual-triggering":e.virtualTriggering,class:xE(xI(i).e("trigger")),onBlur:xI(_),onClick:xI(m),onContextmenu:xI(y),onFocus:xI(g),onMouseenter:xI(p),onMouseleave:xI(f),onKeydown:xI(v)},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var VZ=UH(UZ,[["__file","trigger.vue"]]);const zZ=bG(UH(sS({__name:"teleport",props:hZ,setup:e=>(e,t)=>e.disabled?uC(e.$slots,"default",{key:0}):(iM(),cM(zA,{key:1,to:e.to},[uC(e.$slots,"default")],8,["to"]))}),[["__file","teleport.vue"]])),jZ=()=>{const e=Kz(),t=zW(),n=tk(()=>`${e.value}-popper-container-${t.prefix}`),i=tk(()=>`#${n.value}`);return{id:n,selector:i}},YZ=()=>{const{id:e,selector:t}=jZ();return jS(()=>{dj&&(document.body.querySelector(t.value)||(e=>{const t=document.createElement("div");t.id=e,document.body.appendChild(t)})(e.value))}),{id:e,selector:t}},GZ="focus-trap.focus-after-trapped",HZ="focus-trap.focus-after-released",WZ={cancelable:!0,bubbles:!1},XZ={cancelable:!0,bubbles:!1},qZ="focusAfterTrapped",KZ="focusAfterReleased",ZZ=Symbol("elFocusTrap"),QZ=_I(),JZ=_I(0),eQ=_I(0);let tQ=0;const nQ=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},iQ=(e,t)=>{for(const n of e)if(!rQ(n,t))return n},rQ=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},sQ=(e,t)=>{if(e){const n=document.activeElement;Dq(e,{preventScroll:!0}),eQ.value=window.performance.now(),e!==n&&(e=>e instanceof HTMLInputElement&&"select"in e)(e)&&t&&e.select()}};function oQ(e,t){const n=[...e],i=e.indexOf(t);return-1!==i&&n.splice(i,1),n}const aQ=(()=>{let e=[];return{push:t=>{const n=e[0];n&&t!==n&&n.pause(),e=oQ(e,t),e.unshift(t)},remove:t=>{var n,i;e=oQ(e,t),null==(i=null==(n=e[0])?void 0:n.resume)||i.call(n)}}})(),lQ=()=>{QZ.value="pointer",JZ.value=window.performance.now()},uQ=()=>{QZ.value="keyboard",JZ.value=window.performance.now()},cQ=()=>(YS(()=>{0===tQ&&(document.addEventListener("mousedown",lQ),document.addEventListener("touchstart",lQ),document.addEventListener("keydown",uQ)),tQ++}),WS(()=>{tQ--,tQ<=0&&(document.removeEventListener("mousedown",lQ),document.removeEventListener("touchstart",lQ),document.removeEventListener("keydown",uQ))}),{focusReason:QZ,lastUserFocusTimestamp:JZ,lastAutomatedFocusTimestamp:eQ}),dQ=e=>new CustomEvent("focus-trap.focusout-prevented",{...XZ,detail:e});let hQ=[];const pQ=e=>{e.code===sW.esc&&hQ.forEach(t=>t(e))},fQ=sS({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[qZ,KZ,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=_I();let i,r;const{focusReason:s}=cQ();var o;o=n=>{e.trapped&&!a.paused&&t("release-requested",n)},YS(()=>{0===hQ.length&&document.addEventListener("keydown",pQ),dj&&hQ.push(o)}),WS(()=>{hQ=hQ.filter(e=>e!==o),0===hQ.length&&dj&&document.removeEventListener("keydown",pQ)});const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=n=>{if(!e.loop&&!e.trapped)return;if(a.paused)return;const{code:i,altKey:r,ctrlKey:o,metaKey:l,currentTarget:u,shiftKey:c}=n,{loop:d}=e,h=i===sW.tab&&!r&&!o&&!l,p=document.activeElement;if(h&&p){const e=u,[i,r]=(e=>{const t=nQ(e);return[iQ(t,e),iQ(t.reverse(),e)]})(e);if(i&&r)if(c||p!==r){if(c&&[i,e].includes(p)){const e=dQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&sQ(r,!0))}}else{const e=dQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&sQ(i,!0))}else if(p===e){const e=dQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||n.preventDefault()}}};XC(ZZ,{focusTrapRef:n,onKeydown:l}),CO(()=>e.focusTrapEl,e=>{e&&(n.value=e)},{immediate:!0}),CO([n],([e],[t])=>{e&&(e.addEventListener("keydown",l),e.addEventListener("focusin",d),e.addEventListener("focusout",h)),t&&(t.removeEventListener("keydown",l),t.removeEventListener("focusin",d),t.removeEventListener("focusout",h))});const u=e=>{t(qZ,e)},c=e=>t(KZ,e),d=s=>{const o=xI(n);if(!o)return;const l=s.target,u=s.relatedTarget,c=l&&o.contains(l);if(!e.trapped){u&&o.contains(u)||(i=u)}c&&t("focusin",s),a.paused||e.trapped&&(c?r=l:sQ(r,!0))},h=i=>{const o=xI(n);if(!a.paused&&o)if(e.trapped){const n=i.relatedTarget;FX(n)||o.contains(n)||setTimeout(()=>{if(!a.paused&&e.trapped){const e=dQ({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||sQ(r,!0)}},0)}else{const e=i.target;e&&o.contains(e)||t("focusout",i)}};async function p(){await oA();const t=xI(n);if(t){aQ.push(a);const n=t.contains(document.activeElement)?i:document.activeElement;i=n;if(!t.contains(n)){const i=new Event(GZ,WZ);t.addEventListener(GZ,u),t.dispatchEvent(i),i.defaultPrevented||oA(()=>{let i=e.focusStartEl;Gx(i)||(sQ(i),document.activeElement!==i&&(i="first")),"first"===i&&((e,t=!1)=>{const n=document.activeElement;for(const i of e)if(sQ(i,t),document.activeElement!==n)return})(nQ(t),!0),document.activeElement!==n&&"container"!==i||sQ(t)})}}}function f(){const e=xI(n);if(e){e.removeEventListener(GZ,u);const t=new CustomEvent(HZ,{...WZ,detail:{focusReason:s.value}});e.addEventListener(HZ,c),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=s.value&&JZ.value>eQ.value&&!e.contains(document.activeElement)||sQ(null!=i?i:document.body),e.removeEventListener(HZ,c),aQ.remove(a),i=null,r=null}}return YS(()=>{e.trapped&&p(),CO(()=>e.trapped,e=>{e?p():f()})}),WS(()=>{e.trapped&&f(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",h),n.value=void 0)}),{onKeydown:l}}});var mQ=UH(fQ,[["render",function(e,t,n,i,r,s){return uC(e.$slots,"default",{handleKeydown:e.onKeydown})}],["__file","focus-trap.vue"]]);const gQ=function(e){return void 0===e},_Q=(e,t=[])=>{const{placement:n,strategy:i,popperOptions:r}=e,s={placement:n,strategy:i,...r,modifiers:[...yQ(e),...t]};return function(e,t){t&&(e.modifiers=[...e.modifiers,...null!=t?t:[]])}(s,null==r?void 0:r.modifiers),s};function yQ(e){const{offset:t,gpuAcceleration:n,fallbackPlacements:i}=e;return[{name:"offset",options:{offset:[0,null!=t?t:12]}},{name:"preventOverflow",options:{padding:{top:0,bottom:0,left:0,right:0}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:n}}]}const vQ=(e,t,n={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:e})=>{const t=function(e){const t=Object.keys(e.elements),n=iG(t.map(t=>[t,e.styles[t]||{}])),i=iG(t.map(t=>[t,e.attributes[t]]));return{styles:n,attributes:i}}(e);Object.assign(o.value,t)},requires:["computeStyles"]},r=tk(()=>{const{onFirstUpdate:e,placement:t,strategy:r,modifiers:s}=xI(n);return{onFirstUpdate:e,placement:t||"bottom",strategy:r||"absolute",modifiers:[...s||[],i,{name:"applyStyles",enabled:!1}]}}),s=yI(),o=_I({styles:{popper:{position:xI(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return CO(r,e=>{const t=xI(s);t&&t.setOptions(e)},{deep:!0}),CO([e,t],([e,t])=>{a(),e&&t&&(s.value=aZ(e,t,xI(r)))}),WS(()=>{a()}),{state:tk(()=>{var e;return{...(null==(e=xI(s))?void 0:e.state)||{}}}),styles:tk(()=>xI(o).styles),attributes:tk(()=>xI(o).attributes),update:()=>{var e;return null==(e=xI(s))?void 0:e.update()},forceUpdate:()=>{var e;return null==(e=xI(s))?void 0:e.forceUpdate()},instanceRef:tk(()=>xI(s))}};const bQ=e=>{const{popperInstanceRef:t,contentRef:n,triggerRef:i,role:r}=qC(Bq,void 0),s=_I(),o=tk(()=>e.arrowOffset),a=tk(()=>({name:"eventListeners",enabled:!!e.visible})),l=tk(()=>{var e;const t=xI(s),n=null!=(e=xI(o))?e:0;return{name:"arrow",enabled:!gQ(t),options:{element:t,padding:n}}}),u=tk(()=>({onFirstUpdate:()=>{f()},..._Q(e,[xI(l),xI(a)])})),c=tk(()=>(e=>{if(dj)return yH(e)})(e.referenceEl)||xI(i)),{attributes:d,state:h,styles:p,update:f,forceUpdate:m,instanceRef:g}=vQ(c,n,u);return CO(g,e=>t.value=e,{flush:"sync"}),YS(()=>{CO(()=>{var e,t;return null==(t=null==(e=xI(c))?void 0:e.getBoundingClientRect)?void 0:t.call(e)},()=>{f()})}),{attributes:d,arrowRef:s,contentRef:n,instanceRef:g,state:h,styles:p,role:r,forceUpdate:m,update:f}},TQ=sS({name:"ElPopperContent"}),xQ=sS({...TQ,props:cZ,emits:dZ,setup(e,{expose:t,emit:n}){const i=e,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:l,onFocusoutPrevented:u,onReleaseRequested:c}=((e,t)=>{const n=_I(!1),i=_I();return{focusStartRef:i,trapped:n,onFocusAfterReleased:e=>{var n;"pointer"!==(null==(n=e.detail)?void 0:n.focusReason)&&(i.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:t=>{e.visible&&!n.value&&(t.target&&(i.value=t.target),n.value=!0)},onFocusoutPrevented:t=>{e.trapping||("pointer"===t.detail.focusReason&&t.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,t("close")}}})(i,n),{attributes:d,arrowRef:h,contentRef:p,styles:f,instanceRef:m,role:g,update:_}=bQ(i),{ariaModal:y,arrowStyle:v,contentAttrs:b,contentClass:T,contentStyle:x,updateZIndex:E}=((e,{attributes:t,styles:n,role:i})=>{const{nextZIndex:r}=Ij(),s=Zz("popper"),o=tk(()=>xI(t).popper),a=_I(ej(e.zIndex)?e.zIndex:r()),l=tk(()=>[s.b(),s.is("pure",e.pure),s.is(e.effect),e.popperClass]),u=tk(()=>[{zIndex:xI(a)},xI(n).popper,e.popperStyle||{}]);return{ariaModal:tk(()=>"dialog"===i.value?"false":void 0),arrowStyle:tk(()=>xI(n).arrow||{}),contentAttrs:o,contentClass:l,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=ej(e.zIndex)?e.zIndex:r()}}})(i,{styles:f,attributes:d,role:g}),w=qC(GW,void 0);let I;XC($q,{arrowStyle:v,arrowRef:h}),w&&XC(GW,{...w,addInputId:Rx,removeInputId:Rx});const A=(e=!0)=>{_(),e&&E()},S=()=>{A(!1),i.visible&&i.focusOnShow?s.value=!0:!1===i.visible&&(s.value=!1)};return YS(()=>{CO(()=>i.triggerTargetEl,(e,t)=>{null==I||I(),I=void 0;const n=xI(e||p.value),r=xI(t||p.value);tj(n)&&(I=CO([g,()=>i.ariaLabel,y,()=>i.id],e=>{["role","aria-label","aria-modal","id"].forEach((t,i)=>{FX(e[i])?n.removeAttribute(t):n.setAttribute(t,e[i])})},{immediate:!0})),r!==n&&tj(r)&&["role","aria-label","aria-modal","id"].forEach(e=>{r.removeAttribute(e)})},{immediate:!0}),CO(()=>i.visible,S,{immediate:!0})}),WS(()=>{null==I||I(),I=void 0}),t({popperContentRef:p,popperInstanceRef:m,updatePopper:A,contentStyle:x}),(e,t)=>(iM(),uM("div",SM({ref_key:"contentRef",ref:p},xI(b),{style:xI(x),class:xI(T),tabindex:"-1",onMouseenter:t=>e.$emit("mouseenter",t),onMouseleave:t=>e.$emit("mouseleave",t)}),[_M(xI(mQ),{trapped:xI(s),"trap-on-focus-in":!0,"focus-trap-el":xI(p),"focus-start-el":xI(r),onFocusAfterTrapped:xI(a),onFocusAfterReleased:xI(o),onFocusin:xI(l),onFocusoutPrevented:xI(u),onReleaseRequested:xI(c)},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var EQ=UH(xQ,[["__file","content.vue"]]);const wQ=sS({name:"ElTooltipContent",inheritAttrs:!1}),IQ=sS({...wQ,props:mZ,setup(e,{expose:t}){const n=e,{selector:i}=jZ(),r=Zz("tooltip"),s=_I(),o=cj(()=>{var e;return null==(e=s.value)?void 0:e.popperContentRef});let a;const{controlled:l,id:u,open:c,trigger:d,onClose:h,onOpen:p,onShow:f,onHide:m,onBeforeShow:g,onBeforeHide:_}=qC(Yq,void 0),y=tk(()=>n.transition||`${r.namespace.value}-fade-in-linear`),v=tk(()=>n.persistent);WS(()=>{null==a||a()});const b=tk(()=>!!xI(v)||xI(c)),T=tk(()=>!n.disabled&&xI(c)),x=tk(()=>n.appendTo||i.value),E=tk(()=>{var e;return null!=(e=n.style)?e:{}}),w=_I(!0),I=()=>{m(),N()&&Dq(document.body,{preventScroll:!0}),w.value=!0},A=()=>{if(xI(l))return!0},S=PZ(A,()=>{n.enterable&&"hover"===xI(d)&&p()}),C=PZ(A,()=>{"hover"===xI(d)&&h()}),O=()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e),null==g||g()},M=()=>{null==_||_()},k=()=>{f()},R=()=>{n.virtualTriggering||h()},N=e=>{var t;const n=null==(t=s.value)?void 0:t.popperContentRef,i=(null==e?void 0:e.relatedTarget)||document.activeElement;return null==n?void 0:n.contains(i)};return CO(()=>xI(c),e=>{e?(w.value=!1,a=function(e,t,n={}){const{window:i=vH,ignore:r=[],capture:s=!0,detectIframe:o=!1}=n;if(!i)return;fj&&!TH&&(TH=!0,Array.from(i.document.body.children).forEach(e=>e.addEventListener("click",pj)));let a=!0;const l=e=>r.some(t=>{if("string"==typeof t)return Array.from(i.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{const n=yH(t);return n&&(e.target===n||e.composedPath().includes(n))}}),u=[bH(i,"click",n=>{const i=yH(e);i&&i!==n.target&&!n.composedPath().includes(i)&&(0===n.detail&&(a=!l(n)),a?t(n):a=!0)},{passive:!0,capture:s}),bH(i,"pointerdown",t=>{const n=yH(e);n&&(a=!t.composedPath().includes(n)&&!l(t))},{passive:!0}),o&&bH(i,"blur",n=>{var r;const s=yH(e);"IFRAME"!==(null==(r=i.document.activeElement)?void 0:r.tagName)||(null==s?void 0:s.contains(i.document.activeElement))||t(n)})].filter(Boolean);return()=>u.forEach(e=>e())}(o,()=>{if(xI(l))return;var e;(e=xI(d),e||0===e?Ux(e)?e:[e]:[]).every(e=>"hover"!==e&&"focus"!==e)&&h()})):null==a||a()},{flush:"post"}),CO(()=>n.content,()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e)}),t({contentRef:s,isFocusInsideContent:N}),(e,t)=>(iM(),cM(xI(zZ),{disabled:!e.teleported,to:xI(x)},{default:MA(()=>[xI(b)||!w.value?(iM(),cM(Ak,{key:0,name:xI(y),appear:!xI(v),onAfterLeave:I,onBeforeEnter:O,onAfterEnter:k,onBeforeLeave:M,persisted:""},{default:MA(()=>[kA(_M(xI(EQ),SM({id:xI(u),ref_key:"contentRef",ref:s},e.$attrs,{"aria-label":e.ariaLabel,"aria-hidden":w.value,"boundaries-padding":e.boundariesPadding,"fallback-placements":e.fallbackPlacements,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,placement:e.placement,"popper-options":e.popperOptions,"arrow-offset":e.arrowOffset,strategy:e.strategy,effect:e.effect,enterable:e.enterable,pure:e.pure,"popper-class":e.popperClass,"popper-style":[e.popperStyle,xI(E)],"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,visible:xI(T),"z-index":e.zIndex,onMouseenter:xI(S),onMouseleave:xI(C),onBlur:R,onClose:xI(h)}),{default:MA(()=>[uC(e.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"]),[[zk,xI(T)]])]),_:3},8,["name","appear"])):EM("v-if",!0)]),_:3},8,["disabled","to"]))}});var AQ=UH(IQ,[["__file","content.vue"]]);const SQ=sS({name:"ElPopperArrow",inheritAttrs:!1});var CQ=UH(sS({...SQ,setup(e,{expose:t}){const n=Zz("popper"),{arrowRef:i,arrowStyle:r}=qC($q,void 0);return WS(()=>{i.value=void 0}),t({arrowRef:i}),(e,t)=>(iM(),uM("span",{ref_key:"arrowRef",ref:i,class:xE(xI(n).e("arrow")),style:_E(xI(r)),"data-popper-arrow":""},null,6))}}),[["__file","arrow.vue"]]);const OQ=sS({name:"ElTooltip"}),MQ=sS({...OQ,props:SZ,emits:CZ,setup(e,{expose:t,emit:n}){const i=e;YZ();const r=Zz("tooltip"),s=jW(),o=_I(),a=_I(),l=()=>{var e;const t=xI(o);t&&(null==(e=t.popperInstanceRef)||e.update())},u=_I(!1),c=_I(),{show:d,hide:h,hasUpdateHandler:p}=AZ({indicator:u,toggleReason:c}),{onOpen:f,onClose:m}=(({showAfter:e,hideAfter:t,autoClose:n,open:i,close:r})=>{const{registerTimeout:s}=pZ(),{registerTimeout:o,cancelTimeout:a}=pZ();return{onOpen:(t,a=xI(e))=>{s(()=>{i(t);const e=xI(n);ej(e)&&e>0&&o(()=>{r(t)},e)},a)},onClose:(e,n=xI(t))=>{a(),s(()=>{r(e)},n)}}})({showAfter:kI(i,"showAfter"),hideAfter:kI(i,"hideAfter"),autoClose:kI(i,"autoClose"),open:d,close:h}),g=tk(()=>Jz(i.visible)&&!p.value),_=tk(()=>[r.b(),i.popperClass]);XC(Yq,{controlled:g,id:s,open:sI(u),trigger:kI(i,"trigger"),onOpen:f,onClose:m,onToggle:e=>{xI(u)?m(e):f(e)},onShow:()=>{n("show",c.value)},onHide:()=>{n("hide",c.value)},onBeforeShow:()=>{n("before-show",c.value)},onBeforeHide:()=>{n("before-hide",c.value)},updatePopper:l}),CO(()=>i.disabled,e=>{e&&u.value&&(u.value=!1)});return LS(()=>u.value&&h()),t({popperRef:o,contentRef:a,isFocusInsideContent:e=>{var t;return null==(t=a.value)?void 0:t.isFocusInsideContent(e)},updatePopper:l,onOpen:f,onClose:m,hide:h}),(e,t)=>(iM(),cM(xI(jq),{ref_key:"popperRef",ref:o,role:e.role},{default:MA(()=>[_M(VZ,{disabled:e.disabled,trigger:e.trigger,"trigger-keys":e.triggerKeys,"virtual-ref":e.virtualRef,"virtual-triggering":e.virtualTriggering,"focus-on-target":e.focusOnTarget},{default:MA(()=>[e.$slots.default?uC(e.$slots,"default",{key:0}):EM("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering","focus-on-target"]),_M(AQ,{ref_key:"contentRef",ref:a,"aria-label":e.ariaLabel,"boundaries-padding":e.boundariesPadding,content:e.content,disabled:e.disabled,effect:e.effect,enterable:e.enterable,"fallback-placements":e.fallbackPlacements,"hide-after":e.hideAfter,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,persistent:e.persistent,"popper-class":xI(_),"popper-style":e.popperStyle,placement:e.placement,"popper-options":e.popperOptions,"arrow-offset":e.arrowOffset,pure:e.pure,"raw-content":e.rawContent,"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,"show-after":e.showAfter,strategy:e.strategy,teleported:e.teleported,transition:e.transition,"virtual-triggering":e.virtualTriggering,"z-index":e.zIndex,"append-to":e.appendTo},{default:MA(()=>[uC(e.$slots,"content",{},()=>[e.rawContent?(iM(),uM("span",{key:0,innerHTML:e.content},null,8,["innerHTML"])):(iM(),uM("span",{key:1},$E(e.content),1))]),e.showArrow?(iM(),cM(xI(CQ),{key:0})):EM("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});const kQ=bG(UH(MQ,[["__file","tooltip.vue"]])),RQ={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},NQ=Symbol("scrollbarContextKey"),DQ=oG({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),FQ=sS({__name:"thumb",props:DQ,setup(e){const t=e,n=qC(NQ),i=Zz("scrollbar");n||cW("Thumb","can not inject scrollbar context");const r=_I(),s=_I(),o=_I({}),a=_I(!1);let l=!1,u=!1,c=0,d=0,h=dj?document.onselectstart:null;const p=tk(()=>RQ[t.vertical?"vertical":"horizontal"]),f=tk(()=>(({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}))({size:t.size,move:t.move,bar:p.value})),m=tk(()=>r.value[p.value.offset]**2/n.wrapElement[p.value.scrollSize]/t.ratio/s.value[p.value.offset]),g=e=>{var t;if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;null==(t=window.getSelection())||t.removeAllRanges(),y(e);const n=e.currentTarget;n&&(o.value[p.value.axis]=n[p.value.offset]-(e[p.value.client]-n.getBoundingClientRect()[p.value.direction]))},_=e=>{if(!s.value||!r.value||!n.wrapElement)return;const t=100*(Math.abs(e.target.getBoundingClientRect()[p.value.direction]-e[p.value.client])-s.value[p.value.offset]/2)*m.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=t*n.wrapElement[p.value.scrollSize]/100},y=e=>{e.stopImmediatePropagation(),l=!0,c=n.wrapElement.scrollHeight,d=n.wrapElement.scrollWidth,document.addEventListener("mousemove",v),document.addEventListener("mouseup",b),h=document.onselectstart,document.onselectstart=()=>!1},v=e=>{if(!r.value||!s.value)return;if(!1===l)return;const t=o.value[p.value.axis];if(!t)return;const i=100*(-1*(r.value.getBoundingClientRect()[p.value.direction]-e[p.value.client])-(s.value[p.value.offset]-t))*m.value/r.value[p.value.offset];"scrollLeft"===p.value.scroll?n.wrapElement[p.value.scroll]=i*d/100:n.wrapElement[p.value.scroll]=i*c/100},b=()=>{l=!1,o.value[p.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b),T(),u&&(a.value=!1)};WS(()=>{T(),document.removeEventListener("mouseup",b)});const T=()=>{document.onselectstart!==h&&(document.onselectstart=h)};return bH(kI(n,"scrollbarElement"),"mousemove",()=>{u=!1,a.value=!!t.size}),bH(kI(n,"scrollbarElement"),"mouseleave",()=>{u=!0,a.value=l}),(e,t)=>(iM(),cM(Ak,{name:xI(i).b("fade"),persisted:""},{default:MA(()=>[kA(gM("div",{ref_key:"instance",ref:r,class:xE([xI(i).e("bar"),xI(i).is(xI(p).key)]),onMousedown:_,onClick:YR(()=>{},["stop"])},[gM("div",{ref_key:"thumb",ref:s,class:xE(xI(i).e("thumb")),style:_E(xI(f)),onMousedown:g},null,38)],42,["onClick"]),[[zk,e.always||a.value]])]),_:1},8,["name"]))}});var LQ=UH(FQ,[["__file","thumb.vue"]]);const PQ=sS({__name:"bar",props:oG({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),setup(e,{expose:t}){const n=e,i=qC(NQ),r=_I(0),s=_I(0),o=_I(""),a=_I(""),l=_I(1),u=_I(1);return t({handleScroll:e=>{if(e){const t=e.offsetHeight-4,n=e.offsetWidth-4;s.value=100*e.scrollTop/t*l.value,r.value=100*e.scrollLeft/n*u.value}},update:()=>{const e=null==i?void 0:i.wrapElement;if(!e)return;const t=e.offsetHeight-4,r=e.offsetWidth-4,s=t**2/e.scrollHeight,c=r**2/e.scrollWidth,d=Math.max(s,n.minSize),h=Math.max(c,n.minSize);l.value=s/(t-s)/(d/(t-d)),u.value=c/(r-c)/(h/(r-h)),a.value=d+4(iM(),uM(ZO,null,[_M(LQ,{move:r.value,ratio:u.value,size:o.value,always:e.always},null,8,["move","ratio","size","always"]),_M(LQ,{move:s.value,ratio:l.value,size:a.value,vertical:"",always:e.always},null,8,["move","ratio","size","always"])],64))}});var BQ=UH(PQ,[["__file","bar.vue"]]);const $Q=oG({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:[String,Object,Array],default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Eq(["ariaLabel","ariaOrientation"])}),UQ={"end-reached":e=>["left","right","top","bottom"].includes(e),scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(ej)},VQ=sS({name:"ElScrollbar"}),zQ=sS({...VQ,props:$Q,emits:UQ,setup(e,{expose:t,emit:n}){const i=e,r=Zz("scrollbar");let s,o,a,l=0,u=0,c="";const d={bottom:!1,top:!1,right:!1,left:!1},h=_I(),p=_I(),f=_I(),m=_I(),g=tk(()=>{const e={};return i.height&&(e.height=VH(i.height)),i.maxHeight&&(e.maxHeight=VH(i.maxHeight)),[i.wrapStyle,e]}),_=tk(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),y=tk(()=>[r.e("view"),i.viewClass]),v={top:"bottom",bottom:"top",left:"right",right:"left"},b=()=>{var e;if(p.value){null==(e=m.value)||e.handleScroll(p.value);const t=l,r=u;l=p.value.scrollTop,u=p.value.scrollLeft;const s={bottom:l+p.value.clientHeight>=p.value.scrollHeight-i.distance,top:l<=i.distance&&0!==t,right:u+p.value.clientWidth>=p.value.scrollWidth-i.distance&&r!==u,left:u<=i.distance&&0!==r};if(n("scroll",{scrollTop:l,scrollLeft:u}),t!==l&&(c=l>t?"bottom":"top"),r!==u&&(c=u>r?"right":"left"),i.distance>0){if((e=>{var t;return null!=(t=d[e])&&t})(c))return;(e=>{const t=v[c];if(!t)return;const n=e[c],i=e[t];n&&!d[c]&&(d[c]=!0),!i&&d[t]&&(d[t]=!1)})(s)}s[c]&&n("end-reached",c)}};const T=()=>{var e;null==(e=m.value)||e.update(),d[c]=!1};return CO(()=>i.noresize,e=>{e?(null==s||s(),null==o||o(),null==a||a()):(({stop:s}=OH(f,T)),({stop:o}=OH(p,T)),a=bH("resize",T))},{immediate:!0}),CO(()=>[i.maxHeight,i.height],()=>{i.native||oA(()=>{var e;T(),p.value&&(null==(e=m.value)||e.handleScroll(p.value))})}),XC(NQ,iI({scrollbarElement:h,wrapElement:p})),FS(()=>{p.value&&(p.value.scrollTop=l,p.value.scrollLeft=u)}),YS(()=>{i.native||oA(()=>{T()})}),HS(()=>T()),t({wrapRef:p,update:T,scrollTo:function(e,t){Wx(e)?p.value.scrollTo(e):ej(e)&&ej(t)&&p.value.scrollTo(e,t)},setScrollTop:e=>{ej(e)&&(p.value.scrollTop=e)},setScrollLeft:e=>{ej(e)&&(p.value.scrollLeft=e)},handleScroll:b}),(e,t)=>(iM(),uM("div",{ref_key:"scrollbarRef",ref:h,class:xE(xI(r).b())},[gM("div",{ref_key:"wrapRef",ref:p,class:xE(xI(_)),style:_E(xI(g)),tabindex:e.tabindex,onScroll:b},[(iM(),cM(iC(e.tag),{id:e.id,ref_key:"resizeRef",ref:f,class:xE(xI(y)),style:_E(e.viewStyle),role:e.role,"aria-label":e.ariaLabel,"aria-orientation":e.ariaOrientation},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),e.native?EM("v-if",!0):(iM(),cM(BQ,{key:0,ref_key:"barRef",ref:m,always:e.always,"min-size":e.minSize},null,8,["always","min-size"]))],2))}});const jQ=bG(UH(zQ,[["__file","scrollbar.vue"]]));var YQ=UH(sS({inheritAttrs:!1}),[["render",function(e,t,n,i,r,s){return uC(e.$slots,"default")}],["__file","collection.vue"]]);var GQ=UH(sS({name:"ElCollectionItem",inheritAttrs:!1}),[["render",function(e,t,n,i,r,s){return uC(e.$slots,"default")}],["__file","collection-item.vue"]]);const HQ="data-el-collection-item",WQ=e=>{const t=`El${e}Collection`,n=`${t}Item`,i=Symbol(t),r=Symbol(n),s={...YQ,name:t,setup(){const e=_I(),t=new Map;XC(i,{itemMap:t,getItems:()=>{const n=xI(e);if(!n)return[];const i=Array.from(n.querySelectorAll(`[${HQ}]`));return[...t.values()].sort((e,t)=>i.indexOf(e.ref)-i.indexOf(t.ref))},collectionRef:e})}},o={...GQ,name:n,setup(e,{attrs:t}){const n=_I(),s=qC(i,void 0);XC(r,{collectionItemRef:n}),YS(()=>{const e=xI(n);e&&s.itemMap.set(e,{ref:e,...t})}),WS(()=>{const e=xI(n);s.itemMap.delete(e)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},XQ=oG({style:{type:[String,Array,Object]},currentTabId:{type:String},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:String},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:qQ,ElCollectionItem:KQ,COLLECTION_INJECTION_KEY:ZQ,COLLECTION_ITEM_INJECTION_KEY:QQ}=WQ("RovingFocusGroup"),JQ=Symbol("elRovingFocusGroup"),eJ=Symbol("elRovingFocusGroupItem"),tJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},nJ=(e,t,n)=>{const i=((e,t)=>{if("rtl"!==t)return e;switch(e){case sW.right:return sW.left;case sW.left:return sW.right;default:return e}})(e.code,n);if(!("vertical"===t&&[sW.left,sW.right].includes(i)||"horizontal"===t&&[sW.up,sW.down].includes(i)))return tJ[i]},iJ=e=>{const{activeElement:t}=document;for(const n of e){if(n===t)return;if(n.focus(),t!==document.activeElement)return}},rJ="currentTabIdChange",sJ="rovingFocusGroup.entryFocus",oJ={bubbles:!1,cancelable:!0},aJ=sS({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:XQ,emits:[rJ,"entryFocus"],setup(e,{emit:t}){var n;const i=_I(null!=(n=e.currentTabId||e.defaultCurrentTabId)?n:null),r=_I(!1),s=_I(!1),o=_I(),{getItems:a}=qC(ZQ,void 0),l=tk(()=>[{outline:"none"},e.style]),u=PZ(t=>{var n;null==(n=e.onMousedown)||n.call(e,t)},()=>{s.value=!0}),c=PZ(t=>{var n;null==(n=e.onFocus)||n.call(e,t)},e=>{const t=!xI(s),{target:n,currentTarget:o}=e;if(n===o&&t&&!xI(r)){const e=new Event(sJ,oJ);if(null==o||o.dispatchEvent(e),!e.defaultPrevented){const e=a().filter(e=>e.focusable),t=[e.find(e=>e.active),e.find(e=>e.id===xI(i)),...e].filter(Boolean).map(e=>e.ref);iJ(t)}}s.value=!1}),d=PZ(t=>{var n;null==(n=e.onBlur)||n.call(e,t)},()=>{r.value=!1});XC(JQ,{currentTabbedId:sI(i),loop:kI(e,"loop"),tabIndex:tk(()=>xI(r)?-1:0),rovingFocusGroupRef:o,rovingFocusGroupRootStyle:l,orientation:kI(e,"orientation"),dir:kI(e,"dir"),onItemFocus:e=>{t(rJ,e)},onItemShiftTab:()=>{r.value=!0},onBlur:d,onFocus:c,onMousedown:u}),CO(()=>e.currentTabId,e=>{i.value=null!=e?e:null}),bH(o,sJ,(...e)=>{t("entryFocus",...e)})}});var lJ=UH(sS({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:qQ,ElRovingFocusGroupImpl:UH(aJ,[["render",function(e,t,n,i,r,s){return uC(e.$slots,"default")}],["__file","roving-focus-group-impl.vue"]])}}),[["render",function(e,t,n,i,r,s){const o=tC("el-roving-focus-group-impl"),a=tC("el-focus-group-collection");return iM(),cM(a,null,{default:MA(()=>[_M(o,EE(vM(e.$attrs)),{default:MA(()=>[uC(e.$slots,"default")]),_:3},16)]),_:3})}],["__file","roving-focus-group.vue"]]);const uJ=oG({trigger:_Z.trigger,triggerKeys:{type:Array,default:()=>[sW.enter,sW.numpadEnter,sW.space,sW.down]},virtualTriggering:_Z.virtualTriggering,virtualRef:_Z.virtualRef,effect:{...mZ.effect,default:"light"},type:{type:String},placement:{type:String,default:"bottom"},popperOptions:{type:Object,default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:[Number,String],default:0},maxHeight:{type:[Number,String],default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,values:Uq,default:"menu"},buttonProps:{type:Object},teleported:mZ.teleported,persistent:{type:Boolean,default:!0}}),cJ=oG({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:XH}}),dJ=oG({onKeydown:{type:Function}}),hJ=[sW.down,sW.pageDown,sW.home],pJ=[sW.up,sW.pageUp,sW.end],fJ=[...hJ,...pJ],{ElCollection:mJ,ElCollectionItem:gJ,COLLECTION_INJECTION_KEY:_J,COLLECTION_ITEM_INJECTION_KEY:yJ}=WQ("Dropdown"),vJ=Symbol("elDropdown"),bJ="elDropdown";const TJ=function(){if(!arguments.length)return[];var e=arguments[0];return Aj(e)?e:[e]},{ButtonGroup:xJ}=SX,EJ=sS({name:"ElDropdown",components:{ElButton:SX,ElButtonGroup:xJ,ElScrollbar:jQ,ElDropdownCollection:mJ,ElTooltip:kQ,ElRovingFocusGroup:lJ,ElOnlyChild:kZ,ElIcon:WH,ArrowDown:wG},props:uJ,emits:["visible-change","click","command"],setup(e,{emit:t}){const n=NM(),i=Zz("dropdown"),{t:r}=nG(),s=_I(),o=_I(),a=_I(),l=_I(),u=_I(null),c=_I(null),d=_I(!1),h=tk(()=>({maxHeight:VH(e.maxHeight)})),p=tk(()=>[i.m(_.value)]),f=tk(()=>TJ(e.trigger)),m=jW().value,g=tk(()=>e.id||m);const _=qW();XC(vJ,{contentRef:l,role:tk(()=>e.role),triggerId:g,isUsingKeyboard:d,onItemEnter:function(){},onItemLeave:function(){const e=xI(l);f.value.includes("hover")&&(null==e||e.focus({preventScroll:!0})),c.value=null}}),XC(bJ,{instance:n,dropdownSize:_,handleClick:function(){var e;null==(e=a.value)||e.onClose(void 0,0)},commandHandler:function(...e){t("command",...e)},trigger:kI(e,"trigger"),hideOnClick:kI(e,"hideOnClick")});return{t:r,ns:i,scrollbar:u,wrapStyle:h,dropdownTriggerKls:p,dropdownSize:_,triggerId:g,currentTabId:c,handleCurrentTabIdChange:function(e){c.value=e},handlerMainButtonClick:e=>{t("click",e)},handleEntryFocus:function(e){d.value||(e.preventDefault(),e.stopImmediatePropagation())},handleClose:function(){var e;null==(e=a.value)||e.onClose()},handleOpen:function(){var e;null==(e=a.value)||e.onOpen()},handleBeforeShowTooltip:function(){t("visible-change",!0)},handleShowTooltip:function(e){var t;"keydown"===(null==e?void 0:e.type)&&(null==(t=l.value)||t.focus())},handleBeforeHideTooltip:function(){t("visible-change",!1)},onFocusAfterTrapped:e=>{var t,n;e.preventDefault(),null==(n=null==(t=l.value)?void 0:t.focus)||n.call(t,{preventScroll:!0})},popperRef:a,contentRef:l,triggeringElementRef:s,referenceElementRef:o}}});var wJ=UH(EJ,[["render",function(e,t,n,i,r,s){var o,a;const l=tC("el-dropdown-collection"),u=tC("el-roving-focus-group"),c=tC("el-scrollbar"),d=tC("el-only-child"),h=tC("el-tooltip"),p=tC("el-button"),f=tC("arrow-down"),m=tC("el-icon"),g=tC("el-button-group");return iM(),uM("div",{class:xE([e.ns.b(),e.ns.is("disabled",e.disabled)])},[_M(h,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":null==(o=e.referenceElementRef)?void 0:o.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-arrow":e.showArrow,"show-after":"hover"===e.trigger?e.showTimeout:0,"hide-after":"hover"===e.trigger?e.hideTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":null!=(a=e.virtualRef)?a:e.triggeringElementRef,"virtual-triggering":e.virtualTriggering||e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"","focus-on-target":"",persistent:e.persistent,onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},lC({content:MA(()=>[_M(c,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:MA(()=>[_M(u,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:MA(()=>[_M(l,null,{default:MA(()=>[uC(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:MA(()=>[_M(d,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","persistent","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(iM(),cM(g,{key:0},{default:MA(()=>[_M(p,SM({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:MA(()=>[uC(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),_M(p,SM({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:MA(()=>[_M(m,{class:xE(e.ns.e("icon"))},{default:MA(()=>[_M(f)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):EM("v-if",!0)],2)}],["__file","dropdown.vue"]]);const IJ=sS({components:{ElRovingFocusCollectionItem:KQ},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:n,loop:i,onItemFocus:r,onItemShiftTab:s}=qC(JQ,void 0),{getItems:o}=qC(ZQ,void 0),a=jW(),l=_I(),u=PZ(e=>{t("mousedown",e)},t=>{e.focusable?r(xI(a)):t.preventDefault()}),c=PZ(e=>{t("focus",e)},()=>{r(xI(a))}),d=PZ(e=>{t("keydown",e)},e=>{const{code:t,shiftKey:n,target:r,currentTarget:a}=e;if(t===sW.tab&&n)return void s();if(r!==a)return;const l=nJ(e);if(l){e.preventDefault();let t=o().filter(e=>e.focusable).map(e=>e.ref);switch(l){case"last":t.reverse();break;case"prev":case"next":{"prev"===l&&t.reverse();const e=t.indexOf(a);t=i.value?((e,t)=>e.map((n,i)=>e[(i+t)%e.length]))(t,e+1):t.slice(e+1);break}}oA(()=>{iJ(t)})}}),h=tk(()=>n.value===xI(a));return XC(eJ,{rovingFocusGroupItemRef:l,tabIndex:tk(()=>xI(h)?0:-1),handleMousedown:u,handleFocus:c,handleKeydown:d}),{id:a,handleKeydown:d,handleFocus:c,handleMousedown:u}}});var AJ=UH(IJ,[["render",function(e,t,n,i,r,s){const o=tC("el-roving-focus-collection-item");return iM(),cM(o,{id:e.id,focusable:e.focusable,active:e.active},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["id","focusable","active"])}],["__file","roving-focus-item.vue"]]);const SJ=(...e)=>t=>{e.forEach(e=>{Yx(e)?e(t):e.value=t})},CJ=sS({name:"DropdownItemImpl",components:{ElIcon:WH},props:cJ,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:t}){const n=Zz("dropdown"),{role:i}=qC(vJ,void 0),{collectionItemRef:r}=qC(yJ,void 0),{collectionItemRef:s}=qC(QQ,void 0),{rovingFocusGroupItemRef:o,tabIndex:a,handleFocus:l,handleKeydown:u,handleMousedown:c}=qC(eJ,void 0),d=SJ(r,s,o),h=tk(()=>"menu"===i.value?"menuitem":"navigation"===i.value?"link":"button"),p=PZ(e=>{if([sW.enter,sW.numpadEnter,sW.space].includes(e.code))return e.preventDefault(),e.stopImmediatePropagation(),t("clickimpl",e),!0},u);return{ns:n,itemRef:d,dataset:{[HQ]:""},role:h,tabIndex:a,handleFocus:l,handleKeydown:p,handleMousedown:c}}});const OJ=()=>{const e=qC(bJ,{}),t=tk(()=>null==e?void 0:e.dropdownSize);return{elDropdown:e,_elDropdownSize:t}},MJ=sS({name:"ElDropdownItem",components:{ElDropdownCollectionItem:gJ,ElRovingFocusItem:AJ,ElDropdownItemImpl:UH(CJ,[["render",function(e,t,n,i,r,s){const o=tC("el-icon");return iM(),uM(ZO,null,[e.divided?(iM(),uM("li",{key:0,role:"separator",class:xE(e.ns.bem("menu","item","divided"))},null,2)):EM("v-if",!0),gM("li",SM({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:t=>e.$emit("clickimpl",t),onFocus:e.handleFocus,onKeydown:YR(e.handleKeydown,["self"]),onMousedown:e.handleMousedown,onPointermove:t=>e.$emit("pointermove",t),onPointerleave:t=>e.$emit("pointerleave",t)}),[e.icon?(iM(),cM(o,{key:0},{default:MA(()=>[(iM(),cM(iC(e.icon)))]),_:1})):EM("v-if",!0),uC(e.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}],["__file","dropdown-item-impl.vue"]])},inheritAttrs:!1,props:cJ,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:n}){const{elDropdown:i}=OJ(),r=NM(),s=_I(null),o=tk(()=>{var e,t;return null!=(t=null==(e=xI(s))?void 0:e.textContent)?t:""}),{onItemEnter:a,onItemLeave:l}=qC(vJ,void 0),u=PZ(e=>(t("pointermove",e),e.defaultPrevented),BZ(t=>{if(e.disabled)return void l(t);const n=t.currentTarget;n===document.activeElement||n.contains(document.activeElement)||(a(t),t.defaultPrevented||null==n||n.focus({preventScroll:!0}))})),c=PZ(e=>(t("pointerleave",e),e.defaultPrevented),BZ(l)),d=PZ(n=>{if(!e.disabled)return t("click",n),"keydown"!==n.type&&n.defaultPrevented},t=>{var n,s,o;e.disabled?t.stopImmediatePropagation():((null==(n=null==i?void 0:i.hideOnClick)?void 0:n.value)&&(null==(s=i.handleClick)||s.call(i)),null==(o=i.commandHandler)||o.call(i,e.command,r,t))});return{handleClick:d,handlePointerMove:u,handlePointerLeave:c,textContent:o,propsAndAttrs:tk(()=>({...e,...n}))}}});var kJ=UH(MJ,[["render",function(e,t,n,i,r,s){var o;const a=tC("el-dropdown-item-impl"),l=tC("el-roving-focus-item"),u=tC("el-dropdown-collection-item");return iM(),cM(u,{disabled:e.disabled,"text-value":null!=(o=e.textValue)?o:e.textContent},{default:MA(()=>[_M(l,{focusable:!e.disabled},{default:MA(()=>[_M(a,SM(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:MA(()=>[uC(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}],["__file","dropdown-item.vue"]]);const RJ=sS({name:"ElDropdownMenu",props:dJ,setup(e){const t=Zz("dropdown"),{_elDropdownSize:n}=OJ(),i=n.value,{focusTrapRef:r,onKeydown:s}=qC(ZZ,void 0),{contentRef:o,role:a,triggerId:l}=qC(vJ,void 0),{collectionRef:u,getItems:c}=qC(_J,void 0),{rovingFocusGroupRef:d,rovingFocusGroupRootStyle:h,tabIndex:p,onBlur:f,onFocus:m,onMousedown:g}=qC(JQ,void 0),{collectionRef:_}=qC(ZQ,void 0),y=tk(()=>[t.b("menu"),t.bm("menu",null==i?void 0:i.value)]),v=SJ(o,u,r,d,_),b=PZ(t=>{var n;null==(n=e.onKeydown)||n.call(e,t)},e=>{const{currentTarget:t,code:n,target:i}=e;if(t.contains(i),sW.tab===n&&e.stopImmediatePropagation(),e.preventDefault(),i!==xI(o)||!fJ.includes(n))return;const r=c().filter(e=>!e.disabled).map(e=>e.ref);pJ.includes(n)&&r.reverse(),iJ(r)});return{size:i,rovingFocusGroupRootStyle:h,tabIndex:p,dropdownKls:y,role:a,triggerId:l,dropdownListWrapperRef:v,handleKeydown:e=>{b(e),s(e)},onBlur:f,onFocus:m,onMousedown:g}}});var NJ=UH(RJ,[["render",function(e,t,n,i,r,s){return iM(),uM("ul",{ref:e.dropdownListWrapperRef,class:xE(e.dropdownKls),style:_E(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:e.onBlur,onFocus:e.onFocus,onKeydown:YR(e.handleKeydown,["self"]),onMousedown:YR(e.onMousedown,["self"])},[uC(e.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}],["__file","dropdown-menu.vue"]]);const DJ=bG(wJ,{DropdownItem:kJ,DropdownMenu:NJ}),FJ=TG(kJ),LJ=TG(NJ),PJ=Symbol("uploadContextKey"),BJ=oG({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:e=>e>=0&&e<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:Boolean,duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:Boolean,width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},striped:Boolean,stripedFlow:Boolean,format:{type:Function,default:e=>`${e}%`}}),$J=sS({name:"ElProgress"}),UJ=sS({...$J,props:BJ,setup(e){const t=e,n={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},i=Zz("progress"),r=tk(()=>{const e={width:`${t.percentage}%`,animationDuration:`${t.duration}s`},n=_(t.percentage);return n.includes("gradient")?e.background=n:e.backgroundColor=n,e}),s=tk(()=>(t.strokeWidth/t.width*100).toFixed(1)),o=tk(()=>["circle","dashboard"].includes(t.type)?Number.parseInt(""+(50-Number.parseFloat(s.value)/2),10):0),a=tk(()=>{const e=o.value,n="dashboard"===t.type;return`\n M 50 50\n m 0 ${n?"":"-"}${e}\n a ${e} ${e} 0 1 1 0 ${n?"-":""}${2*e}\n a ${e} ${e} 0 1 1 0 ${n?"":"-"}${2*e}\n `}),l=tk(()=>2*Math.PI*o.value),u=tk(()=>"dashboard"===t.type?.75:1),c=tk(()=>`${-1*l.value*(1-u.value)/2}px`),d=tk(()=>({strokeDasharray:`${l.value*u.value}px, ${l.value}px`,strokeDashoffset:c.value})),h=tk(()=>({strokeDasharray:`${l.value*u.value*(t.percentage/100)}px, ${l.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),p=tk(()=>{let e;return e=t.color?_(t.percentage):n[t.status]||n.default,e}),f=tk(()=>"warning"===t.status?fH:"line"===t.type?"success"===t.status?LG:UG:"success"===t.status?DG:HG),m=tk(()=>"line"===t.type?12+.4*t.strokeWidth:.111111*t.width+2),g=tk(()=>t.format(t.percentage));const _=e=>{var n;const{color:i}=t;if(Yx(i))return i(e);if(Gx(i))return i;{const t=function(e){const t=100/e.length;return e.map((e,n)=>Gx(e)?{color:e,percentage:(n+1)*t}:e).sort((e,t)=>e.percentage-t.percentage)}(i);for(const n of t)if(n.percentage>e)return n.color;return null==(n=t[t.length-1])?void 0:n.color}};return(e,t)=>(iM(),uM("div",{class:xE([xI(i).b(),xI(i).m(e.type),xI(i).is(e.status),{[xI(i).m("without-text")]:!e.showText,[xI(i).m("text-inside")]:e.textInside}]),role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"},["line"===e.type?(iM(),uM("div",{key:0,class:xE(xI(i).b("bar"))},[gM("div",{class:xE(xI(i).be("bar","outer")),style:_E({height:`${e.strokeWidth}px`})},[gM("div",{class:xE([xI(i).be("bar","inner"),{[xI(i).bem("bar","inner","indeterminate")]:e.indeterminate},{[xI(i).bem("bar","inner","striped")]:e.striped},{[xI(i).bem("bar","inner","striped-flow")]:e.stripedFlow}]),style:_E(xI(r))},[(e.showText||e.$slots.default)&&e.textInside?(iM(),uM("div",{key:0,class:xE(xI(i).be("bar","innerText"))},[uC(e.$slots,"default",{percentage:e.percentage},()=>[gM("span",null,$E(xI(g)),1)])],2)):EM("v-if",!0)],6)],6)],2)):(iM(),uM("div",{key:1,class:xE(xI(i).b("circle")),style:_E({height:`${e.width}px`,width:`${e.width}px`})},[(iM(),uM("svg",{viewBox:"0 0 100 100"},[gM("path",{class:xE(xI(i).be("circle","track")),d:xI(a),stroke:`var(${xI(i).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":e.strokeLinecap,"stroke-width":xI(s),fill:"none",style:_E(xI(d))},null,14,["d","stroke","stroke-linecap","stroke-width"]),gM("path",{class:xE(xI(i).be("circle","path")),d:xI(a),stroke:xI(p),fill:"none",opacity:e.percentage?1:0,"stroke-linecap":e.strokeLinecap,"stroke-width":xI(s),style:_E(xI(h))},null,14,["d","stroke","opacity","stroke-linecap","stroke-width"])]))],6)),!e.showText&&!e.$slots.default||e.textInside?EM("v-if",!0):(iM(),uM("div",{key:2,class:xE(xI(i).e("text")),style:_E({fontSize:`${xI(m)}px`})},[uC(e.$slots,"default",{percentage:e.percentage},()=>[e.status?(iM(),cM(xI(WH),{key:1},{default:MA(()=>[(iM(),cM(iC(xI(f))))]),_:1})):(iM(),uM("span",{key:0},$E(xI(g)),1))])],6))],10,["aria-valuenow"]))}});const VJ=bG(UH(UJ,[["__file","progress.vue"]]));class zJ extends Error{constructor(e,t,n,i){super(e),this.name="UploadAjaxError",this.status=t,this.method=n,this.url=i}}function jJ(e,t,n){let i;return i=n.response?`${n.response.error||n.response}`:n.responseText?`${n.responseText}`:`fail to ${t.method} ${e} ${n.status}`,new zJ(i,n.status,t.method,e)}const YJ=["text","picture","picture-card"];let GJ=1;const HJ=()=>Date.now()+GJ++,WJ=oG({action:{type:String,default:"#"},headers:{type:Object},method:{type:String,default:"post"},data:{type:[Object,Function,Promise],default:()=>({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:YJ,default:"text"},httpRequest:{type:Function,default:e=>{"undefined"==typeof XMLHttpRequest&&cW("ElUpload","XMLHttpRequest is undefined");const t=new XMLHttpRequest,n=e.action;t.upload&&t.upload.addEventListener("progress",t=>{const n=t;n.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(n)});const i=new FormData;if(e.data)for(const[t,n]of Object.entries(e.data))Ux(n)&&n.length?i.append(t,...n):i.append(t,n);i.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(jJ(n,e,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(jJ(n,e,t));e.onSuccess(function(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}(t))}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const r=e.headers||{};if(r instanceof Headers)r.forEach((e,n)=>t.setRequestHeader(n,e));else for(const[e,n]of Object.entries(r))FX(n)||t.setRequestHeader(e,String(n));return t.send(i),t}},disabled:Boolean,limit:Number}),XJ=oG({...WJ,beforeUpload:{type:Function,default:Rx},beforeRemove:{type:Function},onRemove:{type:Function,default:Rx},onChange:{type:Function,default:Rx},onPreview:{type:Function,default:Rx},onSuccess:{type:Function,default:Rx},onProgress:{type:Function,default:Rx},onError:{type:Function,default:Rx},onExceed:{type:Function,default:Rx},crossorigin:{type:String}}),qJ=oG({files:{type:Array,default:()=>[]},disabled:Boolean,handlePreview:{type:Function,default:Rx},listType:{type:String,values:YJ,default:"text"},crossorigin:{type:String}}),KJ=sS({name:"ElUploadList"}),ZJ=sS({...KJ,props:qJ,emits:{remove:e=>!!e},setup(e,{emit:t}){const n=e,{t:i}=nG(),r=Zz("upload"),s=Zz("icon"),o=Zz("list"),a=KW(),l=_I(!1),u=tk(()=>[r.b("list"),r.bm("list",n.listType),r.is("disabled",n.disabled)]),c=e=>{t("remove",e)};return(e,t)=>(iM(),cM(ER,{tag:"ul",class:xE(xI(u)),name:xI(o).b()},{default:MA(()=>[(iM(!0),uM(ZO,null,aC(e.files,(t,n)=>(iM(),uM("li",{key:t.uid||t.name,class:xE([xI(r).be("list","item"),xI(r).is(t.status),{focusing:l.value}]),tabindex:"0",onKeydown:HR(e=>!xI(a)&&c(t),["delete"]),onFocus:e=>l.value=!0,onBlur:e=>l.value=!1,onClick:e=>l.value=!1},[uC(e.$slots,"default",{file:t,index:n},()=>["picture"===e.listType||"uploading"!==t.status&&"picture-card"===e.listType?(iM(),uM("img",{key:0,class:xE(xI(r).be("list","item-thumbnail")),src:t.url,crossorigin:e.crossorigin,alt:""},null,10,["src","crossorigin"])):EM("v-if",!0),"uploading"===t.status||"picture-card"!==e.listType?(iM(),uM("div",{key:1,class:xE(xI(r).be("list","item-info"))},[gM("a",{class:xE(xI(r).be("list","item-name")),onClick:YR(n=>e.handlePreview(t),["prevent"])},[_M(xI(WH),{class:xE(xI(s).m("document"))},{default:MA(()=>[_M(xI(KG))]),_:1},8,["class"]),gM("span",{class:xE(xI(r).be("list","item-file-name")),title:t.name},$E(t.name),11,["title"])],10,["onClick"]),"uploading"===t.status?(iM(),cM(xI(VJ),{key:0,type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:Number(t.percentage),style:_E("picture-card"===e.listType?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):EM("v-if",!0)],2)):EM("v-if",!0),gM("label",{class:xE(xI(r).be("list","item-status-label"))},["text"===e.listType?(iM(),cM(xI(WH),{key:0,class:xE([xI(s).m("upload-success"),xI(s).m("circle-check")])},{default:MA(()=>[_M(xI(LG))]),_:1},8,["class"])):["picture-card","picture"].includes(e.listType)?(iM(),cM(xI(WH),{key:1,class:xE([xI(s).m("upload-success"),xI(s).m("check")])},{default:MA(()=>[_M(xI(DG))]),_:1},8,["class"])):EM("v-if",!0)],2),xI(a)?EM("v-if",!0):(iM(),cM(xI(WH),{key:2,class:xE(xI(s).m("close")),onClick:e=>c(t)},{default:MA(()=>[_M(xI(HG))]),_:2},1032,["class","onClick"])),EM(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),EM(" This is a bug which needs to be fixed "),EM(" TODO: Fix the incorrect navigation interaction "),xI(a)?EM("v-if",!0):(iM(),uM("i",{key:3,class:xE(xI(s).m("close-tip"))},$E(xI(i)("el.upload.deleteTip")),3)),"picture-card"===e.listType?(iM(),uM("span",{key:4,class:xE(xI(r).be("list","item-actions"))},[gM("span",{class:xE(xI(r).be("list","item-preview")),onClick:n=>e.handlePreview(t)},[_M(xI(WH),{class:xE(xI(s).m("zoom-in"))},{default:MA(()=>[_M(xI(gH))]),_:1},8,["class"])],10,["onClick"]),xI(a)?EM("v-if",!0):(iM(),uM("span",{key:0,class:xE(xI(r).be("list","item-delete")),onClick:e=>c(t)},[_M(xI(WH),{class:xE(xI(s).m("delete"))},{default:MA(()=>[_M(xI(XG))]),_:1},8,["class"])],10,["onClick"]))],2)):EM("v-if",!0)])],42,["onKeydown","onFocus","onBlur","onClick"]))),128)),uC(e.$slots,"append")]),_:3},8,["class","name"]))}});var QJ=UH(ZJ,[["__file","upload-list.vue"]]);const JJ=function(){this.__data__=new AY,this.size=0};const e0=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const t0=function(e){return this.__data__.get(e)};const n0=function(e){return this.__data__.has(e)};const i0=function(e,t){var n=this.__data__;if(n instanceof AY){var i=n.__data__;if(!SY||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new LY(i)}return n.set(e,t),this.size=n.size,this};function r0(e){var t=this.__data__=new AY(e);this.size=t.size}r0.prototype.clear=JJ,r0.prototype.delete=e0,r0.prototype.get=t0,r0.prototype.has=n0,r0.prototype.set=i0;const s0=r0;const o0=function(e,t){for(var n=-1,i=null==e?0:e.length;++na))return!1;var u=s.get(e),c=s.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,p=2&n?new K1:void 0;for(s.set(e,t),s.set(t,e);++dUx(e)},g2="ElUploadDrag",_2=sS({name:g2}),y2=sS({..._2,props:f2,emits:m2,setup(e,{emit:t}){qC(PJ)||cW(g2,"usage: ");const n=Zz("upload"),i=_I(!1),r=KW(),s=e=>{if(r.value)return;i.value=!1,e.stopPropagation();const n=Array.from(e.dataTransfer.files),s=e.dataTransfer.items||[];n.forEach((e,t)=>{var n;const i=s[t],r=null==(n=null==i?void 0:i.webkitGetAsEntry)?void 0:n.call(i);r&&(e.isDirectory=r.isDirectory)}),t("file",n)},o=()=>{r.value||(i.value=!0)},a=e=>{e.currentTarget.contains(e.relatedTarget)||(i.value=!1)};return(e,t)=>(iM(),uM("div",{class:xE([xI(n).b("dragger"),xI(n).is("dragover",i.value)]),onDrop:YR(s,["prevent"]),onDragover:YR(o,["prevent"]),onDragleave:YR(a,["prevent"])},[uC(e.$slots,"default")],42,["onDrop","onDragover","onDragleave"]))}});var v2=UH(y2,[["__file","upload-dragger.vue"]]);const b2=oG({...WJ,beforeUpload:{type:Function,default:Rx},onRemove:{type:Function,default:Rx},onStart:{type:Function,default:Rx},onSuccess:{type:Function,default:Rx},onProgress:{type:Function,default:Rx},onError:{type:Function,default:Rx},onExceed:{type:Function,default:Rx}}),T2=sS({name:"ElUploadContent",inheritAttrs:!1}),x2=sS({...T2,props:b2,setup(e,{expose:t}){const n=e,i=Zz("upload"),r=KW(),s=yI({}),o=yI(),a=e=>{if(0===e.length)return;const{autoUpload:t,limit:i,fileList:r,multiple:s,onStart:o,onExceed:a}=n;if(i&&r.length+e.length>i)a(e,r);else{s||(e=e.slice(0,1));for(const n of e){const e=n;e.uid=HJ(),o(e),t&&l(e)}}},l=async e=>{if(o.value.value="",!n.beforeUpload)return u(e);let t,i={};try{const r=n.data,s=n.beforeUpload(e);i=Qx(n.data)?H1(n.data):n.data,t=await s,Qx(n.data)&&p2(r,i)&&(i=H1(n.data))}catch(e){t=!1}if(!1===t)return void n.onRemove(e);let r=e;t instanceof Blob&&(r=t instanceof File?t:new File([t],e.name,{type:e.type})),u(Object.assign(r,{uid:e.uid}),i)},u=async(e,t)=>{const{headers:i,data:r,method:o,withCredentials:a,name:l,action:u,onProgress:c,onSuccess:d,onError:h,httpRequest:p}=n;try{t=await(async(e,t)=>Yx(e)?e(t):e)(null!=t?t:r,e)}catch(t){return void n.onRemove(e)}const{uid:f}=e,m={headers:i||{},withCredentials:a,file:e,data:t,method:o,filename:l,action:u,onProgress:t=>{c(t,e)},onSuccess:t=>{d(t,e),delete s.value[f]},onError:t=>{h(t,e),delete s.value[f]}},g=p(m);s.value[f]=g,g instanceof Promise&&g.then(m.onSuccess,m.onError)},c=e=>{const t=e.target.files;t&&a(Array.from(t))},d=()=>{r.value||(o.value.value="",o.value.click())},h=()=>{d()};return t({abort:e=>{const t=(n=s.value,Object.entries(n)).filter(e?([t])=>String(e.uid)===t:()=>!0);var n;t.forEach(([e,t])=>{t instanceof XMLHttpRequest&&t.abort(),delete s.value[e]})},upload:l}),(e,t)=>(iM(),uM("div",{class:xE([xI(i).b(),xI(i).m(e.listType),xI(i).is("drag",e.drag),xI(i).is("disabled",xI(r))]),tabindex:xI(r)?"-1":"0",onClick:d,onKeydown:HR(YR(h,["self"]),["enter","space"])},[e.drag?(iM(),cM(v2,{key:0,disabled:xI(r),onFile:a},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["disabled"])):uC(e.$slots,"default",{key:1}),gM("input",{ref_key:"inputRef",ref:o,class:xE(xI(i).e("input")),name:e.name,disabled:xI(r),multiple:e.multiple,accept:e.accept,type:"file",onChange:c,onClick:YR(()=>{},["stop"])},null,42,["name","disabled","multiple","accept","onClick"])],42,["tabindex","onKeydown"]))}});var E2=UH(x2,[["__file","upload-content.vue"]]);const w2="ElUpload",I2=e=>{var t;(null==(t=e.url)?void 0:t.startsWith("blob:"))&&URL.revokeObjectURL(e.url)},A2=(e,t)=>{const n=BH(e,"fileList",void 0,{passive:!0}),i=e=>n.value.find(t=>t.uid===e.uid);function r(e){var n;null==(n=t.value)||n.abort(e)}function s(e){n.value=n.value.filter(t=>t.uid!==e.uid)}return CO(()=>e.listType,t=>{"picture-card"!==t&&"picture"!==t||(n.value=n.value.map(t=>{const{raw:i,url:r}=t;if(!r&&i)try{t.url=URL.createObjectURL(i)}catch(i){e.onError(i,t,n.value)}return t}))}),CO(n,e=>{for(const t of e)t.uid||(t.uid=HJ()),t.status||(t.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:r,clearFiles:function(e=["ready","uploading","success","fail"]){n.value=n.value.filter(t=>!e.includes(t.status))},handleError:(t,r)=>{const o=i(r);o&&(console.error(t),o.status="fail",s(o),e.onError(t,o,n.value),e.onChange(o,n.value))},handleProgress:(t,r)=>{const s=i(r);s&&(e.onProgress(t,s,n.value),s.status="uploading",s.percentage=Math.round(t.percent))},handleStart:t=>{FX(t.uid)&&(t.uid=HJ());const i={name:t.name,percentage:0,status:"ready",size:t.size,raw:t,uid:t.uid};if("picture-card"===e.listType||"picture"===e.listType)try{i.url=URL.createObjectURL(t)}catch(t){t.message,e.onError(t,i,n.value)}n.value=[...n.value,i],e.onChange(i,n.value)},handleSuccess:(t,r)=>{const s=i(r);s&&(s.status="success",s.response=t,e.onSuccess(t,s,n.value),e.onChange(s,n.value))},handleRemove:async t=>{const o=t instanceof File?i(t):t;o||cW(w2,"file to be removed not found");const a=t=>{r(t),s(t),e.onRemove(t,n.value),I2(t)};if(e.beforeRemove){!1!==await e.beforeRemove(o,n.value)&&a(o)}else a(o)},submit:function(){n.value.filter(({status:e})=>"ready"===e).forEach(({raw:e})=>{var n;return e&&(null==(n=t.value)?void 0:n.upload(e))})},revokeFileObjectURL:I2}},S2=sS({name:"ElUpload"}),C2=sS({...S2,props:XJ,setup(e,{expose:t}){const n=e,i=KW(),r=yI(),{abort:s,submit:o,clearFiles:a,uploadFiles:l,handleStart:u,handleError:c,handleRemove:d,handleSuccess:h,handleProgress:p,revokeFileObjectURL:f}=A2(n,r),m=tk(()=>"picture-card"===n.listType),g=tk(()=>({...n,fileList:l.value,onStart:u,onProgress:p,onSuccess:h,onError:c,onRemove:d}));return WS(()=>{l.value.forEach(f)}),XC(PJ,{accept:kI(n,"accept")}),t({abort:s,submit:o,clearFiles:a,handleStart:u,handleRemove:d}),(e,t)=>(iM(),uM("div",null,[xI(m)&&e.showFileList?(iM(),cM(QJ,{key:0,disabled:xI(i),"list-type":e.listType,files:xI(l),crossorigin:e.crossorigin,"handle-preview":e.onPreview,onRemove:xI(d)},lC({append:MA(()=>[_M(E2,SM({ref_key:"uploadRef",ref:r},xI(g)),{default:MA(()=>[e.$slots.trigger?uC(e.$slots,"trigger",{key:0}):EM("v-if",!0),!e.$slots.trigger&&e.$slots.default?uC(e.$slots,"default",{key:1}):EM("v-if",!0)]),_:3},16)]),_:2},[e.$slots.file?{name:"default",fn:MA(({file:t,index:n})=>[uC(e.$slots,"file",{file:t,index:n})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):EM("v-if",!0),!xI(m)||xI(m)&&!e.showFileList?(iM(),cM(E2,SM({key:1,ref_key:"uploadRef",ref:r},xI(g)),{default:MA(()=>[e.$slots.trigger?uC(e.$slots,"trigger",{key:0}):EM("v-if",!0),!e.$slots.trigger&&e.$slots.default?uC(e.$slots,"default",{key:1}):EM("v-if",!0)]),_:3},16)):EM("v-if",!0),e.$slots.trigger?uC(e.$slots,"default",{key:2}):EM("v-if",!0),uC(e.$slots,"tip"),!xI(m)&&e.showFileList?(iM(),cM(QJ,{key:3,disabled:xI(i),"list-type":e.listType,files:xI(l),crossorigin:e.crossorigin,"handle-preview":e.onPreview,onRemove:xI(d)},lC({_:2},[e.$slots.file?{name:"default",fn:MA(({file:t,index:n})=>[uC(e.$slots,"file",{file:t,index:n})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):EM("v-if",!0)]))}});const O2=bG(UH(C2,[["__file","upload.vue"]]));const M2=function(){return Oj.Date.now()};var k2=/\s/;const R2=function(e){for(var t=e.length;t--&&k2.test(e.charAt(t)););return t};var N2=/^\s+/;const D2=function(e){return e?e.slice(0,R2(e)+1).replace(N2,""):e};var F2=/^[-+]0x[0-9a-f]+$/i,L2=/^0b[01]+$/i,P2=/^0o[0-7]+$/i,B2=parseInt;const $2=function(e){if("number"==typeof e)return e;if(Vj(e))return NaN;if(Gj(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gj(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=D2(e);var n=L2.test(e);return n||P2.test(e)?B2(e.slice(2),n?2:8):F2.test(e)?NaN:+e};var U2=Math.max,V2=Math.min;const z2=function(e,t,n){var i,r,s,o,a,l,u=0,c=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,s=r;return i=r=void 0,u=t,o=e.apply(s,n)}function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=s}function m(){var e=M2();if(f(e))return g(e);a=setTimeout(m,function(e){var n=t-(e-l);return d?V2(n,s-(e-u)):n}(e))}function g(e){return a=void 0,h&&i?p(e):(i=r=void 0,o)}function _(){var e=M2(),n=f(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return function(e){return u=e,a=setTimeout(m,t),c?p(e):o}(l);if(d)return clearTimeout(a),a=setTimeout(m,t),p(l)}return void 0===a&&(a=setTimeout(m,t)),o}return t=$2(t)||0,Gj(n)&&(c=!!n.leading,s=(d="maxWait"in n)?U2($2(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),u=0,i=l=r=a=void 0},_.flush=function(){return void 0===a?o:g(M2())},_};const j2=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Gj(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),z2(e,t,{leading:i,maxWait:t,trailing:r})},Y2=oG({urlList:{type:Array,default:()=>[]},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:Boolean,teleported:Boolean,closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:String}}),G2={close:()=>!0,error:e=>e instanceof Event,switch:e=>ej(e),rotate:e=>ej(e)},H2=sS({name:"ElImageViewer"}),W2=sS({...H2,props:Y2,emits:G2,setup(e,{expose:t,emit:n}){var i;const r=e,s={CONTAIN:{name:"contain",icon:pI(eH)},ORIGINAL:{name:"original",icon:pI(dH)}};let o,a="";const{t:l}=nG(),u=Zz("image-viewer"),{nextZIndex:c}=Ij(),d=_I(),h=_I(),p=GE(),f=tk(()=>{const{scale:e,minScale:t,maxScale:n}=r;return((e,t,n)=>Math.min(n,Math.max(t,e)))(e,t,n)}),m=_I(!0),g=_I(!1),_=_I(r.initialIndex),y=yI(s.CONTAIN),v=_I({scale:f.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),b=_I(null!=(i=r.zIndex)?i:c()),T=tk(()=>{const{urlList:e}=r;return e.length<=1}),x=tk(()=>0===_.value),E=tk(()=>_.value===r.urlList.length-1),w=tk(()=>r.urlList[_.value]),I=tk(()=>[u.e("btn"),u.e("prev"),u.is("disabled",!r.infinite&&x.value)]),A=tk(()=>[u.e("btn"),u.e("next"),u.is("disabled",!r.infinite&&E.value)]),S=tk(()=>{const{scale:e,deg:t,offsetX:n,offsetY:i,enableTransition:r}=v.value;let o=n/e,a=i/e;const l=t*Math.PI/180,u=Math.cos(l),c=Math.sin(l);o=o*u+a*c,a=a*u-n/e*c;const d={transform:`scale(${e}) rotate(${t}deg) translate(${o}px, ${a}px)`,transition:r?"transform .3s":""};return y.value.name===s.CONTAIN.name&&(d.maxWidth=d.maxHeight="100%"),d}),C=tk(()=>`${_.value+1} / ${r.urlList.length}`);function O(){p.stop(),null==o||o(),document.body.style.overflow=a,n("close")}function M(){m.value=!1}function k(e){g.value=!0,m.value=!1,n("error",e),e.target.alt=l("el.image.error")}function R(e){if(m.value||0!==e.button||!d.value)return;v.value.enableTransition=!1;const{offsetX:t,offsetY:n}=v.value,i=e.pageX,r=e.pageY,s=j2(e=>{v.value={...v.value,offsetX:t+e.pageX-i,offsetY:n+e.pageY-r}}),o=bH(document,"mousemove",s);bH(document,"mouseup",()=>{o()}),e.preventDefault()}function N(){v.value={scale:f.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function D(){if(m.value||g.value)return;const e=hG(s),t=Object.values(s),n=y.value.name,i=(t.findIndex(e=>e.name===n)+1)%e.length;y.value=s[e[i]],N()}function F(e){g.value=!1;const t=r.urlList.length;_.value=(e+t)%t}function L(){x.value&&!r.infinite||F(_.value-1)}function P(){E.value&&!r.infinite||F(_.value+1)}function B(e,t={}){if(m.value||g.value)return;const{minScale:i,maxScale:s}=r,{zoomRate:o,rotateDeg:a,enableTransition:l}={zoomRate:r.zoomRate,rotateDeg:90,enableTransition:!0,...t};switch(e){case"zoomOut":v.value.scale>i&&(v.value.scale=Number.parseFloat((v.value.scale/o).toFixed(3)));break;case"zoomIn":v.value.scale0?(e.preventDefault(),!1):void 0}return CO(()=>f.value,e=>{v.value.scale=e}),CO(w,()=>{oA(()=>{const e=h.value;(null==e?void 0:e.complete)||(m.value=!0)})}),CO(_,e=>{N(),n("switch",e)}),YS(()=>{!function(){const e=j2(e=>{switch(e.code){case sW.esc:r.closeOnPressEscape&&O();break;case sW.space:D();break;case sW.left:L();break;case sW.up:B("zoomIn");break;case sW.right:P();break;case sW.down:B("zoomOut")}}),t=j2(e=>{B((e.deltaY||e.deltaX)<0?"zoomIn":"zoomOut",{zoomRate:r.zoomRate,enableTransition:!1})});p.run(()=>{bH(document,"keydown",e),bH(document,"wheel",t)})}(),o=bH("wheel",V,{passive:!1}),a=document.body.style.overflow,document.body.style.overflow="hidden"}),t({setActiveItem:F}),(e,t)=>(iM(),cM(xI(zZ),{to:"body",disabled:!e.teleported},{default:MA(()=>[_M(Ak,{name:"viewer-fade",appear:""},{default:MA(()=>[gM("div",{ref_key:"wrapper",ref:d,tabindex:-1,class:xE(xI(u).e("wrapper")),style:_E({zIndex:b.value})},[_M(xI(mQ),{loop:"",trapped:"","focus-trap-el":d.value,"focus-start-el":"container",onFocusoutPrevented:$,onReleaseRequested:U},{default:MA(()=>[gM("div",{class:xE(xI(u).e("mask")),onClick:YR(t=>e.hideOnClickModal&&O(),["self"])},null,10,["onClick"]),EM(" CLOSE "),gM("span",{class:xE([xI(u).e("btn"),xI(u).e("close")]),onClick:O},[_M(xI(WH),null,{default:MA(()=>[_M(xI(HG))]),_:1})],2),EM(" ARROW "),xI(T)?EM("v-if",!0):(iM(),uM(ZO,{key:0},[gM("span",{class:xE(xI(I)),onClick:L},[_M(xI(WH),null,{default:MA(()=>[_M(xI(AG))]),_:1})],2),gM("span",{class:xE(xI(A)),onClick:P},[_M(xI(WH),null,{default:MA(()=>[_M(xI(CG))]),_:1})],2)],64)),e.$slots.progress||e.showProgress?(iM(),uM("div",{key:1,class:xE([xI(u).e("btn"),xI(u).e("progress")])},[uC(e.$slots,"progress",{activeIndex:_.value,total:e.urlList.length},()=>[TM($E(xI(C)),1)])],2)):EM("v-if",!0),EM(" ACTIONS "),gM("div",{class:xE([xI(u).e("btn"),xI(u).e("actions")])},[gM("div",{class:xE(xI(u).e("actions__inner"))},[uC(e.$slots,"toolbar",{actions:B,prev:L,next:P,reset:D,activeIndex:_.value,setActiveItem:F},()=>[_M(xI(WH),{onClick:e=>B("zoomOut")},{default:MA(()=>[_M(xI(_H))]),_:1},8,["onClick"]),_M(xI(WH),{onClick:e=>B("zoomIn")},{default:MA(()=>[_M(xI(gH))]),_:1},8,["onClick"]),gM("i",{class:xE(xI(u).e("actions__divider"))},null,2),_M(xI(WH),{onClick:D},{default:MA(()=>[(iM(),cM(iC(xI(y).icon)))]),_:1}),gM("i",{class:xE(xI(u).e("actions__divider"))},null,2),_M(xI(WH),{onClick:e=>B("anticlockwise")},{default:MA(()=>[_M(xI(uH))]),_:1},8,["onClick"]),_M(xI(WH),{onClick:e=>B("clockwise")},{default:MA(()=>[_M(xI(cH))]),_:1},8,["onClick"])])],2)],2),EM(" CANVAS "),gM("div",{class:xE(xI(u).e("canvas"))},[g.value&&e.$slots["viewer-error"]?uC(e.$slots,"viewer-error",{key:0,activeIndex:_.value,src:xI(w)}):(iM(),uM("img",{ref_key:"imgRef",ref:h,key:xI(w),src:xI(w),style:_E(xI(S)),class:xE(xI(u).e("img")),crossorigin:e.crossorigin,onLoad:M,onError:k,onMousedown:R},null,46,["src","crossorigin"]))],2),uC(e.$slots,"default")]),_:3},8,["focus-trap-el"])],6)]),_:3})]),_:3},8,["disabled"]))}});const X2=bG(UH(W2,[["__file","image-viewer.vue"]])),q2=oG({hideOnClickModal:Boolean,src:{type:String,default:""},fit:{type:String,values:["","contain","cover","fill","none","scale-down"],default:""},loading:{type:String,values:["eager","lazy"]},lazy:Boolean,scrollContainer:{type:[String,Object]},previewSrcList:{type:Array,default:()=>[]},previewTeleported:Boolean,zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:String}}),K2={load:e=>e instanceof Event,error:e=>e instanceof Event,switch:e=>ej(e),close:()=>!0,show:()=>!0},Z2=(e,t)=>{if(!dj)return!1;const n=((e,t)=>{var n;if(!dj||!e||!t)return"";let i=rE(t);"float"===i&&(i="cssFloat");try{const t=e.style[i];if(t)return t;const r=null==(n=document.defaultView)?void 0:n.getComputedStyle(e,"");return r?r[i]:""}catch(t){return e.style[i]}})(e,{undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)]);return["scroll","auto","overlay"].some(e=>n.includes(e))};const Q2=sS({name:"ElImage",inheritAttrs:!1}),J2=sS({...Q2,props:q2,emits:K2,setup(e,{expose:t,emit:n}){const i=e,{t:r}=nG(),s=Zz("image"),o=IC(),a=tk(()=>iG(Object.entries(o).filter(([e])=>/^(data-|on[A-Z])/i.test(e)||["id","style"].includes(e)))),l=kq({excludeListeners:!0,excludeKeys:tk(()=>Object.keys(a.value))}),u=_I(),c=_I(!1),d=_I(!0),h=_I(!1),p=_I(),f=_I(),m=dj&&"loading"in HTMLImageElement.prototype;let g;const _=tk(()=>[s.e("inner"),v.value&&s.e("preview"),d.value&&s.is("loading")]),y=tk(()=>{const{fit:e}=i;return dj&&e?{objectFit:e}:{}}),v=tk(()=>{const{previewSrcList:e}=i;return Ux(e)&&e.length>0}),b=tk(()=>{const{previewSrcList:e,initialIndex:t}=i;let n=t;return t>e.length-1&&(n=0),n}),T=tk(()=>"eager"!==i.loading&&(!m&&"lazy"===i.loading||i.lazy)),x=()=>{dj&&(d.value=!0,c.value=!1,u.value=i.src)};function E(e){d.value=!1,c.value=!1,n("load",e)}function w(e){d.value=!1,c.value=!0,n("error",e)}const I=vj(function(e){e&&(x(),S())},200,!0);async function A(){var e;if(!dj)return;await oA();const{scrollContainer:t}=i;if(tj(t))f.value=t;else if(Gx(t)&&""!==t)f.value=null!=(e=document.querySelector(t))?e:void 0;else if(p.value){const e=((e,t)=>{if(!dj)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(Z2(n,t))return n;n=n.parentNode}return n})(p.value);f.value=e===window?void 0:e}const{stop:n}=function(e,t,n={}){const{root:i,rootMargin:r="0px",threshold:s=.1,window:o=vH}=n,a=xH(()=>o&&"IntersectionObserver"in o);let l=pj;const u=a.value?CO(()=>({el:yH(e),root:yH(i)}),({el:e,root:n})=>{if(l(),!e)return;const i=new IntersectionObserver(t,{root:n,rootMargin:r,threshold:s});i.observe(e),l=()=>{i.disconnect(),l=pj}},{immediate:!0,flush:"post"}):pj,c=()=>{l(),u()};return yj(c),{isSupported:a,stop:c}}(p,([e])=>{I(e.isIntersecting)},{root:f});g=n}function S(){dj&&I&&(null==g||g(),f.value=void 0,g=void 0)}function C(){v.value&&(h.value=!0,n("show"))}function O(){h.value=!1,n("close")}function M(e){n("switch",e)}return CO(()=>i.src,()=>{T.value?(d.value=!0,c.value=!1,S(),A()):x()}),YS(()=>{T.value?A():x()}),t({showPreview:C}),(e,t)=>(iM(),uM("div",SM({ref_key:"container",ref:p},xI(a),{class:[xI(s).b(),e.$attrs.class]}),[c.value?uC(e.$slots,"error",{key:0},()=>[gM("div",{class:xE(xI(s).e("error"))},$E(xI(r)("el.image.error")),3)]):(iM(),uM(ZO,{key:1},[void 0!==u.value?(iM(),uM("img",SM({key:0},xI(l),{src:u.value,loading:e.loading,style:xI(y),class:xI(_),crossorigin:e.crossorigin,onClick:C,onLoad:E,onError:w}),null,16,["src","loading","crossorigin"])):EM("v-if",!0),d.value?(iM(),uM("div",{key:1,class:xE(xI(s).e("wrapper"))},[uC(e.$slots,"placeholder",{},()=>[gM("div",{class:xE(xI(s).e("placeholder"))},null,2)])],2)):EM("v-if",!0)],64)),xI(v)?(iM(),uM(ZO,{key:2},[h.value?(iM(),cM(xI(X2),{key:0,"z-index":e.zIndex,"initial-index":xI(b),infinite:e.infinite,"zoom-rate":e.zoomRate,"min-scale":e.minScale,"max-scale":e.maxScale,"show-progress":e.showProgress,"url-list":e.previewSrcList,scale:e.scale,crossorigin:e.crossorigin,"hide-on-click-modal":e.hideOnClickModal,teleported:e.previewTeleported,"close-on-press-escape":e.closeOnPressEscape,onClose:O,onSwitch:M},lC({toolbar:MA(t=>[uC(e.$slots,"toolbar",EE(vM(t)))]),default:MA(()=>[e.$slots.viewer?(iM(),uM("div",{key:0},[uC(e.$slots,"viewer")])):EM("v-if",!0)]),_:2},[e.$slots.progress?{name:"progress",fn:MA(t=>[uC(e.$slots,"progress",EE(vM(t)))])}:void 0,e.$slots["viewer-error"]?{name:"viewer-error",fn:MA(t=>[uC(e.$slots,"viewer-error",EE(vM(t)))])}:void 0]),1032,["z-index","initial-index","infinite","zoom-rate","min-scale","max-scale","show-progress","url-list","scale","crossorigin","hide-on-click-modal","teleported","close-on-press-escape"])):EM("v-if",!0)],64)):EM("v-if",!0)],16))}});const e3=bG(UH(J2,[["__file","image.vue"]])),t3={class:"card-header"},n3={key:0,class:"disabled-tag",style:{color:"#f56c6c","margin-left":"8px","font-size":"13px"}},i3={class:"el-dropdown-link"},r3={class:"card-content",style:{"flex-direction":"column",display:"flex"}},s3={class:"card-content-info"},o3={style:{display:"flex",gap:"4px"}},a3={__name:"ClassBox",props:{title:{type:String,default:"类别"},picList:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["add-sample","delete-sample","rename-class","delete-class","disable-class","clear-samples"],setup(e,{emit:t}){const n=e,i=t,r=_I(n.title),s=_I(!1),o=_I(r.value),a=_I(null),l=_I(null);function u(){s.value||(s.value=!0,o.value=r.value,oA(()=>{a.value&&a.value.input&&a.value.input.select()}))}function c(){o.value.trim()&&(r.value=o.value.trim(),i("rename-class",r.value)),s.value=!1}function d(){i("add-sample")}function h(){d(),l.value=setInterval(()=>{d()},200)}function p(){l.value&&(clearInterval(l.value),l.value=null)}function f(){i("delete-class")}function m(){i("disable-class")}function g(){i("clear-samples")}function _(){const e=new(DX());n.picList.forEach((t,n)=>{const i=t.split(",")[1];e.file(`sample_${n+1}.png`,i,{base64:!0})}),e.generateAsync({type:"blob"}).then(e=>{(0,RX.saveAs)(e,"samples.zip")})}function y(e){return new Promise((t,n)=>{if("application/zip"===e.type||e.name.endsWith(".zip")){const r=new(DX());r.loadAsync(e).then(e=>{const n=Object.values(e.files).filter(e=>!e.dir&&e.name.match(/\.(png|jpg|jpeg|gif|bmp)$/i));Promise.all(n.map(e=>r.file(e.name).async("blob").then(t=>{const n=new File([t],e.name,{type:t.type}),i=new FileReader;return i.readAsDataURL(n),new Promise(e=>i.onload=e)}))).then(e=>{e.forEach(e=>i("add-sample",e.target.result)),t(!1)})}).catch(n)}else{const r=new FileReader;r.onload=e=>{i("add-sample",e.target.result),t(!1)},r.onerror=n,r.readAsDataURL(e)}})}return CO(()=>n.title,e=>{r.value=e}),(e,t)=>(iM(),cM(xI(kX),{class:"class-box"},{header:MA(()=>[gM("div",t3,[gM("span",{class:"card-header-title",style:{cursor:"pointer"},onClick:u},[s.value?(iM(),cM(xI(Pq),{key:1,ref_key:"inputRef",ref:a,modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),style:{width:"120px"},onKeyup:HR(c,["enter"]),onBlur:c},null,8,["modelValue"])):(iM(),uM(ZO,{key:0},[TM($E(r.value)+" ",1),_M(xI(WH),{onClick:YR(u,["stop"])},{default:MA(()=>[_M(xI(QG))]),_:1}),n.disabled?(iM(),uM("span",n3," 禁用 ")):EM("v-if",!0)],64))]),_M(xI(DJ),{class:"card-header-title"},{dropdown:MA(()=>[_M(xI(LJ),{class:"class-box-dropdown"},{default:MA(()=>[_M(xI(FJ),{class:"class-box-dropdown-item",onClick:f},{default:MA(()=>t[1]||(t[1]=[gM("span",{style:{color:"#f56c6c"}},"删除类别",-1)])),_:1}),_M(xI(FJ),{class:"class-box-dropdown-item",onClick:m},{default:MA(()=>[TM($E(n.disabled?"启用":"禁用")+"类别 ",1)]),_:1}),_M(xI(FJ),{class:"class-box-dropdown-item",disabled:0===n.picList.length,onClick:g},{default:MA(()=>t[2]||(t[2]=[TM(" 清空样本 ")])),_:1},8,["disabled"]),_M(xI(FJ),{class:"class-box-dropdown-item",disabled:0===n.picList.length,onClick:_},{default:MA(()=>t[3]||(t[3]=[TM(" 导出样本 ")])),_:1},8,["disabled"])]),_:1})]),default:MA(()=>[gM("span",i3,[_M(xI(WH),null,{default:MA(()=>[_M(xI(lH))]),_:1})])]),_:1})])]),default:MA(()=>[gM("div",r3,[gM("div",s3,[TM(" 图像样本 "+$E(n.picList.length)+" ",1),gM("div",o3,[_M(xI(SX),{type:"primary",size:"small",disabled:n.disabled,onMousedown:h,onMouseup:p,onMouseleave:p},{default:MA(()=>[t[4]||(t[4]=TM(" 拍摄样本 ")),_M(xI(WH),null,{default:MA(()=>[_M(xI(RG))]),_:1})]),_:1},8,["disabled"]),_M(xI(O2),{"show-file-list":!1,"before-upload":y,accept:"image/*,.zip",disabled:n.disabled},{default:MA(()=>[_M(xI(SX),{plain:"",type:"primary",size:"small",disabled:n.disabled},{default:MA(()=>[t[5]||(t[5]=TM(" 上传样本 ")),_M(xI(WH),null,{default:MA(()=>[_M(xI(YG))]),_:1})]),_:1},8,["disabled"])]),_:1},8,["disabled"])])]),_M(ER,{name:"fade",tag:"div",class:"card-content-img"},{default:MA(()=>[(iM(!0),uM(ZO,null,aC(n.picList.slice().reverse(),e=>(iM(),uM("div",{key:e,class:"card-content-img-wrapper",style:{position:"relative",display:"inline-block"}},[_M(xI(e3),{src:e,class:xE(["card-content-img-item",{"img-disabled":n.disabled}])},null,8,["src","class"]),_M(xI(WH),{class:"delete-icon",onClick:t=>function(e){i("delete-sample",e)}(e)},{default:MA(()=>[_M(xI(XG))]),_:2},1032,["onClick"])]))),128))]),_:1})])]),_:1}))}},l3=a3,u3={class:"camera-box"},c3={__name:"CameraBox",setup(e,{expose:t}){const n=_I(null),i=qC("shotList");return YS(()=>{navigator.mediaDevices.getUserMedia({video:!0}).then(e=>{n.value&&(n.value.srcObject=e)}).catch(e=>{console.error("无法访问摄像头:",e)})}),t({captureShot:function(){const e=n.value;if(!e)return;const t=e.videoWidth,r=e.videoHeight;let s=0,o=0,a=t,l=r;t>r?(s=(t-r)/2,a=r):r>t&&(o=(r-t)/2,l=t);const u=Math.min(a,l),c=document.createElement("canvas");return c.width=u,c.height=u,c.getContext("2d").drawImage(e,s,o,u,u,0,0,u,u),i.value.push(c.toDataURL("image/png")),c.toDataURL("image/png")}}),(e,t)=>(iM(),uM("div",u3,[gM("video",{id:"webcam",ref_key:"videoRef",ref:n,class:"video-crop",autoplay:"",playsinline:"",muted:"",height:"100%",width:"100%"},null,512)]))}};var d3=__webpack_require__(66262);const h3=(0,d3.A)(c3,[["__scopeId","data-v-da91b390"]]);var p3=__webpack_require__(15838),f3=__webpack_require__(15441),m3=__webpack_require__(29809),g3=__webpack_require__(9258),_3=__webpack_require__(10700); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10174,7 +10174,7 @@ var vG=tS({name:"ArrowDown",__name:"arrow-down",setup:e=>(e,t)=>(JO(),sM("svg",{ * limitations under the License. * ============================================================================= */ -const f3={kernelName:c3.ljI,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,(0,p3.P)((0,d3.w)(n,"float32"),-1))}}};var m3=__webpack_require__(89359),g3=__webpack_require__(96522),_3=__webpack_require__(45702),y3=__webpack_require__(79348),v3=__webpack_require__(45793),b3=__webpack_require__(77126); +const y3={kernelName:f3.ljI,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,(0,_3.P)((0,m3.w)(n,"float32"),-1))}}};var v3=__webpack_require__(89359),b3=__webpack_require__(96522),T3=__webpack_require__(45702),x3=__webpack_require__(79348),E3=__webpack_require__(45793),w3=__webpack_require__(77126); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10191,7 +10191,7 @@ const f3={kernelName:c3.ljI,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const T3={kernelName:c3.Vvy,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,v3.E)((0,d3.w)(n,"float32")),i=(0,y3.R)((0,b3.j)((0,_3.d)(1),t));return(0,g3.H)((0,m3.y)(e,i))}}}},x3={kernelName:c3.PH8,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,y3.R)((0,b3.j)((0,v3.E)((0,d3.w)(n,"float32")),1));return(0,m3.y)(e,t)}}}};var E3=__webpack_require__(62198),w3=__webpack_require__(62302),I3=__webpack_require__(83791); +const I3={kernelName:f3.Vvy,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,E3.E)((0,m3.w)(n,"float32")),i=(0,x3.R)((0,w3.j)((0,T3.d)(1),t));return(0,b3.H)((0,v3.y)(e,i))}}}},A3={kernelName:f3.PH8,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,x3.R)((0,w3.j)((0,E3.E)((0,m3.w)(n,"float32")),1));return(0,v3.y)(e,t)}}}};var S3=__webpack_require__(62198),C3=__webpack_require__(62302),O3=__webpack_require__(83791); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10208,7 +10208,7 @@ const T3={kernelName:c3.Vvy,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const A3={kernelName:c3.OMN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=E3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{let t=e;const i=E3.getReductionAxes(n.shape,r);return i.length>0&&(t=(0,I3.c)(t,i)),(0,w3.t)(t,n.shape)},b:()=>{let t=e;const n=E3.getReductionAxes(i.shape,r);return n.length>0&&(t=(0,I3.c)(t,n)),(0,w3.t)(t,i.shape)}}}},S3={kernelName:c3.EkD,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach((t,i)=>{n[i]=()=>e.clone()}),n}};var C3=__webpack_require__(55537); +const M3={kernelName:f3.OMN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=S3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{let t=e;const i=S3.getReductionAxes(n.shape,r);return i.length>0&&(t=(0,O3.c)(t,i)),(0,C3.t)(t,n.shape)},b:()=>{let t=e;const n=S3.getReductionAxes(i.shape,r);return n.length>0&&(t=(0,O3.c)(t,n)),(0,C3.t)(t,i.shape)}}}},k3={kernelName:f3.EkD,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach((t,i)=>{n[i]=()=>e.clone()}),n}};var R3=__webpack_require__(55537); /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -10225,7 +10225,7 @@ const A3={kernelName:c3.OMN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t * limitations under the License. * ============================================================================= */ -const O3={kernelName:c3.Jp_,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,C3.P)(n)}}},M3={kernelName:c3.p_m,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,C3.P)(n)}}},k3={kernelName:c3.QKF,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,y3.R)((0,b3.j)((0,_3.d)(1),(0,v3.E)((0,d3.w)(n,"float32")))))}}};var R3=__webpack_require__(37523); +const N3={kernelName:f3.Jp_,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,R3.P)(n)}}},D3={kernelName:f3.p_m,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,R3.P)(n)}}},F3={kernelName:f3.QKF,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,x3.R)((0,w3.j)((0,T3.d)(1),(0,E3.E)((0,m3.w)(n,"float32")))))}}};var L3=__webpack_require__(37523); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10242,7 +10242,7 @@ const O3={kernelName:c3.Jp_,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const N3={kernelName:c3.epO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,y3.R)((0,R3.W)((0,_3.d)(1),(0,v3.E)((0,d3.w)(n,"float32"))));return(0,m3.y)(e,t)}}}},D3={kernelName:c3.lxb,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,E3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,R3.W)((0,v3.E)(n),(0,v3.E)(i));let s=(0,h3.l)(e,(0,m3.y)(i,t));const o=(0,E3.getReductionAxes)(n.shape,r);return o.length>0&&(s=(0,I3.c)(s,o)),(0,w3.t)(s,n.shape)},b:()=>{const t=(0,R3.W)((0,v3.E)(n),(0,v3.E)(i));let s=(0,g3.H)((0,h3.l)(e,(0,m3.y)(n,t)));const o=(0,E3.getReductionAxes)(i.shape,r);return o.length>0&&(s=(0,I3.c)(s,o)),(0,w3.t)(s,i.shape)}}}},F3={kernelName:c3.TyE,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,R3.W)((0,v3.E)((0,d3.w)(n,"float32")),1))}}},L3={kernelName:c3.zP9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,b3.j)((0,_3.d)(1),(0,v3.E)((0,d3.w)(n,"float32"))))}}};var P3=__webpack_require__(41585),B3=__webpack_require__(28189),$3=__webpack_require__(45119),U3=__webpack_require__(47195),V3=__webpack_require__(70929);const z3=(0,V3.op)({avgPool3dGrad_: +const P3={kernelName:f3.epO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,x3.R)((0,L3.W)((0,T3.d)(1),(0,E3.E)((0,m3.w)(n,"float32"))));return(0,v3.y)(e,t)}}}},B3={kernelName:f3.lxb,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,S3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,L3.W)((0,E3.E)(n),(0,E3.E)(i));let s=(0,g3.l)(e,(0,v3.y)(i,t));const o=(0,S3.getReductionAxes)(n.shape,r);return o.length>0&&(s=(0,O3.c)(s,o)),(0,C3.t)(s,n.shape)},b:()=>{const t=(0,L3.W)((0,E3.E)(n),(0,E3.E)(i));let s=(0,b3.H)((0,g3.l)(e,(0,v3.y)(n,t)));const o=(0,S3.getReductionAxes)(i.shape,r);return o.length>0&&(s=(0,O3.c)(s,o)),(0,C3.t)(s,i.shape)}}}},$3={kernelName:f3.TyE,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,L3.W)((0,E3.E)((0,m3.w)(n,"float32")),1))}}},U3={kernelName:f3.zP9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,w3.j)((0,T3.d)(1),(0,E3.E)((0,m3.w)(n,"float32"))))}}};var V3=__webpack_require__(41585),z3=__webpack_require__(28189),j3=__webpack_require__(45119),Y3=__webpack_require__(47195),G3=__webpack_require__(70929);const H3=(0,G3.op)({avgPool3dGrad_: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10259,7 +10259,7 @@ const N3={kernelName:c3.epO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -function(e,t,n,i,r,s){const o=(0,B3.YT)(e,"dy","avgPool3dGrad"),a=(0,B3.YT)(t,"input","avgPool3dGrad");let l=o,u=a,c=!1;4===a.rank&&(c=!0,l=(0,w3.t)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),u=(0,w3.t)(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$3.vA(5===l.rank,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),$3.vA(5===u.rank,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`),(0,U3.s_)("avgPool3dGrad",r,s);const d={dy:l,input:u},h={filterSize:n,strides:i,pad:r,dimRoundingMode:s},p=P3.T2.runKernel(c3.wwC,d,h);return c?(0,w3.t)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),j3={kernelName:c3.cS,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{filterSize:r,strides:s,pad:o,dimRoundingMode:a}=n;return{x:()=>z3(e,i,r,s,o,a)}}};const Y3=(0,V3.op)({avgPoolGrad_: +function(e,t,n,i,r,s){const o=(0,z3.YT)(e,"dy","avgPool3dGrad"),a=(0,z3.YT)(t,"input","avgPool3dGrad");let l=o,u=a,c=!1;4===a.rank&&(c=!0,l=(0,C3.t)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),u=(0,C3.t)(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),j3.vA(5===l.rank,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),j3.vA(5===u.rank,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`),(0,Y3.s_)("avgPool3dGrad",r,s);const d={dy:l,input:u},h={filterSize:n,strides:i,pad:r,dimRoundingMode:s},p=V3.T2.runKernel(f3.wwC,d,h);return c?(0,C3.t)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),W3={kernelName:f3.cS,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{filterSize:r,strides:s,pad:o,dimRoundingMode:a}=n;return{x:()=>H3(e,i,r,s,o,a)}}};const X3=(0,G3.op)({avgPoolGrad_: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10276,7 +10276,7 @@ function(e,t,n,i,r,s){const o=(0,B3.YT)(e,"dy","avgPool3dGrad"),a=(0,B3.YT)(t,"i * limitations under the License. * ============================================================================= */ -function(e,t,n,i,r){const s=(0,B3.YT)(e,"dy","avgPoolGrad"),o=(0,B3.YT)(t,"input","avgPoolGrad");$3.vA(o.rank===s.rank,()=>`Rank of input (${o.rank}) does not match rank of dy (${s.rank})`);let a=o,l=s,u=!1;3===o.rank&&(u=!0,a=(0,w3.t)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),l=(0,w3.t)(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$3.vA(4===l.rank,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),$3.vA(4===a.rank,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${a.rank}.`);const c={dy:l,input:a},d={filterSize:n,strides:i,pad:r},h=P3.T2.runKernel(c3.VCH,c,d);return u?(0,w3.t)(h,[h.shape[1],h.shape[2],h.shape[3]]):h}}),G3={kernelName:c3.ho8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{filterSize:r,strides:s,pad:o}=n;return{x:()=>Y3(e,i,r,s,o)}}};var H3=__webpack_require__(65703); +function(e,t,n,i,r){const s=(0,z3.YT)(e,"dy","avgPoolGrad"),o=(0,z3.YT)(t,"input","avgPoolGrad");j3.vA(o.rank===s.rank,()=>`Rank of input (${o.rank}) does not match rank of dy (${s.rank})`);let a=o,l=s,u=!1;3===o.rank&&(u=!0,a=(0,C3.t)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),l=(0,C3.t)(s,[1,s.shape[0],s.shape[1],s.shape[2]])),j3.vA(4===l.rank,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),j3.vA(4===a.rank,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${a.rank}.`);const c={dy:l,input:a},d={filterSize:n,strides:i,pad:r},h=V3.T2.runKernel(f3.VCH,c,d);return u?(0,C3.t)(h,[h.shape[1],h.shape[2],h.shape[3]]):h}}),q3={kernelName:f3.ho8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{filterSize:r,strides:s,pad:o}=n;return{x:()=>X3(e,i,r,s,o)}}};var K3=__webpack_require__(65703); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10293,7 +10293,7 @@ function(e,t,n,i,r){const s=(0,B3.YT)(e,"dy","avgPoolGrad"),o=(0,B3.YT)(t,"input * limitations under the License. * ============================================================================= */ -const W3={kernelName:c3.jAQ,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[i,r]=t,{transposeA:s,transposeB:o}=n;return s||o?!s&&o?{a:()=>(0,H3.N)(e,r,!1,!1),b:()=>(0,H3.N)(e,i,!0,!1)}:s&&!o?{a:()=>(0,H3.N)(r,e,!1,!0),b:()=>(0,H3.N)(i,e,!1,!1)}:{a:()=>(0,H3.N)(r,e,!0,!0),b:()=>(0,H3.N)(e,i,!0,!0)}:{a:()=>(0,H3.N)(e,r,!1,!0),b:()=>(0,H3.N)(i,e,!0,!1)}}};var X3=__webpack_require__(10776); +const Z3={kernelName:f3.jAQ,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[i,r]=t,{transposeA:s,transposeB:o}=n;return s||o?!s&&o?{a:()=>(0,K3.N)(e,r,!1,!1),b:()=>(0,K3.N)(e,i,!0,!1)}:s&&!o?{a:()=>(0,K3.N)(r,e,!1,!0),b:()=>(0,K3.N)(i,e,!1,!1)}:{a:()=>(0,K3.N)(r,e,!0,!0),b:()=>(0,K3.N)(e,i,!0,!0)}:{a:()=>(0,K3.N)(e,r,!1,!0),b:()=>(0,K3.N)(i,e,!0,!1)}}};var Q3=__webpack_require__(10776); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10310,7 +10310,7 @@ const W3={kernelName:c3.jAQ,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[i,r] * limitations under the License. * ============================================================================= */ -const q3={kernelName:c3.Ik2,gradFunc:(e,t,n)=>{const{blockShape:i,crops:r}=n;return{x:()=>(0,X3.e)(e,i,r)}}},K3={kernelName:c3.LB5,gradFunc:(e,t,n)=>{const i=n,r=i.inputShape,s=i.shape,o=Array.from(s);for(let e=r.length-1;e>=0;e--)if(r[e]===s[e])o[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);const a=[];for(let e=0;e1&&a.push(e);return{x:()=>(0,I3.c)(e,a,!0)}}},Z3={kernelName:c3.KXH,gradFunc:e=>({x:()=>e.clone()})},Q3={kernelName:c3.QDP,gradFunc:e=>({x:()=>(0,C3.P)(e)})};var J3=__webpack_require__(13337),e4=__webpack_require__(56508),t4=__webpack_require__(13789),n4=__webpack_require__(12151); +const J3={kernelName:f3.Ik2,gradFunc:(e,t,n)=>{const{blockShape:i,crops:r}=n;return{x:()=>(0,Q3.e)(e,i,r)}}},e4={kernelName:f3.LB5,gradFunc:(e,t,n)=>{const i=n,r=i.inputShape,s=i.shape,o=Array.from(s);for(let e=r.length-1;e>=0;e--)if(r[e]===s[e])o[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);const a=[];for(let e=0;e1&&a.push(e);return{x:()=>(0,O3.c)(e,a,!0)}}},t4={kernelName:f3.KXH,gradFunc:e=>({x:()=>e.clone()})},n4={kernelName:f3.QDP,gradFunc:e=>({x:()=>(0,R3.P)(e)})};var i4=__webpack_require__(13337),r4=__webpack_require__(56508),s4=__webpack_require__(13789),o4=__webpack_require__(12151); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10327,7 +10327,7 @@ const q3={kernelName:c3.Ik2,gradFunc:(e,t,n)=>{const{blockShape:i,crops:r}=n;ret * limitations under the License. * ============================================================================= */ -const i4={kernelName:c3.vaV,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>(0,n4._)((0,t4.n)((0,J3.D)(i,r),(0,e4.I)(i,s)),e,(0,C3.P)(e))}}},r4={kernelName:c3.$zE,inputsToSave:["x"],gradFunc:f3.gradFunc};var s4=__webpack_require__(66512); +const a4={kernelName:f3.vaV,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>(0,o4._)((0,s4.n)((0,i4.D)(i,r),(0,r4.I)(i,s)),e,(0,R3.P)(e))}}},l4={kernelName:f3.$zE,inputsToSave:["x"],gradFunc:y3.gradFunc};var u4=__webpack_require__(66512); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10344,7 +10344,7 @@ const i4={kernelName:c3.vaV,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{cl * limitations under the License. * ============================================================================= */ -const o4={kernelName:c3.$dB,saveAllInputs:!0,gradFunc:(e,t,n)=>{const i=t.map(e=>e.shape),{axis:r}=n,s=(0,$3.Y6)(r,t[0].shape)[0],o=i.map(e=>e[s]);return(0,s4.l)(e,o,s).map(e=>()=>e)}};var a4=__webpack_require__(25248),l4=__webpack_require__(80252); +const c4={kernelName:f3.$dB,saveAllInputs:!0,gradFunc:(e,t,n)=>{const i=t.map(e=>e.shape),{axis:r}=n,s=(0,j3.Y6)(r,t[0].shape)[0],o=i.map(e=>e[s]);return(0,u4.l)(e,o,s).map(e=>()=>e)}};var d4=__webpack_require__(25248),h4=__webpack_require__(80252); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10361,7 +10361,7 @@ const o4={kernelName:c3.$dB,saveAllInputs:!0,gradFunc:(e,t,n)=>{const i=t.map(e= * limitations under the License. * ============================================================================= */ -const u4={kernelName:c3.p2J,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,{dilations:s,strides:o,pad:a,dataFormat:l}=n;return $3.vA(U3.Dh(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>(0,l4.v)(i.shape,e,r,o,a,l),filter:()=>(0,a4.H)(i,e,r.shape,o,a,l)}}};var c4=__webpack_require__(28794); +const p4={kernelName:f3.p2J,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,{dilations:s,strides:o,pad:a,dataFormat:l}=n;return j3.vA(Y3.Dh(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>(0,h4.v)(i.shape,e,r,o,a,l),filter:()=>(0,d4.H)(i,e,r.shape,o,a,l)}}};var f4=__webpack_require__(28794); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10378,7 +10378,7 @@ const u4={kernelName:c3.p2J,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const * limitations under the License. * ============================================================================= */ -const d4={kernelName:c3.jfg,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,{strides:s,pad:o,dataFormat:a,dimRoundingMode:l}=n;return{dy:()=>(0,c4.X)(e,r,s,o,a,1,l),filter:()=>(0,a4.H)(e,i,r.shape,s,o,a,l)}}};const h4=(0,V3.op)({conv3DBackpropFilter_: +const m4={kernelName:f3.jfg,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,{strides:s,pad:o,dataFormat:a,dimRoundingMode:l}=n;return{dy:()=>(0,f4.X)(e,r,s,o,a,1,l),filter:()=>(0,d4.H)(e,i,r.shape,s,o,a,l)}}};const g4=(0,G3.op)({conv3DBackpropFilter_: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10395,7 +10395,7 @@ const d4={kernelName:c3.jfg,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{cons * limitations under the License. * ============================================================================= */ -function(e,t,n,i,r){let s=e;4===e.rank&&(s=(0,w3.t)(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let o=t;4===o.rank&&(o=(0,w3.t)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),$3.vA(5===s.rank,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),$3.vA(5===o.rank,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`),$3.vA(5===n.length,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),$3.vA(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),$3.vA(o.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${n[4]}).`);const a={x:s,dy:o},l={strides:i,pad:r,filterShape:n};return P3.T2.runKernel(c3.iGz,a,l)}});var p4=__webpack_require__(31895); +function(e,t,n,i,r){let s=e;4===e.rank&&(s=(0,C3.t)(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let o=t;4===o.rank&&(o=(0,C3.t)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),j3.vA(5===s.rank,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),j3.vA(5===o.rank,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`),j3.vA(5===n.length,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),j3.vA(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),j3.vA(o.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${n[4]}).`);const a={x:s,dy:o},l={strides:i,pad:r,filterShape:n};return V3.T2.runKernel(f3.iGz,a,l)}});var _4=__webpack_require__(31895); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10412,7 +10412,7 @@ function(e,t,n,i,r){let s=e;4===e.rank&&(s=(0,w3.t)(e,[1,e.shape[0],e.shape[1],e * limitations under the License. * ============================================================================= */ -const f4={kernelName:c3.A1h,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:i,strides:r,pad:s}=n;$3.vA((0,U3.Dh)(i),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const[o,a]=t;return{x:()=>(0,p4.c)(o.shape,e,a,r,s),filter:()=>h4(o,e,a.shape,r,s)}}};var m4=__webpack_require__(33726); +const y4={kernelName:f3.A1h,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:i,strides:r,pad:s}=n;j3.vA((0,Y3.Dh)(i),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const[o,a]=t;return{x:()=>(0,_4.c)(o.shape,e,a,r,s),filter:()=>g4(o,e,a.shape,r,s)}}};var v4=__webpack_require__(33726); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10429,7 +10429,7 @@ const f4={kernelName:c3.A1h,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const * limitations under the License. * ============================================================================= */ -const g4={kernelName:c3.Mn0,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)((0,g3.H)((0,m4.F)((0,d3.w)(n,"float32"))),e)}}};var _4=__webpack_require__(58276); +const b4={kernelName:f3.Mn0,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)((0,b3.H)((0,v4.F)((0,m3.w)(n,"float32"))),e)}}};var T4=__webpack_require__(58276); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10446,7 +10446,7 @@ const g4={kernelName:c3.Mn0,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const y4={kernelName:c3.MnK,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)((0,_4.L)((0,d3.w)(n,"float32")),e)}}};var v4=__webpack_require__(21078),b4=__webpack_require__(76808),T4=__webpack_require__(7703); +const x4={kernelName:f3.MnK,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)((0,T4.L)((0,m3.w)(n,"float32")),e)}}};var E4=__webpack_require__(21078),w4=__webpack_require__(76808),I4=__webpack_require__(7703); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10463,7 +10463,7 @@ const y4={kernelName:c3.MnK,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const x4={kernelName:c3.nY8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r,exclusive:s,reverse:o}=n;return{x:()=>{const t=(0,v4.Em)([r],i.rank);let n=(0,b4.r)(e,r,s,!o);return null!=t&&(n=(0,T4.m)(n,t)),n}}}};var E4=__webpack_require__(41890),w4=__webpack_require__(83134); +const A4={kernelName:f3.nY8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r,exclusive:s,reverse:o}=n;return{x:()=>{const t=(0,E4.Em)([r],i.rank);let n=(0,w4.r)(e,r,s,!o);return null!=t&&(n=(0,I4.m)(n,t)),n}}}};var S4=__webpack_require__(41890),C4=__webpack_require__(83134); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10480,7 +10480,7 @@ const x4={kernelName:c3.nY8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{ax * limitations under the License. * ============================================================================= */ -const I4={kernelName:c3.tGH,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:i,strides:r,pad:s,dimRoundingMode:o}=n,a=null==i?[1,1]:i;$3.vA(U3.Dh(a),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${a}'`);const[l,u]=t;return $3.vA(4===l.rank,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),$3.vA(4===u.rank,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`),$3.vA(l.shape[3]===u.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`),$3.vA(U3.G0(r,a),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${a}'.`),U3.s_("depthwiseConv2d",s,o),{x:()=>(0,w4.l)(l.shape,e,u,r,s,a,o),filter:()=>(0,E4.x)(l,e,u.shape,r,s,a,o)}}},A4={kernelName:c3.jxD,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,s={x:i,filter:r,dy:e},o={x:i,filter:r,dy:e};return{x:()=>P3.T2.runKernel(c3.bP9,s,n),filter:()=>P3.T2.runKernel(c3.pk0,o,n)}}},S4={kernelName:c3.Pah,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,i={dy:e,y:n};return{x:()=>P3.T2.runKernel(c3.rsH,i)}}};var C4=__webpack_require__(8631); +const O4={kernelName:f3.tGH,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:i,strides:r,pad:s,dimRoundingMode:o}=n,a=null==i?[1,1]:i;j3.vA(Y3.Dh(a),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${a}'`);const[l,u]=t;return j3.vA(4===l.rank,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),j3.vA(4===u.rank,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`),j3.vA(l.shape[3]===u.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`),j3.vA(Y3.G0(r,a),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${a}'.`),Y3.s_("depthwiseConv2d",s,o),{x:()=>(0,C4.l)(l.shape,e,u,r,s,a,o),filter:()=>(0,S4.x)(l,e,u.shape,r,s,a,o)}}},M4={kernelName:f3.jxD,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,s={x:i,filter:r,dy:e},o={x:i,filter:r,dy:e};return{x:()=>V3.T2.runKernel(f3.bP9,s,n),filter:()=>V3.T2.runKernel(f3.pk0,o,n)}}},k4={kernelName:f3.Pah,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,i={dy:e,y:n};return{x:()=>V3.T2.runKernel(f3.rsH,i)}}};var R4=__webpack_require__(8631); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10497,7 +10497,7 @@ const I4={kernelName:c3.tGH,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const * limitations under the License. * ============================================================================= */ -const O4={kernelName:c3._s9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0,h3.l)((0,C4.o)((0,g3.H)((0,v3.E)(n))),2/Math.sqrt(Math.PI));return{x:()=>(0,h3.l)(e,i)}}},M4={kernelName:c3.ox3,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,n)}}},k4={kernelName:c3.ybN,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>(0,w3.t)(e,n.shape)}}},R4={kernelName:c3.ybj,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,(0,C4.o)(n))}}},N4={kernelName:c3.ZgB,gradFunc:e=>({x:()=>(0,C3.P)(e)})},D4={kernelName:c3.ElG,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,E3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,m3.y)(e,(0,d3.w)(i,"float32")),s=(0,E3.getReductionAxes)(n.shape,r);return s.length>0?(0,w3.t)((0,I3.c)(t,s),n.shape):t},b:()=>{let t=(0,h3.l)(e,(0,d3.w)(n,"float32"));const s=(0,E3.getReductionAxes)(i.shape,r);s.length>0&&(t=(0,w3.t)((0,I3.c)(t,s),i.shape));const o=(0,v3.E)(i);return(0,g3.H)((0,m3.y)(t,(0,d3.w)(o,"float32")))}}}};var F4=__webpack_require__(17820),L4=__webpack_require__(64826); +const N4={kernelName:f3._s9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0,g3.l)((0,R4.o)((0,b3.H)((0,E3.E)(n))),2/Math.sqrt(Math.PI));return{x:()=>(0,g3.l)(e,i)}}},D4={kernelName:f3.ox3,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,n)}}},F4={kernelName:f3.ybN,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>(0,C3.t)(e,n.shape)}}},L4={kernelName:f3.ybj,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,(0,R4.o)(n))}}},P4={kernelName:f3.ZgB,gradFunc:e=>({x:()=>(0,R3.P)(e)})},B4={kernelName:f3.ElG,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,S3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,v3.y)(e,(0,m3.w)(i,"float32")),s=(0,S3.getReductionAxes)(n.shape,r);return s.length>0?(0,C3.t)((0,O3.c)(t,s),n.shape):t},b:()=>{let t=(0,g3.l)(e,(0,m3.w)(n,"float32"));const s=(0,S3.getReductionAxes)(i.shape,r);s.length>0&&(t=(0,C3.t)((0,O3.c)(t,s),i.shape));const o=(0,E3.E)(i);return(0,b3.H)((0,v3.y)(t,(0,m3.w)(o,"float32")))}}}};var $4=__webpack_require__(17820),U4=__webpack_require__(64826); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10514,7 +10514,7 @@ const O4={kernelName:c3._s9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0, * limitations under the License. * ============================================================================= */ -const P4={kernelName:c3.i5R,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:i}=n,[r,s,o,a]=t,l=null==a?(0,_3.d)(1):a,u=(0,E3.getReductionAxes)(s.shape,r.shape),c=[];if(1===s.rank){for(let e=0;e1===s.rank?(0,w3.t)((0,h3.l)((0,h3.l)(e,(0,L4.V)((0,w3.t)(p,[1,1,1,s.shape[0]]),c)),l),r.shape):(0,w3.t)((0,h3.l)((0,h3.l)(e,p),l),r.shape),mean:()=>{let e=(0,h3.l)((0,h3.l)(p,(0,_3.d)(-1)),h);return 1===s.rank&&(e=(0,I3.c)(e,u)),(0,w3.t)(e,s.shape)},variance:()=>{let e=(0,h3.l)((0,h3.l)(f,d),h);return 1===s.rank&&(e=(0,I3.c)(e,u)),(0,w3.t)(e,s.shape)},scale:()=>{const t=(0,h3.l)(d,p);let n=(0,h3.l)(e,t);return 1===s.rank&&(n=(0,I3.c)(n,u)),(0,w3.t)(n,s.shape)},offset:()=>{let t=e;return 1===s.rank&&(t=(0,I3.c)(t,u)),(0,w3.t)(t,s.shape)}}}};var B4=__webpack_require__(54268),$4=__webpack_require__(97706); +const V4={kernelName:f3.i5R,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:i}=n,[r,s,o,a]=t,l=null==a?(0,T3.d)(1):a,u=(0,S3.getReductionAxes)(s.shape,r.shape),c=[];if(1===s.rank){for(let e=0;e1===s.rank?(0,C3.t)((0,g3.l)((0,g3.l)(e,(0,U4.V)((0,C3.t)(p,[1,1,1,s.shape[0]]),c)),l),r.shape):(0,C3.t)((0,g3.l)((0,g3.l)(e,p),l),r.shape),mean:()=>{let e=(0,g3.l)((0,g3.l)(p,(0,T3.d)(-1)),h);return 1===s.rank&&(e=(0,O3.c)(e,u)),(0,C3.t)(e,s.shape)},variance:()=>{let e=(0,g3.l)((0,g3.l)(f,d),h);return 1===s.rank&&(e=(0,O3.c)(e,u)),(0,C3.t)(e,s.shape)},scale:()=>{const t=(0,g3.l)(d,p);let n=(0,g3.l)(e,t);return 1===s.rank&&(n=(0,O3.c)(n,u)),(0,C3.t)(n,s.shape)},offset:()=>{let t=e;return 1===s.rank&&(t=(0,O3.c)(t,u)),(0,C3.t)(t,s.shape)}}}};var z4=__webpack_require__(54268),j4=__webpack_require__(97706); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10531,7 +10531,7 @@ const P4={kernelName:c3.i5R,inputsToSave:["x","mean","variance","scale"],gradFun * limitations under the License. * ============================================================================= */ -const U4={kernelName:c3.mxL,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[i,r]=t,{axis:s,batchDims:o}=n,a=(0,$3.Y6)(s,i.shape)[0],l=(e,t,n)=>()=>{const i=e.shape,r=t.size,o=i.slice(0,a),l=o.length,u=i.slice(s,i.length).slice(1),c=u.length,d=V4(0,l),h=V4(l+1,l+1+c),p=z4([o,[r],u]),f=(0,w3.t)(n,p),m=(0,w3.t)(t,[r]),g=z4([[l],d,h]),_=(0,T4.m)(f,g);let y=(0,$4.z)(_,m,e.shape[a]);const v=(0,v4.gx)(g);return y=(0,T4.m)(y,v),y};if(1===o){const t=i.shape[0],n=i.split(t,0);return{x:()=>{const t=(0,B4.t)(n.map((t,n)=>l(t,r.slice(n,1),e.slice(n,1))()));return t.reshape(i.shape)},indices:()=>r}}return{x:l(i,r,e),indices:()=>r}}};function V4(e,t){const n=[];for(let i=e;i{const[i,r]=t,{axis:s,batchDims:o}=n,a=(0,j3.Y6)(s,i.shape)[0],l=(e,t,n)=>()=>{const i=e.shape,r=t.size,o=i.slice(0,a),l=o.length,u=i.slice(s,i.length).slice(1),c=u.length,d=G4(0,l),h=G4(l+1,l+1+c),p=H4([o,[r],u]),f=(0,C3.t)(n,p),m=(0,C3.t)(t,[r]),g=H4([[l],d,h]),_=(0,I4.m)(f,g);let y=(0,j4.z)(_,m,e.shape[a]);const v=(0,E4.gx)(g);return y=(0,I4.m)(y,v),y};if(1===o){const t=i.shape[0],n=i.split(t,0);return{x:()=>{const t=(0,z4.t)(n.map((t,n)=>l(t,r.slice(n,1),e.slice(n,1))()));return t.reshape(i.shape)},indices:()=>r}}return{x:l(i,r,e),indices:()=>r}}};function G4(e,t){const n=[];for(let i=e;i{cons * limitations under the License. * ============================================================================= */ -const j4={kernelName:c3.lLS,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,C3.P)(n),b:()=>(0,C3.P)(i)}}},Y4={kernelName:c3.lzr,gradFunc:e=>({x:()=>(0,d3.w)(e,"float32")})},G4={kernelName:c3.gIW,gradFunc:e=>({x:()=>(0,C3.P)(e)})},H4={kernelName:c3.E3$,gradFunc:e=>({x:()=>(0,C3.P)(e)})},W4={kernelName:c3.iPs,gradFunc:e=>({x:()=>(0,C3.P)(e)})};var X4=__webpack_require__(62058); +const W4={kernelName:f3.lLS,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,R3.P)(n),b:()=>(0,R3.P)(i)}}},X4={kernelName:f3.lzr,gradFunc:e=>({x:()=>(0,m3.w)(e,"float32")})},q4={kernelName:f3.gIW,gradFunc:e=>({x:()=>(0,R3.P)(e)})},K4={kernelName:f3.E3$,gradFunc:e=>({x:()=>(0,R3.P)(e)})},Z4={kernelName:f3.iPs,gradFunc:e=>({x:()=>(0,R3.P)(e)})};var Q4=__webpack_require__(62058); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10565,7 +10565,7 @@ const j4={kernelName:c3.lLS,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t * limitations under the License. * ============================================================================= */ -const q4={kernelName:c3.X0$,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{alpha:r}=n,s=(0,X4.r)(i,0);return{x:()=>(0,n4._)(s,e,(0,h3.l)(e,r))}}},K4={kernelName:c3.Cg$,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,R3.W)(n,1))}}},Z4={kernelName:c3.tG8,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,d3.w)(n,"float32"))}}},Q4={kernelName:c3.zfU,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n;return{logits:()=>{const t=(0,C4.o)(i);return(0,b3.j)(e,(0,h3.l)((0,I3.c)(e,r,!0),t))}}}};const J4=(0,V3.op)({localResponseNormalizationBackprop_: +const J4={kernelName:f3.X0$,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{alpha:r}=n,s=(0,Q4.r)(i,0);return{x:()=>(0,o4._)(s,e,(0,g3.l)(e,r))}}},e5={kernelName:f3.Cg$,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,L3.W)(n,1))}}},t5={kernelName:f3.tG8,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,m3.w)(n,"float32"))}}},n5={kernelName:f3.zfU,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n;return{logits:()=>{const t=(0,R4.o)(i);return(0,w3.j)(e,(0,g3.l)((0,O3.c)(e,r,!0),t))}}}};const i5=(0,G3.op)({localResponseNormalizationBackprop_: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10582,7 +10582,7 @@ const q4={kernelName:c3.X0$,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{al * limitations under the License. * ============================================================================= */ -function(e,t,n,i=5,r=1,s=1,o=.5){const a={x:e,y:t,dy:n},l={depthRadius:i,bias:r,alpha:s,beta:o};return P3.T2.runKernel(c3.ToN,a,l)}}),e5={kernelName:c3.jM4,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{depthRadius:s,bias:o,alpha:a,beta:l}=n;return{x:()=>J4(i,r,e,s,o,a,l)}}};var t5=__webpack_require__(13020); +function(e,t,n,i=5,r=1,s=1,o=.5){const a={x:e,y:t,dy:n},l={depthRadius:i,bias:r,alpha:s,beta:o};return V3.T2.runKernel(f3.ToN,a,l)}}),r5={kernelName:f3.jM4,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{depthRadius:s,bias:o,alpha:a,beta:l}=n;return{x:()=>i5(i,r,e,s,o,a,l)}}};var s5=__webpack_require__(13020); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10599,7 +10599,7 @@ function(e,t,n,i=5,r=1,s=1,o=.5){const a={x:e,y:t,dy:n},l={depthRadius:i,bias:r, * limitations under the License. * ============================================================================= */ -function n5(e,t,n,i){return t.rank(0,h3.l)(e,(0,d3.w)((0,t5.L)(n,t),e.dtype))}} +function o5(e,t,n,i){return t.rank(0,g3.l)(e,(0,m3.w)((0,s5.L)(n,t),e.dtype))}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10616,7 +10616,7 @@ function n5(e,t,n,i){return t.rank{const i=n,{reductionIndices:r}=i,s=t[0],o=n5(e,t[1],s,$3.Y6(r,s.shape));return{x:()=>o.x()}}};var r5=__webpack_require__(61303); +const a5={kernelName:f3.VAI,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const i=n,{reductionIndices:r}=i,s=t[0],o=o5(e,t[1],s,j3.Y6(r,s.shape));return{x:()=>o.x()}}};var l5=__webpack_require__(61303); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10633,7 +10633,7 @@ const i5={kernelName:c3.VAI,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t, * limitations under the License. * ============================================================================= */ -const s5={kernelName:c3.LDN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,h3.l)(e,(0,d3.w)((0,J3.D)(n,i),"float32")),b:()=>(0,h3.l)(e,(0,d3.w)((0,r5.M)(n,i),"float32"))}}};const o5=(0,V3.op)({maxPool3dGrad_: +const u5={kernelName:f3.LDN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,g3.l)(e,(0,m3.w)((0,i4.D)(n,i),"float32")),b:()=>(0,g3.l)(e,(0,m3.w)((0,l5.M)(n,i),"float32"))}}};const c5=(0,G3.op)({maxPool3dGrad_: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10650,7 +10650,7 @@ const s5={kernelName:c3.LDN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t * limitations under the License. * ============================================================================= */ -function(e,t,n,i,r,s,o){const a=(0,B3.YT)(e,"dy","maxPool3dGrad"),l=(0,B3.YT)(t,"input","maxPool3dGrad"),u=(0,B3.YT)(n,"output","maxPool3dGrad");let c=a,d=l,h=u,p=!1;4===l.rank&&(p=!0,c=(0,w3.t)(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),d=(0,w3.t)(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),h=(0,w3.t)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),$3.vA(5===c.rank,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`),$3.vA(5===d.rank,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${d.rank}.`),$3.vA(5===h.rank,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${h.rank}.`),(0,U3.s_)("maxPool3dGrad",s,o);const f={dy:c,input:d,output:h},m={filterSize:i,strides:r,pad:s,dimRoundingMode:o},g=P3.T2.runKernel(c3.cHb,f,m);return p?(0,w3.t)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),a5={kernelName:c3.ySp,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=n;return{x:()=>o5(e,i,r,s,o,a,l)}}};const l5=(0,V3.op)({maxPoolGrad_: +function(e,t,n,i,r,s,o){const a=(0,z3.YT)(e,"dy","maxPool3dGrad"),l=(0,z3.YT)(t,"input","maxPool3dGrad"),u=(0,z3.YT)(n,"output","maxPool3dGrad");let c=a,d=l,h=u,p=!1;4===l.rank&&(p=!0,c=(0,C3.t)(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),d=(0,C3.t)(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),h=(0,C3.t)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),j3.vA(5===c.rank,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`),j3.vA(5===d.rank,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${d.rank}.`),j3.vA(5===h.rank,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${h.rank}.`),(0,Y3.s_)("maxPool3dGrad",s,o);const f={dy:c,input:d,output:h},m={filterSize:i,strides:r,pad:s,dimRoundingMode:o},g=V3.T2.runKernel(f3.cHb,f,m);return p?(0,C3.t)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),d5={kernelName:f3.ySp,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=n;return{x:()=>c5(e,i,r,s,o,a,l)}}};const h5=(0,G3.op)({maxPoolGrad_: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10667,7 +10667,7 @@ function(e,t,n,i,r,s,o){const a=(0,B3.YT)(e,"dy","maxPool3dGrad"),l=(0,B3.YT)(t, * limitations under the License. * ============================================================================= */ -function(e,t,n,i,r,s,o){const a=(0,B3.YT)(e,"dy","maxPoolGrad"),l=(0,B3.YT)(t,"input","maxPoolGrad"),u=(0,B3.YT)(n,"output","maxPoolGrad");$3.vA(l.rank===a.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${a.rank})`),$3.vA(4===a.rank,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${a.rank}.`),$3.vA(4===l.rank,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),U3.s_("maxPoolGrad",s,o);const c={dy:a,input:l,output:u},d={filterSize:i,strides:r,pad:s,dimRoundingMode:o};return P3.T2.runKernel(c3.RXX,c,d)}}),u5={kernelName:c3.t3d,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{filterSize:s,strides:o,pad:a}=n;return{x:()=>l5(e,i,r,s,o,a)}}};var c5=__webpack_require__(61411); +function(e,t,n,i,r,s,o){const a=(0,z3.YT)(e,"dy","maxPoolGrad"),l=(0,z3.YT)(t,"input","maxPoolGrad"),u=(0,z3.YT)(n,"output","maxPoolGrad");j3.vA(l.rank===a.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${a.rank})`),j3.vA(4===a.rank,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${a.rank}.`),j3.vA(4===l.rank,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),Y3.s_("maxPoolGrad",s,o);const c={dy:a,input:l,output:u},d={filterSize:i,strides:r,pad:s,dimRoundingMode:o};return V3.T2.runKernel(f3.RXX,c,d)}}),p5={kernelName:f3.t3d,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{filterSize:s,strides:o,pad:a}=n;return{x:()=>h5(e,i,r,s,o,a)}}};var f5=__webpack_require__(61411); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10684,7 +10684,7 @@ function(e,t,n,i,r,s,o){const a=(0,B3.YT)(e,"dy","maxPoolGrad"),l=(0,B3.YT)(t,"i * limitations under the License. * ============================================================================= */ -const d5={kernelName:c3.g5A,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n,s=$3.Y6(r,i.shape),o=(0,v4.lb)(i.shape,s)[1],a=$3.Ze(o);return{x:()=>{const t=i.shape.slice();s.forEach(e=>{t[e]=1});const n=(0,w3.t)(e,t);return(0,m3.y)((0,h3.l)(n,(0,c5.S)(i.shape,"float32")),a)}}}},h5={kernelName:c3.lNG,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const i=n,{axis:r}=i,[s,o]=t,a=n5(e,o,s,$3.Y6(r,s.shape));return{x:()=>a.x()}}},p5={kernelName:c3.LG0,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,h3.l)(e,(0,d3.w)((0,e4.I)(n,i),"float32")),b:()=>(0,h3.l)(e,(0,d3.w)((0,X4.r)(n,i),"float32"))}}};var f5=__webpack_require__(17986); +const m5={kernelName:f3.g5A,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n,s=j3.Y6(r,i.shape),o=(0,E4.lb)(i.shape,s)[1],a=j3.Ze(o);return{x:()=>{const t=i.shape.slice();s.forEach(e=>{t[e]=1});const n=(0,C3.t)(e,t);return(0,v3.y)((0,g3.l)(n,(0,f5.S)(i.shape,"float32")),a)}}}},g5={kernelName:f3.lNG,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const i=n,{axis:r}=i,[s,o]=t,a=o5(e,o,s,j3.Y6(r,s.shape));return{x:()=>a.x()}}},_5={kernelName:f3.LG0,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,g3.l)(e,(0,m3.w)((0,r4.I)(n,i),"float32")),b:()=>(0,g3.l)(e,(0,m3.w)((0,Q4.r)(n,i),"float32"))}}};var y5=__webpack_require__(17986); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10701,7 +10701,7 @@ const d5={kernelName:c3.g5A,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{ax * limitations under the License. * ============================================================================= */ -const m5={kernelName:c3.x7F,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{paddings:r}=n,s=r.map(e=>e[0]);return{x:()=>(0,f5.d)(e,s,i.shape)}}};var g5=__webpack_require__(15606); +const v5={kernelName:f3.x7F,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{paddings:r}=n,s=r.map(e=>e[0]);return{x:()=>(0,y5.d)(e,s,i.shape)}}};var b5=__webpack_require__(15606); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10718,7 +10718,7 @@ const m5={kernelName:c3.x7F,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{ * limitations under the License. * ============================================================================= */ -const _5={kernelName:c3.BLA,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,E3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,E3.getReductionAxes)(n.shape,r);return t.length>0?(0,w3.t)((0,I3.c)(e,t),n.shape):e},b:()=>{const t=(0,h3.l)(e,(0,g3.H)((0,g5.R)((0,m3.y)(n,i)))),s=(0,E3.getReductionAxes)(i.shape,r);return s.length>0?(0,w3.t)((0,I3.c)(t,s),i.shape):t}}}},y5={kernelName:c3.xu7,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,E3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,h3.l)(e,(0,d3.w)(i,"float32")),s=(0,E3.getReductionAxes)(n.shape,r);return s.length>0?(0,w3.t)((0,I3.c)(t,s),n.shape):t},b:()=>{const t=(0,h3.l)(e,(0,d3.w)(n,"float32")),s=(0,E3.getReductionAxes)(i.shape,r);return s.length>0?(0,w3.t)((0,I3.c)(t,s),i.shape):t}}}},v5={kernelName:c3.l0G,gradFunc:e=>({x:()=>(0,g3.H)(e)})};var b5=__webpack_require__(42855); +const T5={kernelName:f3.BLA,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,S3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,S3.getReductionAxes)(n.shape,r);return t.length>0?(0,C3.t)((0,O3.c)(e,t),n.shape):e},b:()=>{const t=(0,g3.l)(e,(0,b3.H)((0,b5.R)((0,v3.y)(n,i)))),s=(0,S3.getReductionAxes)(i.shape,r);return s.length>0?(0,C3.t)((0,O3.c)(t,s),i.shape):t}}}},x5={kernelName:f3.xu7,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,S3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,g3.l)(e,(0,m3.w)(i,"float32")),s=(0,S3.getReductionAxes)(n.shape,r);return s.length>0?(0,C3.t)((0,O3.c)(t,s),n.shape):t},b:()=>{const t=(0,g3.l)(e,(0,m3.w)(n,"float32")),s=(0,S3.getReductionAxes)(i.shape,r);return s.length>0?(0,C3.t)((0,O3.c)(t,s),i.shape):t}}}},E5={kernelName:f3.l0G,gradFunc:e=>({x:()=>(0,b3.H)(e)})};var w5=__webpack_require__(42855); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10735,7 +10735,7 @@ const _5={kernelName:c3.BLA,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t * limitations under the License. * ============================================================================= */ -const T5={kernelName:c3.urI,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>(0,b5.U)(n.shape,"float32")}}},x5={kernelName:c3.LWX,gradFunc:e=>({x:()=>(0,C3.P)(e)})};var E5=__webpack_require__(67261); +const I5={kernelName:f3.urI,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>(0,w5.U)(n.shape,"float32")}}},A5={kernelName:f3.LWX,gradFunc:e=>({x:()=>(0,R3.P)(e)})};var S5=__webpack_require__(67261); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10752,7 +10752,7 @@ const T5={kernelName:c3.urI,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[ * limitations under the License. * ============================================================================= */ -const w5={kernelName:c3.mM$,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:i}=n;return(0,E5.K)(e,i).map(e=>()=>e)}},I5={kernelName:c3.ODT,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{paddings:r}=n,s=r.map(e=>e[0]);return{x:()=>(0,f5.d)(e,s,i.shape)}}};var A5=__webpack_require__(44010),S5=__webpack_require__(98990); +const C5={kernelName:f3.mM$,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:i}=n;return(0,S5.K)(e,i).map(e=>()=>e)}},O5={kernelName:f3.ODT,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{paddings:r}=n,s=r.map(e=>e[0]);return{x:()=>(0,y5.d)(e,s,i.shape)}}};var M5=__webpack_require__(44010),k5=__webpack_require__(98990); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10769,7 +10769,7 @@ const w5={kernelName:c3.mM$,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:i}=n; * limitations under the License. * ============================================================================= */ -const C5={kernelName:c3.pyJ,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,i,r]=t,s=n,o=i,a=E3.assertAndGetBroadcastShape(s.shape,o.shape);return{a:()=>{const t=(0,d3.w)(o,"float32");let n=(0,h3.l)(e,(0,h3.l)(t,(0,S5.n)(s,(0,b3.j)(t,(0,_3.d)(1)))));const i=E3.getReductionAxes(s.shape,a);return i.length>0&&(n=(0,I3.c)(n,i)),(0,w3.t)(n,s.shape)},b:()=>{const t=(0,X4.r)(s,0),n=(0,n4._)(t,(0,A5.R)(s),(0,C3.P)(s));let i=(0,h3.l)(e,(0,h3.l)(r,n));const l=E3.getReductionAxes(o.shape,a);return l.length>0&&(i=(0,I3.c)(i,l)),(0,w3.t)(i,o.shape)}}}},O5={kernelName:c3.Ncv,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,X4.r)(n,0);return{x:()=>(0,n4._)(r,e,(0,h3.l)(e,i)),alpha:()=>{let t=(0,n4._)(r,(0,C3.P)(e),(0,h3.l)(e,n));const s=(0,E3.getReductionAxes)(i.shape,e.shape);return s.length>0&&(t=(0,I3.c)(t,s)),(0,w3.t)(t,i.shape)}}}};var M5=__webpack_require__(10302);function k5(e,t,n){const i=e.shape.length,r=i-n.length,s=v4.Em(n,i);let o=e;null!=s&&(o=(0,T4.m)(e,s));const a=o.shape.slice(),l=a.splice(i-n.length,n.length).reduce((e,t)=>e*t,1);a.push(l);let u= +const R5={kernelName:f3.pyJ,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,i,r]=t,s=n,o=i,a=S3.assertAndGetBroadcastShape(s.shape,o.shape);return{a:()=>{const t=(0,m3.w)(o,"float32");let n=(0,g3.l)(e,(0,g3.l)(t,(0,k5.n)(s,(0,w3.j)(t,(0,T3.d)(1)))));const i=S3.getReductionAxes(s.shape,a);return i.length>0&&(n=(0,O3.c)(n,i)),(0,C3.t)(n,s.shape)},b:()=>{const t=(0,Q4.r)(s,0),n=(0,o4._)(t,(0,M5.R)(s),(0,R3.P)(s));let i=(0,g3.l)(e,(0,g3.l)(r,n));const l=S3.getReductionAxes(o.shape,a);return l.length>0&&(i=(0,O3.c)(i,l)),(0,C3.t)(i,o.shape)}}}},N5={kernelName:f3.Ncv,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,Q4.r)(n,0);return{x:()=>(0,o4._)(r,e,(0,g3.l)(e,i)),alpha:()=>{let t=(0,o4._)(r,(0,R3.P)(e),(0,g3.l)(e,n));const s=(0,S3.getReductionAxes)(i.shape,e.shape);return s.length>0&&(t=(0,O3.c)(t,s)),(0,C3.t)(t,i.shape)}}}};var D5=__webpack_require__(10302);function F5(e,t,n){const i=e.shape.length,r=i-n.length,s=E4.Em(n,i);let o=e;null!=s&&(o=(0,I4.m)(e,s));const a=o.shape.slice(),l=a.splice(i-n.length,n.length).reduce((e,t)=>e*t,1);a.push(l);let u= /** * @license * Copyright 2022 Google Inc. All Rights Reserved. @@ -10786,7 +10786,7 @@ const C5={kernelName:c3.pyJ,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:( * limitations under the License. * ============================================================================= */ -function(e,t,n){const i=e.shape.slice();i[n]=1;const r=(0,w3.t)(t,i),s=(0,M5.L)(e,n,!0,!1),o=(0,M5.L)(e,n,!0,!0),a=(0,h3.l)(s,o);return(0,h3.l)(r,a)}(o.reshape(a),t,r);if(u=u.reshape(o.shape),null!=s){const e=v4.gx(s);u=(0,T4.m)(u,e)}return u}const R5={kernelName:c3.kdj,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n;let s=[];return s=null==r?i.shape.map((e,t)=>t):"number"==typeof r?[r]:r,{x:()=>k5(i,e,s)}}},N5={kernelName:c3.sDr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=E3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{const t=(0,m3.y)(e,(0,d3.w)(i,"float32")),s=E3.getReductionAxes(n.shape,r);return s.length>0?(0,w3.t)((0,I3.c)(t,s),n.shape):t},b:()=>{let t=(0,h3.l)(e,(0,d3.w)(n,"float32"));const s=E3.getReductionAxes(i.shape,r);s.length>0&&(t=(0,w3.t)((0,I3.c)(t,s),i.shape));const o=(0,v3.E)(i);return(0,g3.H)((0,m3.y)(t,(0,d3.w)(o,"float32")))}}}},D5={kernelName:c3.huO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,g3.H)((0,v3.E)(n)))}}},F5={kernelName:c3.P_L,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0,h3.l)((0,e4.I)(n,6),(0,p3.P)(n));return{x:()=>(0,h3.l)(e,(0,d3.w)(i,"float32"))}}},L5={kernelName:c3.fUj,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,(0,d3.w)((0,p3.P)(n),"float32"))}}},P5={kernelName:c3.R23,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,w3.t)(e,n.shape)}}},B5={kernelName:c3.hgw,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[i]=t,r={dy:e,images:i};return{images:()=>P3.T2.runKernel(c3.FCQ,r,n)}}},$5={kernelName:c3.jOE,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[i]=t,r={dy:e,images:i};return{images:()=>P3.T2.runKernel(c3.XQy,r,n)}}};var U5=__webpack_require__(53262); +function(e,t,n){const i=e.shape.slice();i[n]=1;const r=(0,C3.t)(t,i),s=(0,D5.L)(e,n,!0,!1),o=(0,D5.L)(e,n,!0,!0),a=(0,g3.l)(s,o);return(0,g3.l)(r,a)}(o.reshape(a),t,r);if(u=u.reshape(o.shape),null!=s){const e=E4.gx(s);u=(0,I4.m)(u,e)}return u}const L5={kernelName:f3.kdj,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n;let s=[];return s=null==r?i.shape.map((e,t)=>t):"number"==typeof r?[r]:r,{x:()=>F5(i,e,s)}}},P5={kernelName:f3.sDr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=S3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{const t=(0,v3.y)(e,(0,m3.w)(i,"float32")),s=S3.getReductionAxes(n.shape,r);return s.length>0?(0,C3.t)((0,O3.c)(t,s),n.shape):t},b:()=>{let t=(0,g3.l)(e,(0,m3.w)(n,"float32"));const s=S3.getReductionAxes(i.shape,r);s.length>0&&(t=(0,C3.t)((0,O3.c)(t,s),i.shape));const o=(0,E3.E)(i);return(0,b3.H)((0,v3.y)(t,(0,m3.w)(o,"float32")))}}}},B5={kernelName:f3.huO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,b3.H)((0,E3.E)(n)))}}},$5={kernelName:f3.P_L,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0,g3.l)((0,r4.I)(n,6),(0,_3.P)(n));return{x:()=>(0,g3.l)(e,(0,m3.w)(i,"float32"))}}},U5={kernelName:f3.fUj,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,(0,m3.w)((0,_3.P)(n),"float32"))}}},V5={kernelName:f3.R23,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,C3.t)(e,n.shape)}}},z5={kernelName:f3.hgw,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[i]=t,r={dy:e,images:i};return{images:()=>V3.T2.runKernel(f3.FCQ,r,n)}}},j5={kernelName:f3.jOE,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[i]=t,r={dy:e,images:i};return{images:()=>V3.T2.runKernel(f3.XQy,r,n)}}};var Y5=__webpack_require__(53262); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10803,7 +10803,7 @@ function(e,t,n){const i=e.shape.slice();i[n]=1;const r=(0,w3.t)(t,i),s=(0,M5.L)( * limitations under the License. * ============================================================================= */ -const V5={kernelName:c3.D7i,gradFunc:(e,t,n)=>{const{dims:i}=n,r=(0,$3.Y6)(i,e.shape);return{x:()=>(0,U5.B)(e,r)}}},z5={kernelName:c3.hVg,gradFunc:e=>({x:()=>(0,C3.P)(e)})},j5={kernelName:c3.TOR,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.H)((0,m3.y)(e,(0,h3.l)((0,S5.n)(n,1.5),2)))}}};var Y5=__webpack_require__(89881); +const G5={kernelName:f3.D7i,gradFunc:(e,t,n)=>{const{dims:i}=n,r=(0,j3.Y6)(i,e.shape);return{x:()=>(0,Y5.B)(e,r)}}},H5={kernelName:f3.hVg,gradFunc:e=>({x:()=>(0,R3.P)(e)})},W5={kernelName:f3.TOR,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,b3.H)((0,v3.y)(e,(0,g3.l)((0,k5.n)(n,1.5),2)))}}};var X5=__webpack_require__(89881); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10820,7 +10820,7 @@ const V5={kernelName:c3.D7i,gradFunc:(e,t,n)=>{const{dims:i}=n,r=(0,$3.Y6)(i,e.s * limitations under the License. * ============================================================================= */ -const G5={kernelName:c3.l6P,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>(0,d3.w)((0,C3.P)(n),"float32"),t:()=>(0,h3.l)(e,(0,d3.w)(n,e.dtype)),e:()=>(0,h3.l)(e,(0,d3.w)((0,Y5.N)(n),e.dtype))}}};var H5=__webpack_require__(28576); +const q5={kernelName:f3.l6P,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>(0,m3.w)((0,R3.P)(n),"float32"),t:()=>(0,g3.l)(e,(0,m3.w)(n,e.dtype)),e:()=>(0,g3.l)(e,(0,m3.w)((0,X5.N)(n),e.dtype))}}};var K5=__webpack_require__(28576); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10837,7 +10837,7 @@ const G5={kernelName:c3.l6P,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n] * limitations under the License. * ============================================================================= */ -const W5={kernelName:c3.u$b,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,X4.r)(n,(0,_3.d)(0)),i=(0,_3.d)(H5.j),r=(0,_3.d)(H5.X),s=(0,h3.l)(e,r),o=(0,h3.l)((0,h3.l)(e,i),(0,C4.o)((0,d3.w)(n,"float32")));return(0,n4._)(t,s,o)}}}},X5={kernelName:c3.vI1,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,(0,h3.l)(n,(0,b3.j)((0,_3.d)(1),n)))}}},q5={kernelName:c3.YVe,gradFunc:e=>({x:()=>(0,C3.P)(e)})};var K5=__webpack_require__(99907); +const Z5={kernelName:f3.u$b,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,Q4.r)(n,(0,T3.d)(0)),i=(0,T3.d)(K5.j),r=(0,T3.d)(K5.X),s=(0,g3.l)(e,r),o=(0,g3.l)((0,g3.l)(e,i),(0,R4.o)((0,m3.w)(n,"float32")));return(0,o4._)(t,s,o)}}}},Q5={kernelName:f3.vI1,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,(0,g3.l)(n,(0,w3.j)((0,T3.d)(1),n)))}}},J5={kernelName:f3.YVe,gradFunc:e=>({x:()=>(0,R3.P)(e)})};var e6=__webpack_require__(99907); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10854,7 +10854,7 @@ const W5={kernelName:c3.u$b,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const Z5={kernelName:c3.hql,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)((0,K5.g)((0,d3.w)(n,"float32")),e)}}};var Q5=__webpack_require__(27451); +const t6={kernelName:f3.hql,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)((0,e6.g)((0,m3.w)(n,"float32")),e)}}};var n6=__webpack_require__(27451); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10871,7 +10871,7 @@ const Z5={kernelName:c3.hql,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const J5={kernelName:c3.J3C,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)((0,Q5.y)((0,d3.w)(n,"float32")),e)}}};var e6=__webpack_require__(65661),t6=__webpack_require__(34969); +const i6={kernelName:f3.J3C,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)((0,n6.y)((0,m3.w)(n,"float32")),e)}}};var r6=__webpack_require__(65661),s6=__webpack_require__(34969); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10888,7 +10888,7 @@ const J5={kernelName:c3.J3C,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const n6={kernelName:c3.JiE,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{begin:r,size:s}=n,o=i.shape,[a,l]=(0,t6.parseSliceParams)(i,r,s),u=[];for(let t=0;t(0,e6.e)(e,u)}}},i6={kernelName:c3.rFG,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i]=t,{dim:r}=n,s=(0,h3.l)(e,i);return{logits:()=>(0,b3.j)(s,(0,h3.l)((0,I3.c)(s,[r],true),i))}}};var r6=__webpack_require__(28968); +const o6={kernelName:f3.JiE,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{begin:r,size:s}=n,o=i.shape,[a,l]=(0,s6.parseSliceParams)(i,r,s),u=[];for(let t=0;t(0,r6.e)(e,u)}}},a6={kernelName:f3.rFG,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i]=t,{dim:r}=n,s=(0,g3.l)(e,i);return{logits:()=>(0,w3.j)(s,(0,g3.l)((0,O3.c)(s,[r],true),i))}}};var l6=__webpack_require__(28968); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10905,7 +10905,7 @@ const n6={kernelName:c3.JiE,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{be * limitations under the License. * ============================================================================= */ -const s6={kernelName:c3.Fin,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,(0,r6.r)(n))}}};var o6=__webpack_require__(69772); +const u6={kernelName:f3.Fin,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,(0,l6.r)(n))}}};var c6=__webpack_require__(69772); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10922,7 +10922,7 @@ const s6={kernelName:c3.Fin,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;retur * limitations under the License. * ============================================================================= */ -const a6={kernelName:c3.A8B,gradFunc:(e,t,n)=>{const{blockShape:i,paddings:r}=n;return{x:()=>(0,o6.G)(e,i,r)}}};var l6=__webpack_require__(25030); +const d6={kernelName:f3.A8B,gradFunc:(e,t,n)=>{const{blockShape:i,paddings:r}=n;return{x:()=>(0,c6.G)(e,i,r)}}};var h6=__webpack_require__(25030); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10939,7 +10939,7 @@ const a6={kernelName:c3.A8B,gradFunc:(e,t,n)=>{const{blockShape:i,paddings:r}=n; * limitations under the License. * ============================================================================= */ -const u6={kernelName:c3.Blb,gradFunc:(e,t,n)=>{const{axis:i}=n;return{x:()=>(0,l6.x)(e,i)}}},c6={kernelName:c3.dFH,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,h3.l)((0,y3.R)((0,d3.w)(n,"float32")),2))}}},d6={kernelName:c3.M6A,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)(e,(0,h3.l)((0,d3.w)(n,"float32"),2))}}},h6={kernelName:c3.Ddj,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,_3.d)(2);return{a:()=>(0,h3.l)(e,(0,h3.l)(r,(0,b3.j)(n,i))),b:()=>(0,h3.l)(e,(0,h3.l)(r,(0,b3.j)(i,n)))}}},p6={kernelName:c3.pnw,gradFunc:e=>({x:()=>(0,C3.P)(e)})},f6={kernelName:c3.PbM,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=E3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{let t=e;const i=E3.getReductionAxes(n.shape,r);return i.length>0&&(t=(0,I3.c)(t,i)),(0,w3.t)(t,n.shape)},b:()=>{let t=e;const n=E3.getReductionAxes(i.shape,r);return n.length>0&&(t=(0,I3.c)(t,n)),(0,w3.t)((0,g3.H)(t),i.shape)}}}},m6={kernelName:c3.WuN,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,r=i.shape.slice(),{axis:s}=n;(0,$3.Y6)(s,i.shape).forEach(e=>{r[e]=1});const o=(0,w3.t)(e,r),a=(0,h3.l)(o,(0,c5.S)(i.shape,"float32"));return{x:()=>a}}},g6={kernelName:c3.oFs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,m3.y)(e,(0,v3.E)((0,K5.g)(n)))}}},_6={kernelName:c3.iuW,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,h3.l)((0,b3.j)((0,_3.d)(1),(0,v3.E)(n)),e)}}},y6={kernelName:c3.FAs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{reps:r}=n;return{x:()=>{let t=(0,C3.P)(i);if(1===i.rank)for(let n=0;n{const i=n,{perm:r}=i,s=v4.gx(r);return{x:()=>(0,T4.m)(e,s)}}},b6={kernelName:c3.dXR,gradFunc:(e,t,n)=>{const i=n,{axis:r}=i;return{value:()=>(0,B4.t)(e,r)}}};var T6=__webpack_require__(8710),x6=__webpack_require__(48229),E6=__webpack_require__(30178); +const p6={kernelName:f3.Blb,gradFunc:(e,t,n)=>{const{axis:i}=n;return{x:()=>(0,h6.x)(e,i)}}},f6={kernelName:f3.dFH,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,g3.l)((0,x3.R)((0,m3.w)(n,"float32")),2))}}},m6={kernelName:f3.M6A,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)(e,(0,g3.l)((0,m3.w)(n,"float32"),2))}}},g6={kernelName:f3.Ddj,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,T3.d)(2);return{a:()=>(0,g3.l)(e,(0,g3.l)(r,(0,w3.j)(n,i))),b:()=>(0,g3.l)(e,(0,g3.l)(r,(0,w3.j)(i,n)))}}},_6={kernelName:f3.pnw,gradFunc:e=>({x:()=>(0,R3.P)(e)})},y6={kernelName:f3.PbM,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=S3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{let t=e;const i=S3.getReductionAxes(n.shape,r);return i.length>0&&(t=(0,O3.c)(t,i)),(0,C3.t)(t,n.shape)},b:()=>{let t=e;const n=S3.getReductionAxes(i.shape,r);return n.length>0&&(t=(0,O3.c)(t,n)),(0,C3.t)((0,b3.H)(t),i.shape)}}}},v6={kernelName:f3.WuN,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,r=i.shape.slice(),{axis:s}=n;(0,j3.Y6)(s,i.shape).forEach(e=>{r[e]=1});const o=(0,C3.t)(e,r),a=(0,g3.l)(o,(0,f5.S)(i.shape,"float32"));return{x:()=>a}}},b6={kernelName:f3.oFs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,v3.y)(e,(0,E3.E)((0,e6.g)(n)))}}},T6={kernelName:f3.iuW,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,g3.l)((0,w3.j)((0,T3.d)(1),(0,E3.E)(n)),e)}}},x6={kernelName:f3.FAs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{reps:r}=n;return{x:()=>{let t=(0,R3.P)(i);if(1===i.rank)for(let n=0;n{const i=n,{perm:r}=i,s=E4.gx(r);return{x:()=>(0,I4.m)(e,s)}}},w6={kernelName:f3.dXR,gradFunc:(e,t,n)=>{const i=n,{axis:r}=i;return{value:()=>(0,z4.t)(e,r)}}};var I6=__webpack_require__(8710),A6=__webpack_require__(48229),S6=__webpack_require__(30178); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10956,7 +10956,7 @@ const u6={kernelName:c3.Blb,gradFunc:(e,t,n)=>{const{axis:i}=n;return{x:()=>(0,l * limitations under the License. * ============================================================================= */ -const w6={kernelName:c3.pPe,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=(0,E6.P)(t,(0,C3.P)(t)),i=(0,x6.k)(e,n);let r=(0,J3.D)(t,(0,_3.d)(0,"int32"));const s=i.rank-r.rank;for(let e=0;e{const[n]=t;return{x:()=>function(e,t){const n=(0,S6.P)(t,(0,R3.P)(t)),i=(0,A6.k)(e,n);let r=(0,i4.D)(t,(0,T3.d)(0,"int32"));const s=i.rank-r.rank;for(let e=0;e{const[n * limitations under the License. * ============================================================================= */ -const I6={kernelName:c3.xJ3,gradFunc:e=>({x:()=>(0,C3.P)(e)})};var A6=__webpack_require__(37074); +const O6={kernelName:f3.xJ3,gradFunc:e=>({x:()=>(0,R3.P)(e)})};var M6=__webpack_require__(37074); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -10990,7 +10990,7 @@ const I6={kernelName:c3.xJ3,gradFunc:e=>({x:()=>(0,C3.P)(e)})};var A6=__webpack_ * limitations under the License. * ============================================================================= */ -const S6=[f3,T3,x3,A3,S3,O3,M3,k3,N3,D3,F3,L3,j3,G3,W3,q3,K3,Z3,Q3,i4,r4,o4,d4,u4,f4,g4,y4,x4,I4,A4,N5,S4,O4,M4,k4,R4,D4,N4,P4,U4,j4,Y4,G4,H4,W4,q4,K4,Z4,Q4,e5,i5,i5,s5,a5,u5,d5,h5,p5,m5,_5,y5,v5,T5,x5,w5,I5,I5,C5,O5,R5,D5,F5,L5,P5,B5,$5,V5,z5,j5,G5,W5,X5,q5,Z5,J5,n6,i6,s6,a6,a6,u6,u6,c6,h6,d6,p6,f6,m6,g6,_6,y6,v6,b6,w6,I6];for(const e of S6)(0,A6.kr)(e);__webpack_require__(20455); +const k6=[y3,I3,A3,M3,k3,N3,D3,F3,P3,B3,$3,U3,W3,q3,Z3,J3,e4,t4,n4,a4,l4,c4,m4,p4,y4,b4,x4,A4,O4,M4,P5,k4,N4,D4,F4,L4,B4,P4,V4,Y4,W4,X4,q4,K4,Z4,J4,e5,t5,n5,r5,a5,a5,u5,d5,p5,m5,g5,_5,v5,T5,x5,E5,I5,A5,C5,O5,O5,R5,N5,L5,B5,$5,U5,V5,z5,j5,G5,H5,W5,q5,Z5,Q5,J5,t6,i6,o6,a6,u6,d6,d6,p6,p6,f6,g6,m6,_6,y6,v6,b6,T6,x6,E6,w6,C6,O6];for(const e of k6)(0,M6.kr)(e);__webpack_require__(20455); /** * @license * Copyright 2018 Google LLC @@ -11000,7 +11000,7 @@ const S6=[f3,T3,x3,A3,S3,O3,M3,k3,N3,D3,F3,L3,j3,G3,W3,q3,K3,Z3,Q3,i4,r4,o4,d4,u * https://opensource.org/licenses/MIT. * ============================================================================= */ -class C6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,C6.prototype)}}class O6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,O6.prototype)}}class M6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,M6.prototype)}}class k6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,k6.prototype)}}class R6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,R6.prototype)}}Error; +class R6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,R6.prototype)}}class N6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,N6.prototype)}}class D6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,D6.prototype)}}class F6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,F6.prototype)}}class L6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,L6.prototype)}}Error; /** * @license * Copyright 2022 Google LLC @@ -11010,7 +11010,7 @@ class C6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,C6.pro * https://opensource.org/licenses/MIT. * ============================================================================= */ -class N6{constructor(e){this.maxEntries=e||100,this.cache=new Map}get(e){let t;return this.cache.has(e)&&(t=this.cache.get(e),this.cache.delete(e),this.cache.set(e,t)),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxEntries){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let t=0;t=this.maxEntries){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let t=0;tt.toUpperCase())}let V6={};function z6(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function j6(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach(e=>j6(e));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?j6(t):e[n]=t.value)}}}function Y6(e,t={},n={},i="object",r=!1){if("string"==typeof e){const r=e;let s;if(r in n)s=n[r];else if(r in V6)s=V6[r];else if(s=t[r],null==s)throw new M6(`Unknown ${i}: ${e}. This may be due to one of the following reasons:\n1. The ${i} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${i} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return s}{const s=e;if(null==s.className||null==s.config)throw new M6(`${i}: Improper config format: ${JSON.stringify(s)}.\n'className' and 'config' must set.`);const o=s.className;let a,l;if(o in n?[a,l]=n[o]:o in V6?[a,l]=V6.className:o in t&&([a,l]=t[o]),null==a)throw new M6(`Unknown ${i}: ${o}. This may be due to one of the following reasons:\n1. The ${i} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${i} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(V6))e[t]=V6[t];for(const t of Object.keys(n))e[t]=n[t];s.config.customObjects=e;const t=Object.assign({},V6);for(const e of Object.keys(n))V6[e]=n[e];j6(s.config);const i=l(a,s.config,n,r);return V6=Object.assign({},t),i}{const e=Object.assign({},V6);for(const e of Object.keys(n))V6[e]=n[e];const t=new a(s.config);return V6=Object.assign({},e),t}}}function G6(e,t){return-1*function(e,t){return et?1:0}(e,t)}function H6(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function W6(e){if(null==e)throw new M6(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function X6(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new M6(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function q6(e,t,n=0,i=1/0){return F6(n>=0),F6(i>=n),Array.isArray(e)&&e.length>=n&&e.length<=i&&e.every(e=>typeof e===t)}function K6(e,t){Array.isArray(e)?(u3.util.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((e,n)=>K6(e,`element ${n+1} of ${t}`))):u3.util.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${Z6(e)}.`)}function Z6(e){return null===e?"null":Array.isArray(e)?"["+e.map(e=>Z6(e)).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function Q6(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null} +function B6(e,t){if(Array.isArray(e)){let n=[];for(let i=0;it.toUpperCase())}let G6={};function H6(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function W6(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach(e=>W6(e));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?W6(t):e[n]=t.value)}}}function X6(e,t={},n={},i="object",r=!1){if("string"==typeof e){const r=e;let s;if(r in n)s=n[r];else if(r in G6)s=G6[r];else if(s=t[r],null==s)throw new D6(`Unknown ${i}: ${e}. This may be due to one of the following reasons:\n1. The ${i} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${i} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return s}{const s=e;if(null==s.className||null==s.config)throw new D6(`${i}: Improper config format: ${JSON.stringify(s)}.\n'className' and 'config' must set.`);const o=s.className;let a,l;if(o in n?[a,l]=n[o]:o in G6?[a,l]=G6.className:o in t&&([a,l]=t[o]),null==a)throw new D6(`Unknown ${i}: ${o}. This may be due to one of the following reasons:\n1. The ${i} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${i} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(G6))e[t]=G6[t];for(const t of Object.keys(n))e[t]=n[t];s.config.customObjects=e;const t=Object.assign({},G6);for(const e of Object.keys(n))G6[e]=n[e];W6(s.config);const i=l(a,s.config,n,r);return G6=Object.assign({},t),i}{const e=Object.assign({},G6);for(const e of Object.keys(n))G6[e]=n[e];const t=new a(s.config);return G6=Object.assign({},e),t}}}function q6(e,t){return-1*function(e,t){return et?1:0}(e,t)}function K6(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function Z6(e){if(null==e)throw new D6(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function Q6(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new D6(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function J6(e,t,n=0,i=1/0){return $6(n>=0),$6(i>=n),Array.isArray(e)&&e.length>=n&&e.length<=i&&e.every(e=>typeof e===t)}function e8(e,t){Array.isArray(e)?(p3.util.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((e,n)=>e8(e,`element ${n+1} of ${t}`))):p3.util.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${t8(e)}.`)}function t8(e){return null===e?"null":Array.isArray(e)?"["+e.map(e=>t8(e)).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function n8(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null} /** * @license * Copyright 2018 Google LLC @@ -11030,7 +11030,7 @@ function D6(e,t){if(Array.isArray(e)){let n=[];for(let i=0;i0){const n=`${e}_${t}`;return l8.set(n,1),n}return e}const g8=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function _8(e){return!!e.match(g8)} +const a8=["channelsFirst","channelsLast"],l8=["nearest","bilinear"],u8=["valid","same","causal"],c8=["max","avg"],d8=["sum","mul","concat","ave"],h8=new Map;function p8(e){Q6(a8,"DataFormat",e)}function f8(e){Q6(u8,"PaddingMode",e)}function m8(e){Q6(c8,"PoolMode",e)}const g8=[];function _8(e,t){g8.push(e);try{const e=t();return g8.pop(),e}catch(e){throw g8.pop(),e}}function y8(e){if(!T8(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===g8.length?"":g8.join("/")+"/")+e}function v8(e){if(!T8(e))throw new Error("Not a valid tensor name: '"+e+"'");h8.has(e)||h8.set(e,0);const t=h8.get(e);if(h8.set(e,h8.get(e)+1),t>0){const n=`${e}_${t}`;return h8.set(n,1),n}return e}const b8=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function T8(e){return!!e.match(b8)} /** * @license * Copyright 2018 Google LLC @@ -11050,7 +11050,7 @@ const i8=["channelsFirst","channelsLast"],r8=["nearest","bilinear"],s8=["valid", * https://opensource.org/licenses/MIT. * ============================================================================= */ -function y8(e){return e===parseInt(e.toString(),10)}function v8(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let i=1;for(let r=t;rt&&(t=i)}return t}function x8(e,t){if(tt&&(t=i)}return t}function A8(e,t){if(t{switch(e.rank){case 1:return u3.slice1d(e,t,n);case 2:return u3.slice2d(e,[t,0],[n,e.shape[1]]);case 3:return u3.slice3d(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return u3.slice4d(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return u3.slice(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return u3.slice(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new M6(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function C8(e,t,n){return(0,u3.tidy)(()=>{switch(e.rank){case 1:return u3.slice1d(e,t,n);case 2:return u3.slice2d(e,[0,t],[e.shape[0],n]);case 3:return u3.slice3d(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return u3.slice4d(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new M6(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function O8(e,t,n,i){return(0,u3.tidy)(()=>{switch(e.rank){case 1:return u3.slice1d(e,t,n);case 2:switch(i){case 1:return S8(e,t,n);case 2:return C8(e,t,n);default:throw new M6(`The axis is not within the rank of the tensor ${i}`)}case 3:switch(i){case 1:return S8(e,t,n);case 2:return u3.slice3d(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return C8(e,t,n);default:throw new M6(`The axis is not within the rank of the tensor ${i}`)}case 4:switch(i){case 1:return S8(e,t,n);case 2:return u3.slice4d(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return u3.slice4d(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return C8(e,t,n);default:throw new M6(`The axis is not within the rank of the tensor ${i}`)}default:throw new M6(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function M8(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),u3.concat(e,t)}function k8(e,t){switch(e.rank){case 1:return u3.concat1d([e,t]);case 2:return u3.concat2d([e,t],0);case 3:return u3.concat3d([e,t],0);case 4:return u3.concat4d([e,t],0);default:throw new M6(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function R8(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new M6(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return u3.tile(e,t)}function N8(e,t=0,n=1,i,r){return u3.randomNormal(e,t,n,i,r)}function D8(e,t,n,i){if(e.rank<2||t.rank<2)throw new k6(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){if(e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new k6(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(2===e.rank&&2===t.rank){const r=!1,s=!1;return u3.fused.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:i?P8(e.rank,i,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),s=r.pop();e=u3.reshape(e,[-1,s]);const o=t.shape.slice(),a=o.pop(),l=o.pop(),u=[...o,a],c=Array.from({length:t.rank},(e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n);t=u3.reshape(u3.transpose(t,c),[l,-1]);const d=[...r,...u],h=!1,p=!1;return u3.reshape(u3.fused.matMul({a:e,b:t,transposeA:h,transposeB:p,bias:i?P8(e.rank,i,"channelsLast"):null,activation:n}),d)}}function F8(e,t,n){return(0,u3.tidy)(()=>(t=Array.isArray(t)?(0,u3.tensor1d)(t,"int32"):u3.cast(t,"int32"),u3.gather(e,t,n)))}function L8(e){return u3.mul(e,e)}function P8(e,t,n){const i=t.shape;if(1!==t.rank&&t.rank!==e)throw new M6(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===i.length?u3.reshape(t,[1,i[0],1,1,1]):u3.reshape(t,[1,i[3],i[0],i[1],i[2]]);if("channelsLast"===n)return 1===i.length?u3.reshape(t,[1,1,1,1,i[0]]):u3.reshape(t,[1].concat(i))}else if(4===e){if("channelsFirst"===n)return 1===i.length?u3.reshape(t,[1,i[0],1,1]):u3.reshape(t,[1,i[2],i[0],i[1]]);if("channelsLast"===n)return 1===i.length?u3.reshape(t,[1,1,1,i[0]]):u3.reshape(t,[1].concat(i))}else if(3===e){if("channelsFirst"===n)return 1===i.length?u3.reshape(t,[1,i[0],1]):u3.reshape(t,[1,i[1],i[0]]);if("channelsLast"===n)return 1===i.length?u3.reshape(t,[1,1,i[0]]):u3.reshape(t,[1].concat(i))}else if(e<3)return t;throw new M6(`Unsupported input rank by biasAdd: ${t.rank}`)}function B8(e,t,n){return(0,u3.tidy)(()=>(null==n&&(n="channelsLast"),u8(n),u3.add(e,P8(e.rank,t,n))))}function $8(e,t,n,i){return(0,u3.tidy)(()=>u3.dropout(e,t,n,i))}function U8(e,t,n=!1){return n?e():t()} +let S8;function C8(){return null==S8&&(S8=(0,p3.backend)().epsilon()),S8}function O8(e,t){return p3.cast(e,t)}function M8(e,t=-1){const n=e.shape.slice();return t<0&&(t=n.length+t+1),n.splice(t,0,1),p3.reshape(e,n)}function k8(e,t,n){return(0,p3.tidy)(()=>{switch(e.rank){case 1:return p3.slice1d(e,t,n);case 2:return p3.slice2d(e,[t,0],[n,e.shape[1]]);case 3:return p3.slice3d(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return p3.slice4d(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return p3.slice(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return p3.slice(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new D6(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function R8(e,t,n){return(0,p3.tidy)(()=>{switch(e.rank){case 1:return p3.slice1d(e,t,n);case 2:return p3.slice2d(e,[0,t],[e.shape[0],n]);case 3:return p3.slice3d(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return p3.slice4d(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new D6(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function N8(e,t,n,i){return(0,p3.tidy)(()=>{switch(e.rank){case 1:return p3.slice1d(e,t,n);case 2:switch(i){case 1:return k8(e,t,n);case 2:return R8(e,t,n);default:throw new D6(`The axis is not within the rank of the tensor ${i}`)}case 3:switch(i){case 1:return k8(e,t,n);case 2:return p3.slice3d(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return R8(e,t,n);default:throw new D6(`The axis is not within the rank of the tensor ${i}`)}case 4:switch(i){case 1:return k8(e,t,n);case 2:return p3.slice4d(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return p3.slice4d(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return R8(e,t,n);default:throw new D6(`The axis is not within the rank of the tensor ${i}`)}default:throw new D6(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function D8(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),p3.concat(e,t)}function F8(e,t){switch(e.rank){case 1:return p3.concat1d([e,t]);case 2:return p3.concat2d([e,t],0);case 3:return p3.concat3d([e,t],0);case 4:return p3.concat4d([e,t],0);default:throw new D6(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function L8(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new D6(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return p3.tile(e,t)}function P8(e,t=0,n=1,i,r){return p3.randomNormal(e,t,n,i,r)}function B8(e,t,n,i){if(e.rank<2||t.rank<2)throw new F6(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){if(e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new F6(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(2===e.rank&&2===t.rank){const r=!1,s=!1;return p3.fused.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:i?V8(e.rank,i,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),s=r.pop();e=p3.reshape(e,[-1,s]);const o=t.shape.slice(),a=o.pop(),l=o.pop(),u=[...o,a],c=Array.from({length:t.rank},(e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n);t=p3.reshape(p3.transpose(t,c),[l,-1]);const d=[...r,...u],h=!1,p=!1;return p3.reshape(p3.fused.matMul({a:e,b:t,transposeA:h,transposeB:p,bias:i?V8(e.rank,i,"channelsLast"):null,activation:n}),d)}}function $8(e,t,n){return(0,p3.tidy)(()=>(t=Array.isArray(t)?(0,p3.tensor1d)(t,"int32"):p3.cast(t,"int32"),p3.gather(e,t,n)))}function U8(e){return p3.mul(e,e)}function V8(e,t,n){const i=t.shape;if(1!==t.rank&&t.rank!==e)throw new D6(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===i.length?p3.reshape(t,[1,i[0],1,1,1]):p3.reshape(t,[1,i[3],i[0],i[1],i[2]]);if("channelsLast"===n)return 1===i.length?p3.reshape(t,[1,1,1,1,i[0]]):p3.reshape(t,[1].concat(i))}else if(4===e){if("channelsFirst"===n)return 1===i.length?p3.reshape(t,[1,i[0],1,1]):p3.reshape(t,[1,i[2],i[0],i[1]]);if("channelsLast"===n)return 1===i.length?p3.reshape(t,[1,1,1,i[0]]):p3.reshape(t,[1].concat(i))}else if(3===e){if("channelsFirst"===n)return 1===i.length?p3.reshape(t,[1,i[0],1]):p3.reshape(t,[1,i[1],i[0]]);if("channelsLast"===n)return 1===i.length?p3.reshape(t,[1,1,i[0]]):p3.reshape(t,[1].concat(i))}else if(e<3)return t;throw new D6(`Unsupported input rank by biasAdd: ${t.rank}`)}function z8(e,t,n){return(0,p3.tidy)(()=>(null==n&&(n="channelsLast"),p8(n),p3.add(e,V8(e.rank,t,n))))}function j8(e,t,n,i){return(0,p3.tidy)(()=>p3.dropout(e,t,n,i))}function Y8(e,t,n=!1){return n?e():t()} /** * @license * Copyright 2018 Google LLC @@ -11070,7 +11070,7 @@ let E8;function w8(){return null==E8&&(E8=(0,u3.backend)().epsilon()),E8}functio * https://opensource.org/licenses/MIT. * ============================================================================= */ -const V8=["fanIn","fanOut","fanAvg"],z8=["normal","uniform","truncatedNormal"];class j8 extends u3.serialization.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class Y8 extends j8{apply(e,t){return(0,u3.zeros)(e,t)}}Y8.className="Zeros",u3.serialization.registerClass(Y8);class G8 extends j8{apply(e,t){return(0,u3.ones)(e,t)}}G8.className="Ones",u3.serialization.registerClass(G8);class H8 extends j8{constructor(e){if(super(),"object"!=typeof e)throw new M6(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new M6(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return(0,u3.tidy)(()=>(0,u3.mul)((0,u3.scalar)(this.value),(0,u3.ones)(e,t)))}getConfig(){return{value:this.value}}}H8.className="Constant",u3.serialization.registerClass(H8);class W8 extends j8{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return(0,u3.randomUniform)(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}W8.className="RandomUniform",u3.serialization.registerClass(W8);class X8 extends j8{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new k6(`randomNormal does not support dType ${t}.`);return N8(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}X8.className="RandomNormal",u3.serialization.registerClass(X8);class q8 extends j8{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new k6(`truncatedNormal does not support dType ${t}.`);return(0,u3.truncatedNormal)(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}q8.className="TruncatedNormal",u3.serialization.registerClass(q8);class K8 extends j8{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return(0,u3.tidy)(()=>{if(2!==e.length||e[0]!==e[1])throw new M6("Identity matrix initializer can only be used for 2D square matrices.");return(0,u3.mul)(this.gain,(0,u3.eye)(e[0]))})}getConfig(){return{gain:this.gain}}}K8.className="Identity",u3.serialization.registerClass(K8);class Z8 extends j8{constructor(e){if(super(),e.scale<0)throw new M6(`scale must be a positive float. Got: ${e.scale}`); +const G8=["fanIn","fanOut","fanAvg"],H8=["normal","uniform","truncatedNormal"];class W8 extends p3.serialization.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class X8 extends W8{apply(e,t){return(0,p3.zeros)(e,t)}}X8.className="Zeros",p3.serialization.registerClass(X8);class q8 extends W8{apply(e,t){return(0,p3.ones)(e,t)}}q8.className="Ones",p3.serialization.registerClass(q8);class K8 extends W8{constructor(e){if(super(),"object"!=typeof e)throw new D6(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new D6(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return(0,p3.tidy)(()=>(0,p3.mul)((0,p3.scalar)(this.value),(0,p3.ones)(e,t)))}getConfig(){return{value:this.value}}}K8.className="Constant",p3.serialization.registerClass(K8);class Z8 extends W8{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return(0,p3.randomUniform)(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}Z8.className="RandomUniform",p3.serialization.registerClass(Z8);class Q8 extends W8{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new F6(`randomNormal does not support dType ${t}.`);return P8(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}Q8.className="RandomNormal",p3.serialization.registerClass(Q8);class J8 extends W8{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new F6(`truncatedNormal does not support dType ${t}.`);return(0,p3.truncatedNormal)(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}J8.className="TruncatedNormal",p3.serialization.registerClass(J8);class e9 extends W8{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return(0,p3.tidy)(()=>{if(2!==e.length||e[0]!==e[1])throw new D6("Identity matrix initializer can only be used for 2D square matrices.");return(0,p3.mul)(this.gain,(0,p3.eye)(e[0]))})}getConfig(){return{gain:this.gain}}}e9.className="Identity",p3.serialization.registerClass(e9);class t9 extends W8{constructor(e){if(super(),e.scale<0)throw new D6(`scale must be a positive float. Got: ${e.scale}`); /** * @license * Copyright 2018 Google LLC @@ -11080,7 +11080,7 @@ const V8=["fanIn","fanOut","fanAvg"],z8=["normal","uniform","truncatedNormal"];c * https://opensource.org/licenses/MIT. * ============================================================================= */ -var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,X6(V8,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){X6(z8,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,i;if(u8(t),2===e.length)n=e[0],i=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=v8(e,2);n=e[1]*t,i=e[0]*t}else if("channelsLast"===t){const t=v8(e,0,e.length-2);n=e[e.length-2]*t,i=e[e.length-1]*t}}else{const t=v8(e);n=Math.sqrt(t),i=Math.sqrt(t)}return[n,i]}(e),i=n[0],r=n[1];let s=this.scale;if("fanIn"===this.mode?s/=Math.max(1,i):"fanOut"===this.mode?s/=Math.max(1,r):s/=Math.max(1,(i+r)/2),"normal"===this.distribution){const n=Math.sqrt(s);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new k6(`${this.getClassName()} does not support dType ${t}.`);return(0,u3.truncatedNormal)(e,0,n,t,this.seed)}{const n=Math.sqrt(3*s);return(0,u3.randomUniform)(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}Z8.className="VarianceScaling",u3.serialization.registerClass(Z8);class Q8 extends Z8{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return Z8.className}}Q8.className="GlorotUniform",u3.serialization.registerClass(Q8);class J8 extends Z8{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return Z8.className}}J8.className="GlorotNormal",u3.serialization.registerClass(J8);class e9 extends Z8{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return Z8.className}}e9.className="HeNormal",u3.serialization.registerClass(e9);class t9 extends Z8{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return Z8.className}}t9.className="HeUniform",u3.serialization.registerClass(t9);class n9 extends Z8{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return Z8.className}}n9.className="LeCunNormal",u3.serialization.registerClass(n9);class i9 extends Z8{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return Z8.className}}i9.className="LeCunUniform",u3.serialization.registerClass(i9);class r9 extends j8{constructor(e){super(),this.DEFAULT_GAIN=1,this.ELEMENTS_WARN_SLOW=2e3,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed}apply(e,t){return(0,u3.tidy)(()=>{if(e.length<2)throw new k6("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=u3.util.sizeFromShape(e.slice(0,-1)),i=e[e.length-1],r=n*i;r>this.ELEMENTS_WARN_SLOW&&console.warn(`Orthogonal initializer is being called on a matrix with more than ${this.ELEMENTS_WARN_SLOW} (${r}) elements: Slowness may result.`);const s=N8([Math.max(i,n),Math.min(i,n)],0,1,t,this.seed),o=u3.linalg.qr(s,!1);let a=o[0];const l=o[1].flatten().stridedSlice([0],[Math.min(i,n)*Math.min(i,n)],[Math.min(i,n)+1]);return a=(0,u3.mul)(a,l.sign()),n{if(e.length<2)throw new F6("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=p3.util.sizeFromShape(e.slice(0,-1)),i=e[e.length-1],r=n*i;r>this.ELEMENTS_WARN_SLOW&&console.warn(`Orthogonal initializer is being called on a matrix with more than ${this.ELEMENTS_WARN_SLOW} (${r}) elements: Slowness may result.`);const s=P8([Math.max(i,n),Math.min(i,n)],0,1,t,this.seed),o=p3.linalg.qr(s,!1);let a=o[0];const l=o[1].flatten().stridedSlice([0],[Math.min(i,n)*Math.min(i,n)],[Math.min(i,n)+1]);return a=(0,p3.mul)(a,l.sign()),ne*t);return t} +function _9(e){let t=0;for(const n of e)0===n.shape.length?t+=1:t+=n.shape.reduce((e,t)=>e*t);return t} /** * @license * Copyright 2018 Google LLC @@ -11110,7 +11110,7 @@ function p9(e){let t=0;for(const n of e)0===n.shape.length?t+=1:t+=n.shape.reduc * https://opensource.org/licenses/MIT. * ============================================================================= */ -const f9="Variable";class m9{constructor(e,t="float32",n=f9,i=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=e8(),n=null==n?f9:n,this.originalName=f8(n),this.name=m8(this.originalName),this.trainable_=i,this.constraint=r,this.val=u3.variable(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function g9(e){return e.map(e=>e.read())}function _9(e){e.forEach(e=>{e[0].write(e[1])})} +const y9="Variable";class v9{constructor(e,t="float32",n=y9,i=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=r8(),n=null==n?y9:n,this.originalName=y8(n),this.name=v8(this.originalName),this.trainable_=i,this.constraint=r,this.val=p3.variable(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function b9(e){return e.map(e=>e.read())}function T9(e){e.forEach(e=>{e[0].write(e[1])})} /** * @license * Copyright 2018 Google LLC @@ -11120,7 +11120,7 @@ const f9="Variable";class m9{constructor(e,t="float32",n=f9,i=!0,r=null){this.dt * https://opensource.org/licenses/MIT. * ============================================================================= */ -class y9{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class v9{constructor(e,t,n,i,r,s,o){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=i,this.callArgs=r,this.outputTensorIndex=o,this.id=e8(),null!=s&&(this.originalName=f8(s),this.name=m8(this.originalName)),this.rank=t.length}}let b9=0;class T9{constructor(e,t){this.callArgs=t,this.id=b9++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let x9=0;class E9 extends u3.serialization.Serializable{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=x9++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){const e=this.getClassName();t=$6(e)+"_"+n8(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let n=null;null!=e.batchSize&&(n=e.batchSize),t=[n].concat(e.inputShape)}this.batchInputShape=t;let n=e.dtype;null==n&&(n=e.inputDType),null==n&&(n="float32"),this.dtype=n}null!=e.weights?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(0===this.inboundNodes.length)throw new O6(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new M6(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return P6(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return P6(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new C6(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new C6(`Layer ${this.name} is not connected, no input to return.`);return P6(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new C6(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new C6(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return P6(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const t=B6(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=B6(this.inputSpec);if(t.length!==n.length)throw new M6(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;er.maxNDim)throw new M6(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(null!=r.minNDim&&s=0?t[i]:t[t.length+i];if(null!=s&&-1===[s,null].indexOf(o))throw new M6(`Input ${e} is incompatible with layer ${this.name}: expected axis ${i} of input shape to have value ${s} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of B6(e))t.push(n.shape);this.build(P6(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let i=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,i);const r=B6(i),s=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),s.push(e);if(i=P6(s),null!=this.activityRegularizer)throw new k6("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return i}{const n=function(e){e=B6(e);const t=[];for(const n of e)t.push(n.shape);return P6(t)}(e),i=this.computeOutputShape(n);let r;const s="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=i&&i.length>0&&Array.isArray(i[0])?i.map((n,i)=>new v9(s,n,this,B6(e),t,this.name,i)):new v9(s,i,this,B6(e),t,this.name),this.addInboundNode(e,r,null,null,n,i,t),this._refCount++,null!=this.activityRegularizer)throw new k6("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}})}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,i)=>{null!=n&&null!=e[i]&&e[i]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new C6(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new C6(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new O6(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return p9(this.weights)}build(e){this.built=!0}getWeights(e=!1){return g9(e?this.trainableWeights:this.weights)}setWeights(e){(0,u3.tidy)(()=>{const t=this.weights;if(t.length!==e.length)throw new M6(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const n=[],i=g9(t);for(let r=0;rr.apply(u.read())),null==s&&(s=!0),s?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=B6(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach(e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)})}return null}return t}setMaskMetadata(e,t,n){if(!this.supportsMasking)return;const i=this.computeMask(e,n),r=B6(t),s=B6(i);if(r.length!==s.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;ee.dispose()),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0===--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function w9(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;n1)throw new R6(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new R6(`Layer ${this.name} is not connected, no input to return.`);return V6(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new R6(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new R6(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return V6(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const t=z6(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=z6(this.inputSpec);if(t.length!==n.length)throw new D6(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;er.maxNDim)throw new D6(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(null!=r.minNDim&&s=0?t[i]:t[t.length+i];if(null!=s&&-1===[s,null].indexOf(o))throw new D6(`Input ${e} is incompatible with layer ${this.name}: expected axis ${i} of input shape to have value ${s} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of z6(e))t.push(n.shape);this.build(V6(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let i=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,i);const r=z6(i),s=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),s.push(e);if(i=V6(s),null!=this.activityRegularizer)throw new F6("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return i}{const n=function(e){e=z6(e);const t=[];for(const n of e)t.push(n.shape);return V6(t)}(e),i=this.computeOutputShape(n);let r;const s="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=i&&i.length>0&&Array.isArray(i[0])?i.map((n,i)=>new E9(s,n,this,z6(e),t,this.name,i)):new E9(s,i,this,z6(e),t,this.name),this.addInboundNode(e,r,null,null,n,i,t),this._refCount++,null!=this.activityRegularizer)throw new F6("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}})}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,i)=>{null!=n&&null!=e[i]&&e[i]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new R6(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new R6(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new N6(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return _9(this.weights)}build(e){this.built=!0}getWeights(e=!1){return b9(e?this.trainableWeights:this.weights)}setWeights(e){(0,p3.tidy)(()=>{const t=this.weights;if(t.length!==e.length)throw new D6(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const n=[],i=b9(t);for(let r=0;rr.apply(u.read())),null==s&&(s=!0),s?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=z6(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach(e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)})}return null}return t}setMaskMetadata(e,t,n){if(!this.supportsMasking)return;const i=this.computeMask(e,n),r=z6(t),s=z6(i);if(r.length!==s.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;ee.dispose()),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0===--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function C9(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;ne.name),l=[],u=t.names();for(const e of a)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=i&&(i.maxNumTensors=-1/0,i.minNumTensors=1/0);const c=a.join(",")+"|"+t.names().sort().join(",");let d,h=C9.get(c);if(null==h){const e=function(e,t){u3.util.assert(null!=e&&e.length>0,()=>"Expected at least one fetch, got none");let n=[],i={};if(1===e.length){const r=R9(e[0],t);n=r.sorted,i=r.recipientMap}else{const r=new Set;for(const s of e){const{sorted:e,recipientMap:o}=R9(s,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in o)null==i[e]&&(i[e]=new Set),o[e].forEach(t=>i[e].add(t))}}return{sorted:n,recipientCounts:k9(i)}}(o,t);h=e.sorted,d=e.recipientCounts,C9.put(c,h),O9.put(c,d)}d={},r||Object.assign(d,O9.get(c));const p=new S9(t);for(let e=0;ei.maxNumTensors&&(i.maxNumTensors=e),e0;){const e=s[s.length-1];if(n.has(e.name)){s.pop();continue}const t=o[o.length-1]===s.length-1;if(0===e.inputs.length||t)s.pop(),i.push(e),n.add(e.name),t&&o.pop();else{o.push(s.length-1);for(const t of e.inputs)null==r[t.name]&&(r[t.name]=new Set),r[t.name].add(e.name),n.has(t.name)||s.push(t)}}return{sorted:i,recipientMap:r}}function N9(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;te.name),l=[],u=t.names();for(const e of a)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=i&&(i.maxNumTensors=-1/0,i.minNumTensors=1/0);const c=a.join(",")+"|"+t.names().sort().join(",");let d,h=R9.get(c);if(null==h){const e=function(e,t){p3.util.assert(null!=e&&e.length>0,()=>"Expected at least one fetch, got none");let n=[],i={};if(1===e.length){const r=L9(e[0],t);n=r.sorted,i=r.recipientMap}else{const r=new Set;for(const s of e){const{sorted:e,recipientMap:o}=L9(s,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in o)null==i[e]&&(i[e]=new Set),o[e].forEach(t=>i[e].add(t))}}return{sorted:n,recipientCounts:F9(i)}}(o,t);h=e.sorted,d=e.recipientCounts,R9.put(c,h),N9.put(c,d)}d={},r||Object.assign(d,N9.get(c));const p=new k9(t);for(let e=0;ei.maxNumTensors&&(i.maxNumTensors=e),e0;){const e=s[s.length-1];if(n.has(e.name)){s.pop();continue}const t=o[o.length-1]===s.length-1;if(0===e.inputs.length||t)s.pop(),i.push(e),n.add(e.name),t&&o.pop();else{o.push(s.length-1);for(const t of e.inputs)null==r[t.name]&&(r[t.name]=new Set),r[t.name].add(e.name),n.has(t.name)||s.push(t)}}return{sorted:i,recipientMap:r}}function P9(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;tu3.sqrt(u3.sum(u3.mul(e,e),t,!0)))}(0,u3.env)().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",()=>100,function(e){null!=C9&&C9.setMaxEntries(e),null!=O9&&O9.setMaxEntries(e)});class F9 extends u3.serialization.Serializable{getConfig(){return{}}}class L9 extends F9{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,u3.tidy)(()=>{const t=D9(e,this.axis),n=u3.clipByValue(t,0,this.maxValue);return u3.mul(e,u3.div(n,u3.add(w8(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}L9.className="MaxNorm",u3.serialization.registerClass(L9);class P9 extends F9{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,u3.tidy)(()=>u3.div(e,u3.add(w8(),D9(e,this.axis))))}getConfig(){return{axis:this.axis}}}P9.className="UnitNorm",u3.serialization.registerClass(P9);class B9 extends F9{apply(e){return u3.relu(e)}}B9.className="NonNeg",u3.serialization.registerClass(B9);class $9 extends F9{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,u3.tidy)(()=>{const t=D9(e,this.axis),n=u3.add(u3.mul(this.rate,u3.clipByValue(t,this.minValue,this.maxValue)),u3.mul(1-this.rate,t));return u3.mul(e,u3.div(n,u3.add(w8(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}$9.className="MinMaxNorm",u3.serialization.registerClass($9);const U9={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function V9(e){return z6(e)}function z9(e,t={}){return Y6(e,u3.serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function j9(e){if(null==e)return null;if("string"==typeof e){return z9({className:e in U9?U9[e]:e,config:{}})}return e instanceof F9?e:z9(e)} +function B9(e,t){return(0,p3.tidy)(()=>p3.sqrt(p3.sum(p3.mul(e,e),t,!0)))}(0,p3.env)().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",()=>100,function(e){null!=R9&&R9.setMaxEntries(e),null!=N9&&N9.setMaxEntries(e)});class $9 extends p3.serialization.Serializable{getConfig(){return{}}}class U9 extends $9{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,p3.tidy)(()=>{const t=B9(e,this.axis),n=p3.clipByValue(t,0,this.maxValue);return p3.mul(e,p3.div(n,p3.add(C8(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}U9.className="MaxNorm",p3.serialization.registerClass(U9);class V9 extends $9{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,p3.tidy)(()=>p3.div(e,p3.add(C8(),B9(e,this.axis))))}getConfig(){return{axis:this.axis}}}V9.className="UnitNorm",p3.serialization.registerClass(V9);class z9 extends $9{apply(e){return p3.relu(e)}}z9.className="NonNeg",p3.serialization.registerClass(z9);class j9 extends $9{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,p3.tidy)(()=>{const t=B9(e,this.axis),n=p3.add(p3.mul(this.rate,p3.clipByValue(t,this.minValue,this.maxValue)),p3.mul(1-this.rate,t));return p3.mul(e,p3.div(n,p3.add(C8(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}j9.className="MinMaxNorm",p3.serialization.registerClass(j9);const Y9={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function G9(e){return H6(e)}function H9(e,t={}){return X6(e,p3.serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function W9(e){if(null==e)return null;if("string"==typeof e){return H9({className:e in Y9?Y9[e]:e,config:{}})}return e instanceof $9?e:H9(e)} /** * @license * Copyright 2018 Google LLC @@ -11160,7 +11160,7 @@ function D9(e,t){return(0,u3.tidy)(()=>u3.sqrt(u3.sum(u3.mul(e,e),t,!0)))}(0,u3. * https://opensource.org/licenses/MIT. * ============================================================================= */ -function Y9(e){return new L9(e)}function G9(e){return new P9(e)}function H9(){return new B9}function W9(e){return new $9(e)} +function X9(e){return new U9(e)}function q9(e){return new V9(e)}function K9(){return new z9}function Z9(e){return new j9(e)} /** * @license * Copyright 2018 Google LLC @@ -11170,7 +11170,7 @@ function Y9(e){return new L9(e)}function G9(e){return new P9(e)}function H9(){re * https://opensource.org/licenses/MIT. * ============================================================================= */ -function X9(){return new Y8}function q9(){return new G8}function K9(e){return new H8(e)}function Z9(e){return new W8(e)}function Q9(e){return new X8(e)}function J9(e){return new q8(e)}function e7(e){return new K8(e)}function t7(e){return new Z8(e)}function n7(e){return new Q8(e)}function i7(e){return new J8(e)}function r7(e){return new e9(e)}function s7(e){return new t9(e)}function o7(e){return new n9(e)}function a7(e){return new i9(e)}function l7(e){return new r9(e)} +function Q9(){return new X8}function J9(){return new q8}function e7(e){return new K8(e)}function t7(e){return new Z8(e)}function n7(e){return new Q8(e)}function i7(e){return new J8(e)}function r7(e){return new e9(e)}function s7(e){return new t9(e)}function o7(e){return new n9(e)}function a7(e){return new i9(e)}function l7(e){return new r9(e)}function u7(e){return new s9(e)}function c7(e){return new o9(e)}function d7(e){return new a9(e)}function h7(e){return new l9(e)} /** * @license * Copyright 2018 Google LLC @@ -11180,7 +11180,7 @@ function X9(){return new Y8}function q9(){return new G8}function K9(e){return ne * https://opensource.org/licenses/MIT. * ============================================================================= */ -async function u7(e){if(null==e)return;const t=[],n=[],i=[];for(const r in e){const s=e[r];if("number"!=typeof s){const e=s;t.push(e.data()),n.push(r),i.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;t0){const r=await Promise.all(t);for(let t=0;t(0,u3.add)(this.totals[e],(0,u3.mul)(i,n)));this.totals[e]=r,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:(0,u3.tidy)(()=>{const n=(0,u3.mul)((0,u3.div)(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),(0,u3.keep)(t[e])}))}}class m7 extends h7{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const i in this.history){const r=this.history[i];for(let s=0;s{const o=null!=n?n():u3.util.now();return o-rnew g7(e,t))}class y7{constructor(){}static registerCallbackConstructor(e,t){u3.util.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),y7.checkForDuplicate(t),null==y7.constructors[e]&&(y7.constructors[e]=[]),y7.constructors[e].push(t)}static checkForDuplicate(e){for(const t in y7.constructors){y7.constructors[+t].forEach(t=>{if(t===e)throw new M6("Duplicate callback constructor.")})}}static clear(){y7.constructors={}}static createCallbacks(e){const t=[];for(const n in y7.constructors){const i=+n;e>=i&&t.push(...y7.constructors[i])}return t.map(e=>new e)}}function v7(e,t,n,i,r,s,o,a,l){const u=new m7,c=[new f7,...y7.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const d=new p7(c);return d.setParams({epochs:n,initialEpoch:i,samples:r,steps:s,batchSize:o,verbose:t,doValidation:a,metrics:l}),{callbackList:d,history:u}} +var m7;!function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(m7||(m7={}));class g7{constructor(){this.validationData=null}setParams(e){this.params=e}async onEpochBegin(e,t){}async onEpochEnd(e,t){}async onBatchBegin(e,t){}async onBatchEnd(e,t){}async onTrainBegin(e){}async onTrainEnd(e){}setModel(e){}}class _7{constructor(e,t=10){null==e&&(e=[]),this.callbacks=e,this.queueLength=t}append(e){this.callbacks.push(e)}setParams(e){for(const t of this.callbacks)t.setParams(e)}setModel(e){for(const t of this.callbacks)t.setModel(e)}async onEpochBegin(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onEpochBegin(e,t)}async onEpochEnd(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onEpochEnd(e,t)}async onBatchBegin(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onBatchBegin(e,t)}async onBatchEnd(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onBatchEnd(e,t)}async onTrainBegin(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainBegin(e)}async onTrainEnd(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainEnd(e)}}class y7 extends g7{constructor(){super()}async onEpochBegin(e){this.seen=0,this.totals={}}async onBatchEnd(e,t){null==t&&(t={});const n=null==t.size?0:t.size;this.seen+=n;for(const e in t){const i=t[e];if("number"==typeof i)this.totals.hasOwnProperty(e)||(this.totals[e]=0),this.totals[e]=this.totals[e]+i*n;else{let t;e in this.totals?t=this.totals[e]:this.totals[e]=0;const r=(0,p3.tidy)(()=>(0,p3.add)(this.totals[e],(0,p3.mul)(i,n)));this.totals[e]=r,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:(0,p3.tidy)(()=>{const n=(0,p3.mul)((0,p3.div)(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),(0,p3.keep)(t[e])}))}}class v7 extends g7{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const i in this.history){const r=this.history[i];for(let s=0;s{const o=null!=n?n():p3.util.now();return o-rnew b7(e,t))}class x7{constructor(){}static registerCallbackConstructor(e,t){p3.util.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),x7.checkForDuplicate(t),null==x7.constructors[e]&&(x7.constructors[e]=[]),x7.constructors[e].push(t)}static checkForDuplicate(e){for(const t in x7.constructors){x7.constructors[+t].forEach(t=>{if(t===e)throw new D6("Duplicate callback constructor.")})}}static clear(){x7.constructors={}}static createCallbacks(e){const t=[];for(const n in x7.constructors){const i=+n;e>=i&&t.push(...x7.constructors[i])}return t.map(e=>new e)}}function E7(e,t,n,i,r,s,o,a,l){const u=new v7,c=[new y7,...x7.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const d=new _7(c);return d.setParams({epochs:n,initialEpoch:i,samples:r,steps:s,batchSize:o,verbose:t,doValidation:a,metrics:l}),{callbackList:d,history:u}} /** * @license * Copyright 2018 Google LLC @@ -11200,7 +11200,7 @@ var d7;!function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(d7||(d7={}) * https://opensource.org/licenses/MIT. * ============================================================================= */ -function b7(e,t={},n=!1){return Y6(e,u3.serialization.SerializationMap.getMap().classNameMap,t,"layer",n)} +function w7(e,t={},n=!1){return X6(e,p3.serialization.SerializationMap.getMap().classNameMap,t,"layer",n)} /** * @license * Copyright 2018 Google LLC @@ -11210,7 +11210,7 @@ function b7(e,t={},n=!1){return Y6(e,u3.serialization.SerializationMap.getMap(). * https://opensource.org/licenses/MIT. * ============================================================================= */ -function T7(e,t){return(0,u3.tidy)(()=>{"float32"!==e.dtype&&(e=u3.cast(e,"float32"));const n=u3.sum(L8(e),t,!0),i=u3.fill(n.shape,w8()),r=u3.sqrt(u3.maximum(n,i));return u3.div(e,r)})}function x7(e,t){return(0,u3.tidy)(()=>u3.mean(L8(u3.sub(t,e)),-1))}function E7(e,t){return(0,u3.tidy)(()=>u3.mean(u3.abs(u3.sub(t,e)),-1))}function w7(e,t){return(0,u3.tidy)(()=>{const n=u3.sub(e,t),i=u3.clipByValue(u3.abs(e),w8(),Number.MAX_VALUE),r=u3.abs(u3.div(n,i));return u3.mul(100,u3.mean(r,-1))})}function I7(e,t){return(0,u3.tidy)(()=>{const n=u3.clipByValue(t,w8(),Number.MAX_VALUE),i=u3.log(u3.add(1,n)),r=u3.clipByValue(e,w8(),Number.MAX_VALUE),s=u3.log(u3.add(1,r));return u3.mean(L8(u3.sub(i,s)),-1)})}function A7(e,t,n=!1){return(0,u3.tidy)(()=>{if(n)t=u3.softmax(t);else{const e=u3.sum(t,t.shape.length-1,!0);t=u3.div(t,e)}return t=u3.clipByValue(t,w8(),1-w8()),u3.neg(u3.sum(u3.mul(u3.cast(e,"float32"),u3.log(t)),t.shape.length-1))})}function S7(e,t,n=!1){return(0,u3.tidy)(()=>{const i=u3.cast(u3.floor(function(e){const t=[v8(e.shape)];return u3.reshape(e,t)}(e)),"int32"),r=(t=u3.clipByValue(t,w8(),1-w8())).shape;return A7(u3.reshape(u3.oneHot(i,r[r.length-1]),r),t,n)})}function C7(e,t){return(0,u3.tidy)(()=>{let n;return n=u3.clipByValue(t,w8(),1-w8()),n=u3.log(u3.div(n,u3.sub(1,n))),u3.mean(function(e,t){if(!u3.util.arraysEqual(e.shape,t.shape))throw new M6(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return(0,u3.tidy)(()=>{const n=u3.relu(t),i=u3.neg(u3.abs(t));return u3.add(u3.sub(n,u3.mul(t,e)),u3.log1p(u3.exp(i)))})}(e,n),-1)})}function O7(e,t){return(0,u3.tidy)(()=>{const n=u3.clipByValue(e,w8(),1),i=u3.clipByValue(t,w8(),1);return u3.sum(u3.mul(e,u3.log(u3.div(n,i))),-1)})}function M7(e,t){return(0,u3.tidy)(()=>{const n=T7(e,-1),i=T7(t,-1),r=u3.mul(n,i);return u3.neg(u3.sum(r,-1))})}y7.constructors={};const k7={meanSquaredError:x7,meanAbsoluteError:E7,meanAbsolutePercentageError:w7,meanSquaredLogarithmicError:I7,squaredHinge:function(e,t){return(0,u3.tidy)(()=>{const n=u3.maximum(0,u3.sub(1,u3.mul(e,t)));return u3.mean(L8(n),-1)})},hinge:function(e,t){return(0,u3.tidy)(()=>{const n=u3.maximum(0,u3.sub(1,u3.mul(e,t)));return u3.mean(n,-1)})},categoricalHinge:function(e,t){return(0,u3.tidy)(()=>{const n=u3.sum(u3.mul(e,t),-1),i=u3.max(u3.mul(u3.sub(1,e),t),-1);return u3.maximum(0,u3.add(1,u3.sub(i,n)))})},logcosh:function(e,t){return(0,u3.tidy)(()=>{const n=Math.log(2),i=u3.sub(t,e),r=u3.sub(u3.add(i,u3.softplus(u3.mul(-2,i))),n);return u3.mean(r,-1)})},categoricalCrossentropy:A7,sparseCategoricalCrossentropy:S7,binaryCrossentropy:C7,kullbackLeiblerDivergence:O7,poisson:function(e,t){return(0,u3.tidy)(()=>{const n=u3.log(u3.add(w8(),t));return u3.mean(u3.sub(t,u3.mul(e,n)),-1)})},cosineProximity:M7};function R7(e){if("string"==typeof e){if(e in k7)return k7[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new M6(t)}return e} +function I7(e,t){return(0,p3.tidy)(()=>{"float32"!==e.dtype&&(e=p3.cast(e,"float32"));const n=p3.sum(U8(e),t,!0),i=p3.fill(n.shape,C8()),r=p3.sqrt(p3.maximum(n,i));return p3.div(e,r)})}function A7(e,t){return(0,p3.tidy)(()=>p3.mean(U8(p3.sub(t,e)),-1))}function S7(e,t){return(0,p3.tidy)(()=>p3.mean(p3.abs(p3.sub(t,e)),-1))}function C7(e,t){return(0,p3.tidy)(()=>{const n=p3.sub(e,t),i=p3.clipByValue(p3.abs(e),C8(),Number.MAX_VALUE),r=p3.abs(p3.div(n,i));return p3.mul(100,p3.mean(r,-1))})}function O7(e,t){return(0,p3.tidy)(()=>{const n=p3.clipByValue(t,C8(),Number.MAX_VALUE),i=p3.log(p3.add(1,n)),r=p3.clipByValue(e,C8(),Number.MAX_VALUE),s=p3.log(p3.add(1,r));return p3.mean(U8(p3.sub(i,s)),-1)})}function M7(e,t,n=!1){return(0,p3.tidy)(()=>{if(n)t=p3.softmax(t);else{const e=p3.sum(t,t.shape.length-1,!0);t=p3.div(t,e)}return t=p3.clipByValue(t,C8(),1-C8()),p3.neg(p3.sum(p3.mul(p3.cast(e,"float32"),p3.log(t)),t.shape.length-1))})}function k7(e,t,n=!1){return(0,p3.tidy)(()=>{const i=p3.cast(p3.floor(function(e){const t=[E8(e.shape)];return p3.reshape(e,t)}(e)),"int32"),r=(t=p3.clipByValue(t,C8(),1-C8())).shape;return M7(p3.reshape(p3.oneHot(i,r[r.length-1]),r),t,n)})}function R7(e,t){return(0,p3.tidy)(()=>{let n;return n=p3.clipByValue(t,C8(),1-C8()),n=p3.log(p3.div(n,p3.sub(1,n))),p3.mean(function(e,t){if(!p3.util.arraysEqual(e.shape,t.shape))throw new D6(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return(0,p3.tidy)(()=>{const n=p3.relu(t),i=p3.neg(p3.abs(t));return p3.add(p3.sub(n,p3.mul(t,e)),p3.log1p(p3.exp(i)))})}(e,n),-1)})}function N7(e,t){return(0,p3.tidy)(()=>{const n=p3.clipByValue(e,C8(),1),i=p3.clipByValue(t,C8(),1);return p3.sum(p3.mul(e,p3.log(p3.div(n,i))),-1)})}function D7(e,t){return(0,p3.tidy)(()=>{const n=I7(e,-1),i=I7(t,-1),r=p3.mul(n,i);return p3.neg(p3.sum(r,-1))})}x7.constructors={};const F7={meanSquaredError:A7,meanAbsoluteError:S7,meanAbsolutePercentageError:C7,meanSquaredLogarithmicError:O7,squaredHinge:function(e,t){return(0,p3.tidy)(()=>{const n=p3.maximum(0,p3.sub(1,p3.mul(e,t)));return p3.mean(U8(n),-1)})},hinge:function(e,t){return(0,p3.tidy)(()=>{const n=p3.maximum(0,p3.sub(1,p3.mul(e,t)));return p3.mean(n,-1)})},categoricalHinge:function(e,t){return(0,p3.tidy)(()=>{const n=p3.sum(p3.mul(e,t),-1),i=p3.max(p3.mul(p3.sub(1,e),t),-1);return p3.maximum(0,p3.add(1,p3.sub(i,n)))})},logcosh:function(e,t){return(0,p3.tidy)(()=>{const n=Math.log(2),i=p3.sub(t,e),r=p3.sub(p3.add(i,p3.softplus(p3.mul(-2,i))),n);return p3.mean(r,-1)})},categoricalCrossentropy:M7,sparseCategoricalCrossentropy:k7,binaryCrossentropy:R7,kullbackLeiblerDivergence:N7,poisson:function(e,t){return(0,p3.tidy)(()=>{const n=p3.log(p3.add(C8(),t));return p3.mean(p3.sub(t,p3.mul(e,n)),-1)})},cosineProximity:D7};function L7(e){if("string"==typeof e){if(e in F7)return F7[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new D6(t)}return e} /** * @license * Copyright 2018 Google LLC @@ -11220,7 +11220,7 @@ function T7(e,t){return(0,u3.tidy)(()=>{"float32"!==e.dtype&&(e=u3.cast(e,"float * https://opensource.org/licenses/MIT. * ============================================================================= */ -function N7(e,t){return(0,u3.tidy)(()=>{const n=u3.mul(.5,u3.onesLike(t)),i=I8(u3.greater(t,n),e.dtype);return u3.mean(u3.equal(e,i),-1)})}function D7(e,t){return(0,u3.tidy)(()=>I8(u3.equal(u3.argMax(e,-1),u3.argMax(t,-1)),"float32"))}function F7(e,t){return(0,u3.tidy)(()=>u3.cast(u3.sum(u3.logicalAnd(u3.equal(e,1),u3.equal(t,1))),"float32"))}function L7(e,t){return(0,u3.tidy)(()=>{const n=F7(e,t),i=function(e,t){return(0,u3.tidy)(()=>u3.cast(u3.sum(u3.logicalAnd(u3.equal(e,0),u3.equal(t,1))),"float32"))}(e,t),r=u3.add(n,i);return u3.cast(u3.where(u3.greater(r,0),u3.div(n,r),0),"float32")})}function P7(e,t){return(0,u3.tidy)(()=>{const n=F7(e,t),i=function(e,t){return(0,u3.tidy)(()=>u3.cast(u3.sum(u3.logicalAnd(u3.equal(e,1),u3.equal(t,0))),"float32"))}(e,t),r=u3.add(n,i);return u3.cast(u3.where(u3.greater(r,0),u3.div(n,r),0),"float32")})}function B7(e,t){return C7(e,t)}function $7(e,t){return e.rank===t.rank&&(e=u3.squeeze(e,[e.rank-1])),(t=u3.argMax(t,-1)).dtype!==e.dtype&&(t=u3.cast(t,e.dtype)),u3.cast(u3.equal(e,t),"float32")}const U7=A7,V7=S7,z7={binaryAccuracy:N7,categoricalAccuracy:D7,precision:L7,categoricalCrossentropy:U7,sparseCategoricalCrossentropy:V7,mse:x7,MSE:x7,mae:E7,MAE:E7,mape:w7,MAPE:w7,cosine:M7};function j7(e){if("string"==typeof e&&e in z7)return z7[e];if("string"!=typeof e&&null!=e)return e;throw new M6(`Unknown metric ${e}`)}function Y7(e){if(F6(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(k7))if(k7[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(z7))if(z7[n]===e){t=n;break}return void 0!==t?t:e.name}} +function P7(e,t){return(0,p3.tidy)(()=>{const n=p3.mul(.5,p3.onesLike(t)),i=O8(p3.greater(t,n),e.dtype);return p3.mean(p3.equal(e,i),-1)})}function B7(e,t){return(0,p3.tidy)(()=>O8(p3.equal(p3.argMax(e,-1),p3.argMax(t,-1)),"float32"))}function $7(e,t){return(0,p3.tidy)(()=>p3.cast(p3.sum(p3.logicalAnd(p3.equal(e,1),p3.equal(t,1))),"float32"))}function U7(e,t){return(0,p3.tidy)(()=>{const n=$7(e,t),i=function(e,t){return(0,p3.tidy)(()=>p3.cast(p3.sum(p3.logicalAnd(p3.equal(e,0),p3.equal(t,1))),"float32"))}(e,t),r=p3.add(n,i);return p3.cast(p3.where(p3.greater(r,0),p3.div(n,r),0),"float32")})}function V7(e,t){return(0,p3.tidy)(()=>{const n=$7(e,t),i=function(e,t){return(0,p3.tidy)(()=>p3.cast(p3.sum(p3.logicalAnd(p3.equal(e,1),p3.equal(t,0))),"float32"))}(e,t),r=p3.add(n,i);return p3.cast(p3.where(p3.greater(r,0),p3.div(n,r),0),"float32")})}function z7(e,t){return R7(e,t)}function j7(e,t){return e.rank===t.rank&&(e=p3.squeeze(e,[e.rank-1])),(t=p3.argMax(t,-1)).dtype!==e.dtype&&(t=p3.cast(t,e.dtype)),p3.cast(p3.equal(e,t),"float32")}const Y7=M7,G7=k7,H7={binaryAccuracy:P7,categoricalAccuracy:B7,precision:U7,categoricalCrossentropy:Y7,sparseCategoricalCrossentropy:G7,mse:A7,MSE:A7,mae:S7,MAE:S7,mape:C7,MAPE:C7,cosine:D7};function W7(e){if("string"==typeof e&&e in H7)return H7[e];if("string"!=typeof e&&null!=e)return e;throw new D6(`Unknown metric ${e}`)}function X7(e){if($6(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(F7))if(F7[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(H7))if(H7[n]===e){t=n;break}return void 0!==t?t:e.name}} /** * @license * Copyright 2019 Google LLC @@ -11230,7 +11230,7 @@ function N7(e,t){return(0,u3.tidy)(()=>{const n=u3.mul(.5,u3.onesLike(t)),i=I8(u * https://opensource.org/licenses/MIT. * ============================================================================= */ -const G7=1048576;function H7(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!W7(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const n=JSON.stringify(e);n.length>G7&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${n.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function W7(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!W7(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!W7(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}} +const q7=1048576;function K7(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Z7(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const n=JSON.stringify(e);n.length>q7&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${n.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function Z7(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!Z7(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Z7(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}} /** * @license * Copyright 2018 Google LLC @@ -11240,7 +11240,7 @@ const G7=1048576;function H7(e,t,n=!1){if(null==e||"object"!=typeof e||Object.ge * https://opensource.org/licenses/MIT. * ============================================================================= */ -function X7(e,t,n,i=console.log){const r=function(e){let t=!0;const n=[],i=[];for(const t in e.nodesByDepth)n.push(e.nodesByDepth[t]);for(const e of n){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}i.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==i.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),s=["Layer (type)","Input Shape","Output shape","Param #"];let o;if(r?(t=t||90,n=n||[.32,.61,.89,1]):(t=t||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map(e=>Math.floor(t*e))),!r){s.push("Receives inputs"),o=[];for(const t in e.nodesByDepth)o.push(...e.nodesByDepth[t])}i("_".repeat(t)),q7(s,n,i),i("=".repeat(t));const a=e.layers;for(let e=0;e0&&(i=i.slice(0,i.length-1)+" "),i+=e[n],i=i.slice(0,t[n]),i+=" ".repeat(t[n]-i.length);n(i)}function K7(e,t,n){let i,r;try{r=e.inboundNodes.map(e=>JSON.stringify(e.inputShapes)).join(",")}catch(e){r="multiple"}try{i=JSON.stringify(e.outputShape)}catch(e){i="multiple"}q7([`${e.name} (${e.getClassName()})`,r,i,e.countParams().toString()],t,n)}function Z7(e,t,n,i){let r,s;try{s=e.inboundNodes.map(e=>JSON.stringify(e.inputShapes)).join(",")}catch(e){s="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const o=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;e1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}i.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==i.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),s=["Layer (type)","Input Shape","Output shape","Param #"];let o;if(r?(t=t||90,n=n||[.32,.61,.89,1]):(t=t||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map(e=>Math.floor(t*e))),!r){s.push("Receives inputs"),o=[];for(const t in e.nodesByDepth)o.push(...e.nodesByDepth[t])}i("_".repeat(t)),J7(s,n,i),i("=".repeat(t));const a=e.layers;for(let e=0;e0&&(i=i.slice(0,i.length-1)+" "),i+=e[n],i=i.slice(0,t[n]),i+=" ".repeat(t[n]-i.length);n(i)}function eee(e,t,n){let i,r;try{r=e.inboundNodes.map(e=>JSON.stringify(e.inputShapes)).join(",")}catch(e){r="multiple"}try{i=JSON.stringify(e.outputShape)}catch(e){i="multiple"}J7([`${e.name} (${e.getClassName()})`,r,i,e.countParams().toString()],t,n)}function tee(e,t,n,i){let r,s;try{s=e.inboundNodes.map(e=>JSON.stringify(e.inputShapes)).join(",")}catch(e){s="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const o=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name)}`);H6(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(e=>e.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,i=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(i)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,i=e.tensorIndex;F6(0===n,"input layer has >1 nodes"),F6(0===i,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(i)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;te.shape),this.internalOutputShapes=this.outputs.map(e=>e.shape);const t={},n={},i={},r={},s={},o=[],a=(e,t,n,i,r,l)=>{null!=i&&null!=r&&null!=l||(i=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=i.inboundNodes[r];if(-1!==n.indexOf(u))throw new O6(`The tensor ${e.name} at layer "${i.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(nee.nodeKey(i,r)),i.id in s||(s[i.id]=Object.keys(s).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(u),1);o.push(u)},l=[],u=[];for(const e of this.outputs)a(e,l,u);const c=o.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let s=t[e.id];const o=null==i[e.outboundLayer.id]?0:i[e.outboundLayer.id];s=Math.max(s,o),i[e.outboundLayer.id]=s,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=s;for(let i=0;iparseInt(e,10)).sort(G6);this.layers=[];for(const e of p){const t=h[e];t.sort((e,t)=>{const n=s[e.id],i=s[t.id];return ni?1:0});for(const e of t)e instanceof nee&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=h,p=Object.keys(d).map(e=>parseInt(e,10)).sort(G6);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of d[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new O6(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)f.push(e);m.push(e.name)}}this.nodesByDepth=d;const g=this.layers.map(e=>e.name);for(const e of g){const t=g.filter(t=>t===e).length;if(1!==t)throw new O6(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new T9({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(e=>null),outputMasks:this.outputs.map(e=>null),inputShapes:this.inputs.map(e=>e.shape),outputShapes:this.outputs.map(e=>e.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0===--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(t=>t.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new M6("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let i=0;const r=(e=>{const t=Object.keys(e);if(0===t.length)return!1;const n=t[0].split("/");return!isNaN(parseInt(n[n.length-1],10))})(e);r&&this.parseWeights(e);for(const e of this.layers)for(const[t,s]of e.weights.entries()){const e=r?`${s.name.split("/").slice(0,-1).join("/")+"/"}${t}`:s.originalName;if(null!=n[e])throw new M6(`Duplicate weight name: ${e}`);n[e]=s,i++}const s=[];for(const i in e){let r=i;if(null==n[i]){const e=i.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])s.push([n[r],e[i]]);else if(t)throw new M6(`Provided weight data has no target variable: ${i}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new M6(`${e.length} of ${i} weights are not set: ${e}`)}_9(s)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),i=["vars","layer_checkpoint_dependencies"],r=n.map(e=>e.startsWith("_")?e.slice(1):e).filter(e=>!i.includes(e)).join("/");r!==t&&(e[r]=e[t],delete e[t])}}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${tee}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=eee(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return(0,u3.tidy)(()=>{e=B6(e);const n=new S9;for(let t=0;t{let n;return e=B6(e),n=null==t?D6(null,e.length):B6(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){const t=c9(e);if(t.length!==this.inputLayers.length)throw new M6(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10)).sort(G6);if(i.length>1)for(const e of i){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map(e=>e.id).indexOf(t.id))continue;const i=[];for(let t=0;tparseInt(e,10)).sort(G6);for(const e of i){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,i=e.inputTensors,r=e.outputTensors,s=new Array;for(const e of i)e.id in n&&s.push(n[e.id]);if(s.length===i.length){let i,o,a,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===s.length){const[e,n]=s[0];null==u.mask&&(u.mask=n),a=B6(t.call(e,u)),l=B6(t.computeMask(e,n)),i=[e],o=[n]}else i=s.map(e=>e[0]),o=s.map(e=>e[1]),null==u.mask&&(u.mask=o),a=B6(t.call(i,u)),l=B6(t.computeMask(i,o));if(t.activityRegularizer)throw new k6("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e{const e=[];for(const t of this.layers)for(let n=0;n0){const e=[];for(let n=0;n0&&e.apply(P6(n),i)}function l(e){const n=e.name,s=b7(e,null!=t.customObjects?t.customObjects:{});s.setFastWeightInitDuringBuild(i),r[n]=s;e.inboundNodes.forEach(e=>{if(!(e instanceof Array))throw new M6(`Corrupted configuration, expected array for nodeData: ${e}`);o(s,e)})}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!W6(s);)for(const e of c){const t=r[e.name];if(t.name in s){const e=s[t.name];delete s[t.name];for(const n of e)a(t,n)}}const d=[],h=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],i=e[2];F6(t in r);const s=r[t].inboundNodes[n].outputTensors;d.push(s[i])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],i=e[2];F6(t in r);const s=r[t].inboundNodes[n].outputTensors;h.push(s[i])}return new e({inputs:d,outputs:h,name:u})}get stateful(){if(this._stateful)throw new M6("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){(0,u3.tidy)(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}} +const see="4.22.0";class oee extends S9{constructor(e){if(super({}),this.containerNodes=new Set,this.name=e.name,null==this.name){const e=this.getClassName().toLowerCase();this.name=o8(e)}if(this.supportsMasking=!1,this.trainable_=!0,Array.isArray(e.inputs)?this.inputs=e.inputs.slice():this.inputs=[e.inputs],Array.isArray(e.outputs)?this.outputs=e.outputs.slice():this.outputs=[e.outputs],K6(this.inputs).length!==this.inputs.length)throw new D6(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map(e=>e.name)}`);K6(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(e=>e.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,i=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(i)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,i=e.tensorIndex;$6(0===n,"input layer has >1 nodes"),$6(0===i,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(i)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;te.shape),this.internalOutputShapes=this.outputs.map(e=>e.shape);const t={},n={},i={},r={},s={},o=[],a=(e,t,n,i,r,l)=>{null!=i&&null!=r&&null!=l||(i=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=i.inboundNodes[r];if(-1!==n.indexOf(u))throw new N6(`The tensor ${e.name} at layer "${i.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(oee.nodeKey(i,r)),i.id in s||(s[i.id]=Object.keys(s).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(u),1);o.push(u)},l=[],u=[];for(const e of this.outputs)a(e,l,u);const c=o.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let s=t[e.id];const o=null==i[e.outboundLayer.id]?0:i[e.outboundLayer.id];s=Math.max(s,o),i[e.outboundLayer.id]=s,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=s;for(let i=0;iparseInt(e,10)).sort(q6);this.layers=[];for(const e of p){const t=h[e];t.sort((e,t)=>{const n=s[e.id],i=s[t.id];return ni?1:0});for(const e of t)e instanceof oee&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=h,p=Object.keys(d).map(e=>parseInt(e,10)).sort(q6);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of d[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new N6(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)f.push(e);m.push(e.name)}}this.nodesByDepth=d;const g=this.layers.map(e=>e.name);for(const e of g){const t=g.filter(t=>t===e).length;if(1!==t)throw new N6(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new I9({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(e=>null),outputMasks:this.outputs.map(e=>null),inputShapes:this.inputs.map(e=>e.shape),outputShapes:this.outputs.map(e=>e.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0===--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(t=>t.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new D6("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let i=0;const r=(e=>{const t=Object.keys(e);if(0===t.length)return!1;const n=t[0].split("/");return!isNaN(parseInt(n[n.length-1],10))})(e);r&&this.parseWeights(e);for(const e of this.layers)for(const[t,s]of e.weights.entries()){const e=r?`${s.name.split("/").slice(0,-1).join("/")+"/"}${t}`:s.originalName;if(null!=n[e])throw new D6(`Duplicate weight name: ${e}`);n[e]=s,i++}const s=[];for(const i in e){let r=i;if(null==n[i]){const e=i.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])s.push([n[r],e[i]]);else if(t)throw new D6(`Provided weight data has no target variable: ${i}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new D6(`${e.length} of ${i} weights are not set: ${e}`)}T9(s)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),i=["vars","layer_checkpoint_dependencies"],r=n.map(e=>e.startsWith("_")?e.slice(1):e).filter(e=>!i.includes(e)).join("/");r!==t&&(e[r]=e[t],delete e[t])}}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${see}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=ree(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return(0,p3.tidy)(()=>{e=z6(e);const n=new k9;for(let t=0;t{let n;return e=z6(e),n=null==t?B6(null,e.length):z6(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){const t=f9(e);if(t.length!==this.inputLayers.length)throw new D6(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10)).sort(q6);if(i.length>1)for(const e of i){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map(e=>e.id).indexOf(t.id))continue;const i=[];for(let t=0;tparseInt(e,10)).sort(q6);for(const e of i){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,i=e.inputTensors,r=e.outputTensors,s=new Array;for(const e of i)e.id in n&&s.push(n[e.id]);if(s.length===i.length){let i,o,a,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===s.length){const[e,n]=s[0];null==u.mask&&(u.mask=n),a=z6(t.call(e,u)),l=z6(t.computeMask(e,n)),i=[e],o=[n]}else i=s.map(e=>e[0]),o=s.map(e=>e[1]),null==u.mask&&(u.mask=o),a=z6(t.call(i,u)),l=z6(t.computeMask(i,o));if(t.activityRegularizer)throw new F6("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e{const e=[];for(const t of this.layers)for(let n=0;n0){const e=[];for(let n=0;n0&&e.apply(V6(n),i)}function l(e){const n=e.name,s=w7(e,null!=t.customObjects?t.customObjects:{});s.setFastWeightInitDuringBuild(i),r[n]=s;e.inboundNodes.forEach(e=>{if(!(e instanceof Array))throw new D6(`Corrupted configuration, expected array for nodeData: ${e}`);o(s,e)})}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!Z6(s);)for(const e of c){const t=r[e.name];if(t.name in s){const e=s[t.name];delete s[t.name];for(const n of e)a(t,n)}}const d=[],h=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],i=e[2];$6(t in r);const s=r[t].inboundNodes[n].outputTensors;d.push(s[i])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],i=e[2];$6(t in r);const s=r[t].inboundNodes[n].outputTensors;h.push(s[i])}return new e({inputs:d,outputs:h,name:u})}get stateful(){if(this._stateful)throw new D6("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){(0,p3.tidy)(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}} /** * @license * Copyright 2018 Google LLC @@ -11262,7 +11262,7 @@ const tee="4.22.0";class nee extends E9{constructor(e){if(super({}),this.contain * https://opensource.org/licenses/MIT. * ============================================================================= */ -function iee(e,t,n){const i=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map(e=>null);if(1===i)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==i)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${i} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach(t=>{t in e?n.push(e[t]):n.push(null)}),n}throw new Error(`The model has multiple (${i}) outputs, so ${n} must be either an array with ${i} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function ree(e,t){return iee(e,t,"classWeight")}async function see(e,t,n,i){if(null!=t||null!=i)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=(0,u3.tidy)(()=>{if(1===e.shape.length)return(0,u3.clone)(e);if(2===e.shape.length){if(e.shape[1]>1){const t=1;return(0,u3.argMax)(e,t)}if(1===e.shape[1])return(0,u3.reshape)(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),i=Array.from(await t.data());(0,u3.dispose)(t);const r=[];return i.forEach(e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);r.push(n[e])}),(0,u3.tensor1d)(r,"float32")}return null}function oee(e,t){return(0,u3.mul)(e,t)}function aee(e,t){let n,i;const r=t;n=r.xs,i=r.ys,u3.util.assert(null!=n&&null!=i,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);const s=lee("input",e.inputNames,n),o=lee("output",e.outputNames,i),a=s[0].shape[0];u3.util.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),u3.util.assert(o.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${o.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${s[t].shape[0]}; expected ${a} based on input ${e.inputNames[0]}.`);for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${o[t].shape[0]}; expected ${a} based on input ${e.inputNames[0]}.`);return{xs:s,ys:o}}function lee(e,t,n){if(n instanceof u3.Tensor)return[n];if(Array.isArray(n))return u3.util.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{const i=[];for(const r of t){if(null==n[r])throw new M6(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);i.push(n[r])}return i}}async function uee(e,t,n){const i=null!=n.batchesPerEpoch;if(u3.util.assert(null!=e.optimizer,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),u3.util.assert(null!=n,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),u3.util.assert(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),u3.util.assert(!i||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),u3.util.assert(null==n.validationSplit,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const r=null!=n.validationData;let s,o;if(r)if(cee(n.validationData))u3.util.assert(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{const e=function(e){if(3===e.length)throw new k6("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);s=e.xs,o=e.ys}const a=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map(e=>"val_"+e)):l.slice();const c=_7(n.callbacks,n.yieldEvery),d=null==n.verbose?1:n.verbose,{callbackList:h,history:p}=v7(c,d,n.epochs,null,null,function(e,t){let n=null;null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size);return n}(t,n),null,r,u);h.setModel(e),e.history=p,await h.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f=n.batchesPerEpoch:t.done){if(r){let t;t=cee(n.validationData)?B6(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):B6(e.evaluate(s,o,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;nnull);if(1===i)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==i)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${i} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach(t=>{t in e?n.push(e[t]):n.push(null)}),n}throw new Error(`The model has multiple (${i}) outputs, so ${n} must be either an array with ${i} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function lee(e,t){return aee(e,t,"classWeight")}async function uee(e,t,n,i){if(null!=t||null!=i)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=(0,p3.tidy)(()=>{if(1===e.shape.length)return(0,p3.clone)(e);if(2===e.shape.length){if(e.shape[1]>1){const t=1;return(0,p3.argMax)(e,t)}if(1===e.shape[1])return(0,p3.reshape)(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),i=Array.from(await t.data());(0,p3.dispose)(t);const r=[];return i.forEach(e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);r.push(n[e])}),(0,p3.tensor1d)(r,"float32")}return null}function cee(e,t){return(0,p3.mul)(e,t)}function dee(e,t){let n,i;const r=t;n=r.xs,i=r.ys,p3.util.assert(null!=n&&null!=i,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);const s=hee("input",e.inputNames,n),o=hee("output",e.outputNames,i),a=s[0].shape[0];p3.util.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),p3.util.assert(o.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${o.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${s[t].shape[0]}; expected ${a} based on input ${e.inputNames[0]}.`);for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${o[t].shape[0]}; expected ${a} based on input ${e.inputNames[0]}.`);return{xs:s,ys:o}}function hee(e,t,n){if(n instanceof p3.Tensor)return[n];if(Array.isArray(n))return p3.util.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{const i=[];for(const r of t){if(null==n[r])throw new D6(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);i.push(n[r])}return i}}async function pee(e,t,n){const i=null!=n.batchesPerEpoch;if(p3.util.assert(null!=e.optimizer,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),p3.util.assert(null!=n,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),p3.util.assert(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),p3.util.assert(!i||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),p3.util.assert(null==n.validationSplit,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const r=null!=n.validationData;let s,o;if(r)if(fee(n.validationData))p3.util.assert(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{const e=function(e){if(3===e.length)throw new F6("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);s=e.xs,o=e.ys}const a=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map(e=>"val_"+e)):l.slice();const c=T7(n.callbacks,n.yieldEvery),d=null==n.verbose?1:n.verbose,{callbackList:h,history:p}=E7(c,d,n.epochs,null,null,function(e,t){let n=null;null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size);return n}(t,n),null,r,u);h.setModel(e),e.history=p,await h.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f=n.batchesPerEpoch:t.done){if(r){let t;t=fee(n.validationData)?z6(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):z6(e.evaluate(s,o,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function hee(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(e=>S8(e,t,n-t)):S8(e,t,n-t)}function pee(e,t){return u3.tidy(()=>null==e?null:Array.isArray(e)?e.map(e=>pee(e,t)):F8(e,"int32"===t.dtype?t:u3.cast(t,"int32")))}function fee(e,t){const n=[];let i=0,r=null;for(;i=e&&(r=e),n.push([i,r]),i=r;return n}function mee(e){const t=[];e instanceof u3.Tensor&&(e=[e]);for(let n=0;nn.push(e.id));else if(null!=t)for(const e in t){const i=t[e];n.push(i.id)}const i=[];if(e instanceof u3.Tensor)-1===n.indexOf(e.id)&&i.push(e);else if(Array.isArray(e))e.forEach(e=>{-1===n.indexOf(e.id)&&i.push(e)});else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&i.push(r)}i.forEach(e=>{e.isDisposed||e.dispose()})}function _ee(e){return Array.isArray(e)}function yee(e){return! +function mee(e){p3.util.assert(e>0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function gee(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(e=>k8(e,t,n-t)):k8(e,t,n-t)}function _ee(e,t){return p3.tidy(()=>null==e?null:Array.isArray(e)?e.map(e=>_ee(e,t)):$8(e,"int32"===t.dtype?t:p3.cast(t,"int32")))}function yee(e,t){const n=[];let i=0,r=null;for(;i=e&&(r=e),n.push([i,r]),i=r;return n}function vee(e){const t=[];e instanceof p3.Tensor&&(e=[e]);for(let n=0;nn.push(e.id));else if(null!=t)for(const e in t){const i=t[e];n.push(i.id)}const i=[];if(e instanceof p3.Tensor)-1===n.indexOf(e.id)&&i.push(e);else if(Array.isArray(e))e.forEach(e=>{-1===n.indexOf(e.id)&&i.push(e)});else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&i.push(r)}i.forEach(e=>{e.isDisposed||e.dispose()})}function Tee(e){return Array.isArray(e)}function xee(e){return! /** * @license * Copyright 2018 Google LLC @@ -11282,7 +11282,7 @@ function dee(e){u3.util.assert(e>0&&Number.isInteger(e),()=>`batchSize is requir * https://opensource.org/licenses/MIT. * ============================================================================= */ -function(e){return e instanceof u3.Tensor}(e)&&!_ee(e)}function vee(e,t,n,i=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(_ee(e)&&e.length>0)t=!0;else if(yee(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new M6(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map(e=>null);let s;if(yee(e)){s=[];for(const n of t){if(null==e[n])throw new M6(`No data provided for "${n}". Need data for each key in: ${t}`);s.push(e[n])}}else if(_ee(e)){if(e.length!==t.length)throw new M6(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(t.length>1)throw new M6(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=mee(s),null!=n)for(let e=0;e=0&&s!==a)throw new M6(`${r} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${r} received an input with ${o.shape[0]} examples, each with shape [${o.shape.slice(1,o.shape.length)}] (tensor shape [${o.shape}])`)}}return s}function bee(e,t,n,i=!0,r=""){let s;if(Array.isArray(e)){if(e.length!==t.length)throw new M6(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);s=e}else{if(t.length>1)throw new M6(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(null!=n)for(let e=0;e0)t=!0;else if(xee(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new D6(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map(e=>null);let s;if(xee(e)){s=[];for(const n of t){if(null==e[n])throw new D6(`No data provided for "${n}". Need data for each key in: ${t}`);s.push(e[n])}}else if(Tee(e)){if(e.length!==t.length)throw new D6(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(t.length>1)throw new D6(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=vee(s),null!=n)for(let e=0;e=0&&s!==a)throw new D6(`${r} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${r} received an input with ${o.shape[0]} examples, each with shape [${o.shape.slice(1,o.shape.length)}] (tensor shape [${o.shape}])`)}}return s}function wee(e,t,n,i=!0,r=""){let s;if(Array.isArray(e)){if(e.length!==t.length)throw new D6(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);s=e}else{if(t.length>1)throw new D6(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(null!=n)for(let e=0;eu3.train.adagrad(.01),Adadelta:()=>u3.train.adadelta(1,.95,w8()),Adam:()=>u3.train.adam(.001,.9,.999,w8()),Adamax:()=>u3.train.adamax(.002,.9,.999,w8(),0),RMSProp:()=>u3.train.rmsprop(.001,.9,0,w8()),SGD:()=>u3.train.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new M6(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof u3.Optimizer))throw new M6("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new M6(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const n=e.loss;t=n.map(e=>R7(e))}else{const n=R7(e.loss);this.outputs.forEach(e=>{t.push(n)})}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new M6(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)null==e.loss[n]&&console.warn(`Output "${n}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${n} during training`),t.push(R7(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e{for(let e=0;e1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}});const i=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map(e=>[]);let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map(e=>n);{const e=[];for(const i of t){let t=n.hasOwnProperty(i)?n[i]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),r=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};p8("metric",()=>{for(let e=0;e{let n,i,s;for(const o of t){if("string"==typeof o&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(o)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===C7?-1!==["accuracy","acc"].indexOf(o)?i=N7:-1!==["crossentropy","ce"].indexOf(o)&&(i=B7):this.lossFunctions[e]===S7?-1!==["accuracy","acc"].indexOf(o)?i=$7:-1!==["crossentropy","ce"].indexOf(o)&&(i=V7):-1!==["accuracy","acc"].indexOf(o)?i=D7:-1!==["crossentropy","ce"].indexOf(o)&&(i=U7),-1!==["accuracy","acc"].indexOf(o)?r="acc":-1!==["crossentropy","ce"].indexOf(o)&&(r="ce"),s=i,n=""+r}else{const e=j7(o);s=e,n=""+Y7(o)}let t;p8(n,()=>{t=s}),r(e,n,t)}})(i[e])}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){const i=null==n.batchSize?32:n.batchSize;dee(i);const r=this.standardizeUserDataXY(e,t,!0,i);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return P6(this.testLoop(t,e,i,n.verbose,n.steps))}finally{gee(r[0],e),gee(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const i=null!=(n=n||{}).batches,r=e.testFunction;let s=[];if(n.verbose>0)throw new k6("Verbose mode is not implemented yet.");u3.util.assert(!i||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);const o=function(e){return"function"==typeof e.next}(t)?t:await t.iterator();let a=0,l=0;for(;!i||l{if(t.value){const{xs:n,ys:i}=aee(e,t.value),o=n.concat(i),u=u3.tidy(()=>r(o));if(u3.dispose(o),0===l)for(let e=0;eu3.add(s[e],u3.mul(c,t))),l>0&&u3.dispose(n)}u3.dispose(u),a+=c,++l}return s}),t.done){i&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let e=0;ee.name);for(let i=0;i0){const n=[];throw t.forEach((t,i)=>{null==t&&n.push(e[i])}),new M6(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return u3.tidy(()=>{const i=this.checkNumSamples(e);if(n)throw new k6("Verbose predictLoop() is not implemented yet.");const r=fee(i,t),s=this.outputs.map(e=>[]);for(let t=0;t{const n=r[t][0],i=r[t][1],s=hee(e,n,i),o=[];if(Array.isArray(s))for(let e=0;es[t].push(e))}return P6(s.map(e=>u3.concat(e,0)))})}predict(e,t={}){const n=mee(e);bee(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return dee(e),this.predictLoop(n,e)}finally{gee(n,e)}}predictOnBatch(e){bee(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,i){if(null==this.optimizer_)throw new O6("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;ee.shape[0]));n.sort();const i=H6(t.map(e=>e.shape[0]));if(i.sort(),n.length>1)throw new M6(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(e=>e.shape))}`);if(i.length>1)throw new M6(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(e=>e.shape))}`);if(n.length>0&&i.length>0&&!u3.util.arraysEqual(n,i))throw new M6(`Input Tensors should have the same number of samples as target Tensors. Found ${n[0]} input sample(s) and ${i[0]} target sample(s).`)}(e=vee(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=vee(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const i=[x7,C7,A7];for(let r=0;r0&&e[0].shape[0]%i!==0)throw new M6(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${i}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,i,r=!0,s){const[o,a]=this.standardizeUserDataXY(e,t,r,s);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=i){const e=ree(i,this.outputNames);l=[];for(let t=0;t{const s=this.checkNumSamples(t,n,r,"steps"),o=[];if(i>0)throw new k6("Verbose mode is not implemented yet.");if(null!=r)throw new k6("steps mode in testLoop() is not implemented yet");{const i=fee(s,n),r=(0,u3.tensor1d)(x8(0,s));for(let n=0;n1){r+=`_${L6(e.slice(0,n),i)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),i=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),s=[],o=this.collectedTrainableWeights.map(e=>e.read());return[this.optimizer_.minimize(()=>{const e=[];for(let t=0;t1&&e{l=u3.add(l,e)}),l},!0,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>u3.tidy(()=>{const t=[];let n;const i=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new k6("validationData including sample weights is not supported yet."):new M6(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);a=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(a,l,null,null,e,h);u=t[0],c=t[1],m=u.concat(c)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){g=!0;const e=Math.floor(i[0].shape[0]*(1-n.validationSplit)),t=i[0].shape[0];u=hee(i,e,t),s=i,i=hee(i,0,e),c=hee(r,e,t),o=r,r=hee(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const _=i.concat(r).concat(d);this.checkTrainableWeightsConsistency();const y=this.makeTrainFunction(),v=this.getDedupedMetricsNames();let b,T;g?(this.makeTestFunction(),b=this.testFunction,T=v.slice().concat(v.map(e=>"val_"+e))):(b=null,m=[],T=v.slice());const x=_7(n.callbacks,n.yieldEvery);return await this.fitLoop(y,_,v,h,n.epochs,n.verbose,x,b,m,n.shuffle,T,n.initialEpoch,null,null)}finally{this.isTraining=!1,gee(i,e),gee(r,t),gee(s,e),gee(o,t),gee(u,a),gee(c,l),null!=d&&u3.dispose(d)}}async fitLoop(e,t,n,i,r,s,o,a,l,u,c,d,h,p){null==i&&(i=32),null==r&&(r=1),null==u&&(u=!0),null==d&&(d=0);let f=!1;if(null!=a&&null!=l&&(f=!0),null!=p&&(f=!0,null==h))throw new M6("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,i,h,"steps_per_epoch");let g;null!=m&&(g=x8(0,m)),null==s&&(s=1);const{callbackList:_,history:y}=v7(o,s,r,d,m,h,i,f,c);_.setModel(this),this.history=y,await _.onTrainBegin(),this.stopTraining_=!1;for(let s=d;s{const d=o[u][0],h=o[u][1],p=S8(s,d,h-d);c.batch=u,c.size=h-d;const m=pee(t,p),g=e(m);for(let e=0;e$6(e))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const i of t){if("string"!=typeof n[i])throw new Error("Serialization of non-string loss is not supported.");e[i]=$6(n[i])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[$6(Y7(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>$6(Y7(e)));{const e={};for(const t in this.metrics)e[t]=$6(Y7(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=b7(J7(e.optimizer_config));let n,i;if("string"==typeof e.loss)n=U6(e.loss);else if(Array.isArray(e.loss))n=e.loss.map(e=>U6(e));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=U6(e.loss[t])}if(Array.isArray(e.metrics))i=e.metrics.map(e=>U6(e));else if(null!=e.metrics){i={};for(const t in e.metrics)i[t]=U6(e.metrics[t])}this.compile({loss:n,metrics:i,optimizer:t})}async save(e,t){if("string"==typeof e){const t=u3.io.getSaveHandlers(e);if(0===t.length)throw new M6(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new M6(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new M6("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await u3.io.encodeWeights(this.getNamedWeights(t)),i={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${tee}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){i.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await u3.io.encodeWeights(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=u3.io.concatenateArrayBuffers([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;H7(this.userDefinedMetadata,this.name,e),i.userDefinedMetadata=this.userDefinedMetadata}return i.weightData=n.data,i.weightSpecs=n.specs,e.save(i)}setUserDefinedMetadata(e){H7(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}Tee.className="Model",u3.serialization.registerClass(Tee);class xee extends Tee{} +function(e){const t={Adagrad:()=>p3.train.adagrad(.01),Adadelta:()=>p3.train.adadelta(1,.95,C8()),Adam:()=>p3.train.adam(.001,.9,.999,C8()),Adamax:()=>p3.train.adamax(.002,.9,.999,C8(),0),RMSProp:()=>p3.train.rmsprop(.001,.9,0,C8()),SGD:()=>p3.train.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new D6(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof p3.Optimizer))throw new D6("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new D6(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const n=e.loss;t=n.map(e=>L7(e))}else{const n=L7(e.loss);this.outputs.forEach(e=>{t.push(n)})}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new D6(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)null==e.loss[n]&&console.warn(`Output "${n}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${n} during training`),t.push(L7(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e{for(let e=0;e1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}});const i=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map(e=>[]);let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map(e=>n);{const e=[];for(const i of t){let t=n.hasOwnProperty(i)?n[i]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),r=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};_8("metric",()=>{for(let e=0;e{let n,i,s;for(const o of t){if("string"==typeof o&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(o)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===R7?-1!==["accuracy","acc"].indexOf(o)?i=P7:-1!==["crossentropy","ce"].indexOf(o)&&(i=z7):this.lossFunctions[e]===k7?-1!==["accuracy","acc"].indexOf(o)?i=j7:-1!==["crossentropy","ce"].indexOf(o)&&(i=G7):-1!==["accuracy","acc"].indexOf(o)?i=B7:-1!==["crossentropy","ce"].indexOf(o)&&(i=Y7),-1!==["accuracy","acc"].indexOf(o)?r="acc":-1!==["crossentropy","ce"].indexOf(o)&&(r="ce"),s=i,n=""+r}else{const e=W7(o);s=e,n=""+X7(o)}let t;_8(n,()=>{t=s}),r(e,n,t)}})(i[e])}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){const i=null==n.batchSize?32:n.batchSize;mee(i);const r=this.standardizeUserDataXY(e,t,!0,i);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return V6(this.testLoop(t,e,i,n.verbose,n.steps))}finally{bee(r[0],e),bee(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const i=null!=(n=n||{}).batches,r=e.testFunction;let s=[];if(n.verbose>0)throw new F6("Verbose mode is not implemented yet.");p3.util.assert(!i||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);const o=function(e){return"function"==typeof e.next}(t)?t:await t.iterator();let a=0,l=0;for(;!i||l{if(t.value){const{xs:n,ys:i}=dee(e,t.value),o=n.concat(i),u=p3.tidy(()=>r(o));if(p3.dispose(o),0===l)for(let e=0;ep3.add(s[e],p3.mul(c,t))),l>0&&p3.dispose(n)}p3.dispose(u),a+=c,++l}return s}),t.done){i&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let e=0;ee.name);for(let i=0;i0){const n=[];throw t.forEach((t,i)=>{null==t&&n.push(e[i])}),new D6(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return p3.tidy(()=>{const i=this.checkNumSamples(e);if(n)throw new F6("Verbose predictLoop() is not implemented yet.");const r=yee(i,t),s=this.outputs.map(e=>[]);for(let t=0;t{const n=r[t][0],i=r[t][1],s=gee(e,n,i),o=[];if(Array.isArray(s))for(let e=0;es[t].push(e))}return V6(s.map(e=>p3.concat(e,0)))})}predict(e,t={}){const n=vee(e);wee(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return mee(e),this.predictLoop(n,e)}finally{bee(n,e)}}predictOnBatch(e){wee(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,i){if(null==this.optimizer_)throw new N6("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;ee.shape[0]));n.sort();const i=K6(t.map(e=>e.shape[0]));if(i.sort(),n.length>1)throw new D6(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(e=>e.shape))}`);if(i.length>1)throw new D6(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(e=>e.shape))}`);if(n.length>0&&i.length>0&&!p3.util.arraysEqual(n,i))throw new D6(`Input Tensors should have the same number of samples as target Tensors. Found ${n[0]} input sample(s) and ${i[0]} target sample(s).`)}(e=Eee(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=Eee(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const i=[A7,R7,M7];for(let r=0;r0&&e[0].shape[0]%i!==0)throw new D6(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${i}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,i,r=!0,s){const[o,a]=this.standardizeUserDataXY(e,t,r,s);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=i){const e=lee(i,this.outputNames);l=[];for(let t=0;t{const s=this.checkNumSamples(t,n,r,"steps"),o=[];if(i>0)throw new F6("Verbose mode is not implemented yet.");if(null!=r)throw new F6("steps mode in testLoop() is not implemented yet");{const i=yee(s,n),r=(0,p3.tensor1d)(A8(0,s));for(let n=0;n1){r+=`_${U6(e.slice(0,n),i)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),i=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),s=[],o=this.collectedTrainableWeights.map(e=>e.read());return[this.optimizer_.minimize(()=>{const e=[];for(let t=0;t1&&e{l=p3.add(l,e)}),l},!0,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>p3.tidy(()=>{const t=[];let n;const i=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new F6("validationData including sample weights is not supported yet."):new D6(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);a=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(a,l,null,null,e,h);u=t[0],c=t[1],m=u.concat(c)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){g=!0;const e=Math.floor(i[0].shape[0]*(1-n.validationSplit)),t=i[0].shape[0];u=gee(i,e,t),s=i,i=gee(i,0,e),c=gee(r,e,t),o=r,r=gee(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const _=i.concat(r).concat(d);this.checkTrainableWeightsConsistency();const y=this.makeTrainFunction(),v=this.getDedupedMetricsNames();let b,T;g?(this.makeTestFunction(),b=this.testFunction,T=v.slice().concat(v.map(e=>"val_"+e))):(b=null,m=[],T=v.slice());const x=T7(n.callbacks,n.yieldEvery);return await this.fitLoop(y,_,v,h,n.epochs,n.verbose,x,b,m,n.shuffle,T,n.initialEpoch,null,null)}finally{this.isTraining=!1,bee(i,e),bee(r,t),bee(s,e),bee(o,t),bee(u,a),bee(c,l),null!=d&&p3.dispose(d)}}async fitLoop(e,t,n,i,r,s,o,a,l,u,c,d,h,p){null==i&&(i=32),null==r&&(r=1),null==u&&(u=!0),null==d&&(d=0);let f=!1;if(null!=a&&null!=l&&(f=!0),null!=p&&(f=!0,null==h))throw new D6("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,i,h,"steps_per_epoch");let g;null!=m&&(g=A8(0,m)),null==s&&(s=1);const{callbackList:_,history:y}=E7(o,s,r,d,m,h,i,f,c);_.setModel(this),this.history=y,await _.onTrainBegin(),this.stopTraining_=!1;for(let s=d;s{const d=o[u][0],h=o[u][1],p=k8(s,d,h-d);c.batch=u,c.size=h-d;const m=_ee(t,p),g=e(m);for(let e=0;ej6(e))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const i of t){if("string"!=typeof n[i])throw new Error("Serialization of non-string loss is not supported.");e[i]=j6(n[i])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[j6(X7(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>j6(X7(e)));{const e={};for(const t in this.metrics)e[t]=j6(X7(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=w7(iee(e.optimizer_config));let n,i;if("string"==typeof e.loss)n=Y6(e.loss);else if(Array.isArray(e.loss))n=e.loss.map(e=>Y6(e));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=Y6(e.loss[t])}if(Array.isArray(e.metrics))i=e.metrics.map(e=>Y6(e));else if(null!=e.metrics){i={};for(const t in e.metrics)i[t]=Y6(e.metrics[t])}this.compile({loss:n,metrics:i,optimizer:t})}async save(e,t){if("string"==typeof e){const t=p3.io.getSaveHandlers(e);if(0===t.length)throw new D6(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new D6(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new D6("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await p3.io.encodeWeights(this.getNamedWeights(t)),i={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${see}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){i.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await p3.io.encodeWeights(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=p3.io.concatenateArrayBuffers([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;K7(this.userDefinedMetadata,this.name,e),i.userDefinedMetadata=this.userDefinedMetadata}return i.weightData=n.data,i.weightSpecs=n.specs,e.save(i)}setUserDefinedMetadata(e){K7(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}Iee.className="Model",p3.serialization.registerClass(Iee);class Aee extends Iee{} /** * @license * Copyright 2018 Google LLC @@ -11302,7 +11302,7 @@ function(e){const t={Adagrad:()=>u3.train.adagrad(.01),Adadelta:()=>u3.train.ada * https://opensource.org/licenses/MIT. * ============================================================================= */ -async function Eee(e,t){"modelTopology"in e||(e={modelTopology:e});let n=e.modelTopology;null!=n.model_config&&(n=n.model_config);const i=b7(J7(n),t);if(null!=e.weightsManifest){const t=await u3.io.loadWeights(e.weightsManifest,e.pathPrefix,i.weights.map(e=>e.originalName)),n={};for(const e of i.weights)n[e.originalName]=t[e.originalName];i.loadWeights(n),(0,u3.dispose)(t)}return i}async function wee(e,t){if(null==t&&(t={}),"string"==typeof e){const n=u3.io.getLoadHandlers(e,t);if(0===n.length)n.push(u3.io.browserHTTPRequest(e,t));else if(n.length>1)throw new M6(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return async function(e,t,n){null==n&&(n={});if(null==e.load)throw new M6("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const i=await e.load();let r=i.modelTopology;null!=r.model_config&&(r=r.model_config);const s=null==n.strict||n.strict,o=null!=i.weightData&&null!=i.weightSpecs&&s,a=b7(J7(r),t,o),l=i.trainingConfig;null!=l&&a.loadTrainingConfig(l);null!=i.userDefinedMetadata&&a.setUserDefinedMetadata(i.userDefinedMetadata);if(null!=i.weightData){if(null==i.weightSpecs)throw new M6("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");const{modelWeights:e,optimizerWeights:t}=function(e,t){const n=u3.io.decodeWeights(e,t),i={},r=[];return t.forEach(e=>{"optimizer"===e.group?r.push({name:e.name,tensor:n[e.name]}):i[e.name]=n[e.name]}),{modelWeights:i,optimizerWeights:r}}(i.weightData,i.weightSpecs);a.loadWeights(e,s),null!=a.optimizer&&t.length>0&&await a.optimizer.setWeights(t),(0,u3.dispose)(e),(0,u3.dispose)(t.map(e=>e.tensor))}return a}(e,void 0,t)}xee.className="Functional",u3.serialization.registerClass(xee);class Iee extends Tee{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:n8("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(e=>e<0))throw new M6(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof Iee||e instanceof Tee;let n;if(t){if(n=e,1!==n.outputs.length)throw new M6("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new M6("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new M6("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=A9({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new M6(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new M6("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=w9(this.outputs[0])}this.inboundNodes=[],new T9({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:D6(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(e=>e.shape),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(h9(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new Tee({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new O6("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new O6("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new O6("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new O6("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},i=!1){let r,s={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new M6("Legacy serialization format not supported yet.");r=t}else u3.util.assert(null!=t.layers,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),r=t.layers,delete t.layers,s=t;const o=new e(s);if(!(o instanceof Iee))throw new k6(`Sequential.fromConfig called on non-Sequential input: ${o}`);for(const e of r){const t=b7(e,void 0,i);i&&t.setFastWeightInitDuringBuild(!0),o.add(t)}return o}set stopTraining(e){if(null==this.model)throw new M6("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new M6("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}} +async function See(e,t){"modelTopology"in e||(e={modelTopology:e});let n=e.modelTopology;null!=n.model_config&&(n=n.model_config);const i=w7(iee(n),t);if(null!=e.weightsManifest){const t=await p3.io.loadWeights(e.weightsManifest,e.pathPrefix,i.weights.map(e=>e.originalName)),n={};for(const e of i.weights)n[e.originalName]=t[e.originalName];i.loadWeights(n),(0,p3.dispose)(t)}return i}async function Cee(e,t){if(null==t&&(t={}),"string"==typeof e){const n=p3.io.getLoadHandlers(e,t);if(0===n.length)n.push(p3.io.browserHTTPRequest(e,t));else if(n.length>1)throw new D6(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return async function(e,t,n){null==n&&(n={});if(null==e.load)throw new D6("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const i=await e.load();let r=i.modelTopology;null!=r.model_config&&(r=r.model_config);const s=null==n.strict||n.strict,o=null!=i.weightData&&null!=i.weightSpecs&&s,a=w7(iee(r),t,o),l=i.trainingConfig;null!=l&&a.loadTrainingConfig(l);null!=i.userDefinedMetadata&&a.setUserDefinedMetadata(i.userDefinedMetadata);if(null!=i.weightData){if(null==i.weightSpecs)throw new D6("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");const{modelWeights:e,optimizerWeights:t}=function(e,t){const n=p3.io.decodeWeights(e,t),i={},r=[];return t.forEach(e=>{"optimizer"===e.group?r.push({name:e.name,tensor:n[e.name]}):i[e.name]=n[e.name]}),{modelWeights:i,optimizerWeights:r}}(i.weightData,i.weightSpecs);a.loadWeights(e,s),null!=a.optimizer&&t.length>0&&await a.optimizer.setWeights(t),(0,p3.dispose)(e),(0,p3.dispose)(t.map(e=>e.tensor))}return a}(e,void 0,t)}Aee.className="Functional",p3.serialization.registerClass(Aee);class Oee extends Iee{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:o8("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(e=>e<0))throw new D6(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof Oee||e instanceof Iee;let n;if(t){if(n=e,1!==n.outputs.length)throw new D6("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new D6("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new D6("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=M9({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new D6(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new D6("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=C9(this.outputs[0])}this.inboundNodes=[],new I9({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:B6(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(e=>e.shape),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(g9(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new Iee({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new N6("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new N6("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new N6("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new N6("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},i=!1){let r,s={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new D6("Legacy serialization format not supported yet.");r=t}else p3.util.assert(null!=t.layers,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),r=t.layers,delete t.layers,s=t;const o=new e(s);if(!(o instanceof Oee))throw new F6(`Sequential.fromConfig called on non-Sequential input: ${o}`);for(const e of r){const t=w7(e,void 0,i);i&&t.setFastWeightInitDuringBuild(!0),o.add(t)}return o}set stopTraining(e){if(null==this.model)throw new D6("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new D6("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}} /** * @license * Copyright 2018 Google LLC @@ -11312,7 +11312,7 @@ async function Eee(e,t){"modelTopology"in e||(e={modelTopology:e});let n=e.model * https://opensource.org/licenses/MIT. * ============================================================================= */ -function Aee(e){return new Tee(e)}function See(e){return new Iee(e)}function Cee(e){return A9(e)}function Oee(e,t){y7.registerCallbackConstructor(e,t)}Iee.className="Sequential",u3.serialization.registerClass(Iee); +function Mee(e){return new Iee(e)}function kee(e){return new Oee(e)}function Ree(e){return M9(e)}function Nee(e,t){x7.registerCallbackConstructor(e,t)}Oee.className="Sequential",p3.serialization.registerClass(Oee); /** * @license * Copyright 2018 Google LLC @@ -11322,7 +11322,7 @@ function Aee(e){return new Tee(e)}function See(e){return new Iee(e)}function Cee * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Mee extends u3.serialization.Serializable{getConfig(){return{}}}class kee extends Mee{apply(e,t=1){return function(e,t=1){if(1!==t)throw new k6(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return u3.elu(e)}(e,t)}}kee.className="elu",u3.serialization.registerClass(kee);class Ree extends Mee{apply(e){return u3.selu(e)}}Ree.className="selu",u3.serialization.registerClass(Ree);class Nee extends Mee{apply(e){return u3.relu(e)}}Nee.className="relu",u3.serialization.registerClass(Nee);class Dee extends Mee{apply(e){return(0,u3.tidy)(()=>u3.minimum(6,u3.relu(e)))}}Dee.className="relu6",u3.serialization.registerClass(Dee);class Fee extends Mee{apply(e){return e}}Fee.className="linear",u3.serialization.registerClass(Fee);class Lee extends Mee{apply(e){return u3.sigmoid(e)}}Lee.className="sigmoid",u3.serialization.registerClass(Lee);class Pee extends Mee{apply(e){return function(e){return(0,u3.tidy)(()=>{const t=u3.add(.5,u3.mul(.2,e));return u3.clipByValue(t,0,1)})}(e)}}Pee.className="hardSigmoid",u3.serialization.registerClass(Pee);class Bee extends Mee{apply(e){return u3.softplus(e)}}Bee.className="softplus",u3.serialization.registerClass(Bee);class $ee extends Mee{apply(e){return function(e){return(0,u3.tidy)(()=>u3.div(e,u3.add(u3.abs(e),1)))}(e)}}$ee.className="softsign",u3.serialization.registerClass($ee);class Uee extends Mee{apply(e){return u3.tanh(e)}}Uee.className="tanh",u3.serialization.registerClass(Uee);class Vee extends Mee{apply(e,t=-1){return u3.softmax(e,t)}}Vee.className="softmax",u3.serialization.registerClass(Vee);class zee extends Mee{apply(e,t=-1){return u3.logSoftmax(e,t)}}zee.className="logSoftmax",u3.serialization.registerClass(zee);class jee extends Mee{apply(e){return(0,u3.tidy)(()=>u3.tidy(()=>{const t=Math.sqrt(2),n=u3.mul(.5,u3.add(1,u3.erf(u3.div(e,t))));return u3.mul(e,n)}))}}jee.className="gelu",u3.serialization.registerClass(jee);class Yee extends Mee{apply(e){return(0,u3.tidy)(()=>u3.mul(.5,u3.mul(e,u3.add(1,u3.tanh(u3.mul(u3.sqrt(u3.div(2,Math.PI)),u3.add(e,u3.mul(.044715,u3.pow(e,3)))))))))}}Yee.className="gelu_new",u3.serialization.registerClass(Yee);class Gee extends Mee{apply(e){return(0,u3.tidy)(()=>u3.mul(e,u3.tanh(u3.softplus(e))))}}Gee.className="mish",u3.serialization.registerClass(Gee);class Hee extends Mee{apply(e,t=1){return(0,u3.tidy)(()=>u3.mul(u3.sigmoid(u3.mul(e,t)),e))}}function Wee(e){return e.getClassName()}function Xee(e,t={}){return Y6(e,u3.serialization.SerializationMap.getMap().classNameMap,t,"activation")}function qee(e){if(null==e){const e={className:"linear",config:{}};return Xee(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},Xee(t)}return e instanceof Mee?e:Xee(e)} +class Dee extends p3.serialization.Serializable{getConfig(){return{}}}class Fee extends Dee{apply(e,t=1){return function(e,t=1){if(1!==t)throw new F6(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return p3.elu(e)}(e,t)}}Fee.className="elu",p3.serialization.registerClass(Fee);class Lee extends Dee{apply(e){return p3.selu(e)}}Lee.className="selu",p3.serialization.registerClass(Lee);class Pee extends Dee{apply(e){return p3.relu(e)}}Pee.className="relu",p3.serialization.registerClass(Pee);class Bee extends Dee{apply(e){return(0,p3.tidy)(()=>p3.minimum(6,p3.relu(e)))}}Bee.className="relu6",p3.serialization.registerClass(Bee);class $ee extends Dee{apply(e){return e}}$ee.className="linear",p3.serialization.registerClass($ee);class Uee extends Dee{apply(e){return p3.sigmoid(e)}}Uee.className="sigmoid",p3.serialization.registerClass(Uee);class Vee extends Dee{apply(e){return function(e){return(0,p3.tidy)(()=>{const t=p3.add(.5,p3.mul(.2,e));return p3.clipByValue(t,0,1)})}(e)}}Vee.className="hardSigmoid",p3.serialization.registerClass(Vee);class zee extends Dee{apply(e){return p3.softplus(e)}}zee.className="softplus",p3.serialization.registerClass(zee);class jee extends Dee{apply(e){return function(e){return(0,p3.tidy)(()=>p3.div(e,p3.add(p3.abs(e),1)))}(e)}}jee.className="softsign",p3.serialization.registerClass(jee);class Yee extends Dee{apply(e){return p3.tanh(e)}}Yee.className="tanh",p3.serialization.registerClass(Yee);class Gee extends Dee{apply(e,t=-1){return p3.softmax(e,t)}}Gee.className="softmax",p3.serialization.registerClass(Gee);class Hee extends Dee{apply(e,t=-1){return p3.logSoftmax(e,t)}}Hee.className="logSoftmax",p3.serialization.registerClass(Hee);class Wee extends Dee{apply(e){return(0,p3.tidy)(()=>p3.tidy(()=>{const t=Math.sqrt(2),n=p3.mul(.5,p3.add(1,p3.erf(p3.div(e,t))));return p3.mul(e,n)}))}}Wee.className="gelu",p3.serialization.registerClass(Wee);class Xee extends Dee{apply(e){return(0,p3.tidy)(()=>p3.mul(.5,p3.mul(e,p3.add(1,p3.tanh(p3.mul(p3.sqrt(p3.div(2,Math.PI)),p3.add(e,p3.mul(.044715,p3.pow(e,3)))))))))}}Xee.className="gelu_new",p3.serialization.registerClass(Xee);class qee extends Dee{apply(e){return(0,p3.tidy)(()=>p3.mul(e,p3.tanh(p3.softplus(e))))}}qee.className="mish",p3.serialization.registerClass(qee);class Kee extends Dee{apply(e,t=1){return(0,p3.tidy)(()=>p3.mul(p3.sigmoid(p3.mul(e,t)),e))}}function Zee(e){return e.getClassName()}function Qee(e,t={}){return X6(e,p3.serialization.SerializationMap.getMap().classNameMap,t,"activation")}function Jee(e){if(null==e){const e={className:"linear",config:{}};return Qee(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},Qee(t)}return e instanceof Dee?e:Qee(e)} /** * @license * Copyright 2018 Google LLC @@ -11332,7 +11332,7 @@ class Mee extends u3.serialization.Serializable{getConfig(){return{}}}class kee * https://opensource.org/licenses/MIT. * ============================================================================= */ -function Kee(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}Hee.className="swish",u3.serialization.registerClass(Hee);class Zee extends u3.serialization.Serializable{}class Qee extends Zee{constructor(e){super(),Kee(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return(0,u3.tidy)(()=>{let t=(0,u3.zeros)([1]);return this.hasL1&&(t=(0,u3.add)(t,(0,u3.sum)(u3.mul(this.l1,(0,u3.abs)(e))))),this.hasL2&&(t=(0,u3.add)(t,(0,u3.sum)(u3.mul(this.l2,L8(e))))),u3.reshape(t,[])})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}Qee.className="L1L2",u3.serialization.registerClass(Qee);const Jee={l1l2:"L1L2"};function ete(e){return z6(e)}function tte(e,t={}){return Y6(e,u3.serialization.SerializationMap.getMap().classNameMap,t,"regularizer")}function nte(e){if(null==e)return null;if("string"==typeof e){return tte({className:e in Jee?Jee[e]:e,config:{}})}return e instanceof Zee?e:tte(e)} +function ete(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}Kee.className="swish",p3.serialization.registerClass(Kee);class tte extends p3.serialization.Serializable{}class nte extends tte{constructor(e){super(),ete(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return(0,p3.tidy)(()=>{let t=(0,p3.zeros)([1]);return this.hasL1&&(t=(0,p3.add)(t,(0,p3.sum)(p3.mul(this.l1,(0,p3.abs)(e))))),this.hasL2&&(t=(0,p3.add)(t,(0,p3.sum)(p3.mul(this.l2,U8(e))))),p3.reshape(t,[])})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}nte.className="L1L2",p3.serialization.registerClass(nte);const ite={l1l2:"L1L2"};function rte(e){return H6(e)}function ste(e,t={}){return X6(e,p3.serialization.SerializationMap.getMap().classNameMap,t,"regularizer")}function ote(e){if(null==e)return null;if("string"==typeof e){return ste({className:e in ite?ite[e]:e,config:{}})}return e instanceof tte?e:ste(e)} /** * @license * Copyright 2018 Google LLC @@ -11342,7 +11342,7 @@ function Kee(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 * https://opensource.org/licenses/MIT. * ============================================================================= */ -class ite extends E9{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=d9(e);let n=(0,u3.relu)(e);return null!=this.maxValue&&(n=(0,u3.clipByValue)(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}ite.className="ReLU",u3.serialization.registerClass(ite);class rte extends E9{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=d9(e);return(0,u3.leakyRelu)(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}rte.className="LeakyReLU",u3.serialization.registerClass(rte);class ste extends E9{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=l9(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=nte(e.alphaRegularizer),this.alphaConstraint=j9(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new M6(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=h9(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t{let n=d9(e);const i=t.mask;if(null!=i){const e=(0,u3.mul)((0,u3.sub)((0,u3.ones)(n.shape),(0,u3.cast)(i,n.dtype)),(0,u3.scalar)(-1e9));n=(0,u3.add)(n,e)}return this.axis instanceof Array?this.axis.length>1?(0,u3.exp)((0,u3.sub)(n,(0,u3.logSumExp)(n,this.axis,!0))):this.softmax(n,this.axis[0]):this.softmax(n,this.axis)})}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}} +class ate extends S9{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=m9(e);let n=(0,p3.relu)(e);return null!=this.maxValue&&(n=(0,p3.clipByValue)(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}ate.className="ReLU",p3.serialization.registerClass(ate);class lte extends S9{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=m9(e);return(0,p3.leakyRelu)(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}lte.className="LeakyReLU",p3.serialization.registerClass(lte);class ute extends S9{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=h9(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=ote(e.alphaRegularizer),this.alphaConstraint=W9(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new D6(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=g9(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t{let n=m9(e);const i=t.mask;if(null!=i){const e=(0,p3.mul)((0,p3.sub)((0,p3.ones)(n.shape),(0,p3.cast)(i,n.dtype)),(0,p3.scalar)(-1e9));n=(0,p3.add)(n,e)}return this.axis instanceof Array?this.axis.length>1?(0,p3.exp)((0,p3.sub)(n,(0,p3.logSumExp)(n,this.axis,!0))):this.softmax(n,this.axis[0]):this.softmax(n,this.axis)})}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}} /** * @license * Copyright 2018 Google LLC @@ -11352,7 +11352,7 @@ class ite extends E9{constructor(e){super(null==e?{}:e),this.supportsMasking=!0, * https://opensource.org/licenses/MIT. * ============================================================================= */ -function ute(e,t,n){if("number"==typeof e)return D6(e,t);if(e.length!==t)throw new M6(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let i=0;i(u8(t),"channelsFirst"===t?u3.transpose(e,[0,2,3,1]):e))}function pte(e,t){return(0,u3.tidy)(()=>(u8(t),"channelsFirst"===t?u3.transpose(e,[0,2,3,4,1]):e))}function fte(e,t,n,i=1,r="valid",s,o=1){return(0,u3.tidy)(()=>{if(null==s&&(s="channelsLast"),u8(s),3!==e.shape.length)throw new M6(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new M6(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new M6(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===s&&(e=u3.transpose(e,[0,2,1])),"causal"===r)throw new k6("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let a=u3.conv1d(e,t,i,"same"===r?"same":"valid","NWC",o);return null!=n&&(a=B8(a,n)),a})}function mte(e,t,n,i=[1,1],r="valid",s,o,a=null){return(0,u3.tidy)(()=>{if(null==s&&(s="channelsLast"),u8(s),3!==e.rank&&4!==e.rank)throw new M6(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new M6(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=hte(e,s);if("causal"===r)throw new k6("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=u3.fused.conv2d({x:l,filter:t,strides:i,pad:"same"===r?"same":"valid",dilations:o,dataFormat:"NHWC",bias:n,activation:a}),"channelsFirst"===s&&(l=u3.transpose(l,[0,3,1,2])),l})}function gte(e,t,n,i=[1,1,1],r="valid",s,o){return(0,u3.tidy)(()=>{if(null==s&&(s="channelsLast"),u8(s),4!==e.rank&&5!==e.rank)throw new M6(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new M6(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let a=pte(e,s);if("causal"===r)throw new k6("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return a=u3.conv3d(a,t,i,"same"===r?"same":"valid","NDHWC",o),null!=n&&(a=B8(a,n)),"channelsFirst"===s&&(a=u3.transpose(a,[0,4,1,2,3])),a})}lte.className="Softmax",u3.serialization.registerClass(lte);class _te extends E9{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",_te.verifyArgs(t),this.rank=e,K6(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new k6(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=ute(t.kernelSize,e,"kernelSize"),this.strides=ute(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,c8(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,u8(this.dataFormat),this.activation=qee(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=l9(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=j9(t.biasConstraint),this.biasRegularizer=nte(t.biasRegularizer),this.activityRegularizer=nte(t.activityRegularizer),this.dilationRate=ute(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new M6(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new M6(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new M6(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(F6("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!q6(e.kernelSize,"number",1,3))throw new M6(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Wee(this.activation),useBias:this.useBias,biasInitializer:a9(this.biasInitializer),biasRegularizer:ete(this.biasRegularizer),activityRegularizer:ete(this.activityRegularizer),biasConstraint:V9(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class yte extends _te{constructor(e,t){super(e,t),this.kernel=null,yte.verifyArgs(t),this.filters=t.filters,K6(this.filters,"filters"),this.kernelInitializer=l9(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=j9(t.kernelConstraint),this.kernelRegularizer=nte(t.kernelRegularizer)}build(e){e=h9(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new M6(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],i=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",i,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return(0,u3.tidy)(()=>{let t;e=d9(e);const n=null==this.bias?null:this.bias.read(),i=Q6(this.activation.getClassName());if(null!=i&&2===this.rank)t=mte(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,i);else{if(1===this.rank)t=fte(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=mte(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new k6("convolutions greater than 3D are not implemented yet.");t=gte(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t})}computeOutputShape(e){e=h9(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e 0 but got ${JSON.stringify(e.filters)}`)}}class vte extends yte{constructor(e){super(2,e),vte.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!q6(e.kernelSize,"number",1,2))throw new M6(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}vte.className="Conv2D",u3.serialization.registerClass(vte);class bte extends yte{constructor(e){super(3,e),bte.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new M6(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}bte.className="Conv3D",u3.serialization.registerClass(bte);class Tte extends vte{constructor(e){if(super(e),this.inputSpec=[new y9({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new M6(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=h9(e)).length)throw new M6("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new M6("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],i=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new y9({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return u3.tidy(()=>{let t=d9(e);if(4!==t.shape.length)throw new M6(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,i=n[0];let r,s;"channelsFirst"===this.dataFormat?(r=2,s=3):(r=1,s=2);const o=n[r],a=n[s],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],d=this.strides[1],h=[i,dte(o,c,l,this.padding),dte(a,d,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=u3.transpose(t,[0,2,3,1]));let p=u3.conv2dTranspose(t,this.kernel.read(),h,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=u3.transpose(p,[0,3,1,2])),null!=this.bias&&(p=B8(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p})}computeOutputShape(e){const t=(e=h9(e)).slice();let n,i,r;"channelsFirst"===this.dataFormat?(n=1,i=2,r=3):(n=3,i=1,r=2);const s=this.kernelSize[0],o=this.kernelSize[1],a=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[i]=dte(t[i],a,s,this.padding),t[r]=dte(t[r],l,o,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Tte.className="Conv2DTranspose",u3.serialization.registerClass(Tte);class xte extends bte{constructor(e){if(super(e),this.inputSpec=[new y9({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new M6(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=h9(e)).length)throw new M6("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new M6("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],i=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new y9({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return u3.tidy(()=>{let t=d9(e);if(5!==t.shape.length)throw new M6(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,i=n[0];let r,s,o;"channelsFirst"===this.dataFormat?(o=2,r=3,s=4):(o=1,r=2,s=3);const a=n[o],l=n[r],u=n[s],c=this.kernelSize[0],d=this.kernelSize[1],h=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[i,dte(a,p,c,this.padding),dte(l,f,d,this.padding),dte(u,m,h,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=u3.transpose(t,[0,2,3,4,1]));let _=u3.conv3dTranspose(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(_=u3.transpose(_,[0,4,1,2,3])),null!==this.bias&&(_=B8(_,this.bias.read(),this.dataFormat)),null!==this.activation&&(_=this.activation.apply(_)),_})}computeOutputShape(e){const t=(e=h9(e)).slice();let n,i,r,s;"channelsFirst"===this.dataFormat?(n=1,i=2,r=3,s=4):(n=4,i=1,r=2,s=3);const o=this.kernelSize[0],a=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],d=this.strides[2];return t[n]=this.filters,t[i]=dte(t[i],u,o,this.padding),t[r]=dte(t[r],c,a,this.padding),t[s]=dte(t[s],d,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}xte.className="Conv3DTranspose",u3.serialization.registerClass(xte);class Ete extends yte{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new M6("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new M6("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new M6(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=l9(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=nte(t.depthwiseRegularizer),this.depthwiseConstraint=j9(t.depthwiseConstraint),this.pointwiseInitializer=l9(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=nte(t.pointwiseRegularizer),this.pointwiseConstraint=j9(t.pointwiseConstraint)}build(e){if((e=h9(e)).length{let t;if(e=d9(e),1===this.rank)throw new k6("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=u3.transpose(e,[0,2,3,1])),t=u3.separableConv2d(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=B8(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=u3.transpose(t,[0,3,1,2])),t})}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=a9(this.depthwiseInitializer),e.pointwiseInitializer=a9(this.pointwiseInitializer),e.depthwiseRegularizer=ete(this.depthwiseRegularizer),e.pointwiseRegularizer=ete(this.pointwiseRegularizer),e.depthwiseConstraint=V9(this.depthwiseConstraint),e.pointwiseConstraint=V9(this.pointwiseConstraint),e}}Ete.className="SeparableConv";class wte extends Ete{constructor(e){super(2,e)}}wte.className="SeparableConv2D",u3.serialization.registerClass(wte);class Ite extends yte{constructor(e){super(1,e),Ite.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!q6(e.kernelSize,"number",1,1))throw new M6(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}Ite.className="Conv1D",u3.serialization.registerClass(Ite);class Ate extends E9{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return(0,u3.tidy)(()=>{if(e=d9(e),"channelsLast"===this.dataFormat){const t=O8(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return O8(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=O8(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return O8(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}Ate.className="Cropping2D",u3.serialization.registerClass(Ate);class Ste extends E9{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,u8(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,X6(r8,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return u3.tidy(()=>{let t=d9(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=u3.transpose(t,[0,2,3,1]);const e=this.size[0]*n[2],i=this.size[1]*n[3],r="nearest"===this.interpolation?u3.image.resizeNearestNeighbor(t,[e,i]):u3.image.resizeBilinear(t,[e,i]);return u3.transpose(r,[0,3,1,2])}{const e=this.size[0]*n[1],i=this.size[1]*n[2];return"nearest"===this.interpolation?u3.image.resizeNearestNeighbor(t,[e,i]):u3.image.resizeBilinear(t,[e,i])}})}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}Ste.className="UpSampling2D",u3.serialization.registerClass(Ste);class Cte extends _te{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=l9(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=j9(e.depthwiseConstraint),this.depthwiseRegularizer=nte(e.depthwiseRegularizer)}build(e){if((e=h9(e)).length<4)throw new M6(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new M6(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],i=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",i,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return(0,u3.tidy)(()=>{let t= +function gte(e,t){return(0,p3.tidy)(()=>(p8(t),"channelsFirst"===t?p3.transpose(e,[0,2,3,1]):e))}function _te(e,t){return(0,p3.tidy)(()=>(p8(t),"channelsFirst"===t?p3.transpose(e,[0,2,3,4,1]):e))}function yte(e,t,n,i=1,r="valid",s,o=1){return(0,p3.tidy)(()=>{if(null==s&&(s="channelsLast"),p8(s),3!==e.shape.length)throw new D6(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new D6(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new D6(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===s&&(e=p3.transpose(e,[0,2,1])),"causal"===r)throw new F6("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let a=p3.conv1d(e,t,i,"same"===r?"same":"valid","NWC",o);return null!=n&&(a=z8(a,n)),a})}function vte(e,t,n,i=[1,1],r="valid",s,o,a=null){return(0,p3.tidy)(()=>{if(null==s&&(s="channelsLast"),p8(s),3!==e.rank&&4!==e.rank)throw new D6(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new D6(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=gte(e,s);if("causal"===r)throw new F6("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=p3.fused.conv2d({x:l,filter:t,strides:i,pad:"same"===r?"same":"valid",dilations:o,dataFormat:"NHWC",bias:n,activation:a}),"channelsFirst"===s&&(l=p3.transpose(l,[0,3,1,2])),l})}function bte(e,t,n,i=[1,1,1],r="valid",s,o){return(0,p3.tidy)(()=>{if(null==s&&(s="channelsLast"),p8(s),4!==e.rank&&5!==e.rank)throw new D6(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new D6(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let a=_te(e,s);if("causal"===r)throw new F6("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return a=p3.conv3d(a,t,i,"same"===r?"same":"valid","NDHWC",o),null!=n&&(a=z8(a,n)),"channelsFirst"===s&&(a=p3.transpose(a,[0,4,1,2,3])),a})}hte.className="Softmax",p3.serialization.registerClass(hte);class Tte extends S9{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",Tte.verifyArgs(t),this.rank=e,e8(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new F6(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=pte(t.kernelSize,e,"kernelSize"),this.strides=pte(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,f8(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,p8(this.dataFormat),this.activation=Jee(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=h9(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=W9(t.biasConstraint),this.biasRegularizer=ote(t.biasRegularizer),this.activityRegularizer=ote(t.activityRegularizer),this.dilationRate=pte(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new D6(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new D6(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new D6(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if($6("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!J6(e.kernelSize,"number",1,3))throw new D6(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Zee(this.activation),useBias:this.useBias,biasInitializer:d9(this.biasInitializer),biasRegularizer:rte(this.biasRegularizer),activityRegularizer:rte(this.activityRegularizer),biasConstraint:G9(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class xte extends Tte{constructor(e,t){super(e,t),this.kernel=null,xte.verifyArgs(t),this.filters=t.filters,e8(this.filters,"filters"),this.kernelInitializer=h9(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=W9(t.kernelConstraint),this.kernelRegularizer=ote(t.kernelRegularizer)}build(e){e=g9(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new D6(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],i=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",i,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return(0,p3.tidy)(()=>{let t;e=m9(e);const n=null==this.bias?null:this.bias.read(),i=n8(this.activation.getClassName());if(null!=i&&2===this.rank)t=vte(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,i);else{if(1===this.rank)t=yte(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=vte(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new F6("convolutions greater than 3D are not implemented yet.");t=bte(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t})}computeOutputShape(e){e=g9(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e 0 but got ${JSON.stringify(e.filters)}`)}}class Ete extends xte{constructor(e){super(2,e),Ete.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!J6(e.kernelSize,"number",1,2))throw new D6(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}Ete.className="Conv2D",p3.serialization.registerClass(Ete);class wte extends xte{constructor(e){super(3,e),wte.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new D6(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}wte.className="Conv3D",p3.serialization.registerClass(wte);class Ite extends Ete{constructor(e){if(super(e),this.inputSpec=[new x9({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new D6(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=g9(e)).length)throw new D6("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new D6("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],i=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new x9({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return p3.tidy(()=>{let t=m9(e);if(4!==t.shape.length)throw new D6(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,i=n[0];let r,s;"channelsFirst"===this.dataFormat?(r=2,s=3):(r=1,s=2);const o=n[r],a=n[s],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],d=this.strides[1],h=[i,mte(o,c,l,this.padding),mte(a,d,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=p3.transpose(t,[0,2,3,1]));let p=p3.conv2dTranspose(t,this.kernel.read(),h,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=p3.transpose(p,[0,3,1,2])),null!=this.bias&&(p=z8(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p})}computeOutputShape(e){const t=(e=g9(e)).slice();let n,i,r;"channelsFirst"===this.dataFormat?(n=1,i=2,r=3):(n=3,i=1,r=2);const s=this.kernelSize[0],o=this.kernelSize[1],a=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[i]=mte(t[i],a,s,this.padding),t[r]=mte(t[r],l,o,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Ite.className="Conv2DTranspose",p3.serialization.registerClass(Ite);class Ate extends wte{constructor(e){if(super(e),this.inputSpec=[new x9({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new D6(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=g9(e)).length)throw new D6("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new D6("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],i=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new x9({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return p3.tidy(()=>{let t=m9(e);if(5!==t.shape.length)throw new D6(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,i=n[0];let r,s,o;"channelsFirst"===this.dataFormat?(o=2,r=3,s=4):(o=1,r=2,s=3);const a=n[o],l=n[r],u=n[s],c=this.kernelSize[0],d=this.kernelSize[1],h=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[i,mte(a,p,c,this.padding),mte(l,f,d,this.padding),mte(u,m,h,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=p3.transpose(t,[0,2,3,4,1]));let _=p3.conv3dTranspose(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(_=p3.transpose(_,[0,4,1,2,3])),null!==this.bias&&(_=z8(_,this.bias.read(),this.dataFormat)),null!==this.activation&&(_=this.activation.apply(_)),_})}computeOutputShape(e){const t=(e=g9(e)).slice();let n,i,r,s;"channelsFirst"===this.dataFormat?(n=1,i=2,r=3,s=4):(n=4,i=1,r=2,s=3);const o=this.kernelSize[0],a=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],d=this.strides[2];return t[n]=this.filters,t[i]=mte(t[i],u,o,this.padding),t[r]=mte(t[r],c,a,this.padding),t[s]=mte(t[s],d,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Ate.className="Conv3DTranspose",p3.serialization.registerClass(Ate);class Ste extends xte{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new D6("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new D6("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new D6(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=h9(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=ote(t.depthwiseRegularizer),this.depthwiseConstraint=W9(t.depthwiseConstraint),this.pointwiseInitializer=h9(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=ote(t.pointwiseRegularizer),this.pointwiseConstraint=W9(t.pointwiseConstraint)}build(e){if((e=g9(e)).length{let t;if(e=m9(e),1===this.rank)throw new F6("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=p3.transpose(e,[0,2,3,1])),t=p3.separableConv2d(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=z8(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=p3.transpose(t,[0,3,1,2])),t})}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=d9(this.depthwiseInitializer),e.pointwiseInitializer=d9(this.pointwiseInitializer),e.depthwiseRegularizer=rte(this.depthwiseRegularizer),e.pointwiseRegularizer=rte(this.pointwiseRegularizer),e.depthwiseConstraint=G9(this.depthwiseConstraint),e.pointwiseConstraint=G9(this.pointwiseConstraint),e}}Ste.className="SeparableConv";class Cte extends Ste{constructor(e){super(2,e)}}Cte.className="SeparableConv2D",p3.serialization.registerClass(Cte);class Ote extends xte{constructor(e){super(1,e),Ote.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!J6(e.kernelSize,"number",1,1))throw new D6(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}Ote.className="Conv1D",p3.serialization.registerClass(Ote);class Mte extends S9{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return(0,p3.tidy)(()=>{if(e=m9(e),"channelsLast"===this.dataFormat){const t=N8(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return N8(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=N8(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return N8(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}Mte.className="Cropping2D",p3.serialization.registerClass(Mte);class kte extends S9{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,p8(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,Q6(l8,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return p3.tidy(()=>{let t=m9(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=p3.transpose(t,[0,2,3,1]);const e=this.size[0]*n[2],i=this.size[1]*n[3],r="nearest"===this.interpolation?p3.image.resizeNearestNeighbor(t,[e,i]):p3.image.resizeBilinear(t,[e,i]);return p3.transpose(r,[0,3,1,2])}{const e=this.size[0]*n[1],i=this.size[1]*n[2];return"nearest"===this.interpolation?p3.image.resizeNearestNeighbor(t,[e,i]):p3.image.resizeBilinear(t,[e,i])}})}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}kte.className="UpSampling2D",p3.serialization.registerClass(kte);class Rte extends Tte{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=h9(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=W9(e.depthwiseConstraint),this.depthwiseRegularizer=ote(e.depthwiseRegularizer)}build(e){if((e=g9(e)).length<4)throw new D6(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new D6(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],i=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",i,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return(0,p3.tidy)(()=>{let t= /** * @license * Copyright 2018 Google LLC @@ -11372,7 +11372,7 @@ function hte(e,t){return(0,u3.tidy)(()=>(u8(t),"channelsFirst"===t?u3.transpose( * https://opensource.org/licenses/MIT. * ============================================================================= */ -function(e,t,n=[1,1],i="valid",r,s){return(0,u3.tidy)(()=>{null==r&&(r="channelsLast"),u8(r);let o=hte(e,r);if(4!==e.rank)throw new M6(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new M6(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return o=u3.depthwiseConv2d(o,t,n,"same"===i?"same":"valid","NHWC",s),"channelsFirst"===r&&(o=u3.transpose(o,[0,3,1,2])),o})}(e=d9(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=B8(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t})}computeOutputShape(e){e=h9(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],i="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=cte(t,this.kernelSize[0],this.padding,this.strides[0]),s=cte(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],i,r,s]:[e[0],r,s,i]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=a9(this.depthwiseInitializer),e.depthwiseRegularizer=ete(this.depthwiseRegularizer),e.depthwiseConstraint=V9(this.depthwiseRegularizer),e}} +function(e,t,n=[1,1],i="valid",r,s){return(0,p3.tidy)(()=>{null==r&&(r="channelsLast"),p8(r);let o=gte(e,r);if(4!==e.rank)throw new D6(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new D6(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return o=p3.depthwiseConv2d(o,t,n,"same"===i?"same":"valid","NHWC",s),"channelsFirst"===r&&(o=p3.transpose(o,[0,3,1,2])),o})}(e=m9(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=z8(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t})}computeOutputShape(e){e=g9(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],i="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=fte(t,this.kernelSize[0],this.padding,this.strides[0]),s=fte(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],i,r,s]:[e[0],r,s,i]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=d9(this.depthwiseInitializer),e.depthwiseRegularizer=rte(this.depthwiseRegularizer),e.depthwiseConstraint=G9(this.depthwiseRegularizer),e}} /** * @license * Copyright 2018 Google LLC @@ -11382,7 +11382,7 @@ function(e,t,n=[1,1],i="valid",r,s){return(0,u3.tidy)(()=>{null==r&&(r="channels * https://opensource.org/licenses/MIT. * ============================================================================= */ -function Ote(e,t,n,i){if(Array.isArray(e)){if(null!=t||null!=n)throw new M6("When inputs is an array, neither initialState or constants should be provided");null!=i&&(n=e.slice(e.length-i,e.length),e=e.slice(0,e.length-i)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=r(t),constants:n=r(n)}}function Mte(e,t,n,i=!1,r,s,o=!1,a=!1){return u3.tidy(()=>{const l=t.shape.length;if(l<3)throw new M6(`Input should be at least 3D, but is ${l}D.`);const u=[1,0].concat(x8(2,l));if(t=u3.transpose(t,u),null!=s)throw new k6("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=r&&((r=u3.cast(u3.cast(r,"bool"),"float32")).rank===l-1&&(r=u3.expandDims(r,-1)),r=u3.transpose(r,u)),i&&(t=u3.reverse(t,0),null!=r&&(r=u3.reverse(r,0)));const c=[];let d,h=n;const p=t.shape[0],f=u3.unstack(t);let m,g;null!=r&&(m=u3.unstack(r));for(let t=0;te(n,h));if(null==r)d=i[0],h=i[1];else{const e=u3.tidy(()=>{const e=m[t],n=u3.sub(u3.onesLike(e),e);return{output:u3.add(u3.mul(i[0],e),u3.mul(h[0],n)),newStates:h.map((t,r)=>u3.add(u3.mul(i[1][r],e),u3.mul(t,n)))}});d=e.output,h=e.newStates}a&&c.push(d)}if(a){const e=1;g=u3.stack(c,e)}return[d,g,h]})}Cte.className="DepthwiseConv2D",u3.serialization.registerClass(Cte);class kte extends E9{constructor(e){let t;if(super(e),null==e.cell)throw new M6("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new $te({cells:e.cell}):e.cell,null==t.stateSize)throw new M6("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new y9({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return x8(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map(e=>null)}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){u9(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let i;if(i=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const i of t)n.push([e[0],i]);return[i].concat(n)}return i}computeMask(e,t){return u3.tidy(()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map(e=>null);return[e].concat(t)}return e})}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ne.shape[e.shape.length-1]),r))throw new M6(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map(e=>new y9({shape:[null,e]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){(0,u3.tidy)(()=>{if(!this.stateful)throw new C6("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new M6("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>u3.zeros([n,e])):this.states_=[u3.zeros([n,this.cell.stateSize])];else if(null==e)u3.dispose(this.states_),null!=this.keptStates&&(u3.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>u3.zeros([n,e])):this.states_[0]=u3.zeros([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new M6(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):u3.dispose(this.states_);for(let t=0;tu3.keep(e.clone()))})}apply(e,t){let n=null==t?null:t.initialState,i=null==t?null:t.constants;null==t&&(t={});const r=Ote(e,n,i,this.numConstants);e=r.inputs,n=r.initialState,i=r.constants;let s=[],o=[];if(null!=n){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new y9({shape:e.shape}));o=o.concat(this.stateSpec)}null!=i&&(t.constants=i,s=s.concat(i),this.numConstants=i.length);if(s[0]instanceof v9){const n=[e].concat(s),i=this.inputSpec.concat(o),r=this.inputSpec;this.inputSpec=i;const a=super.apply(n,t);return this.inputSpec=r,a}return super.apply(e,t)}call(e,t){return(0,u3.tidy)(()=>{const n=null==t?null:t.mask,i=null==t?null:t.training;let r=null==t?null:t.initialState;e=d9(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new M6(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const o={training:i},a=Mte((e,t)=>{const n=this.cell.call([e].concat(t),o);return[n[0],n.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=a[0],u=a[1],c=a[2];this.stateful&&this.resetStates(c,i);const d=this.returnSequences?u:l;return this.returnState?[d].concat(c):d})}getInitialState(e){return(0,u3.tidy)(()=>{let t=u3.zeros(e.shape);return t=u3.sum(t,[1,2]),t=A8(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(e=>e>1?R8(t,[1,e]):t):this.cell.stateSize>1?[R8(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===kte.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const i=b7(t.cell,n);return new e(Object.assign(t,{cell:i}))}}kte.className="RNN",u3.serialization.registerClass(kte);class Rte extends E9{}class Nte extends Rte{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,K6(this.units,"units"),this.activation=qee(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=l9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=l9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=l9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=nte(e.kernelRegularizer),this.recurrentRegularizer=nte(e.recurrentRegularizer),this.biasRegularizer=nte(e.biasRegularizer),this.kernelConstraint=j9(e.kernelConstraint),this.recurrentConstraint=j9(e.recurrentConstraint),this.biasConstraint=j9(e.biasConstraint),this.dropout=b8([1,T8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=b8([1,T8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=h9(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return(0,u3.tidy)(()=>{if(2!==e.length)throw new M6(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const i=null!=t.training&&t.training;let r;0u3.onesLike(e),rate:this.dropout,training:i,dropoutFunc:this.dropoutFunc})),0u3.onesLike(n),rate:this.recurrentDropout,training:i,dropoutFunc:this.dropoutFunc}));const s=this.dropoutMask,o=this.recurrentDropoutMask;r=D8(null!=s?u3.mul(e,s):e,this.kernel.read()),null!=this.bias&&(r=B8(r,this.bias.read())),null!=o&&(n=u3.mul(n,o));let a=u3.add(r,D8(n,this.recurrentKernel.read()));return null!=this.activation&&(a=this.activation.apply(a)),[a,a]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:Wee(this.activation),useBias:this.useBias,kernelInitializer:a9(this.kernelInitializer),recurrentInitializer:a9(this.recurrentInitializer),biasInitializer:a9(this.biasInitializer),kernelRegularizer:ete(this.kernelRegularizer),recurrentRegularizer:ete(this.recurrentRegularizer),biasRegularizer:ete(this.biasRegularizer),activityRegularizer:ete(this.activityRegularizer),kernelConstraint:V9(this.kernelConstraint),recurrentConstraint:V9(this.recurrentConstraint),biasConstraint:V9(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}Nte.className="SimpleRNNCell",u3.serialization.registerClass(Nte);class Dte extends kte{constructor(e){e.cell=new Nte(e),super(e)}call(e,t){return(0,u3.tidy)(()=>{null!=this.cell.dropoutMask&&(u3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(u3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return new e(t)}}Dte.className="SimpleRNN",u3.serialization.registerClass(Dte);class Fte extends Rte{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new M6("GRUCell does not support reset_after parameter set to true.");this.units=e.units,K6(this.units,"units"),this.activation=qee(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=qee(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=l9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=l9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=l9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=nte(e.kernelRegularizer),this.recurrentRegularizer=nte(e.recurrentRegularizer),this.biasRegularizer=nte(e.biasRegularizer),this.kernelConstraint=j9(e.kernelConstraint),this.recurrentConstraint=j9(e.recurrentConstraint),this.biasConstraint=j9(e.biasConstraint),this.dropout=b8([1,T8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=b8([1,T8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=h9(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return(0,u3.tidy)(()=>{if(2!==e.length)throw new M6(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let i=e[1];e=e[0],0u3.onesLike(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0u3.onesLike(i),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,s=this.recurrentDropoutMask;let o,a,l;0{null!=this.cell.dropoutMask&&(u3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(u3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Lte.className="GRU",u3.serialization.registerClass(Lte);class Pte extends Rte{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,K6(this.units,"units"),this.activation=qee(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=qee(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=l9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=l9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=l9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=nte(e.kernelRegularizer),this.recurrentRegularizer=nte(e.recurrentRegularizer),this.biasRegularizer=nte(e.biasRegularizer),this.kernelConstraint=j9(e.kernelConstraint),this.recurrentConstraint=j9(e.recurrentConstraint),this.biasConstraint=j9(e.biasConstraint),this.dropout=b8([1,T8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=b8([1,T8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=h9(e))[e.length-1];let i;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;i=new((t=class extends j8{apply(t,i){const r=e.apply([n]),s=(new G8).apply([n]),o=e.apply([2*n]);return k8(k8(r,s),o)}}).className="CustomInit",t)}else i=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,i,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return(0,u3.tidy)(()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new M6(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let i=e[1];const r=e[2];e=e[0],0u3.onesLike(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0u3.onesLike(i),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const s=this.dropoutMask,o=this.recurrentDropoutMask;let a,l,u,c;0{null!=this.cell.dropoutMask&&(u3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(u3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Bte.className="LSTM",u3.serialization.registerClass(Bte);class $te extends Rte{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return(0,u3.tidy)(()=>{let n=e.slice(1);const i=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?i.push(n.splice(0,e.stateSize.length)):i.push(n.splice(0,1));i.reverse();const r=[];let s;for(let o=0;o{p8(`RNNCell_${i}`,()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map(e=>({className:e.getClassName(),config:e.getConfig()}))};return Object.assign(Object.assign({},e),t)}static fromConfig(e,t,n={}){const i=[];for(const e of t.cells)i.push(b7(e,n));return new e({cells:i})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return g9(e)}setWeights(e){const t=[];for(const n of this.cells){const i=n.weights.length,r=e.splice(i);for(let e=0;enull!=s?s(t(),n):$8(t(),n),a=()=>U8(o,t,i);if(!r||r<=1)return u3.keep(a().clone());return Array(r).fill(void 0).map(a).map(e=>u3.keep(e.clone()))}$te.className="StackedRNNCells",u3.serialization.registerClass($te); +function Nte(e,t,n,i){if(Array.isArray(e)){if(null!=t||null!=n)throw new D6("When inputs is an array, neither initialState or constants should be provided");null!=i&&(n=e.slice(e.length-i,e.length),e=e.slice(0,e.length-i)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=r(t),constants:n=r(n)}}function Dte(e,t,n,i=!1,r,s,o=!1,a=!1){return p3.tidy(()=>{const l=t.shape.length;if(l<3)throw new D6(`Input should be at least 3D, but is ${l}D.`);const u=[1,0].concat(A8(2,l));if(t=p3.transpose(t,u),null!=s)throw new F6("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=r&&((r=p3.cast(p3.cast(r,"bool"),"float32")).rank===l-1&&(r=p3.expandDims(r,-1)),r=p3.transpose(r,u)),i&&(t=p3.reverse(t,0),null!=r&&(r=p3.reverse(r,0)));const c=[];let d,h=n;const p=t.shape[0],f=p3.unstack(t);let m,g;null!=r&&(m=p3.unstack(r));for(let t=0;te(n,h));if(null==r)d=i[0],h=i[1];else{const e=p3.tidy(()=>{const e=m[t],n=p3.sub(p3.onesLike(e),e);return{output:p3.add(p3.mul(i[0],e),p3.mul(h[0],n)),newStates:h.map((t,r)=>p3.add(p3.mul(i[1][r],e),p3.mul(t,n)))}});d=e.output,h=e.newStates}a&&c.push(d)}if(a){const e=1;g=p3.stack(c,e)}return[d,g,h]})}Rte.className="DepthwiseConv2D",p3.serialization.registerClass(Rte);class Fte extends S9{constructor(e){let t;if(super(e),null==e.cell)throw new D6("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new jte({cells:e.cell}):e.cell,null==t.stateSize)throw new D6("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new x9({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return A8(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map(e=>null)}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){p9(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let i;if(i=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const i of t)n.push([e[0],i]);return[i].concat(n)}return i}computeMask(e,t){return p3.tidy(()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map(e=>null);return[e].concat(t)}return e})}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ne.shape[e.shape.length-1]),r))throw new D6(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map(e=>new x9({shape:[null,e]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){(0,p3.tidy)(()=>{if(!this.stateful)throw new R6("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new D6("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>p3.zeros([n,e])):this.states_=[p3.zeros([n,this.cell.stateSize])];else if(null==e)p3.dispose(this.states_),null!=this.keptStates&&(p3.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>p3.zeros([n,e])):this.states_[0]=p3.zeros([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new D6(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):p3.dispose(this.states_);for(let t=0;tp3.keep(e.clone()))})}apply(e,t){let n=null==t?null:t.initialState,i=null==t?null:t.constants;null==t&&(t={});const r=Nte(e,n,i,this.numConstants);e=r.inputs,n=r.initialState,i=r.constants;let s=[],o=[];if(null!=n){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new x9({shape:e.shape}));o=o.concat(this.stateSpec)}null!=i&&(t.constants=i,s=s.concat(i),this.numConstants=i.length);if(s[0]instanceof E9){const n=[e].concat(s),i=this.inputSpec.concat(o),r=this.inputSpec;this.inputSpec=i;const a=super.apply(n,t);return this.inputSpec=r,a}return super.apply(e,t)}call(e,t){return(0,p3.tidy)(()=>{const n=null==t?null:t.mask,i=null==t?null:t.training;let r=null==t?null:t.initialState;e=m9(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new D6(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const o={training:i},a=Dte((e,t)=>{const n=this.cell.call([e].concat(t),o);return[n[0],n.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=a[0],u=a[1],c=a[2];this.stateful&&this.resetStates(c,i);const d=this.returnSequences?u:l;return this.returnState?[d].concat(c):d})}getInitialState(e){return(0,p3.tidy)(()=>{let t=p3.zeros(e.shape);return t=p3.sum(t,[1,2]),t=M8(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(e=>e>1?L8(t,[1,e]):t):this.cell.stateSize>1?[L8(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===Fte.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const i=w7(t.cell,n);return new e(Object.assign(t,{cell:i}))}}Fte.className="RNN",p3.serialization.registerClass(Fte);class Lte extends S9{}class Pte extends Lte{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,e8(this.units,"units"),this.activation=Jee(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=h9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=h9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=h9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=ote(e.kernelRegularizer),this.recurrentRegularizer=ote(e.recurrentRegularizer),this.biasRegularizer=ote(e.biasRegularizer),this.kernelConstraint=W9(e.kernelConstraint),this.recurrentConstraint=W9(e.recurrentConstraint),this.biasConstraint=W9(e.biasConstraint),this.dropout=w8([1,I8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=w8([1,I8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=g9(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return(0,p3.tidy)(()=>{if(2!==e.length)throw new D6(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const i=null!=t.training&&t.training;let r;0p3.onesLike(e),rate:this.dropout,training:i,dropoutFunc:this.dropoutFunc})),0p3.onesLike(n),rate:this.recurrentDropout,training:i,dropoutFunc:this.dropoutFunc}));const s=this.dropoutMask,o=this.recurrentDropoutMask;r=B8(null!=s?p3.mul(e,s):e,this.kernel.read()),null!=this.bias&&(r=z8(r,this.bias.read())),null!=o&&(n=p3.mul(n,o));let a=p3.add(r,B8(n,this.recurrentKernel.read()));return null!=this.activation&&(a=this.activation.apply(a)),[a,a]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:Zee(this.activation),useBias:this.useBias,kernelInitializer:d9(this.kernelInitializer),recurrentInitializer:d9(this.recurrentInitializer),biasInitializer:d9(this.biasInitializer),kernelRegularizer:rte(this.kernelRegularizer),recurrentRegularizer:rte(this.recurrentRegularizer),biasRegularizer:rte(this.biasRegularizer),activityRegularizer:rte(this.activityRegularizer),kernelConstraint:G9(this.kernelConstraint),recurrentConstraint:G9(this.recurrentConstraint),biasConstraint:G9(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}Pte.className="SimpleRNNCell",p3.serialization.registerClass(Pte);class Bte extends Fte{constructor(e){e.cell=new Pte(e),super(e)}call(e,t){return(0,p3.tidy)(()=>{null!=this.cell.dropoutMask&&(p3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(p3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return new e(t)}}Bte.className="SimpleRNN",p3.serialization.registerClass(Bte);class $te extends Lte{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new D6("GRUCell does not support reset_after parameter set to true.");this.units=e.units,e8(this.units,"units"),this.activation=Jee(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Jee(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=h9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=h9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=h9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=ote(e.kernelRegularizer),this.recurrentRegularizer=ote(e.recurrentRegularizer),this.biasRegularizer=ote(e.biasRegularizer),this.kernelConstraint=W9(e.kernelConstraint),this.recurrentConstraint=W9(e.recurrentConstraint),this.biasConstraint=W9(e.biasConstraint),this.dropout=w8([1,I8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=w8([1,I8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=g9(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return(0,p3.tidy)(()=>{if(2!==e.length)throw new D6(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let i=e[1];e=e[0],0p3.onesLike(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0p3.onesLike(i),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,s=this.recurrentDropoutMask;let o,a,l;0{null!=this.cell.dropoutMask&&(p3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(p3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Ute.className="GRU",p3.serialization.registerClass(Ute);class Vte extends Lte{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,e8(this.units,"units"),this.activation=Jee(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Jee(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=h9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=h9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=h9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=ote(e.kernelRegularizer),this.recurrentRegularizer=ote(e.recurrentRegularizer),this.biasRegularizer=ote(e.biasRegularizer),this.kernelConstraint=W9(e.kernelConstraint),this.recurrentConstraint=W9(e.recurrentConstraint),this.biasConstraint=W9(e.biasConstraint),this.dropout=w8([1,I8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=w8([1,I8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=g9(e))[e.length-1];let i;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;i=new((t=class extends W8{apply(t,i){const r=e.apply([n]),s=(new q8).apply([n]),o=e.apply([2*n]);return F8(F8(r,s),o)}}).className="CustomInit",t)}else i=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,i,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return(0,p3.tidy)(()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new D6(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let i=e[1];const r=e[2];e=e[0],0p3.onesLike(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0p3.onesLike(i),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const s=this.dropoutMask,o=this.recurrentDropoutMask;let a,l,u,c;0{null!=this.cell.dropoutMask&&(p3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(p3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}zte.className="LSTM",p3.serialization.registerClass(zte);class jte extends Lte{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return(0,p3.tidy)(()=>{let n=e.slice(1);const i=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?i.push(n.splice(0,e.stateSize.length)):i.push(n.splice(0,1));i.reverse();const r=[];let s;for(let o=0;o{_8(`RNNCell_${i}`,()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map(e=>({className:e.getClassName(),config:e.getConfig()}))};return Object.assign(Object.assign({},e),t)}static fromConfig(e,t,n={}){const i=[];for(const e of t.cells)i.push(w7(e,n));return new e({cells:i})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return b9(e)}setWeights(e){const t=[];for(const n of this.cells){const i=n.weights.length,r=e.splice(i);for(let e=0;enull!=s?s(t(),n):j8(t(),n),a=()=>Y8(o,t,i);if(!r||r<=1)return p3.keep(a().clone());return Array(r).fill(void 0).map(a).map(e=>p3.keep(e.clone()))}jte.className="StackedRNNCells",p3.serialization.registerClass(jte); /** * @license * Copyright 2020 Google LLC @@ -11392,7 +11392,7 @@ function Ote(e,t,n,i){if(Array.isArray(e)){if(null!=t||null!=n)throw new M6("Whe * https://opensource.org/licenses/MIT. * ============================================================================= */ -var Vte=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{if(null!=this.cell.dropoutMask&&(u3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(u3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new M6("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return u3.tidy(()=>{const{stateSize:t}=this.cell,n=e.shape,i=this.computeSingleOutputShape(n),r=[i[0],...i.slice(2)],s=u3.zeros(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){u3.tidy(()=>{if(!this.stateful)throw new C6("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,i=this.computeSingleOutputShape(n),r=[i[0],...i.slice(2)];if(null==n[0])throw new M6("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>u3.zeros(r)):this.states_=[u3.zeros(r)];else if(null==e)u3.dispose(this.states_),null!=this.keptStates&&(u3.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>u3.zeros(r)):this.states_[0]=u3.zeros(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new M6(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):u3.dispose(this.states_);for(let t=0;tu3.keep(e.clone()))})}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:i,padding:r,strides:s,dilationRate:o}=this.cell,a="channelsFirst"===t,l=e[a?3:2],u=e[a?4:3],c=cte(l,i[0],r,s[0],o[0]),d=cte(u,i[1],r,s[1],o[1]);return[...e.slice(0,2),...a?[n,c,d]:[c,d,n]]}}zte.className="ConvRNN2D";class jte extends Pte{constructor(e){const{filters:t,kernelSize:n,strides:i,padding:r,dataFormat:s,dilationRate:o}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,K6(this.filters,"filters"),this.kernelSize=ute(n,2,"kernelSize"),this.kernelSize.forEach(e=>K6(e,"kernelSize")),this.strides=ute(i||1,2,"strides"),this.strides.forEach(e=>K6(e,"strides")),this.padding=r||"valid",c8(this.padding),this.dataFormat=s||"channelsLast",u8(this.dataFormat),this.dilationRate=ute(o||1,2,"dilationRate"),this.dilationRate.forEach(e=>K6(e,"dilationRate"))}build(e){var t;e=h9(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new M6(`The channel dimension of the input should be defined. Found ${e[n]}`);const i=e[n],r=this.kernelSize.concat([i,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const s=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",s,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,i=this.filters;e=new((t=class extends j8{apply(e,t){return M8([n.apply([i]),u3.ones([i]),n.apply([2*i])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return u3.tidy(()=>{if(3!==e.length)throw new M6(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,i=e[0],r=e[1],s=e[2];0u3.onesLike(i),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const o=this.dropoutMask,a=(e,t,n)=>t&&t[n]?u3.mul(t[n],e):e;let l=a(i,o,0),u=a(i,o,1),c=a(i,o,2),d=a(i,o,3);0u3.onesLike(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const h=this.recurrentDropoutMask;let p=a(r,h,0),f=a(r,h,1),m=a(r,h,2),g=a(r,h,3);const[_,y,v,b]=u3.split(this.kernel.read(),4,3),[T,x,E,w]=this.useBias?u3.split(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,_,T,this.padding),u=this.inputConv(u,y,x,this.padding),c=this.inputConv(c,v,E,this.padding),d=this.inputConv(d,b,w,this.padding);const[I,A,S,C]=u3.split(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,I),f=this.recurrentConv(f,A),m=this.recurrentConv(m,S),g=this.recurrentConv(g,C);const O=this.recurrentActivation.apply(u3.add(l,p)),M=this.recurrentActivation.apply(u3.add(u,f)),k=u3.add(u3.mul(M,s),u3.mul(O,this.activation.apply(u3.add(c,m)))),R=u3.mul(this.recurrentActivation.apply(u3.add(d,g)),this.activation.apply(k));return[R,R,k]})}getConfig(){const e=super.getConfig(),{units:t}=e,n=Vte(e,["units"]),i={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),i)}inputConv(e,t,n,i){const r=u3.conv2d(e,t,this.strides,i||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?B8(r,n,this.dataFormat):r}recurrentConv(e,t){return u3.conv2d(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}jte.className="ConvLSTM2DCell",u3.serialization.registerClass(jte);class Yte extends zte{constructor(e){const t=new jte(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}Yte.className="ConvLSTM2D",u3.serialization.registerClass(Yte); +var Gte=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{if(null!=this.cell.dropoutMask&&(p3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(p3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new D6("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return p3.tidy(()=>{const{stateSize:t}=this.cell,n=e.shape,i=this.computeSingleOutputShape(n),r=[i[0],...i.slice(2)],s=p3.zeros(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){p3.tidy(()=>{if(!this.stateful)throw new R6("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,i=this.computeSingleOutputShape(n),r=[i[0],...i.slice(2)];if(null==n[0])throw new D6("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>p3.zeros(r)):this.states_=[p3.zeros(r)];else if(null==e)p3.dispose(this.states_),null!=this.keptStates&&(p3.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>p3.zeros(r)):this.states_[0]=p3.zeros(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new D6(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):p3.dispose(this.states_);for(let t=0;tp3.keep(e.clone()))})}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:i,padding:r,strides:s,dilationRate:o}=this.cell,a="channelsFirst"===t,l=e[a?3:2],u=e[a?4:3],c=fte(l,i[0],r,s[0],o[0]),d=fte(u,i[1],r,s[1],o[1]);return[...e.slice(0,2),...a?[n,c,d]:[c,d,n]]}}Hte.className="ConvRNN2D";class Wte extends Vte{constructor(e){const{filters:t,kernelSize:n,strides:i,padding:r,dataFormat:s,dilationRate:o}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,e8(this.filters,"filters"),this.kernelSize=pte(n,2,"kernelSize"),this.kernelSize.forEach(e=>e8(e,"kernelSize")),this.strides=pte(i||1,2,"strides"),this.strides.forEach(e=>e8(e,"strides")),this.padding=r||"valid",f8(this.padding),this.dataFormat=s||"channelsLast",p8(this.dataFormat),this.dilationRate=pte(o||1,2,"dilationRate"),this.dilationRate.forEach(e=>e8(e,"dilationRate"))}build(e){var t;e=g9(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new D6(`The channel dimension of the input should be defined. Found ${e[n]}`);const i=e[n],r=this.kernelSize.concat([i,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const s=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",s,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,i=this.filters;e=new((t=class extends W8{apply(e,t){return D8([n.apply([i]),p3.ones([i]),n.apply([2*i])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return p3.tidy(()=>{if(3!==e.length)throw new D6(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,i=e[0],r=e[1],s=e[2];0p3.onesLike(i),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const o=this.dropoutMask,a=(e,t,n)=>t&&t[n]?p3.mul(t[n],e):e;let l=a(i,o,0),u=a(i,o,1),c=a(i,o,2),d=a(i,o,3);0p3.onesLike(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const h=this.recurrentDropoutMask;let p=a(r,h,0),f=a(r,h,1),m=a(r,h,2),g=a(r,h,3);const[_,y,v,b]=p3.split(this.kernel.read(),4,3),[T,x,E,w]=this.useBias?p3.split(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,_,T,this.padding),u=this.inputConv(u,y,x,this.padding),c=this.inputConv(c,v,E,this.padding),d=this.inputConv(d,b,w,this.padding);const[I,A,S,C]=p3.split(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,I),f=this.recurrentConv(f,A),m=this.recurrentConv(m,S),g=this.recurrentConv(g,C);const O=this.recurrentActivation.apply(p3.add(l,p)),M=this.recurrentActivation.apply(p3.add(u,f)),k=p3.add(p3.mul(M,s),p3.mul(O,this.activation.apply(p3.add(c,m)))),R=p3.mul(this.recurrentActivation.apply(p3.add(d,g)),this.activation.apply(k));return[R,R,k]})}getConfig(){const e=super.getConfig(),{units:t}=e,n=Gte(e,["units"]),i={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),i)}inputConv(e,t,n,i){const r=p3.conv2d(e,t,this.strides,i||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?z8(r,n,this.dataFormat):r}recurrentConv(e,t){return p3.conv2d(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}Wte.className="ConvLSTM2DCell",p3.serialization.registerClass(Wte);class Xte extends Hte{constructor(e){const t=new Wte(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}Xte.className="ConvLSTM2D",p3.serialization.registerClass(Xte); /** * @license * Copyright 2018 Google LLC @@ -11402,7 +11402,7 @@ var Vte=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.ca * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Gte extends E9{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e{this.invokeCallHook(e,t);const n=d9(e);if(0$8(n,this.rate,i,this.seed),()=>n,e)}return e})}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}Gte.className="Dropout",u3.serialization.registerClass(Gte);class Hte extends Gte{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}Hte.className="SpatialDropout1D",u3.serialization.registerClass(Hte);class Wte extends E9{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,K6(this.units,"units"),this.activation=qee(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=l9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=l9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=j9(e.kernelConstraint),this.biasConstraint=j9(e.biasConstraint),this.kernelRegularizer=nte(e.kernelRegularizer),this.biasRegularizer=nte(e.biasRegularizer),this.activityRegularizer=nte(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=h9(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=h9(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return(0,u3.tidy)(()=>{this.invokeCallHook(e,t);const n=d9(e),i=Q6(this.activation.getClassName());let r;return null!=i?r=D8(n,this.kernel.read(),i,this.bias?this.bias.read():null):(r=D8(n,this.kernel.read()),null!=this.bias&&(r=B8(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r})}getConfig(){const e={units:this.units,activation:Wee(this.activation),useBias:this.useBias,kernelInitializer:a9(this.kernelInitializer),biasInitializer:a9(this.biasInitializer),kernelRegularizer:ete(this.kernelRegularizer),biasRegularizer:ete(this.biasRegularizer),activityRegularizer:ete(this.activityRegularizer),kernelConstraint:V9(this.kernelConstraint),biasConstraint:V9(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}Wte.className="Dense",u3.serialization.registerClass(Wte);class Xte extends E9{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=h9(e);for(const t of e.slice(1))if(null==t)throw new M6(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],v8(e,1)]}call(e,t){return(0,u3.tidy)(()=>{this.invokeCallHook(e,t);let n=d9(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=d9(e);return this.activation.apply(n)})}getConfig(){const e={activation:Wee(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}qte.className="Activation",u3.serialization.registerClass(qte);class Kte extends E9{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return(0,u3.tidy)(()=>{return e=d9(e),t=e,n=this.n,(0,u3.tidy)(()=>{if(2!==t.shape.length)throw new M6(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return R8(A8(t,1),[1,n,1])});var t,n})}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}Kte.className="RepeatVector",u3.serialization.registerClass(Kte);class Zte extends E9{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=d9(e),i=n.shape,r=i.slice(0,1).concat(this.fixUnknownDimension(i.slice(1),this.targetShape));return(0,u3.reshape)(n,r)})}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}Zte.className="Reshape",u3.serialization.registerClass(Zte);class Qte extends E9{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=x8(1,e.dims.length+1);if(!u3.util.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new y9({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=h9(e)).slice();return this.dims.forEach((n,i)=>{t[i+1]=e[n]}),t}call(e,t){return(0,u3.transpose)(d9(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}Qte.className="Permute",u3.serialization.registerClass(Qte);class Jte extends E9{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=d9(e);return(0,u3.any)((0,u3.notEqual)(n,this.maskValue),-1)}call(e,t){return(0,u3.tidy)(()=>{this.invokeCallHook(e,t);const n=d9(e),i=(0,u3.any)((0,u3.notEqual)(n,this.maskValue),-1,!0);return(0,u3.mul)(n,(0,u3.cast)(i,n.dtype))})}}Jte.className="Masking",u3.serialization.registerClass(Jte); +class qte extends S9{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e{this.invokeCallHook(e,t);const n=m9(e);if(0j8(n,this.rate,i,this.seed),()=>n,e)}return e})}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}qte.className="Dropout",p3.serialization.registerClass(qte);class Kte extends qte{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}Kte.className="SpatialDropout1D",p3.serialization.registerClass(Kte);class Zte extends S9{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,e8(this.units,"units"),this.activation=Jee(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=h9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=h9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=W9(e.kernelConstraint),this.biasConstraint=W9(e.biasConstraint),this.kernelRegularizer=ote(e.kernelRegularizer),this.biasRegularizer=ote(e.biasRegularizer),this.activityRegularizer=ote(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=g9(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=g9(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return(0,p3.tidy)(()=>{this.invokeCallHook(e,t);const n=m9(e),i=n8(this.activation.getClassName());let r;return null!=i?r=B8(n,this.kernel.read(),i,this.bias?this.bias.read():null):(r=B8(n,this.kernel.read()),null!=this.bias&&(r=z8(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r})}getConfig(){const e={units:this.units,activation:Zee(this.activation),useBias:this.useBias,kernelInitializer:d9(this.kernelInitializer),biasInitializer:d9(this.biasInitializer),kernelRegularizer:rte(this.kernelRegularizer),biasRegularizer:rte(this.biasRegularizer),activityRegularizer:rte(this.activityRegularizer),kernelConstraint:G9(this.kernelConstraint),biasConstraint:G9(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}Zte.className="Dense",p3.serialization.registerClass(Zte);class Qte extends S9{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=g9(e);for(const t of e.slice(1))if(null==t)throw new D6(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],E8(e,1)]}call(e,t){return(0,p3.tidy)(()=>{this.invokeCallHook(e,t);let n=m9(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=m9(e);return this.activation.apply(n)})}getConfig(){const e={activation:Zee(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}Jte.className="Activation",p3.serialization.registerClass(Jte);class ene extends S9{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return(0,p3.tidy)(()=>{return e=m9(e),t=e,n=this.n,(0,p3.tidy)(()=>{if(2!==t.shape.length)throw new D6(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return L8(M8(t,1),[1,n,1])});var t,n})}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}ene.className="RepeatVector",p3.serialization.registerClass(ene);class tne extends S9{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=m9(e),i=n.shape,r=i.slice(0,1).concat(this.fixUnknownDimension(i.slice(1),this.targetShape));return(0,p3.reshape)(n,r)})}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}tne.className="Reshape",p3.serialization.registerClass(tne);class nne extends S9{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=A8(1,e.dims.length+1);if(!p3.util.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new x9({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=g9(e)).slice();return this.dims.forEach((n,i)=>{t[i+1]=e[n]}),t}call(e,t){return(0,p3.transpose)(m9(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}nne.className="Permute",p3.serialization.registerClass(nne);class ine extends S9{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=m9(e);return(0,p3.any)((0,p3.notEqual)(n,this.maskValue),-1)}call(e,t){return(0,p3.tidy)(()=>{this.invokeCallHook(e,t);const n=m9(e),i=(0,p3.any)((0,p3.notEqual)(n,this.maskValue),-1,!0);return(0,p3.mul)(n,(0,p3.cast)(i,n.dtype))})}}ine.className="Masking",p3.serialization.registerClass(ine); /** * @license * Copyright 2018 Google LLC @@ -11412,7 +11412,7 @@ class Gte extends E9{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate, * https://opensource.org/licenses/MIT. * ============================================================================= */ -class ene extends E9{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(B6(e.inputLength))}this.inputDim=e.inputDim,K6(this.inputDim,"inputDim"),this.outputDim=e.outputDim,K6(this.outputDim,"outputDim"),this.embeddingsInitializer=l9(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=nte(e.embeddingsRegularizer),this.activityRegularizer=nte(e.activityRegularizer),this.embeddingsConstraint=j9(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return(0,u3.tidy)(()=>this.maskZero?(e=d9(e),(0,u3.notEqual)(e,(0,u3.zerosLike)(e))):null)}computeOutputShape(e){if(e=h9(e),null==this.inputLength)return[...e,this.outputDim];const t=B6(this.inputLength);if(t.length!==e.length-1)throw new M6(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let i=0;i{this.invokeCallHook(e,t);let n=d9(e);"int32"!==n.dtype&&(n=I8(n,"int32"));const i=F8(this.embeddings.read(),(0,u3.reshape)(n,[n.size]));return(0,u3.reshape)(i,h9(this.computeOutputShape(n.shape)))})}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:a9(this.embeddingsInitializer),embeddingsRegularizer:ete(this.embeddingsRegularizer),activityRegularizer:ete(this.activityRegularizer),embeddingsConstraint:V9(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}ene.className="Embedding",u3.serialization.registerClass(ene); +class rne extends S9{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(z6(e.inputLength))}this.inputDim=e.inputDim,e8(this.inputDim,"inputDim"),this.outputDim=e.outputDim,e8(this.outputDim,"outputDim"),this.embeddingsInitializer=h9(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=ote(e.embeddingsRegularizer),this.activityRegularizer=ote(e.activityRegularizer),this.embeddingsConstraint=W9(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return(0,p3.tidy)(()=>this.maskZero?(e=m9(e),(0,p3.notEqual)(e,(0,p3.zerosLike)(e))):null)}computeOutputShape(e){if(e=g9(e),null==this.inputLength)return[...e,this.outputDim];const t=z6(this.inputLength);if(t.length!==e.length-1)throw new D6(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let i=0;i{this.invokeCallHook(e,t);let n=m9(e);"int32"!==n.dtype&&(n=O8(n,"int32"));const i=$8(this.embeddings.read(),(0,p3.reshape)(n,[n.size]));return(0,p3.reshape)(i,g9(this.computeOutputShape(n.shape)))})}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:d9(this.embeddingsInitializer),embeddingsRegularizer:rte(this.embeddingsRegularizer),activityRegularizer:rte(this.activityRegularizer),embeddingsConstraint:G9(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}rne.className="Embedding",p3.serialization.registerClass(rne); /** * @license * Copyright 2018 Google LLC @@ -11422,7 +11422,7 @@ class ene extends E9{constructor(e){if(super(e),this.embeddings=null,this.DEFAUL * https://opensource.org/licenses/MIT. * ============================================================================= */ -class tne extends E9{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new k6}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new M6(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;te.length);-1===e.indexOf(null)&&1===H6(i).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return(0,u3.tidy)(()=>{if(this.reshapeRequired){const t=[],n=e.map(e=>e.rank);if(-1===n.indexOf(null)){const i=T8(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=x8(1,e).concat([0]);t.push(u3.transpose(i,r)),n=!0}else t.push(i)}let i=this.mergeFunction(t);const r=i.rank;if(n)if(null==r){const e=i.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));i=u3.reshape(u3.transpose(u3.reshape(i,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(x8(0,r-1));i=u3.transpose(i,e)}return i}}return this.mergeFunction(e)})}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n{if(null==t)return null;if(!Array.isArray(t))throw new M6("`mask` should be an Array");if(!Array.isArray(e))throw new M6("`inputs` should be an Array");if(t.length!==e.length)throw new M6(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(e=>null==e))return null;let n=(t=t.map(e=>null==e?e:u3.expandDims(e,0)))[0];for(let e=1;e{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new M6("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return(0,u3.tidy)(()=>M8(e,this.axis))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new M6("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),i=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[i]||null==e[i]){n[i]=null;break}n[i]+=e[i]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new M6("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new M6("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new M6(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return u3.tidy(()=>{let n=!0;if(t.forEach(e=>{null==e||(n=!1)}),n)return null;const i=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs.");const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new k6("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(t,n);if(t[i[0]]!==n[i[1]])throw new M6(`Dimension incompatibility: ${t[i[0]]} !== ${n[i[1]]}`)}mergeFunction(e){if(2!==e.length)throw new M6(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],i=e[1];return t=Array.isArray(this.axes)?this.axes.map((t,n)=>lne(t,e[n].shape.length)):[lne(this.axes,n.shape.length),lne(this.axes,i.shape.length)],this.normalize&&(n=T7(n,t[0]),i=T7(i,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new k6("batchDot is not implemented for tensors of 4D or higher rank yet");if(u3.util.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),u3.util.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new k6("batchDot is not implemented for complex64-type Tensors yet.");const i=e.shape.length,r=t.shape.length;null==n&&(n=[i-1,r-2]);const s=n;return u3.tidy(()=>{let n,o;if(i>r){n=i-r;const e=[];for(let t=0;ti){n=r-i;const t=[];for(let e=0;e0){let e;e=i>r?i+r-3:i-1;const t=[];for(let i=e;i"A `Dot` layer should be called on a list of exactly 2 inputs.");const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new k6("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(t,n);t.splice(i[0],1),n.splice(i[1],1),n.splice(0,1);const r=t.concat(n);return 1===r.length&&r.push(1),r}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}une.className="Dot",u3.serialization.registerClass(une); +class sne extends S9{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new F6}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new D6(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;te.length);-1===e.indexOf(null)&&1===K6(i).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return(0,p3.tidy)(()=>{if(this.reshapeRequired){const t=[],n=e.map(e=>e.rank);if(-1===n.indexOf(null)){const i=I8(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=A8(1,e).concat([0]);t.push(p3.transpose(i,r)),n=!0}else t.push(i)}let i=this.mergeFunction(t);const r=i.rank;if(n)if(null==r){const e=i.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));i=p3.reshape(p3.transpose(p3.reshape(i,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(A8(0,r-1));i=p3.transpose(i,e)}return i}}return this.mergeFunction(e)})}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n{if(null==t)return null;if(!Array.isArray(t))throw new D6("`mask` should be an Array");if(!Array.isArray(e))throw new D6("`inputs` should be an Array");if(t.length!==e.length)throw new D6(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(e=>null==e))return null;let n=(t=t.map(e=>null==e?e:p3.expandDims(e,0)))[0];for(let e=1;e{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new D6("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return(0,p3.tidy)(()=>D8(e,this.axis))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new D6("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),i=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[i]||null==e[i]){n[i]=null;break}n[i]+=e[i]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new D6("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new D6("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new D6(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return p3.tidy(()=>{let n=!0;if(t.forEach(e=>{null==e||(n=!1)}),n)return null;const i=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs.");const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new F6("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(t,n);if(t[i[0]]!==n[i[1]])throw new D6(`Dimension incompatibility: ${t[i[0]]} !== ${n[i[1]]}`)}mergeFunction(e){if(2!==e.length)throw new D6(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],i=e[1];return t=Array.isArray(this.axes)?this.axes.map((t,n)=>hne(t,e[n].shape.length)):[hne(this.axes,n.shape.length),hne(this.axes,i.shape.length)],this.normalize&&(n=I7(n,t[0]),i=I7(i,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new F6("batchDot is not implemented for tensors of 4D or higher rank yet");if(p3.util.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),p3.util.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new F6("batchDot is not implemented for complex64-type Tensors yet.");const i=e.shape.length,r=t.shape.length;null==n&&(n=[i-1,r-2]);const s=n;return p3.tidy(()=>{let n,o;if(i>r){n=i-r;const e=[];for(let t=0;ti){n=r-i;const t=[];for(let e=0;e0){let e;e=i>r?i+r-3:i-1;const t=[];for(let i=e;i"A `Dot` layer should be called on a list of exactly 2 inputs.");const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new F6("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(t,n);t.splice(i[0],1),n.splice(i[1],1),n.splice(0,1);const r=t.concat(n);return 1===r.length&&r.push(1),r}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}pne.className="Dot",p3.serialization.registerClass(pne); /** * @license * Copyright 2018 Google LLC @@ -11432,7 +11432,7 @@ class tne extends E9{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFu * https://opensource.org/licenses/MIT. * ============================================================================= */ -class cne extends E9{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return(0,u3.tidy)(()=>{this.invokeCallHook(e,t);const n=d9(e);return U8(()=>(0,u3.add)(N8(n.shape,0,this.stddev),n),()=>n,t.training||!1)})}}cne.className="GaussianNoise",u3.serialization.registerClass(cne);class dne extends E9{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return(0,u3.tidy)(()=>{this.invokeCallHook(e,t);const n=d9(e);if(this.rate>0&&this.rate<1){return U8(()=>{const e=Math.sqrt(this.rate/(1-this.rate));return(0,u3.mul)(n,N8(n.shape,1,e))},()=>n,t.training||!1)}return n})}}dne.className="GaussianDropout",u3.serialization.registerClass(dne);class hne extends E9{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||d9(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return(0,u3.tidy)(()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),i=()=>{const t=d9(e),i=-1.7580993408473766;let r=(0,u3.greaterEqual)((0,u3.randomUniform)(n),this.rate);r=I8(r,"float32");const s=((1-this.rate)*(1+this.rate*i**2))**-.5,o=-s*i*this.rate,a=(0,u3.add)((0,u3.mul)(t,r),(0,u3.mul)((0,u3.add)(r,-1),i));return(0,u3.add)((0,u3.mul)(a,s),o)};return U8(i,()=>d9(e),t.training||!1)}return e})}} +class fne extends S9{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return(0,p3.tidy)(()=>{this.invokeCallHook(e,t);const n=m9(e);return Y8(()=>(0,p3.add)(P8(n.shape,0,this.stddev),n),()=>n,t.training||!1)})}}fne.className="GaussianNoise",p3.serialization.registerClass(fne);class mne extends S9{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return(0,p3.tidy)(()=>{this.invokeCallHook(e,t);const n=m9(e);if(this.rate>0&&this.rate<1){return Y8(()=>{const e=Math.sqrt(this.rate/(1-this.rate));return(0,p3.mul)(n,P8(n.shape,1,e))},()=>n,t.training||!1)}return n})}}mne.className="GaussianDropout",p3.serialization.registerClass(mne);class gne extends S9{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||m9(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return(0,p3.tidy)(()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),i=()=>{const t=m9(e),i=-1.7580993408473766;let r=(0,p3.greaterEqual)((0,p3.randomUniform)(n),this.rate);r=O8(r,"float32");const s=((1-this.rate)*(1+this.rate*i**2))**-.5,o=-s*i*this.rate,a=(0,p3.add)((0,p3.mul)(t,r),(0,p3.mul)((0,p3.add)(r,-1),i));return(0,p3.add)((0,p3.mul)(a,s),o)};return Y8(i,()=>m9(e),t.training||!1)}return e})}} /** * @license * Copyright 2018 Google LLC @@ -11442,7 +11442,7 @@ class cne extends E9{constructor(e){super(e),this.supportsMasking=!0,this.stddev * https://opensource.org/licenses/MIT. * ============================================================================= */ -function pne(e,t,n,i,r,s=.001){let o;if(2===e.rank)o=u3.batchNorm2d(e,t,n,i,r,s);else if(3===e.rank)o=u3.batchNorm3d(e,t,n,i,r,s);else{if(4!==e.rank)throw new k6(`batchNormalization is not implemented for array of rank ${e.rank} yet`);o=u3.batchNorm4d(e,t,n,i,r,s)}return o}function fne(e,t,n,i,r=.001){return u3.util.arraysEqual(i.slice().sort(),x8(0,e.rank-1))?function(e,t,n,i,r=.001){return(0,u3.tidy)(()=>{const s=u3.moments(e,i),o=s.mean,a=s.variance;return[pne(e,o,a,n,t,r),o,a]})}(e,t,n,i,r):function(e,t,n,i,r=.001){return(0,u3.tidy)(()=>{const s=u3.moments(e,i),o=s.mean,a=s.variance,l=[];for(const t of x8(0,e.rank))-1!==i.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=(0,u3.reshape)(o,l),c=(0,u3.reshape)(a,l),d=null==t?null:(0,u3.reshape)(t,l),h=null==n?null:(0,u3.reshape)(n,l);return[pne(e,u,c,h,d,r),o,a]})}(e,t,n,i,r)}hne.className="AlphaDropout",u3.serialization.registerClass(hne);class mne extends E9{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=l9(e.betaInitializer||"zeros"),this.gammaInitializer=l9(e.gammaInitializer||"ones"),this.movingMeanInitializer=l9(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=l9(e.movingVarianceInitializer||"ones"),this.betaConstraint=j9(e.betaConstraint),this.gammaConstraint=j9(e.gammaConstraint),this.betaRegularizer=nte(e.betaRegularizer),this.gammaRegularizer=nte(e.gammaRegularizer)}build(e){e=h9(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new M6(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new y9({ndim:e.length,axes:{[t]:n}})];const i=[n];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return(0,u3.tidy)(()=>{const n=null!=t.training&&t.training,i=d9(e),r=i.shape,s=r.length,o=x8(0,s),a=this.axis>=0?this.axis:this.axis+s;o.splice(a,1);const l=D6(1,s);l[a]=r[a];const u=o.slice();u.sort();const c=!u3.util.arraysEqual(u,x8(0,s).slice(0,s-1));if(!n)return(()=>{if(c){const e=(0,u3.reshape)(this.movingMean.read(),l),t=(0,u3.reshape)(this.movingVariance.read(),l),n=this.center?(0,u3.reshape)(this.beta.read(),l):null,r=this.scale?(0,u3.reshape)(this.gamma.read(),l):null;return pne(i,e,t,n,r,this.epsilon)}return pne(i,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[d,h,p]=fne(i,this.gamma.read(),this.beta.read(),o,this.epsilon),f=(e,t,n)=>{u3.tidy(()=>{const i=1-n,r=e.read(),s=u3.mul(u3.sub(r,t),i);e.write(u3.sub(r,s))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,p,this.momentum)})(),d})}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:a9(this.betaInitializer),gammaInitializer:a9(this.gammaInitializer),movingMeanInitializer:a9(this.movingMeanInitializer),movingVarianceInitializer:a9(this.movingVarianceInitializer),betaRegularizer:ete(this.betaRegularizer),gammaRegularizer:ete(this.gammaRegularizer),betaConstraint:V9(this.betaConstraint),gammaConstraint:V9(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}mne.className="BatchNormalization",u3.serialization.registerClass(mne);class gne extends E9{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=l9(e.betaInitializer||"zeros"),this.gammaInitializer=l9(e.gammaInitializer||"ones"),this.betaRegularizer=nte(e.betaRegularizer),this.gammaRegularizer=nte(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=h9(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==H6(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map(t=>e[t]),i=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,i):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,i):this.beta=null,this.built=!0}call(e,t){const n=d9(e),i=n.shape,r=i.length;return(0,u3.tidy)(()=>{let{mean:e,variance:t}=(0,u3.moments)(n,this.axis,!0);const s=D6(1,r);for(const e of this.axis)s[e]=i[e];const o=e=>null!=e&&e.shape.length!==r?u3.reshape(e,s):e;let a=this.scale?o(this.gamma.read()):null,l=this.center?o(this.beta.read()):null;const u=[],c=[];for(let e=0;e=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return(0,u3.tidy)(()=>{return t=d9(e),n=this.padding,i=this.dataFormat,(0,u3.tidy)(()=>{if(4!==t.rank)throw new M6(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new M6("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==i&&(i="channelsLast"),"channelsLast"!==i&&"channelsFirst"!==i)throw new M6(`Unknown data format: ${i}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===i?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],u3.pad(t,e)});var t,n,i})}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}} +function _ne(e,t,n,i,r,s=.001){let o;if(2===e.rank)o=p3.batchNorm2d(e,t,n,i,r,s);else if(3===e.rank)o=p3.batchNorm3d(e,t,n,i,r,s);else{if(4!==e.rank)throw new F6(`batchNormalization is not implemented for array of rank ${e.rank} yet`);o=p3.batchNorm4d(e,t,n,i,r,s)}return o}function yne(e,t,n,i,r=.001){return p3.util.arraysEqual(i.slice().sort(),A8(0,e.rank-1))?function(e,t,n,i,r=.001){return(0,p3.tidy)(()=>{const s=p3.moments(e,i),o=s.mean,a=s.variance;return[_ne(e,o,a,n,t,r),o,a]})}(e,t,n,i,r):function(e,t,n,i,r=.001){return(0,p3.tidy)(()=>{const s=p3.moments(e,i),o=s.mean,a=s.variance,l=[];for(const t of A8(0,e.rank))-1!==i.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=(0,p3.reshape)(o,l),c=(0,p3.reshape)(a,l),d=null==t?null:(0,p3.reshape)(t,l),h=null==n?null:(0,p3.reshape)(n,l);return[_ne(e,u,c,h,d,r),o,a]})}(e,t,n,i,r)}gne.className="AlphaDropout",p3.serialization.registerClass(gne);class vne extends S9{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=h9(e.betaInitializer||"zeros"),this.gammaInitializer=h9(e.gammaInitializer||"ones"),this.movingMeanInitializer=h9(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=h9(e.movingVarianceInitializer||"ones"),this.betaConstraint=W9(e.betaConstraint),this.gammaConstraint=W9(e.gammaConstraint),this.betaRegularizer=ote(e.betaRegularizer),this.gammaRegularizer=ote(e.gammaRegularizer)}build(e){e=g9(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new D6(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new x9({ndim:e.length,axes:{[t]:n}})];const i=[n];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return(0,p3.tidy)(()=>{const n=null!=t.training&&t.training,i=m9(e),r=i.shape,s=r.length,o=A8(0,s),a=this.axis>=0?this.axis:this.axis+s;o.splice(a,1);const l=B6(1,s);l[a]=r[a];const u=o.slice();u.sort();const c=!p3.util.arraysEqual(u,A8(0,s).slice(0,s-1));if(!n)return(()=>{if(c){const e=(0,p3.reshape)(this.movingMean.read(),l),t=(0,p3.reshape)(this.movingVariance.read(),l),n=this.center?(0,p3.reshape)(this.beta.read(),l):null,r=this.scale?(0,p3.reshape)(this.gamma.read(),l):null;return _ne(i,e,t,n,r,this.epsilon)}return _ne(i,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[d,h,p]=yne(i,this.gamma.read(),this.beta.read(),o,this.epsilon),f=(e,t,n)=>{p3.tidy(()=>{const i=1-n,r=e.read(),s=p3.mul(p3.sub(r,t),i);e.write(p3.sub(r,s))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,p,this.momentum)})(),d})}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:d9(this.betaInitializer),gammaInitializer:d9(this.gammaInitializer),movingMeanInitializer:d9(this.movingMeanInitializer),movingVarianceInitializer:d9(this.movingVarianceInitializer),betaRegularizer:rte(this.betaRegularizer),gammaRegularizer:rte(this.gammaRegularizer),betaConstraint:G9(this.betaConstraint),gammaConstraint:G9(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}vne.className="BatchNormalization",p3.serialization.registerClass(vne);class bne extends S9{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=h9(e.betaInitializer||"zeros"),this.gammaInitializer=h9(e.gammaInitializer||"ones"),this.betaRegularizer=ote(e.betaRegularizer),this.gammaRegularizer=ote(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=g9(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==K6(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map(t=>e[t]),i=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,i):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,i):this.beta=null,this.built=!0}call(e,t){const n=m9(e),i=n.shape,r=i.length;return(0,p3.tidy)(()=>{let{mean:e,variance:t}=(0,p3.moments)(n,this.axis,!0);const s=B6(1,r);for(const e of this.axis)s[e]=i[e];const o=e=>null!=e&&e.shape.length!==r?p3.reshape(e,s):e;let a=this.scale?o(this.gamma.read()):null,l=this.center?o(this.beta.read()):null;const u=[],c=[];for(let e=0;e=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return(0,p3.tidy)(()=>{return t=m9(e),n=this.padding,i=this.dataFormat,(0,p3.tidy)(()=>{if(4!==t.rank)throw new D6(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new D6("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==i&&(i="channelsLast"),"channelsLast"!==i&&"channelsFirst"!==i)throw new D6(`Unknown data format: ${i}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===i?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],p3.pad(t,e)});var t,n,i})}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}} /** * @license * Copyright 2018 Google LLC @@ -11452,7 +11452,7 @@ function pne(e,t,n,i,r,s=.001){let o;if(2===e.rank)o=u3.batchNorm2d(e,t,n,i,r,s) * https://opensource.org/licenses/MIT. * ============================================================================= */ -function yne(e,t,n,i,r,s){return(0,u3.tidy)(()=>{let o;u8(r),d8(s),c8(i),null==n&&(n=[1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==s&&(s="max"),e=hte(e,r);const a="same"===i?"same":"valid";return o="max"===s?u3.maxPool(e,t,n,a):u3.avgPool(e,t,n,a),"channelsFirst"===r&&(o=u3.transpose(o,[0,3,1,2])),o})}function vne(e,t,n,i,r,s){return(0,u3.tidy)(()=>{let o;u8(r),d8(s),c8(i),null==n&&(n=[1,1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==s&&(s="max"),e=pte(e,r);const a="same"===i?"same":"valid";return o="max"===s?u3.maxPool3d(e,t,n,a):u3.avgPool3d(e,t,n,a),"channelsFirst"===r&&(o=u3.transpose(o,[0,4,1,2,3])),o})}_ne.className="ZeroPadding2D",u3.serialization.registerClass(_ne);class bne extends E9{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new M6(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(K6(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new M6(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}K6(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,c8(this.padding),this.inputSpec=[new y9({ndim:3})]}computeOutputShape(e){const t=cte((e=h9(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return(0,u3.tidy)(()=>{this.invokeCallHook(e,t),e=A8(d9(e),2);const n=this.poolingFunction(d9(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return u3.squeeze(n,[2])})}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class Tne extends bne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return u8(r),c8(i),yne(e,t,n,i,r,"max")}}Tne.className="MaxPooling1D",u3.serialization.registerClass(Tne);class xne extends bne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return u8(r),c8(i),yne(e,t,n,i,r,"avg")}}xne.className="AveragePooling1D",u3.serialization.registerClass(xne);class Ene extends E9{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new M6(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];K6(this.poolSize,"poolSize"),K6(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,u8(this.dataFormat),c8(this.padding),this.inputSpec=[new y9({ndim:4})]}computeOutputShape(e){e=h9(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=cte(t,this.poolSize[0],this.padding,this.strides[0]),n=cte(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return(0,u3.tidy)(()=>(this.invokeCallHook(e,t),this.poolingFunction(d9(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class wne extends Ene{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return u8(r),c8(i),yne(e,t,n,i,r,"max")}}wne.className="MaxPooling2D",u3.serialization.registerClass(wne);class Ine extends Ene{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return u8(r),c8(i),yne(e,t,n,i,r,"avg")}}Ine.className="AveragePooling2D",u3.serialization.registerClass(Ine);class Ane extends E9{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new M6(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];K6(this.poolSize,"poolSize"),K6(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,u8(this.dataFormat),c8(this.padding),this.inputSpec=[new y9({ndim:5})]}computeOutputShape(e){e=h9(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],i="channelsFirst"===this.dataFormat?e[4]:e[3];return t=cte(t,this.poolSize[0],this.padding,this.strides[0]),n=cte(n,this.poolSize[1],this.padding,this.strides[1]),i=cte(i,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,i]:[e[0],t,n,i,e[4]]}call(e,t){return(0,u3.tidy)(()=>(this.invokeCallHook(e,t),this.poolingFunction(d9(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class Sne extends Ane{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return u8(r),c8(i),vne(e,t,n,i,r,"max")}}Sne.className="MaxPooling3D",u3.serialization.registerClass(Sne);class Cne extends Ane{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return u8(r),c8(i),vne(e,t,n,i,r,"avg")}}Cne.className="AveragePooling3D",u3.serialization.registerClass(Cne);class One extends E9{constructor(e){super(e),this.inputSpec=[new y9({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new k6}}class Mne extends One{constructor(e){super(e||{})}call(e,t){return(0,u3.tidy)(()=>{const t=d9(e);return u3.mean(t,1)})}}Mne.className="GlobalAveragePooling1D",u3.serialization.registerClass(Mne);class kne extends One{constructor(e){super(e||{})}call(e,t){return(0,u3.tidy)(()=>{const t=d9(e);return u3.max(t,1)})}}kne.className="GlobalMaxPooling1D",u3.serialization.registerClass(kne);class Rne extends E9{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,u8(this.dataFormat),this.inputSpec=[new y9({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new k6}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class Nne extends Rne{call(e,t){return(0,u3.tidy)(()=>{const t=d9(e);return"channelsLast"===this.dataFormat?u3.mean(t,[1,2]):u3.mean(t,[2,3])})}}Nne.className="GlobalAveragePooling2D",u3.serialization.registerClass(Nne);class Dne extends Rne{call(e,t){return(0,u3.tidy)(()=>{const t=d9(e);return"channelsLast"===this.dataFormat?u3.max(t,[1,2]):u3.max(t,[2,3])})}}Dne.className="GlobalMaxPooling2D",u3.serialization.registerClass(Dne); +function xne(e,t,n,i,r,s){return(0,p3.tidy)(()=>{let o;p8(r),m8(s),f8(i),null==n&&(n=[1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==s&&(s="max"),e=gte(e,r);const a="same"===i?"same":"valid";return o="max"===s?p3.maxPool(e,t,n,a):p3.avgPool(e,t,n,a),"channelsFirst"===r&&(o=p3.transpose(o,[0,3,1,2])),o})}function Ene(e,t,n,i,r,s){return(0,p3.tidy)(()=>{let o;p8(r),m8(s),f8(i),null==n&&(n=[1,1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==s&&(s="max"),e=_te(e,r);const a="same"===i?"same":"valid";return o="max"===s?p3.maxPool3d(e,t,n,a):p3.avgPool3d(e,t,n,a),"channelsFirst"===r&&(o=p3.transpose(o,[0,4,1,2,3])),o})}Tne.className="ZeroPadding2D",p3.serialization.registerClass(Tne);class wne extends S9{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new D6(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(e8(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new D6(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}e8(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,f8(this.padding),this.inputSpec=[new x9({ndim:3})]}computeOutputShape(e){const t=fte((e=g9(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return(0,p3.tidy)(()=>{this.invokeCallHook(e,t),e=M8(m9(e),2);const n=this.poolingFunction(m9(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return p3.squeeze(n,[2])})}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class Ine extends wne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return p8(r),f8(i),xne(e,t,n,i,r,"max")}}Ine.className="MaxPooling1D",p3.serialization.registerClass(Ine);class Ane extends wne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return p8(r),f8(i),xne(e,t,n,i,r,"avg")}}Ane.className="AveragePooling1D",p3.serialization.registerClass(Ane);class Sne extends S9{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new D6(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];e8(this.poolSize,"poolSize"),e8(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,p8(this.dataFormat),f8(this.padding),this.inputSpec=[new x9({ndim:4})]}computeOutputShape(e){e=g9(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=fte(t,this.poolSize[0],this.padding,this.strides[0]),n=fte(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return(0,p3.tidy)(()=>(this.invokeCallHook(e,t),this.poolingFunction(m9(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class Cne extends Sne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return p8(r),f8(i),xne(e,t,n,i,r,"max")}}Cne.className="MaxPooling2D",p3.serialization.registerClass(Cne);class One extends Sne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return p8(r),f8(i),xne(e,t,n,i,r,"avg")}}One.className="AveragePooling2D",p3.serialization.registerClass(One);class Mne extends S9{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new D6(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];e8(this.poolSize,"poolSize"),e8(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,p8(this.dataFormat),f8(this.padding),this.inputSpec=[new x9({ndim:5})]}computeOutputShape(e){e=g9(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],i="channelsFirst"===this.dataFormat?e[4]:e[3];return t=fte(t,this.poolSize[0],this.padding,this.strides[0]),n=fte(n,this.poolSize[1],this.padding,this.strides[1]),i=fte(i,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,i]:[e[0],t,n,i,e[4]]}call(e,t){return(0,p3.tidy)(()=>(this.invokeCallHook(e,t),this.poolingFunction(m9(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class kne extends Mne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return p8(r),f8(i),Ene(e,t,n,i,r,"max")}}kne.className="MaxPooling3D",p3.serialization.registerClass(kne);class Rne extends Mne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return p8(r),f8(i),Ene(e,t,n,i,r,"avg")}}Rne.className="AveragePooling3D",p3.serialization.registerClass(Rne);class Nne extends S9{constructor(e){super(e),this.inputSpec=[new x9({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new F6}}class Dne extends Nne{constructor(e){super(e||{})}call(e,t){return(0,p3.tidy)(()=>{const t=m9(e);return p3.mean(t,1)})}}Dne.className="GlobalAveragePooling1D",p3.serialization.registerClass(Dne);class Fne extends Nne{constructor(e){super(e||{})}call(e,t){return(0,p3.tidy)(()=>{const t=m9(e);return p3.max(t,1)})}}Fne.className="GlobalMaxPooling1D",p3.serialization.registerClass(Fne);class Lne extends S9{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,p8(this.dataFormat),this.inputSpec=[new x9({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new F6}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class Pne extends Lne{call(e,t){return(0,p3.tidy)(()=>{const t=m9(e);return"channelsLast"===this.dataFormat?p3.mean(t,[1,2]):p3.mean(t,[2,3])})}}Pne.className="GlobalAveragePooling2D",p3.serialization.registerClass(Pne);class Bne extends Lne{call(e,t){return(0,p3.tidy)(()=>{const t=m9(e);return"channelsLast"===this.dataFormat?p3.max(t,[1,2]):p3.max(t,[2,3])})}}Bne.className="GlobalMaxPooling2D",p3.serialization.registerClass(Bne); /** * @license * Copyright 2018 Google LLC @@ -11462,7 +11462,7 @@ function yne(e,t,n,i,r,s){return(0,u3.tidy)(()=>{let o;u8(r),d8(s),c8(i),null==n * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Fne extends E9{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const i=b7(t.layer,n);delete t.layer;const r={layer:i};return Object.assign(r,t),new e(r)}}class Lne extends Fne{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=h9(e)).length<3)throw new M6(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=h9(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),i=e[1];return[n[0],i].concat(n.slice(1))}call(e,t){return(0,u3.tidy)(()=>Mte((e,n)=>[d9(this.layer.call(e,t)),[]],e=d9(e),[],!1,null,null,!1,!0)[1])}}Lne.className="TimeDistributed",u3.serialization.registerClass(Lne);class Pne extends Fne{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=b7(n),t.goBackwards=!0!==t.goBackwards;const i={};var r;if(i.className=e.layer.getClassName(),i.config=t,this.backwardLayer=b7(i),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,r=this.mergeMode,X6(a8,"BidirectionalMergeMode",r),e.weights)throw new k6("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t,n,i,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(i=r.slice(1),t=r[0]):t=r[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(i).concat(i.slice()):[t].concat(i).concat(i.slice()):P6(n)}apply(e,t){let n=null==t?null:t.initialState,i=null==t?null:t.constants;null==t&&(t={});const r=Ote(e,n,i,this.numConstants);if(e=r.inputs,n=r.initialState,i=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==i)return super.apply(e,t);const s=[],o=[];if(null!=n){const e=n.length;if(e%2>0)throw new M6("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);const i=n.map(e=>new y9({shape:e.shape}));this.forwardLayer.stateSpec=i.slice(0,e/2),this.backwardLayer.stateSpec=i.slice(e/2),o.push(...i)}if(null!=i)throw new k6("Support for constants in Bidirectional layers is not implemented yet.");const a=s[0]instanceof v9;for(const e of s)if(e instanceof v9!==a)throw new M6("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(a){const n=[e].concat(s),i=this.inputSpec.concat(o),r=this.inputSpec;this.inputSpec=i;const a=super.apply(n,t);return this.inputSpec=r,a}return super.apply(e,t)}call(e,t){return(0,u3.tidy)(()=>{const n=t.initialState;let i,r,s,o;if(null==n)i=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const s=n.slice(0,n.length/2),o=n.slice(n.length/2);i=this.forwardLayer.call(e,Object.assign(t,{initialState:s})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:o}))}return this.returnState&&(Array.isArray(i)&&(s=i.slice(1).concat(r.slice(1))),i=i[0],r=r[0]),this.returnSequences&&(r=u3.reverse(r,1)),"concat"===this.mergeMode?o=M8([i,r]):"sum"===this.mergeMode?o=u3.add(i,r):"ave"===this.mergeMode?o=u3.mul(.5,u3.add(i,r)):"mul"===this.mergeMode?o=u3.mul(i,r):null==this.mergeMode&&(o=[i,r]),this.returnState?null==this.mergeMode?o.concat(s):[o].concat(s):o})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){p8(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),p8(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map(e=>null);return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=b7(t.layer);if(delete t.layer,null!=t.numConstants)throw new k6("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const i=t;return i.layer=n,new e(i)}}Pne.className="Bidirectional",u3.serialization.registerClass(Pne); +class $ne extends S9{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const i=w7(t.layer,n);delete t.layer;const r={layer:i};return Object.assign(r,t),new e(r)}}class Une extends $ne{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=g9(e)).length<3)throw new D6(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=g9(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),i=e[1];return[n[0],i].concat(n.slice(1))}call(e,t){return(0,p3.tidy)(()=>Dte((e,n)=>[m9(this.layer.call(e,t)),[]],e=m9(e),[],!1,null,null,!1,!0)[1])}}Une.className="TimeDistributed",p3.serialization.registerClass(Une);class Vne extends $ne{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=w7(n),t.goBackwards=!0!==t.goBackwards;const i={};var r;if(i.className=e.layer.getClassName(),i.config=t,this.backwardLayer=w7(i),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,r=this.mergeMode,Q6(d8,"BidirectionalMergeMode",r),e.weights)throw new F6("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t,n,i,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(i=r.slice(1),t=r[0]):t=r[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(i).concat(i.slice()):[t].concat(i).concat(i.slice()):V6(n)}apply(e,t){let n=null==t?null:t.initialState,i=null==t?null:t.constants;null==t&&(t={});const r=Nte(e,n,i,this.numConstants);if(e=r.inputs,n=r.initialState,i=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==i)return super.apply(e,t);const s=[],o=[];if(null!=n){const e=n.length;if(e%2>0)throw new D6("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);const i=n.map(e=>new x9({shape:e.shape}));this.forwardLayer.stateSpec=i.slice(0,e/2),this.backwardLayer.stateSpec=i.slice(e/2),o.push(...i)}if(null!=i)throw new F6("Support for constants in Bidirectional layers is not implemented yet.");const a=s[0]instanceof E9;for(const e of s)if(e instanceof E9!==a)throw new D6("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(a){const n=[e].concat(s),i=this.inputSpec.concat(o),r=this.inputSpec;this.inputSpec=i;const a=super.apply(n,t);return this.inputSpec=r,a}return super.apply(e,t)}call(e,t){return(0,p3.tidy)(()=>{const n=t.initialState;let i,r,s,o;if(null==n)i=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const s=n.slice(0,n.length/2),o=n.slice(n.length/2);i=this.forwardLayer.call(e,Object.assign(t,{initialState:s})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:o}))}return this.returnState&&(Array.isArray(i)&&(s=i.slice(1).concat(r.slice(1))),i=i[0],r=r[0]),this.returnSequences&&(r=p3.reverse(r,1)),"concat"===this.mergeMode?o=D8([i,r]):"sum"===this.mergeMode?o=p3.add(i,r):"ave"===this.mergeMode?o=p3.mul(.5,p3.add(i,r)):"mul"===this.mergeMode?o=p3.mul(i,r):null==this.mergeMode&&(o=[i,r]),this.returnState?null==this.mergeMode?o.concat(s):[o].concat(s):o})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){_8(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),_8(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map(e=>null);return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=w7(t.layer);if(delete t.layer,null!=t.numConstants)throw new F6("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const i=t;return i.layer=n,new e(i)}}Vne.className="Bidirectional",p3.serialization.registerClass(Vne); /** * @license * Copyright 2022 CodeSmith LLC @@ -11472,7 +11472,7 @@ class Fne extends E9{constructor(e){super(e),this.layer=e.layer}build(e){this.bu * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Bne extends E9{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return(0,u3.tidy)(()=>("float32"!==(e=d9(e)).dtype&&(e=I8(e,"float32")),(0,u3.add)((0,u3.mul)(e,this.scale),this.offset)))}}Bne.className="Rescaling",u3.serialization.registerClass(Bne); +class zne extends S9{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return(0,p3.tidy)(()=>("float32"!==(e=m9(e)).dtype&&(e=O8(e,"float32")),(0,p3.add)((0,p3.mul)(e,this.scale),this.offset)))}}zne.className="Rescaling",p3.serialization.registerClass(zne); /** * @license * Copyright 2022 CodeSmith LLC @@ -11482,7 +11482,7 @@ class Bne extends E9{constructor(e){super(e),this.scale=e.scale,e.offset?this.of * https://opensource.org/licenses/MIT. * ============================================================================= */ -const{resizeBilinear:$ne,cropAndResize:Une}=u3.image;class Vne extends E9{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,i,r,s,o,a){return(0,u3.tidy)(()=>{let l,u=!1;const c=[t/s,n/o,(i+t)/s,(r+n)/o],d=[];3===e.rank?(u=!0,l=(0,u3.stack)([e])):l=e;for(let e=0;eI8($ne(e,[t,n]),i))}call(e,t){return(0,u3.tidy)(()=>{const t=d9(e),n=t.dtype,i=t.shape,r=i[i.length-3],s=i[i.length-2];let o=0;r!==this.height&&(o=Math.floor((r-this.height)/2));let a=0;return s!==this.width&&(a=Math.floor((s-this.width)/2),0===a&&(a=1)),o>=0&&a>=0?this.centerCrop(t,o,a,this.height,this.width,r,s,n):this.upsize(e,this.height,this.width,n)})}getConfig(){const e={height:this.height,width:this.width},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=h9(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}Vne.className="CenterCrop",u3.serialization.registerClass(Vne); +const{resizeBilinear:jne,cropAndResize:Yne}=p3.image;class Gne extends S9{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,i,r,s,o,a){return(0,p3.tidy)(()=>{let l,u=!1;const c=[t/s,n/o,(i+t)/s,(r+n)/o],d=[];3===e.rank?(u=!0,l=(0,p3.stack)([e])):l=e;for(let e=0;eO8(jne(e,[t,n]),i))}call(e,t){return(0,p3.tidy)(()=>{const t=m9(e),n=t.dtype,i=t.shape,r=i[i.length-3],s=i[i.length-2];let o=0;r!==this.height&&(o=Math.floor((r-this.height)/2));let a=0;return s!==this.width&&(a=Math.floor((s-this.width)/2),0===a&&(a=1)),o>=0&&a>=0?this.centerCrop(t,o,a,this.height,this.width,r,s,n):this.upsize(e,this.height,this.width,n)})}getConfig(){const e={height:this.height,width:this.width},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=g9(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}Gne.className="CenterCrop",p3.serialization.registerClass(Gne); /** * @license * Copyright 2022 CodeSmith LLC @@ -11492,7 +11492,7 @@ const{resizeBilinear:$ne,cropAndResize:Une}=u3.image;class Vne extends E9{constr * https://opensource.org/licenses/MIT. * ============================================================================= */ -class zne extends E9{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){return null==(e=h9(e))?[this.numTokens]:"oneHot"===this.outputMode&&1!==e[e.length-1]?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,t){return(0,u3.tidy)(()=>{let n;if("int32"!==(e=d9(e)).dtype&&(e=I8(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new M6(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=d9(t.countWeights)}const i=(0,u3.max)(e),r=(0,u3.min)(e),s=(0,u3.greater)(this.numTokens,i).bufferSync().get(0),o=(0,u3.greaterEqual)(r,0).bufferSync().get(0);if(!s||!o)throw new M6(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`); +class Hne extends S9{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){return null==(e=g9(e))?[this.numTokens]:"oneHot"===this.outputMode&&1!==e[e.length-1]?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,t){return(0,p3.tidy)(()=>{let n;if("int32"!==(e=m9(e)).dtype&&(e=O8(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new D6(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=m9(t.countWeights)}const i=(0,p3.max)(e),r=(0,p3.min)(e),s=(0,p3.greater)(this.numTokens,i).bufferSync().get(0),o=(0,p3.greaterEqual)(r,0).bufferSync().get(0);if(!s||!o)throw new D6(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`); /** * @license * Copyright 2022 CodeSmith LLC @@ -11502,7 +11502,7 @@ class zne extends E9{constructor(e){super(e),this.numTokens=e.numTokens,e.output * https://opensource.org/licenses/MIT. * ============================================================================= */ -return function(e,t,n,i){let r=d9(e);if("int32"!==r.dtype&&(r=I8(r,"int32")),"int"===t)return r;const s=r.shape;if(0===r.rank&&(r=(0,u3.expandDims)(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=(0,u3.expandDims)(r,-1)),r.rank>2)throw new M6(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${s} which would result in output rank ${r.rank}.`);const o=["multiHot","oneHot"].includes(t),a=r;let l;if(l=void 0!==i&&"count"===t?(0,u3.denseBincount)(a,i,n,o):(0,u3.denseBincount)(a,[],n,o),"tfIdf"!==t)return l;if(i)return(0,u3.mul)(l,i);throw new M6("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)})}}zne.className="CategoryEncoding",u3.serialization.registerClass(zne); +return function(e,t,n,i){let r=m9(e);if("int32"!==r.dtype&&(r=O8(r,"int32")),"int"===t)return r;const s=r.shape;if(0===r.rank&&(r=(0,p3.expandDims)(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=(0,p3.expandDims)(r,-1)),r.rank>2)throw new D6(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${s} which would result in output rank ${r.rank}.`);const o=["multiHot","oneHot"].includes(t),a=r;let l;if(l=void 0!==i&&"count"===t?(0,p3.denseBincount)(a,i,n,o):(0,p3.denseBincount)(a,[],n,o),"tfIdf"!==t)return l;if(i)return(0,p3.mul)(l,i);throw new D6("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)})}}Hne.className="CategoryEncoding",p3.serialization.registerClass(Hne); /** * @license * Copyright 2022 CodeSmith LLC @@ -11512,7 +11512,7 @@ return function(e,t,n,i){let r=d9(e);if("int32"!==r.dtype&&(r=I8(r,"int32")),"in * https://opensource.org/licenses/MIT. * ============================================================================= */ -const jne=new Set(["bilinear","nearest"]);class Yne extends E9{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!jne.has(e.interpolation))throw new M6(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);this.interpolation=e.interpolation}else this.interpolation="bilinear";this.cropToAspectRatio=Boolean(e.cropToAspectRatio)}computeOutputShape(e){const t=(e=h9(e))[2];return[this.height,this.width,t]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return(0,u3.tidy)(()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return u3.image.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return u3.image.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...jne]} are supported`)})}}Yne.className="Resizing",u3.serialization.registerClass(Yne); +const Wne=new Set(["bilinear","nearest"]);class Xne extends S9{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!Wne.has(e.interpolation))throw new D6(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);this.interpolation=e.interpolation}else this.interpolation="bilinear";this.cropToAspectRatio=Boolean(e.cropToAspectRatio)}computeOutputShape(e){const t=(e=g9(e))[2];return[this.height,this.width,t]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return(0,p3.tidy)(()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return p3.image.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return p3.image.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...Wne]} are supported`)})}}Xne.className="Resizing",p3.serialization.registerClass(Xne); /** * @license * Copyright 2023 CodeSmith LLC @@ -11522,7 +11522,7 @@ const jne=new Set(["bilinear","nearest"]);class Yne extends E9{constructor(e){if * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Gne{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}Gne.className="RandomSeed"; +class qne{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}qne.className="RandomSeed"; /** * @license * Copyright 2023 CodeSmith LLC @@ -11532,7 +11532,7 @@ class Gne{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.se * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Hne extends E9{constructor(e){super(e),this.randomGenerator=new Gne(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}Hne.className="BaseRandomLayer"; +class Kne extends S9{constructor(e){super(e),this.randomGenerator=new qne(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}Kne.className="BaseRandomLayer"; /** * @license * Copyright 2023 CodeSmith LLC @@ -11542,7 +11542,7 @@ class Hne extends E9{constructor(e){super(e),this.randomGenerator=new Gne(e.seed * https://opensource.org/licenses/MIT. * ============================================================================= */ -const Wne=new Set(["bilinear","nearest"]);class Xne extends Hne{constructor(e){super(e);const{factor:t,interpolation:n="bilinear"}=e;if(this.factor=t,Array.isArray(this.factor)&&2===this.factor.length)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else{if(Array.isArray(this.factor)||!(this.factor>0))throw new M6(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);this.widthLower=-this.factor,this.widthUpper=this.factor}if(this.widthLower<-1||this.widthUpper<-1)throw new M6(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=d9(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=(0,u3.randomUniform)([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let i=this.widthFactor.dataSync()[0]*n;i=Math.round(i);const r=[this.imgHeight,i];switch(this.interpolation){case"bilinear":return u3.image.resizeBilinear(e,r);case"nearest":return u3.image.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...Wne]} are supported`)}})}} +const Zne=new Set(["bilinear","nearest"]);class Qne extends Kne{constructor(e){super(e);const{factor:t,interpolation:n="bilinear"}=e;if(this.factor=t,Array.isArray(this.factor)&&2===this.factor.length)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else{if(Array.isArray(this.factor)||!(this.factor>0))throw new D6(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);this.widthLower=-this.factor,this.widthUpper=this.factor}if(this.widthLower<-1||this.widthUpper<-1)throw new D6(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=m9(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=(0,p3.randomUniform)([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let i=this.widthFactor.dataSync()[0]*n;i=Math.round(i);const r=[this.imgHeight,i];switch(this.interpolation){case"bilinear":return p3.image.resizeBilinear(e,r);case"nearest":return p3.image.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...Zne]} are supported`)}})}} /** * @license * Copyright 2018 Google LLC @@ -11552,7 +11552,7 @@ const Wne=new Set(["bilinear","nearest"]);class Xne extends Hne{constructor(e){s * https://opensource.org/licenses/MIT. * ============================================================================= */ -function qne(e){return new I9(e)}function Kne(e){return new ote(e)}function Zne(e){return new ite(e)}function Qne(e){return new rte(e)}function Jne(e){return new ste(e)}function eie(e){return new lte(e)}function tie(e){return new ate(e)}function nie(e){return new Ite(e)}function iie(e){return new vte(e)}function rie(e){return new Tte(e)}function sie(e){return new bte(e)}function oie(e){return new xte(e)}function aie(e){return new wte(e)}function lie(e){return new Ate(e)}function uie(e){return new Ste(e)}function cie(e){return new Cte(e)}function die(e){return new qte(e)}function hie(e){return new Wte(e)}function pie(e){return new Gte(e)}function fie(e){return new Hte(e)}function mie(e){return new Xte(e)}function gie(e){return new Kte(e)}function _ie(e){return new Zte(e)}function yie(e){return new Qte(e)}function vie(e){return new ene(e)}function bie(e){return new nne(e)}function Tie(e){return new rne(e)}function xie(e){return new ane(e)}function Eie(e){return new sne(e)}function wie(e){return new one(e)}function Iie(e){return new ine(e)}function Aie(e){return new une(e)}function Sie(e){return new mne(e)}function Cie(e){return new gne(e)}function Oie(e){return new _ne(e)}function Mie(e){return new xne(e)}function kie(e){return Mie(e)}function Rie(e){return Mie(e)}function Nie(e){return new Ine(e)}function Die(e){return Nie(e)}function Fie(e){return Nie(e)}function Lie(e){return new Cne(e)}function Pie(e){return Lie(e)}function Bie(e){return Lie(e)}function $ie(e){return new Mne(e)}function Uie(e){return new Nne(e)}function Vie(e){return new kne(e)}function zie(e){return new Dne(e)}function jie(e){return new Tne(e)}function Yie(e){return new wne(e)}function Gie(e){return new Sne(e)}function Hie(e){return new Lte(e)}function Wie(e){return new Fte(e)}function Xie(e){return new Bte(e)}function qie(e){return new Pte(e)}function Kie(e){return new Dte(e)}function Zie(e){return new Nte(e)}function Qie(e){return new Yte(e)}function Jie(e){return new jte(e)}function ere(e){return new kte(e)}function tre(e){return new $te(e)}function nre(e){return new Pne(e)}function ire(e){return new Lne(e)}Xne.className="RandomWidth",u3.serialization.registerClass(Xne);const rre=Vie,sre=zie,ore=jie,are=Yie;function lre(e){return new cne(e)}function ure(e){return new dne(e)}function cre(e){return new hne(e)}function dre(e){return new Jte(e)}function hre(e){return new Bne(e)}function pre(e){return new Vne(e)}function fre(e){return new Yne(e)}function mre(e){return new zne(e)}function gre(e){return new Xne(e)}function _re(e,t){return N7(e,t)}function yre(e,t){return B7(e,t)}function vre(e,t){return $7(e,t)}function bre(e,t){return D7(e,t)}function Tre(e,t){return U7(e,t)}function xre(e,t){return L7(e,t)}function Ere(e,t){return P7(e,t)}function wre(e,t){return M7(e,t)}function Ire(e,t){return E7(e,t)}function Are(e,t){return w7(e,t)}function Sre(e,t){return w7(e,t)}function Cre(e,t){return w7(e,t)}function Ore(e,t){return x7(e,t)}function Mre(e,t){return x7(e,t)}function kre(e,t){return x7(e,t)}function Rre(e,t){return function(e,t){return(0,u3.tidy)(()=>{const n=e.sub(t).square().sum(),i=e.sub(e.mean()).square().sum();return u3.scalar(1).sub(n.div(i))})}(e,t)} +function Jne(e){return new O9(e)}function eie(e){return new cte(e)}function tie(e){return new ate(e)}function nie(e){return new lte(e)}function iie(e){return new ute(e)}function rie(e){return new hte(e)}function sie(e){return new dte(e)}function oie(e){return new Ote(e)}function aie(e){return new Ete(e)}function lie(e){return new Ite(e)}function uie(e){return new wte(e)}function cie(e){return new Ate(e)}function die(e){return new Cte(e)}function hie(e){return new Mte(e)}function pie(e){return new kte(e)}function fie(e){return new Rte(e)}function mie(e){return new Jte(e)}function gie(e){return new Zte(e)}function _ie(e){return new qte(e)}function yie(e){return new Kte(e)}function vie(e){return new Qte(e)}function bie(e){return new ene(e)}function Tie(e){return new tne(e)}function xie(e){return new nne(e)}function Eie(e){return new rne(e)}function wie(e){return new one(e)}function Iie(e){return new lne(e)}function Aie(e){return new dne(e)}function Sie(e){return new une(e)}function Cie(e){return new cne(e)}function Oie(e){return new ane(e)}function Mie(e){return new pne(e)}function kie(e){return new vne(e)}function Rie(e){return new bne(e)}function Nie(e){return new Tne(e)}function Die(e){return new Ane(e)}function Fie(e){return Die(e)}function Lie(e){return Die(e)}function Pie(e){return new One(e)}function Bie(e){return Pie(e)}function $ie(e){return Pie(e)}function Uie(e){return new Rne(e)}function Vie(e){return Uie(e)}function zie(e){return Uie(e)}function jie(e){return new Dne(e)}function Yie(e){return new Pne(e)}function Gie(e){return new Fne(e)}function Hie(e){return new Bne(e)}function Wie(e){return new Ine(e)}function Xie(e){return new Cne(e)}function qie(e){return new kne(e)}function Kie(e){return new Ute(e)}function Zie(e){return new $te(e)}function Qie(e){return new zte(e)}function Jie(e){return new Vte(e)}function ere(e){return new Bte(e)}function tre(e){return new Pte(e)}function nre(e){return new Xte(e)}function ire(e){return new Wte(e)}function rre(e){return new Fte(e)}function sre(e){return new jte(e)}function ore(e){return new Vne(e)}function are(e){return new Une(e)}Qne.className="RandomWidth",p3.serialization.registerClass(Qne);const lre=Gie,ure=Hie,cre=Wie,dre=Xie;function hre(e){return new fne(e)}function pre(e){return new mne(e)}function fre(e){return new gne(e)}function mre(e){return new ine(e)}function gre(e){return new zne(e)}function _re(e){return new Gne(e)}function yre(e){return new Xne(e)}function vre(e){return new Hne(e)}function bre(e){return new Qne(e)}function Tre(e,t){return P7(e,t)}function xre(e,t){return z7(e,t)}function Ere(e,t){return j7(e,t)}function wre(e,t){return B7(e,t)}function Ire(e,t){return Y7(e,t)}function Are(e,t){return U7(e,t)}function Sre(e,t){return V7(e,t)}function Cre(e,t){return D7(e,t)}function Ore(e,t){return S7(e,t)}function Mre(e,t){return C7(e,t)}function kre(e,t){return C7(e,t)}function Rre(e,t){return C7(e,t)}function Nre(e,t){return A7(e,t)}function Dre(e,t){return A7(e,t)}function Fre(e,t){return A7(e,t)}function Lre(e,t){return function(e,t){return(0,p3.tidy)(()=>{const n=e.sub(t).square().sum(),i=e.sub(e.mean()).square().sum();return p3.scalar(1).sub(n.div(i))})}(e,t)} /** * @license * Copyright 2018 Google LLC @@ -11562,7 +11562,7 @@ function qne(e){return new I9(e)}function Kne(e){return new ote(e)}function Zne( * https://opensource.org/licenses/MIT. * ============================================================================= */ -function Nre(e){return new Qee(e)}function Dre(e){return Kee(t=e),new Qee({l1:null!=t?t.l1:null,l2:0});var t}function Fre(e){return Kee(t=e),new Qee({l2:null!=t?t.l2:null,l1:0});var t} +function Pre(e){return new nte(e)}function Bre(e){return ete(t=e),new nte({l1:null!=t?t.l1:null,l2:0});var t}function $re(e){return ete(t=e),new nte({l2:null!=t?t.l2:null,l1:0});var t} /** * @license * Copyright 2018 Google LLC @@ -11572,7 +11572,7 @@ function Nre(e){return new Qee(e)}function Dre(e){return Kee(t=e),new Qee({l1:nu * https://opensource.org/licenses/MIT. * ============================================================================= */ -class Lre extends h7{constructor(){super(...arguments),this.model=null}setModel(e){if(!(e instanceof Tee))throw new Error("model must be a LayersModel, not some other Container");this.model=e}}function Pre(e,t){return et}class $re extends Lre{constructor(e){if(super(),null==e&&(e={}),e.restoreBestWeights)throw new k6("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,-1===["auto","min","max"].indexOf(this.mode)&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),"min"===this.mode?this.monitorFunc=Pre:"max"===this.mode||-1!==this.monitor.indexOf("acc")?this.monitorFunc=Bre:this.monitorFunc=Pre,this.monitorFunc===Pre&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Pre?1/0:-1/0}async onEpochEnd(e,t){await u7(t);const n=this.getMonitorValue(t);null!=n&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){null==e&&(e={});const t=e[this.monitor];return null==t&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}}const Ure={earlyStopping:function(e){return new $re(e)}}; +class Ure extends g7{constructor(){super(...arguments),this.model=null}setModel(e){if(!(e instanceof Iee))throw new Error("model must be a LayersModel, not some other Container");this.model=e}}function Vre(e,t){return et}class jre extends Ure{constructor(e){if(super(),null==e&&(e={}),e.restoreBestWeights)throw new F6("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,-1===["auto","min","max"].indexOf(this.mode)&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),"min"===this.mode?this.monitorFunc=Vre:"max"===this.mode||-1!==this.monitor.indexOf("acc")?this.monitorFunc=zre:this.monitorFunc=Vre,this.monitorFunc===Vre&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Vre?1/0:-1/0}async onEpochEnd(e,t){await p7(t);const n=this.getMonitorValue(t);null!=n&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){null==e&&(e={});const t=e[this.monitor];return null==t&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}}const Yre={earlyStopping:function(e){return new jre(e)}}; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -11590,7 +11590,7 @@ class Lre extends h7{constructor(){super(...arguments),this.model=null}setModel( * * ============================================================================= */ -var Vre,zre;(0,u3.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")}),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(Vre||(Vre={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(zre||(zre={})); +var Gre,Hre;(0,p3.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")}),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(Gre||(Gre={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(Hre||(Hre={})); /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -11607,7 +11607,7 @@ var Vre,zre;(0,u3.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,e=>{e&& * limitations under the License. * ============================================================================= */ -const jre={};function Yre(e,t){const n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};jre[e]=n}function Gre(e){return jre[e]}function Hre(e){delete jre[e]} +const Wre={};function Xre(e,t){const n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};Wre[e]=n}function qre(e){return Wre[e]}function Kre(e){delete Wre[e]} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11624,7 +11624,7 @@ const jre={};function Yre(e,t){const n={tfOpName:e,category:"custom",inputs:[],a * limitations under the License. * ============================================================================= */ -function Wre(e,t,n,i,r){const s=t.inputParams[e];if(s&&void 0!==s.inputIndexStart){const e=s.inputIndexStart,o=0===s.inputIndexEnd?void 0:void 0===s.inputIndexEnd?e+1:s.inputIndexEnd,a=e<0?t.inputNames.length+e:e;if("tensor"===s.type)return Xre(t.inputNames[a],n,i,r);if("tensors"===s.type){const s=t.inputs.slice(e,o),a=t.inputNames.slice(e,o).filter((e,t)=>{var n;return"NoOp"!==(null===(n=s[t])||void 0===n?void 0:n.op)});return a.map(e=>Xre(e,n,i,r))}const l=Xre(t.inputNames[a],n,i,r),u=l.dataSync();return"number"===s.type?u[0]:u3.util.toNestedArray(l.shape,u)}const o=t.attrParams[e];return o&&o.value}function Xre(e,t,n,i){const[r,s]=Qre(e,n);if(null!=i){const e=i.getHashTableHandleByName(r);if(null!=e)return e}const o=n.currentContextIds.find(e=>!!t[Zre(r,e)]);return void 0!==o?t[Zre(r,o)][s]:void 0}function qre(e,t,n){return t[Zre(e,n.currentContextId)]}function Kre(e,t){const[n,i,r]=Qre(e,t);return[Zre(n,t&&t.currentContextId),i,r]}function Zre(e,t){return t?`${e}-${t}`:e}function Qre(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const i=e.split(":");let r;if(1===i.length)r=[e,0,void 0];else{const e=i[0],t=3===i.length?i[1]:void 0;r=[e,Number(i[i.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function Jre(e,t,n){let i=Wre("pad",e,t,n);if("explicit"===i){i=Wre("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=i[2*e],r[e][1]=i[2*e+1];return r}return i}function ese(e){return e.kept?e:(0,u3.clone)(e)} +function Zre(e,t,n,i,r){const s=t.inputParams[e];if(s&&void 0!==s.inputIndexStart){const e=s.inputIndexStart,o=0===s.inputIndexEnd?void 0:void 0===s.inputIndexEnd?e+1:s.inputIndexEnd,a=e<0?t.inputNames.length+e:e;if("tensor"===s.type)return Qre(t.inputNames[a],n,i,r);if("tensors"===s.type){const s=t.inputs.slice(e,o),a=t.inputNames.slice(e,o).filter((e,t)=>{var n;return"NoOp"!==(null===(n=s[t])||void 0===n?void 0:n.op)});return a.map(e=>Qre(e,n,i,r))}const l=Qre(t.inputNames[a],n,i,r),u=l.dataSync();return"number"===s.type?u[0]:p3.util.toNestedArray(l.shape,u)}const o=t.attrParams[e];return o&&o.value}function Qre(e,t,n,i){const[r,s]=nse(e,n);if(null!=i){const e=i.getHashTableHandleByName(r);if(null!=e)return e}const o=n.currentContextIds.find(e=>!!t[tse(r,e)]);return void 0!==o?t[tse(r,o)][s]:void 0}function Jre(e,t,n){return t[tse(e,n.currentContextId)]}function ese(e,t){const[n,i,r]=nse(e,t);return[tse(n,t&&t.currentContextId),i,r]}function tse(e,t){return t?`${e}-${t}`:e}function nse(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const i=e.split(":");let r;if(1===i.length)r=[e,0,void 0];else{const e=i[0],t=3===i.length?i[1]:void 0;r=[e,Number(i[i.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function ise(e,t,n){let i=Zre("pad",e,t,n);if("explicit"===i){i=Zre("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=i[2*e],r[e][1]=i[2*e+1];return r}return i}function rse(e){return e.kept?e:(0,p3.clone)(e)} /** * @license * Copyright 2023 Google LLC. All Rights Reserved. @@ -11641,7 +11641,7 @@ function Wre(e,t,n,i,r){const s=t.inputParams[e];if(s&&void 0!==s.inputIndexStar * limitations under the License. * ============================================================================= */ -const tse=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],nse=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],ise=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],rse=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],sse=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],ose=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],ase=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],lse=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],use=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],cse=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],dse=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],hse=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],pse=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],fse=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],mse=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],gse=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],_se=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],yse=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],vse=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]; +const sse=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],ose=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],ase=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],lse=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],use=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],cse=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],dse=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],hse=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],pse=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],fse=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],mse=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],gse=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],_se=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],yse=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],vse=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],bse=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],Tse=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],xse=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],Ese=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11658,7 +11658,7 @@ const tse=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type: * limitations under the License. * ============================================================================= */ -class bse{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[ge,_e,ye,ve,be,Te,xe,Ee,we,Ie,Ae,Se,Ce,Oe,Me,ke,Re,Ne,De].map(e=>e.json));this.opMappers=e.reduce((e,t)=>(e[t.tfOpName]=t,e),{})}transformGraph(e,t={}){const n=e.node,i=[],r=[],s=[],o=n.reduce((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?i.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||s.push(e[t.name]),e),{});let a=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const d=Object.keys(o);d.forEach(e=>{const t=o[e];t.inputNames.forEach((e,n)=>{const[i,,r]=Kre(e),s=o[i];if(null!=s.outputs){const e=s.outputs.indexOf(r);if(-1!==e){const r=`${i}:${e}`;t.inputNames[n]=r}}t.inputs.push(s),s.children.push(t)})}),0===Object.keys(c).length?d.forEach(e=>{const t=o[e];0===t.children.length&&l.push(t)}):Object.keys(c).forEach(e=>{const[t]=Kre(e),n=o[t];null!=n&&(n.signatureKey=c[e],l.push(n))}),Object.keys(u).length>0?Object.keys(u).forEach(e=>{const[t]=Kre(e),n=o[t];n&&(n.signatureKey=u[e],a.push(n))}):a=i;let h={};null!=e.library&&null!=e.library.function&&(h=e.library.function.reduce((e,t)=>(e[t.signature.name]=this.mapFunction(t),e),{}));const p={nodes:o,inputs:a,outputs:l,weights:r,placeholders:i,signature:t,functions:h};return s.length>0&&(p.initNodes=s),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){const t=Gre(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(e=>e.startsWith("^")?e.slice(1):e),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce((t,n)=>{const i=n.type;let r;switch(n.type){case"string":r=xse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=xse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=Rse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Rse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=wse(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=wse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=kse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=kse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=Ese(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ese(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=Dse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Dse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=Mse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Mse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=Nse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Nse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=Sse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Sse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=Cse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Cse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=Ase(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ase(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:r,type:i},t},{})),n}mapFunction(e){const t=e.nodeDef,n=[];let i={};null!=t&&(i=t.reduce((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e),{}));const r=[],s=[];e.signature.inputArg.forEach(e=>{const[t]=Kre(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:Ise(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),i[t]=n});Object.keys(i).forEach(e=>{const t=i[e];t.inputNames.forEach((e,n)=>{const[r,,s]=Kre(e),o=i[r];if(null!=o.outputs){const e=o.outputs.indexOf(s);if(-1!==e){const i=`${r}:${e}`;t.inputNames[n]=i}}t.inputs.push(o),o.children.push(t)})});const o=e.ret;e.signature.outputArg.forEach(e=>{const[t,n]=Kre(o[e.name]),r=i[t];null!=r&&(r.defaultOutput=n,s.push(r))});const a=this.mapArgsToSignature(e);return{nodes:i,inputs:r,outputs:s,weights:n,placeholders:[],signature:a}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function Tse(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=(0,u3.env)().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function xse(e,t,n,i=!1){const r=e[t];return null!=r?Tse(r.s,i):n}function Ese(e,t,n){const i=e[t];return i?i.b:n}function wse(e,t,n){const i=e[t]||{},r=null!=i.i?i.i:null!=i.f?i.f:n;return"number"==typeof r?r:parseInt(r,10)}function Ise(e){switch("string"==typeof e&&(e=Vre[e]),e){case Vre.DT_FLOAT:case Vre.DT_HALF:return"float32";case Vre.DT_INT32:case Vre.DT_INT64:case Vre.DT_INT8:case Vre.DT_UINT8:return"int32";case Vre.DT_BOOL:return"bool";case Vre.DT_DOUBLE:return"float32";case Vre.DT_STRING:return"string";case Vre.DT_COMPLEX64:case Vre.DT_COMPLEX128:return"complex64";default:return null}}function Ase(e,t,n){const i=e[t];return i&&i.func?i.func.name:n}function Sse(e,t,n){const i=e[t];return i&&i.type?Ise(i.type):n}function Cse(e,t,n){const i=e[t];return i&&i.list&&i.list.type?i.list.type.map(e=>Ise(e)):n}function Ose(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(e=>"number"==typeof e.size?e.size:parseInt(e.size,10)):[]}function Mse(e,t,n){const i=e[t];return i&&i.shape?Ose(i.shape):n}function kse(e,t,n){const i=e[t];return i?((i.list.f&&i.list.f.length?i.list.f:i.list.i)||[]).map(e=>"number"==typeof e?e:parseInt(e,10)):n}function Rse(e,t,n,i=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map(e=>Tse(e,i)):n}function Nse(e,t,n){const i=e[t];return i&&i.list&&i.list.shape?i.list.shape.map(e=>Ose(e)):n}function Dse(e,t,n){const i=e[t];return i&&i.list&&i.list.b?i.list.b:n} +class wse{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[ge,_e,ye,ve,be,Te,xe,Ee,we,Ie,Ae,Se,Ce,Oe,Me,ke,Re,Ne,De].map(e=>e.json));this.opMappers=e.reduce((e,t)=>(e[t.tfOpName]=t,e),{})}transformGraph(e,t={}){const n=e.node,i=[],r=[],s=[],o=n.reduce((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?i.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||s.push(e[t.name]),e),{});let a=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const d=Object.keys(o);d.forEach(e=>{const t=o[e];t.inputNames.forEach((e,n)=>{const[i,,r]=ese(e),s=o[i];if(null!=s.outputs){const e=s.outputs.indexOf(r);if(-1!==e){const r=`${i}:${e}`;t.inputNames[n]=r}}t.inputs.push(s),s.children.push(t)})}),0===Object.keys(c).length?d.forEach(e=>{const t=o[e];0===t.children.length&&l.push(t)}):Object.keys(c).forEach(e=>{const[t]=ese(e),n=o[t];null!=n&&(n.signatureKey=c[e],l.push(n))}),Object.keys(u).length>0?Object.keys(u).forEach(e=>{const[t]=ese(e),n=o[t];n&&(n.signatureKey=u[e],a.push(n))}):a=i;let h={};null!=e.library&&null!=e.library.function&&(h=e.library.function.reduce((e,t)=>(e[t.signature.name]=this.mapFunction(t),e),{}));const p={nodes:o,inputs:a,outputs:l,weights:r,placeholders:i,signature:t,functions:h};return s.length>0&&(p.initNodes=s),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){const t=qre(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(e=>e.startsWith("^")?e.slice(1):e),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce((t,n)=>{const i=n.type;let r;switch(n.type){case"string":r=Ase(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ase(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=Lse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Lse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=Cse(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=Cse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=Fse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Fse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=Sse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Sse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=Bse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Bse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=Dse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Dse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=Pse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Pse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=kse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=kse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=Rse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Rse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=Mse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Mse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:r,type:i},t},{})),n}mapFunction(e){const t=e.nodeDef,n=[];let i={};null!=t&&(i=t.reduce((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e),{}));const r=[],s=[];e.signature.inputArg.forEach(e=>{const[t]=ese(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:Ose(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),i[t]=n});Object.keys(i).forEach(e=>{const t=i[e];t.inputNames.forEach((e,n)=>{const[r,,s]=ese(e),o=i[r];if(null!=o.outputs){const e=o.outputs.indexOf(s);if(-1!==e){const i=`${r}:${e}`;t.inputNames[n]=i}}t.inputs.push(o),o.children.push(t)})});const o=e.ret;e.signature.outputArg.forEach(e=>{const[t,n]=ese(o[e.name]),r=i[t];null!=r&&(r.defaultOutput=n,s.push(r))});const a=this.mapArgsToSignature(e);return{nodes:i,inputs:r,outputs:s,weights:n,placeholders:[],signature:a}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function Ise(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=(0,p3.env)().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function Ase(e,t,n,i=!1){const r=e[t];return null!=r?Ise(r.s,i):n}function Sse(e,t,n){const i=e[t];return i?i.b:n}function Cse(e,t,n){const i=e[t]||{},r=null!=i.i?i.i:null!=i.f?i.f:n;return"number"==typeof r?r:parseInt(r,10)}function Ose(e){switch("string"==typeof e&&(e=Gre[e]),e){case Gre.DT_FLOAT:case Gre.DT_HALF:return"float32";case Gre.DT_INT32:case Gre.DT_INT64:case Gre.DT_INT8:case Gre.DT_UINT8:return"int32";case Gre.DT_BOOL:return"bool";case Gre.DT_DOUBLE:return"float32";case Gre.DT_STRING:return"string";case Gre.DT_COMPLEX64:case Gre.DT_COMPLEX128:return"complex64";default:return null}}function Mse(e,t,n){const i=e[t];return i&&i.func?i.func.name:n}function kse(e,t,n){const i=e[t];return i&&i.type?Ose(i.type):n}function Rse(e,t,n){const i=e[t];return i&&i.list&&i.list.type?i.list.type.map(e=>Ose(e)):n}function Nse(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(e=>"number"==typeof e.size?e.size:parseInt(e.size,10)):[]}function Dse(e,t,n){const i=e[t];return i&&i.shape?Nse(i.shape):n}function Fse(e,t,n){const i=e[t];return i?((i.list.f&&i.list.f.length?i.list.f:i.list.i)||[]).map(e=>"number"==typeof e?e:parseInt(e,10)):n}function Lse(e,t,n,i=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map(e=>Ise(e,i)):n}function Pse(e,t,n){const i=e[t];return i&&i.list&&i.list.shape?i.list.shape.map(e=>Nse(e)):n}function Bse(e,t,n){const i=e[t];return i&&i.list&&i.list.b?i.list.b:n} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -11675,7 +11675,7 @@ class bse{static get Instance(){return this._instance||(this._instance=new this) * limitations under the License. * ============================================================================= */ -class Fse{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(e=>this.getInput(e)),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce((e,t)=>(e[t]=this.getAttr(t),e),{}))}getInput(e){return Xre(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return Xre(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return wse(this.node.rawAttrs,e,t);if(null!=n.s)return xse(this.node.rawAttrs,e,t);if(null!=n.b)return Ese(this.node.rawAttrs,e,t);if(null!=n.shape)return Mse(this.node.rawAttrs,e,t);if(null!=n.type)return Sse(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return kse(this.node.rawAttrs,e,t);if(null!=n.list.s)return Rse(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Nse(this.node.rawAttrs,e,t);if(null!=n.list.b)return Dse(this.node.rawAttrs,e,t);if(null!=n.list.type)return Cse(this.node.rawAttrs,e,t)}return t}}var Lse=__webpack_require__(67270); +class $se{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(e=>this.getInput(e)),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce((e,t)=>(e[t]=this.getAttr(t),e),{}))}getInput(e){return Qre(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return Qre(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Cse(this.node.rawAttrs,e,t);if(null!=n.s)return Ase(this.node.rawAttrs,e,t);if(null!=n.b)return Sse(this.node.rawAttrs,e,t);if(null!=n.shape)return Dse(this.node.rawAttrs,e,t);if(null!=n.type)return kse(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Fse(this.node.rawAttrs,e,t);if(null!=n.list.s)return Lse(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Pse(this.node.rawAttrs,e,t);if(null!=n.list.b)return Bse(this.node.rawAttrs,e,t);if(null!=n.list.type)return Rse(this.node.rawAttrs,e,t)}return t}}var Use=__webpack_require__(67270); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -11692,7 +11692,7 @@ class Fse{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.in * limitations under the License. * ============================================================================= */ -function Pse(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){u3.util.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let i=0;in+` Shapes ${e} and ${t} must match`)}}}function Bse(e){return"number"!=typeof e&&!e.some(e=>e<0)}function $se(e,t,n){let i=Use(e,n);const r=!Bse(i);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${i}`);if(r&&t.forEach(e=>{i=Use(e.shape,i)}),!Bse(i))throw new Error(`Non-fully-defined elementShape: ${i}`);return i}function Use(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let i=0;i=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[i]=r>=0?r:s}return n} +function Vse(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){p3.util.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let i=0;in+` Shapes ${e} and ${t} must match`)}}}function zse(e){return"number"!=typeof e&&!e.some(e=>e<0)}function jse(e,t,n){let i=Yse(e,n);const r=!zse(i);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${i}`);if(r&&t.forEach(e=>{i=Yse(e.shape,i)}),!zse(i))throw new Error(`Non-fully-defined elementShape: ${i}`);return i}function Yse(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let i=0;i=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[i]=r>=0?r:s}return n} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11709,7 +11709,7 @@ function Pse(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){u3.util.assert * limitations under the License. * ============================================================================= */ -class Vse{constructor(e,t,n,i,r,s,o){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=i,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=o,this.tensors=[],this.closed_=!1,this.idTensor=(0,u3.scalar)(0),(0,u3.keep)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(e=>this.read(e))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),Pse(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,(0,u3.keep)(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((e,n)=>this.write(e,t[n]))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,(0,u3.unstack)(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const i=e.map(e=>(n+=e,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const r=0===n?0:t.size/n,s=[];(0,u3.tidy)(()=>{t=(0,u3.reshape)(t,[1,n,r]);for(let n=0;n{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(e=>this.read(e))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),Vse(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,(0,p3.keep)(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((e,n)=>this.write(e,t[n]))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,(0,p3.unstack)(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const i=e.map(e=>(n+=e,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const r=0===n?0:t.size/n,s=[];(0,p3.tidy)(()=>{t=(0,p3.reshape)(t,[1,n,r]);for(let n=0;n{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);Pse(t,e.shape,"TensorList shape mismatch: "),(0,u3.keep)(e)}),this.idTensor=(0,u3.scalar)(0),this.maxNumElements=i,(0,u3.keep)(this.idTensor)}copy(){return new zse([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&e.has(t.id)||t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);Pse(e,this.elementShape,"TensorList shape mismatch: ");const i=$se(this.elementShape,this.tensors,e);return(0,u3.tidy)(()=>{const e=this.tensors.map(e=>(0,u3.reshape)(e,i));return(0,u3.stack)(e,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=$se(this.elementShape,this.tensors,e),i=this.tensors.pop();return i.kept=!1,Pse(i.shape,e,"TensorList shape mismatch: "),(0,u3.reshape)(i,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Pse(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");(0,u3.keep)(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new zse([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);Pse(this.tensors[e].shape,t,"TensorList shape mismatch: ");const i=$se(this.elementShape,this.tensors,t);return(0,u3.reshape)(this.tensors[e],i)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);Pse(this.elementShape,t.shape,"TensorList shape mismatch: "),(0,u3.keep)(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);Pse(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const i=$se(this.elementShape,this.tensors,n);return 0===e.length?(0,u3.tensor)([],[0].concat(i)):(0,u3.tidy)(()=>{const t=e.map(e=>(0,u3.reshape)(this.tensors[e],i));return(0,u3.stack)(t,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Pse(this.elementShape,t,"TensorList shape mismatch: ");const n=$se(this.elementShape,this.tensors,t);return 0===this.size()?(0,u3.tensor)([],[0].concat(n)):(0,u3.tidy)(()=>{const e=this.tensors.map(e=>(0,u3.reshape)(e,n));return(0,u3.concat)(e,0)})}} +class Hse{get id(){return this.idTensor.id}constructor(e,t,n,i=-1){this.tensors=e,this.elementShape=t,this.elementDtype=n,null!=e&&e.forEach(e=>{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);Vse(t,e.shape,"TensorList shape mismatch: "),(0,p3.keep)(e)}),this.idTensor=(0,p3.scalar)(0),this.maxNumElements=i,(0,p3.keep)(this.idTensor)}copy(){return new Hse([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{null!=e&&e.has(t.id)||t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);Vse(e,this.elementShape,"TensorList shape mismatch: ");const i=jse(this.elementShape,this.tensors,e);return(0,p3.tidy)(()=>{const e=this.tensors.map(e=>(0,p3.reshape)(e,i));return(0,p3.stack)(e,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=jse(this.elementShape,this.tensors,e),i=this.tensors.pop();return i.kept=!1,Vse(i.shape,e,"TensorList shape mismatch: "),(0,p3.reshape)(i,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Vse(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");(0,p3.keep)(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new Hse([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);Vse(this.tensors[e].shape,t,"TensorList shape mismatch: ");const i=jse(this.elementShape,this.tensors,t);return(0,p3.reshape)(this.tensors[e],i)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);Vse(this.elementShape,t.shape,"TensorList shape mismatch: "),(0,p3.keep)(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);Vse(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const i=jse(this.elementShape,this.tensors,n);return 0===e.length?(0,p3.tensor)([],[0].concat(i)):(0,p3.tidy)(()=>{const t=e.map(e=>(0,p3.reshape)(this.tensors[e],i));return(0,p3.stack)(t,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Vse(this.elementShape,t,"TensorList shape mismatch: ");const n=jse(this.elementShape,this.tensors,t);return 0===this.size()?(0,p3.tensor)([],[0].concat(n)):(0,p3.tidy)(()=>{const e=this.tensors.map(e=>(0,p3.reshape)(e,n));return(0,p3.concat)(e,0)})}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11743,7 +11743,7 @@ class zse{get id(){return this.idTensor.id}constructor(e,t,n,i=-1){this.tensors= * limitations under the License. * ============================================================================= */ -const jse=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const i=Wre("thenBranch",e,t,n),r=Wre("elseBranch",e,t,n),s=Wre("cond",e,t,n),o=Wre("args",e,t,n);return(await s.data())[0]?n.functionMap[i].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const i=Wre("body",e,t,n),r=Wre("cond",e,t,n),s=Wre("args",e,t,n),o=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),a=s.map(e=>e.id);let l=await o[0].data();o.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||e.dispose()});let u=s;for(;l[0];){const e=u;u=await n.functionMap[i].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map(e=>e.id);e.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()});const s=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await s[0].data(),s.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})}return u}case"LoopCond":return[ese(Wre("pred",e,t,n))];case"Switch":{const i=Wre("pred",e,t,n);let r=Wre("data",e,t,n);return r.kept||(r=ese(r)),(await i.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const i=e.inputNames.find(e=>void 0!==Xre(e,t,n));if(i){return[ese(Xre(i,t,n))]}return}case"Enter":{const i=Wre("frameName",e,t,n),r=Wre("tensor",e,t,n);return n.enterFrame(i),[ese(r)]}case"Exit":{const i=Wre("tensor",e,t,n);return n.exitFrame(),[ese(i)]}case"NextIteration":{const i=Wre("tensor",e,t,n);return n.nextIteration(),[ese(i)]}case"TensorArrayV3":{const i=Wre("size",e,t,n),r=Wre("dtype",e,t,n),s=Wre("elementShape",e,t,n),o=Wre("dynamicSize",e,t,n),a=Wre("clearAfterRead",e,t,n),l=Wre("identicalElementShapes",e,t,n),u=Wre("name",e,t,n),c=new Vse(u,r,i,s,l,o,a);return n.addTensorArray(c),[c.idTensor,(0,u3.scalar)(1)]}case"TensorArrayWriteV3":{const i=Wre("tensorArrayId",e,t,n),r=Wre("index",e,t,n),s=Wre("tensor",e,t,n),o=n.getTensorArray(i.id);return o.write(r,s),[o.idTensor]}case"TensorArrayReadV3":{const i=Wre("tensorArrayId",e,t,n),r=Wre("index",e,t,n);return[n.getTensorArray(i.id).read(r)]}case"TensorArrayGatherV3":{const i=Wre("tensorArrayId",e,t,n),r=Wre("indices",e,t,n),s=Wre("dtype",e,t,n);return[n.getTensorArray(i.id).gather(r,s)]}case"TensorArrayScatterV3":{const i=Wre("tensorArrayId",e,t,n),r=Wre("indices",e,t,n),s=Wre("tensor",e,t,n),o=n.getTensorArray(i.id);return o.scatter(r,s),[o.idTensor]}case"TensorArrayConcatV3":{const i=Wre("tensorArrayId",e,t,n),r=n.getTensorArray(i.id),s=Wre("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{const i=Wre("tensorArrayId",e,t,n),r=Wre("tensor",e,t,n),s=Wre("lengths",e,t,n),o=n.getTensorArray(i.id);return o.split(s,r),[o.idTensor]}case"TensorArraySizeV3":{const i=Wre("tensorArrayId",e,t,n),r=n.getTensorArray(i.id);return[(0,u3.scalar)(r.size(),"int32")]}case"TensorArrayCloseV3":{const i=Wre("tensorArrayId",e,t,n),r=n.getTensorArray(i.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const i=Wre("tensorListId",e,t,n),r=Wre("index",e,t,n),s=Wre("tensor",e,t,n),o=n.getTensorList(i.id);return o.setItem(r,s),[o.idTensor]}case"TensorListGetItem":{const i=Wre("tensorListId",e,t,n),r=Wre("index",e,t,n),s=Wre("elementShape",e,t,n),o=Wre("elementDType",e,t,n);return[n.getTensorList(i.id).getItem(r,s,o)]}case"TensorListScatterV2":case"TensorListScatter":{const i=Wre("indices",e,t,n),r=function(e,t,n,i){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const r=Math.max(...t);if(null!=i&&-1!==i&&r>=i)throw new Error(`Max index must be < array size (${r} vs. ${i})`);const s=new zse([],n,e.dtype,i),o=(0,u3.unstack)(e,0);return t.forEach((e,t)=>{s.setItem(e,o[t])}),s}(Wre("tensor",e,t,n),i,Wre("elementShape",e,t,n),Wre("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const i=Wre("elementShape",e,t,n),r=Wre("elementDType",e,t,n);let s;s="TensorListReserve"===e.op?"numElements":"maxNumElements";const o=Wre(s,e,t,n),a=function(e,t,n,i){return new zse([],e,t,i)}(i,r,0,"TensorListReserve"===e.op?-1:o);return n.addTensorList(a),[a.idTensor]}case"TensorListGather":{const i=Wre("tensorListId",e,t,n),r=Wre("indices",e,t,n),s=Wre("elementShape",e,t,n),o=Wre("elementDType",e,t,n);return[n.getTensorList(i.id).gather(r,o,s)]}case"TensorListStack":{const i=Wre("tensorListId",e,t,n),r=Wre("elementShape",e,t,n),s=Wre("elementDType",e,t,n),o=Wre("numElements",e,t,n);return[n.getTensorList(i.id).stack(r,s,o)]}case"TensorListFromTensor":{const i=function(e,t,n){const i=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);Pse(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=(0,u3.unstack)(e);return new zse(r,t,i)}(Wre("tensor",e,t,n),Wre("elementShape",e,t,n),Wre("elementDType",e,t,n));return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const i=Wre("tensorListId",e,t,n),r=n.getTensorList(i.id),s=Wre("dtype",e,t,n),o=Wre("elementShape",e,t,n);return[r.concat(s,o)]}case"TensorListPushBack":{const i=Wre("tensorListId",e,t,n),r=Wre("tensor",e,t,n),s=n.getTensorList(i.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{const i=Wre("tensorListId",e,t,n),r=Wre("elementShape",e,t,n),s=Wre("elementDType",e,t,n);return[n.getTensorList(i.id).popBack(r,s)]}case"TensorListSplit":{const i=Wre("tensor",e,t,n),r=Wre("elementShape",e,t,n),s=function(e,t,n){let i=0;const r=t.map(e=>(i+=e,i));if(i!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${i}, and tensor's shape is: ${e.shape}`);const s=Use(e.shape.slice(1),n),o=0===i?0:e.size/i,a=(0,u3.tidy)(()=>{const n=[];e=(0,u3.reshape)(e,[1,i,o]);for(let i=0;i{switch(e.op){case"If":case"StatelessIf":{const i=Zre("thenBranch",e,t,n),r=Zre("elseBranch",e,t,n),s=Zre("cond",e,t,n),o=Zre("args",e,t,n);return(await s.data())[0]?n.functionMap[i].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const i=Zre("body",e,t,n),r=Zre("cond",e,t,n),s=Zre("args",e,t,n),o=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),a=s.map(e=>e.id);let l=await o[0].data();o.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||e.dispose()});let u=s;for(;l[0];){const e=u;u=await n.functionMap[i].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map(e=>e.id);e.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()});const s=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await s[0].data(),s.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})}return u}case"LoopCond":return[rse(Zre("pred",e,t,n))];case"Switch":{const i=Zre("pred",e,t,n);let r=Zre("data",e,t,n);return r.kept||(r=rse(r)),(await i.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const i=e.inputNames.find(e=>void 0!==Qre(e,t,n));if(i){return[rse(Qre(i,t,n))]}return}case"Enter":{const i=Zre("frameName",e,t,n),r=Zre("tensor",e,t,n);return n.enterFrame(i),[rse(r)]}case"Exit":{const i=Zre("tensor",e,t,n);return n.exitFrame(),[rse(i)]}case"NextIteration":{const i=Zre("tensor",e,t,n);return n.nextIteration(),[rse(i)]}case"TensorArrayV3":{const i=Zre("size",e,t,n),r=Zre("dtype",e,t,n),s=Zre("elementShape",e,t,n),o=Zre("dynamicSize",e,t,n),a=Zre("clearAfterRead",e,t,n),l=Zre("identicalElementShapes",e,t,n),u=Zre("name",e,t,n),c=new Gse(u,r,i,s,l,o,a);return n.addTensorArray(c),[c.idTensor,(0,p3.scalar)(1)]}case"TensorArrayWriteV3":{const i=Zre("tensorArrayId",e,t,n),r=Zre("index",e,t,n),s=Zre("tensor",e,t,n),o=n.getTensorArray(i.id);return o.write(r,s),[o.idTensor]}case"TensorArrayReadV3":{const i=Zre("tensorArrayId",e,t,n),r=Zre("index",e,t,n);return[n.getTensorArray(i.id).read(r)]}case"TensorArrayGatherV3":{const i=Zre("tensorArrayId",e,t,n),r=Zre("indices",e,t,n),s=Zre("dtype",e,t,n);return[n.getTensorArray(i.id).gather(r,s)]}case"TensorArrayScatterV3":{const i=Zre("tensorArrayId",e,t,n),r=Zre("indices",e,t,n),s=Zre("tensor",e,t,n),o=n.getTensorArray(i.id);return o.scatter(r,s),[o.idTensor]}case"TensorArrayConcatV3":{const i=Zre("tensorArrayId",e,t,n),r=n.getTensorArray(i.id),s=Zre("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{const i=Zre("tensorArrayId",e,t,n),r=Zre("tensor",e,t,n),s=Zre("lengths",e,t,n),o=n.getTensorArray(i.id);return o.split(s,r),[o.idTensor]}case"TensorArraySizeV3":{const i=Zre("tensorArrayId",e,t,n),r=n.getTensorArray(i.id);return[(0,p3.scalar)(r.size(),"int32")]}case"TensorArrayCloseV3":{const i=Zre("tensorArrayId",e,t,n),r=n.getTensorArray(i.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const i=Zre("tensorListId",e,t,n),r=Zre("index",e,t,n),s=Zre("tensor",e,t,n),o=n.getTensorList(i.id);return o.setItem(r,s),[o.idTensor]}case"TensorListGetItem":{const i=Zre("tensorListId",e,t,n),r=Zre("index",e,t,n),s=Zre("elementShape",e,t,n),o=Zre("elementDType",e,t,n);return[n.getTensorList(i.id).getItem(r,s,o)]}case"TensorListScatterV2":case"TensorListScatter":{const i=Zre("indices",e,t,n),r=function(e,t,n,i){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const r=Math.max(...t);if(null!=i&&-1!==i&&r>=i)throw new Error(`Max index must be < array size (${r} vs. ${i})`);const s=new Hse([],n,e.dtype,i),o=(0,p3.unstack)(e,0);return t.forEach((e,t)=>{s.setItem(e,o[t])}),s}(Zre("tensor",e,t,n),i,Zre("elementShape",e,t,n),Zre("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const i=Zre("elementShape",e,t,n),r=Zre("elementDType",e,t,n);let s;s="TensorListReserve"===e.op?"numElements":"maxNumElements";const o=Zre(s,e,t,n),a=function(e,t,n,i){return new Hse([],e,t,i)}(i,r,0,"TensorListReserve"===e.op?-1:o);return n.addTensorList(a),[a.idTensor]}case"TensorListGather":{const i=Zre("tensorListId",e,t,n),r=Zre("indices",e,t,n),s=Zre("elementShape",e,t,n),o=Zre("elementDType",e,t,n);return[n.getTensorList(i.id).gather(r,o,s)]}case"TensorListStack":{const i=Zre("tensorListId",e,t,n),r=Zre("elementShape",e,t,n),s=Zre("elementDType",e,t,n),o=Zre("numElements",e,t,n);return[n.getTensorList(i.id).stack(r,s,o)]}case"TensorListFromTensor":{const i=function(e,t,n){const i=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);Vse(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=(0,p3.unstack)(e);return new Hse(r,t,i)}(Zre("tensor",e,t,n),Zre("elementShape",e,t,n),Zre("elementDType",e,t,n));return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const i=Zre("tensorListId",e,t,n),r=n.getTensorList(i.id),s=Zre("dtype",e,t,n),o=Zre("elementShape",e,t,n);return[r.concat(s,o)]}case"TensorListPushBack":{const i=Zre("tensorListId",e,t,n),r=Zre("tensor",e,t,n),s=n.getTensorList(i.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{const i=Zre("tensorListId",e,t,n),r=Zre("elementShape",e,t,n),s=Zre("elementDType",e,t,n);return[n.getTensorList(i.id).popBack(r,s)]}case"TensorListSplit":{const i=Zre("tensor",e,t,n),r=Zre("elementShape",e,t,n),s=function(e,t,n){let i=0;const r=t.map(e=>(i+=e,i));if(i!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${i}, and tensor's shape is: ${e.shape}`);const s=Yse(e.shape.slice(1),n),o=0===i?0:e.size/i,a=(0,p3.tidy)(()=>{const n=[];e=(0,p3.reshape)(e,[1,i,o]);for(let i=0;i{switch(e.op){case"If":case"StatelessIf":{const i=Wre("t * limitations under the License. * ============================================================================= */ -function Yse(e,t,n){const[i,r]=Wre("fusedOps",e,t,n),s="biasadd"===i,o=!s,a="prelu"===r,l="fusedbatchnorm"===i,u=Wre("numArgs",e,t,n);if(s){if(a&&2!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&s&&1!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const c=Wre("strides",e,t,n),d=Jre(e,t,n),h=Wre("dataFormat",e,t,n).toUpperCase(),p=Wre("dilations",e,t,n);let[f,m]=Wre("args",e,t,n);o&&(m=f,f=void 0);return{stride:c,pad:d,dataFormat:h,dilations:p,biasArg:f,preluArg:m,activationFunc:r,leakyreluAlpha:Wre("leakyreluAlpha",e,t,n)}} +function Xse(e,t,n){const[i,r]=Zre("fusedOps",e,t,n),s="biasadd"===i,o=!s,a="prelu"===r,l="fusedbatchnorm"===i,u=Zre("numArgs",e,t,n);if(s){if(a&&2!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&s&&1!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const c=Zre("strides",e,t,n),d=ise(e,t,n),h=Zre("dataFormat",e,t,n).toUpperCase(),p=Zre("dilations",e,t,n);let[f,m]=Zre("args",e,t,n);o&&(m=f,f=void 0);return{stride:c,pad:d,dataFormat:h,dilations:p,biasArg:f,preluArg:m,activationFunc:r,leakyreluAlpha:Zre("leakyreluAlpha",e,t,n)}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11777,7 +11777,7 @@ function Yse(e,t,n){const[i,r]=Wre("fusedOps",e,t,n),s="biasadd"===i,o=!s,a="pre * limitations under the License. * ============================================================================= */ -function Gse(e,t,n){return{boxes:Wre("boxes",e,t,n),scores:Wre("scores",e,t,n),maxOutputSize:Wre("maxOutputSize",e,t,n),iouThreshold:Wre("iouThreshold",e,t,n),scoreThreshold:Wre("scoreThreshold",e,t,n),softNmsSigma:Wre("softNmsSigma",e,t,n)}} +function qse(e,t,n){return{boxes:Zre("boxes",e,t,n),scores:Zre("scores",e,t,n),maxOutputSize:Zre("maxOutputSize",e,t,n),iouThreshold:Zre("iouThreshold",e,t,n),scoreThreshold:Zre("scoreThreshold",e,t,n),softNmsSigma:Zre("softNmsSigma",e,t,n)}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -11794,7 +11794,7 @@ function Gse(e,t,n){return{boxes:Wre("boxes",e,t,n),scores:Wre("scores",e,t,n),m * limitations under the License. * ============================================================================= */ -class Hse{get id(){return this.handle.id}constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=(0,u3.scalar)(0),this.tensorMap=new Map,(0,u3.keep)(this.handle)}clearAndClose(){this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return _3.d(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),(0,u3.tidy)(()=>{const e=(0,u3.unstack)(t),i=n.length,r=e.length;u3.util.assert(i===r,()=>`The number of elements doesn't match, keys has ${i} elements, the values has ${r} elements.`);for(let t=0;t{const e=[];for(let i=0;ie.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return T3.d(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),(0,p3.tidy)(()=>{const e=(0,p3.unstack)(t),i=n.length,r=e.length;p3.util.assert(i===r,()=>`The number of elements doesn't match, keys has ${i} elements, the values has ${r} elements.`);for(let t=0;t{const e=[];for(let i=0;i{switch(e.category){case"arithmetic":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[i.add(Wre("a",e,t,n),Wre("b",e,t,n))];case"AddN":return[i.addN(Wre("tensors",e,t,n))];case"FloorMod":case"Mod":return[i.mod(Wre("a",e,t,n),Wre("b",e,t,n))];case"Mul":return[i.mul(Wre("a",e,t,n),Wre("b",e,t,n))];case"RealDiv":case"Div":return[i.div(Wre("a",e,t,n),Wre("b",e,t,n))];case"DivNoNan":return[i.divNoNan(Wre("a",e,t,n),Wre("b",e,t,n))];case"FloorDiv":return[i.floorDiv(Wre("a",e,t,n),Wre("b",e,t,n))];case"Sub":return[i.sub(Wre("a",e,t,n),Wre("b",e,t,n))];case"Minimum":return[i.minimum(Wre("a",e,t,n),Wre("b",e,t,n))];case"Maximum":return[i.maximum(Wre("a",e,t,n),Wre("b",e,t,n))];case"Pow":return[i.pow(Wre("a",e,t,n),Wre("b",e,t,n))];case"SquaredDifference":return[i.squaredDifference(Wre("a",e,t,n),Wre("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"basic_math":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Abs":case"ComplexAbs":return[i.abs(Wre("x",e,t,n))];case"Acos":return[i.acos(Wre("x",e,t,n))];case"Acosh":return[i.acosh(Wre("x",e,t,n))];case"Asin":return[i.asin(Wre("x",e,t,n))];case"Asinh":return[i.asinh(Wre("x",e,t,n))];case"Atan":return[i.atan(Wre("x",e,t,n))];case"Atan2":return[i.atan2(Wre("x",e,t,n),Wre("y",e,t,n))];case"Atanh":return[i.atanh(Wre("x",e,t,n))];case"Ceil":return[i.ceil(Wre("x",e,t,n))];case"Complex":return[i.complex(Wre("real",e,t,n),Wre("imag",e,t,n))];case"Cos":return[i.cos(Wre("x",e,t,n))];case"Cosh":return[i.cosh(Wre("x",e,t,n))];case"Elu":return[i.elu(Wre("x",e,t,n))];case"Erf":return[i.erf(Wre("x",e,t,n))];case"Exp":return[i.exp(Wre("x",e,t,n))];case"Expm1":return[i.expm1(Wre("x",e,t,n))];case"Floor":return[i.floor(Wre("x",e,t,n))];case"Log":return[i.log(Wre("x",e,t,n))];case"Log1p":return[i.log1p(Wre("x",e,t,n))];case"Imag":return[i.imag(Wre("x",e,t,n))];case"Neg":return[i.neg(Wre("x",e,t,n))];case"Reciprocal":return[i.reciprocal(Wre("x",e,t,n))];case"Real":return[i.real(Wre("x",e,t,n))];case"Relu":return[i.relu(Wre("x",e,t,n))];case"Round":return[i.round(Wre("x",e,t,n))];case"Selu":return[i.selu(Wre("x",e,t,n))];case"Sigmoid":return[i.sigmoid(Wre("x",e,t,n))];case"Sin":return[i.sin(Wre("x",e,t,n))];case"Sign":return[i.sign(Wre("x",e,t,n))];case"Sinh":return[i.sinh(Wre("x",e,t,n))];case"Softplus":return[i.softplus(Wre("x",e,t,n))];case"Sqrt":return[i.sqrt(Wre("x",e,t,n))];case"Square":return[i.square(Wre("x",e,t,n))];case"Tanh":return[i.tanh(Wre("x",e,t,n))];case"Tan":return[i.tan(Wre("x",e,t,n))];case"ClipByValue":return[i.clipByValue(Wre("x",e,t,n),Wre("clipValueMin",e,t,n),Wre("clipValueMax",e,t,n))];case"Relu6":return[i.relu6(Wre("x",e,t,n))];case"Rsqrt":return[i.rsqrt(Xre(e.inputNames[0],t,n))];case"LeakyRelu":return[i.leakyRelu(Wre("x",e,t,n),Wre("alpha",e,t,n))];case"Prelu":return[i.prelu(Wre("x",e,t,n),Wre("alpha",e,t,n))];case"IsNan":return[i.isNaN(Xre(e.inputNames[0],t,n))];case"IsInf":return[i.isInf(Xre(e.inputNames[0],t,n))];case"IsFinite":return[i.isFinite(Xre(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"control":return jse(e,t,n);case"convolution":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Conv1D":{const r=Wre("stride",e,t,n),s=Wre("pad",e,t,n),o=Wre("dataFormat",e,t,n).toUpperCase(),a=Wre("dilation",e,t,n);return[i.conv1d(Wre("x",e,t,n),Wre("filter",e,t,n),r,s,o,a)]}case"Conv2D":{const r=Wre("strides",e,t,n),s=Jre(e,t,n),o=Wre("dataFormat",e,t,n).toUpperCase(),a=Wre("dilations",e,t,n);return[i.conv2d(Wre("x",e,t,n),Wre("filter",e,t,n),[r[1],r[2]],s,o,[a[1],a[2]])]}case"_FusedConv2D":{const{stride:r,pad:s,dataFormat:o,dilations:a,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=Yse(e,t,n);return[i.fused.conv2d({x:Wre("x",e,t,n),filter:Wre("filter",e,t,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:s,dataFormat:o,dilations:a,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=Yse(e,t,n);return[i.fused.depthwiseConv2d({x:Wre("x",e,t,n),filter:Wre("filter",e,t,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=Wre("outputShape",e,t,n),s=Wre("strides",e,t,n),o=Jre(e,t,n);return[i.conv2dTranspose(Wre("x",e,t,n),Wre("filter",e,t,n),r,[s[1],s[2]],o)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=Wre("strides",e,t,n),s=Jre(e,t,n),o=Wre("dilations",e,t,n),a=Wre("dataFormat",e,t,n).toUpperCase();return[i.depthwiseConv2d(Wre("input",e,t,n),Wre("filter",e,t,n),[r[1],r[2]],s,a,[o[1],o[2]])]}case"Conv3D":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("dataFormat",e,t,n).toUpperCase(),a=Wre("dilations",e,t,n);return[i.conv3d(Wre("x",e,t,n),Wre("filter",e,t,n),[r[1],r[2],r[3]],s,o,[a[1],a[2],a[3]])]}case"AvgPool":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("kernelSize",e,t,n);return[i.avgPool(Wre("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s)]}case"MaxPool":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("kernelSize",e,t,n);return[i.maxPool(Wre("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s)]}case"MaxPoolWithArgmax":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("kernelSize",e,t,n),a=Wre("includeBatchInIndex",e,t,n),{result:l,indexes:u}=i.maxPoolWithArgmax(Wre("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s,a);return[l,u]}case"AvgPool3D":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("kernelSize",e,t,n);return[i.avgPool3d(Wre("x",e,t,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],s)]}case"MaxPool3D":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("kernelSize",e,t,n);return[i.maxPool3d(Wre("x",e,t,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],s)]}case"Dilation2D":{const r=Wre("strides",e,t,n),s=Wre("pad",e,t,n),o=Wre("dilations",e,t,n),a=r[1],l=r[2],u=o[1],c=o[2];return[i.dilation2d(Wre("x",e,t,n),Wre("filter",e,t,n),[a,l],s,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"creation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Fill":{const r=Wre("shape",e,t,n),s=Wre("dtype",e,t,n),o=Wre("value",e,t,n);return[i.fill(r,o,s)]}case"LinSpace":{const r=Wre("start",e,t,n),s=Wre("stop",e,t,n),o=Wre("num",e,t,n);return[i.linspace(r,s,o)]}case"Multinomial":{const r=Wre("logits",e,t,n),s=Wre("numSamples",e,t,n),o=Wre("seed",e,t,n);return[i.multinomial(r,s,o)]}case"OneHot":{const r=Wre("indices",e,t,n),s=Wre("depth",e,t,n),o=Wre("onValue",e,t,n),a=Wre("offValue",e,t,n),l=Wre("dtype",e,t,n);return[i.oneHot(r,s,o,a,l)]}case"Ones":return[i.ones(Wre("shape",e,t,n),Wre("dtype",e,t,n))];case"OnesLike":return[i.onesLike(Wre("x",e,t,n))];case"RandomStandardNormal":return[i.randomStandardNormal(Wre("shape",e,t,n),Wre("dtype",e,t,n),Wre("seed",e,t,n))];case"RandomUniform":return[i.randomUniform(Wre("shape",e,t,n),Wre("minval",e,t,n),Wre("maxval",e,t,n),Wre("dtype",e,t,n))];case"RandomUniformInt":return[i.randomUniformInt(Wre("shape",e,t,n),Wre("minval",e,t,n),Wre("maxval",e,t,n),Wre("seed",e,t,n))];case"Range":{const r=Wre("start",e,t,n),s=Wre("stop",e,t,n),o=Wre("step",e,t,n);return[i.range(r,s,o,Wre("dtype",e,t,n))]}case"TruncatedNormal":{const r=Wre("shape",e,t,n),s=Wre("mean",e,t,n),o=Wre("stdDev",e,t,n),a=Wre("seed",e,t,n);return[i.truncatedNormal(r,s,o,Wre("dtype",e,t,n),a)]}case"Zeros":return[i.zeros(Wre("shape",e,t,n),Wre("dtype",e,t,n))];case"ZerosLike":return[i.zerosLike(Wre("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"dynamic":return(async(e,t,n,i,r=Fe)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=Gse(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(i,s,o,a,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=Gse(e,t,n),u=Wre("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(i,s,o,a,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=Gse(e,t,n);return[await r.image.nonMaxSuppressionAsync(i,s,o,a,l)]}case"Where":{const i=r.cast(Wre("condition",e,t,n),"bool"),s=[await r.whereAsync(i)];return i.dispose(),s}case"ListDiff":return r.setdiff1dAsync(Wre("x",e,t,n),Wre("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"LowerBound":{const r=Wre("sortedSequence",e,t,n),s=Wre("values",e,t,n);return[i.lowerBound(r,s)]}case"TopKV2":{const r=Wre("x",e,t,n),s=Wre("k",e,t,n),o=Wre("sorted",e,t,n),a=i.topk(r,s,o);return[a.values,a.indices]}case"UpperBound":{const r=Wre("sortedSequence",e,t,n),s=Wre("values",e,t,n);return[i.upperBound(r,s)]}case"Unique":{const r=Wre("x",e,t,n),s=i.unique(r);return[s.values,s.indices]}case"UniqueV2":{const r=Wre("x",e,t,n),s=Wre("axis",e,t,n),o=i.unique(r,s);return[o.values,o.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"image":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"ResizeBilinear":{const r=Wre("images",e,t,n),s=Wre("size",e,t,n),o=Wre("alignCorners",e,t,n),a=Wre("halfPixelCenters",e,t,n);return[i.image.resizeBilinear(r,[s[0],s[1]],o,a)]}case"ResizeNearestNeighbor":{const r=Wre("images",e,t,n),s=Wre("size",e,t,n),o=Wre("alignCorners",e,t,n),a=Wre("halfPixelCenters",e,t,n);return[i.image.resizeNearestNeighbor(r,[s[0],s[1]],o,a)]}case"CropAndResize":{const r=Wre("image",e,t,n),s=Wre("boxes",e,t,n),o=Wre("boxInd",e,t,n),a=Wre("cropSize",e,t,n),l=Wre("method",e,t,n),u=Wre("extrapolationValue",e,t,n);return[i.image.cropAndResize(r,s,o,a,l,u)]}case"ImageProjectiveTransformV3":{const r=Wre("images",e,t,n),s=Wre("transforms",e,t,n),o=Wre("outputShape",e,t,n),a=Wre("fillValue",e,t,n),l=Wre("interpolation",e,t,n),u=Wre("fillMode",e,t,n);return[i.image.transform(r,s,l.toLowerCase(),u.toLowerCase(),a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"graph":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=Wre("default",e,t,n);return[Xre(e.name,t,n)||r];case"Placeholder":return[Xre(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[ese(Wre("x",e,t,n))];case"IdentityN":return Wre("x",e,t,n).map(e=>ese(e));case"Shape":return[i.tensor1d(Wre("x",e,t,n).shape,"int32")];case"ShapeN":return Wre("x",e,t,n).map(e=>i.tensor1d(e.shape));case"Size":return[i.scalar(Wre("x",e,t,n).size,"int32")];case"Rank":return[i.scalar(Wre("x",e,t,n).rank,"int32")];case"NoOp":return[i.scalar(1)];case"Print":const s=Wre("x",e,t,n),o=Wre("data",e,t,n),a=Wre("message",e,t,n),l=Wre("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(a);for(let e=0;e((e,t,n,i=Fe)=>{switch(e.op){case"Equal":return[i.equal(Wre("a",e,t,n),Wre("b",e,t,n))];case"NotEqual":return[i.notEqual(Wre("a",e,t,n),Wre("b",e,t,n))];case"Greater":return[i.greater(Wre("a",e,t,n),Wre("b",e,t,n))];case"GreaterEqual":return[i.greaterEqual(Wre("a",e,t,n),Wre("b",e,t,n))];case"Less":return[i.less(Wre("a",e,t,n),Wre("b",e,t,n))];case"LessEqual":return[i.lessEqual(Wre("a",e,t,n),Wre("b",e,t,n))];case"LogicalAnd":return[i.logicalAnd(Wre("a",e,t,n),Wre("b",e,t,n))];case"LogicalNot":return[i.logicalNot(Wre("a",e,t,n))];case"LogicalOr":return[i.logicalOr(Wre("a",e,t,n),Wre("b",e,t,n))];case"Select":case"SelectV2":return[i.where(Wre("condition",e,t,n),Wre("a",e,t,n),Wre("b",e,t,n))];case"BitwiseAnd":return[i.bitwiseAnd(Wre("a",e,t,n),Wre("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"matrices":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[i.matMul(Wre("a",e,t,n),Wre("b",e,t,n),Wre("transposeA",e,t,n),Wre("transposeB",e,t,n))];case"Einsum":return[i.einsum(Wre("equation",e,t,n),...Wre("tensors",e,t,n))];case"Transpose":return[i.transpose(Wre("x",e,t,n),Wre("perm",e,t,n))];case"_FusedMatMul":const[r,s]=Wre("fusedOps",e,t,n),o="biasadd"===r,a="prelu"===s,l=Wre("numArgs",e,t,n),u=Wre("leakyreluAlpha",e,t,n);if(o){if(a&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,d]=Wre("args",e,t,n);return[i.fused.matMul({a:Wre("a",e,t,n),b:Wre("b",e,t,n),transposeA:Wre("transposeA",e,t,n),transposeB:Wre("transposeB",e,t,n),bias:c,activation:s,preluActivationWeights:d,leakyreluAlpha:u})];case"MatrixBandPart":return[i.linalg.bandPart(Wre("a",e,t,n),Wre("numLower",e,t,n),Wre("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"normalization":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"EuclideanNorm":return[i.euclideanNorm(Wre("x",e,t,n),Wre("axis",e,t,n),Wre("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[i.batchNorm(Wre("x",e,t,n),Wre("mean",e,t,n),Wre("variance",e,t,n),Wre("offset",e,t,n),Wre("scale",e,t,n),Wre("epsilon",e,t,n))];case"LRN":return[i.localResponseNormalization(Wre("x",e,t,n),Wre("radius",e,t,n),Wre("bias",e,t,n),Wre("alpha",e,t,n),Wre("beta",e,t,n))];case"Softmax":return[i.softmax(Wre("x",e,t,n))];case"LogSoftmax":return[i.logSoftmax(Wre("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"ragged":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:s}=i.raggedGather(Wre("paramsNestedSplits",e,t,n),Wre("paramsDenseValues",e,t,n),Wre("indices",e,t,n),Wre("outputRaggedRank",e,t,n));return r.concat(s)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:s}=i.raggedRange(Wre("starts",e,t,n),Wre("limits",e,t,n),Wre("splits",e,t,n));return[r,s]}case"RaggedTensorToTensor":return[i.raggedTensorToTensor(Wre("shape",e,t,n),Wre("values",e,t,n),Wre("defaultValue",e,t,n),Wre("rowPartitionTensors",e,t,n),Wre("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"reduction":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Max":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.max(Wre("x",e,t,n),r,s)]}case"Mean":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.mean(Wre("x",e,t,n),r,s)]}case"Min":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.min(Wre("x",e,t,n),r,s)]}case"Sum":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.sum(Wre("x",e,t,n),r,s)]}case"All":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.all(Wre("x",e,t,n),r,s)]}case"Any":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.any(Wre("x",e,t,n),r,s)]}case"ArgMax":{const r=Wre("axis",e,t,n);return[i.argMax(Wre("x",e,t,n),r)]}case"ArgMin":{const r=Wre("axis",e,t,n);return[i.argMin(Wre("x",e,t,n),r)]}case"Prod":{const r=Wre("axis",e,t,n),s=Wre("keepDims",e,t,n);return[i.prod(Wre("x",e,t,n),r,s)]}case"Cumprod":{const r=Wre("axis",e,t,n),s=Wre("exclusive",e,t,n),o=Wre("reverse",e,t,n);return[i.cumprod(Wre("x",e,t,n),r,s,o)]}case"Cumsum":{const r=Wre("axis",e,t,n),s=Wre("exclusive",e,t,n),o=Wre("reverse",e,t,n);return[i.cumsum(Wre("x",e,t,n),r,s,o)]}case"Bincount":const r=Wre("x",e,t,n),s=Wre("weights",e,t,n),o=Wre("size",e,t,n);return[i.bincount(r,s,o)];case"DenseBincount":{const r=Wre("x",e,t,n),s=Wre("weights",e,t,n),o=Wre("size",e,t,n),a=Wre("binaryOutput",e,t,n);return[i.denseBincount(r,s,o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"slice_join":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=Wre("n",e,t,n),s=Wre("axis",e,t,n);let o=Wre("tensors",e,t,n);return o=o.slice(0,r),[i.concat(o,s)]}case"Gather":{const r=Wre("x",e,t,n),s=Wre("indices",e,t,n);return[i.gather(r,i.cast(s,"int32"),0)]}case"GatherV2":{const r=Wre("axis",e,t,n),s=Wre("batchDims",e,t,n),o=Wre("x",e,t,n),a=Wre("indices",e,t,n);return[i.gather(o,i.cast(a,"int32"),r,s)]}case"Reverse":{const r=Wre("dims",e,t,n),s=[];for(let e=0;e{const r=Wre("axis",e,t,n),s=Wre("tensors",e,t,n),o=s[0].shape,a=i.squeeze(s[0]).shape,l=s.map(e=>{const t=u3.util.arraysEqual(e.shape,o);if(!t&&!u3.util.arraysEqual(i.squeeze(e).shape,a))throw new Error("the input tensors shape does not match");return t?e:i.reshape(e,o)});return[i.stack(l,r)]});case"Unpack":{const r=Wre("axis",e,t,n),s=Wre("tensor",e,t,n);return i.unstack(s,r)}case"Tile":{const r=Wre("reps",e,t,n);return[i.tile(Wre("x",e,t,n),r)]}case"Split":case"SplitV":{const r=Wre("axis",e,t,n),s=Wre("numOrSizeSplits",e,t,n),o=Wre("x",e,t,n);return i.split(o,s,r)}case"ScatterNd":{const r=Wre("indices",e,t,n),s=Wre("values",e,t,n),o=Wre("shape",e,t,n);return[i.scatterND(r,s,o)]}case"GatherNd":{const r=Wre("x",e,t,n),s=Wre("indices",e,t,n);return[i.gatherND(r,s)]}case"SparseToDense":{const r=Wre("sparseIndices",e,t,n),s=Wre("outputShape",e,t,n),o=Wre("sparseValues",e,t,n),a=Wre("defaultValue",e,t,n);return[i.sparseToDense(r,o,s,o.dtype===a.dtype?a:i.cast(a,o.dtype))]}case"TensorScatterUpdate":{const r=Wre("indices",e,t,n),s=Wre("values",e,t,n),o=Wre("tensor",e,t,n);return[i.tensorScatterUpdate(o,r,s)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"sparse":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:s,emptyRowIndicator:o,reverseIndexMap:a}=i.sparse.sparseFillEmptyRows(Wre("indices",e,t,n),Wre("values",e,t,n),Wre("denseShape",e,t,n),Wre("defaultValue",e,t,n));return[r,s,o,a]}case"SparseReshape":{const{outputIndices:r,outputShape:s}=i.sparse.sparseReshape(Wre("inputIndices",e,t,n),Wre("inputShape",e,t,n),Wre("newShape",e,t,n));return[r,s]}case"SparseSegmentMean":return[i.sparse.sparseSegmentMean(Wre("data",e,t,n),Wre("indices",e,t,n),Wre("segmentIds",e,t,n))];case"SparseSegmentSum":return[i.sparse.sparseSegmentSum(Wre("data",e,t,n),Wre("indices",e,t,n),Wre("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"spectral":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"FFT":return[i.fft(Wre("x",e,t,n))];case"IFFT":return[i.ifft(Wre("x",e,t,n))];case"RFFT":return[i.rfft(Wre("x",e,t,n))];case"IRFFT":return[i.irfft(Wre("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"string":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"StaticRegexReplace":return[i.string.staticRegexReplace(Wre("input",e,t,n),Wre("pattern",e,t,n),Wre("rewrite",e,t,n),Wre("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:s}=i.string.stringNGrams(Wre("data",e,t,n),Wre("dataSplits",e,t,n),Wre("separator",e,t,n),Wre("nGramWidths",e,t,n),Wre("leftPad",e,t,n),Wre("rightPad",e,t,n),Wre("padWidth",e,t,n),Wre("preserveShortSequences",e,t,n));return[r,s]}case"StringSplit":{const{indices:r,values:s,shape:o}=i.string.stringSplit(Wre("input",e,t,n),Wre("delimiter",e,t,n),Wre("skipEmpty",e,t,n));return[r,s,o]}case"StringToHashBucketFast":return[i.string.stringToHashBucketFast(Wre("input",e,t,n),Wre("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"transformation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Cast":return[i.cast(Wre("x",e,t,n),Wre("dtype",e,t,n))];case"ExpandDims":{const r=Wre("axis",e,t,n);return[i.expandDims(Wre("x",e,t,n),r)]}case"Squeeze":{const r=Wre("axis",e,t,n);return[i.squeeze(Wre("x",e,t,n),r)]}case"Reshape":return[i.reshape(Wre("x",e,t,n),Wre("shape",e,t,n))];case"EnsureShape":return[i.ensureShape(Wre("x",e,t,n),Wre("shape",e,t,n))];case"MirrorPad":return[i.mirrorPad(Wre("x",e,t,n),Wre("padding",e,t,n),Wre("mode",e,t,n))];case"PadV2":case"Pad":return[i.pad(Wre("x",e,t,n),Wre("padding",e,t,n),Wre("constantValue",e,t,n))];case"SpaceToBatchND":{const r=Wre("blockShape",e,t,n),s=Wre("paddings",e,t,n);return[i.spaceToBatchND(Wre("x",e,t,n),r,s)]}case"BatchToSpaceND":{const r=Wre("blockShape",e,t,n),s=Wre("crops",e,t,n);return[i.batchToSpaceND(Wre("x",e,t,n),r,s)]}case"DepthToSpace":{const r=Wre("blockSize",e,t,n),s=Wre("dataFormat",e,t,n).toUpperCase();return[i.depthToSpace(Wre("x",e,t,n),r,s)]}case"BroadcastTo":return[i.broadcastTo(Wre("x",e,t,n),Wre("shape",e,t,n))];case"BroadcastArgs":return[i.broadcastArgs(Wre("s0",e,t,n),Wre("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"hash_table":return(async(e,t,n,i)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=i.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=Wre("keyDType",e,t,n),s=Wre("valueDType",e,t,n),o=new Hse(r,s);return i.addHashTable(e.name,o),[o.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=Wre("tableHandle",e,t,n,i),s=Wre("keys",e,t,n),o=Wre("values",e,t,n),a=i.getHashTableById(r.id);return[await a.import(s,o)]}case"LookupTableFind":case"LookupTableFindV2":{const r=Wre("tableHandle",e,t,n,i),s=Wre("keys",e,t,n),o=Wre("defaultValue",e,t,n),a=i.getHashTableById(r.id);return[await a.find(s,o)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=Wre("tableHandle",e,t,n,i);return[i.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,i);case"custom":const s=Gre(e.op);if(s&&s.customExecutor)return s.customExecutor(new Fse(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return u3.util.isPromise(s)?s.then(e=>[].concat(e)):[].concat(s)}class Xse{constructor(e={},t={},n={},i={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=i,this.parseNodeNameCache=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}} +function Zse(e,t,n,i,r=p3.tidy){const s=((e,t,n)=>{switch(e.category){case"arithmetic":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[i.add(Zre("a",e,t,n),Zre("b",e,t,n))];case"AddN":return[i.addN(Zre("tensors",e,t,n))];case"FloorMod":case"Mod":return[i.mod(Zre("a",e,t,n),Zre("b",e,t,n))];case"Mul":return[i.mul(Zre("a",e,t,n),Zre("b",e,t,n))];case"RealDiv":case"Div":return[i.div(Zre("a",e,t,n),Zre("b",e,t,n))];case"DivNoNan":return[i.divNoNan(Zre("a",e,t,n),Zre("b",e,t,n))];case"FloorDiv":return[i.floorDiv(Zre("a",e,t,n),Zre("b",e,t,n))];case"Sub":return[i.sub(Zre("a",e,t,n),Zre("b",e,t,n))];case"Minimum":return[i.minimum(Zre("a",e,t,n),Zre("b",e,t,n))];case"Maximum":return[i.maximum(Zre("a",e,t,n),Zre("b",e,t,n))];case"Pow":return[i.pow(Zre("a",e,t,n),Zre("b",e,t,n))];case"SquaredDifference":return[i.squaredDifference(Zre("a",e,t,n),Zre("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"basic_math":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Abs":case"ComplexAbs":return[i.abs(Zre("x",e,t,n))];case"Acos":return[i.acos(Zre("x",e,t,n))];case"Acosh":return[i.acosh(Zre("x",e,t,n))];case"Asin":return[i.asin(Zre("x",e,t,n))];case"Asinh":return[i.asinh(Zre("x",e,t,n))];case"Atan":return[i.atan(Zre("x",e,t,n))];case"Atan2":return[i.atan2(Zre("x",e,t,n),Zre("y",e,t,n))];case"Atanh":return[i.atanh(Zre("x",e,t,n))];case"Ceil":return[i.ceil(Zre("x",e,t,n))];case"Complex":return[i.complex(Zre("real",e,t,n),Zre("imag",e,t,n))];case"Cos":return[i.cos(Zre("x",e,t,n))];case"Cosh":return[i.cosh(Zre("x",e,t,n))];case"Elu":return[i.elu(Zre("x",e,t,n))];case"Erf":return[i.erf(Zre("x",e,t,n))];case"Exp":return[i.exp(Zre("x",e,t,n))];case"Expm1":return[i.expm1(Zre("x",e,t,n))];case"Floor":return[i.floor(Zre("x",e,t,n))];case"Log":return[i.log(Zre("x",e,t,n))];case"Log1p":return[i.log1p(Zre("x",e,t,n))];case"Imag":return[i.imag(Zre("x",e,t,n))];case"Neg":return[i.neg(Zre("x",e,t,n))];case"Reciprocal":return[i.reciprocal(Zre("x",e,t,n))];case"Real":return[i.real(Zre("x",e,t,n))];case"Relu":return[i.relu(Zre("x",e,t,n))];case"Round":return[i.round(Zre("x",e,t,n))];case"Selu":return[i.selu(Zre("x",e,t,n))];case"Sigmoid":return[i.sigmoid(Zre("x",e,t,n))];case"Sin":return[i.sin(Zre("x",e,t,n))];case"Sign":return[i.sign(Zre("x",e,t,n))];case"Sinh":return[i.sinh(Zre("x",e,t,n))];case"Softplus":return[i.softplus(Zre("x",e,t,n))];case"Sqrt":return[i.sqrt(Zre("x",e,t,n))];case"Square":return[i.square(Zre("x",e,t,n))];case"Tanh":return[i.tanh(Zre("x",e,t,n))];case"Tan":return[i.tan(Zre("x",e,t,n))];case"ClipByValue":return[i.clipByValue(Zre("x",e,t,n),Zre("clipValueMin",e,t,n),Zre("clipValueMax",e,t,n))];case"Relu6":return[i.relu6(Zre("x",e,t,n))];case"Rsqrt":return[i.rsqrt(Qre(e.inputNames[0],t,n))];case"LeakyRelu":return[i.leakyRelu(Zre("x",e,t,n),Zre("alpha",e,t,n))];case"Prelu":return[i.prelu(Zre("x",e,t,n),Zre("alpha",e,t,n))];case"IsNan":return[i.isNaN(Qre(e.inputNames[0],t,n))];case"IsInf":return[i.isInf(Qre(e.inputNames[0],t,n))];case"IsFinite":return[i.isFinite(Qre(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"control":return Wse(e,t,n);case"convolution":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Conv1D":{const r=Zre("stride",e,t,n),s=Zre("pad",e,t,n),o=Zre("dataFormat",e,t,n).toUpperCase(),a=Zre("dilation",e,t,n);return[i.conv1d(Zre("x",e,t,n),Zre("filter",e,t,n),r,s,o,a)]}case"Conv2D":{const r=Zre("strides",e,t,n),s=ise(e,t,n),o=Zre("dataFormat",e,t,n).toUpperCase(),a=Zre("dilations",e,t,n);return[i.conv2d(Zre("x",e,t,n),Zre("filter",e,t,n),[r[1],r[2]],s,o,[a[1],a[2]])]}case"_FusedConv2D":{const{stride:r,pad:s,dataFormat:o,dilations:a,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=Xse(e,t,n);return[i.fused.conv2d({x:Zre("x",e,t,n),filter:Zre("filter",e,t,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:s,dataFormat:o,dilations:a,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=Xse(e,t,n);return[i.fused.depthwiseConv2d({x:Zre("x",e,t,n),filter:Zre("filter",e,t,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=Zre("outputShape",e,t,n),s=Zre("strides",e,t,n),o=ise(e,t,n);return[i.conv2dTranspose(Zre("x",e,t,n),Zre("filter",e,t,n),r,[s[1],s[2]],o)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=Zre("strides",e,t,n),s=ise(e,t,n),o=Zre("dilations",e,t,n),a=Zre("dataFormat",e,t,n).toUpperCase();return[i.depthwiseConv2d(Zre("input",e,t,n),Zre("filter",e,t,n),[r[1],r[2]],s,a,[o[1],o[2]])]}case"Conv3D":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("dataFormat",e,t,n).toUpperCase(),a=Zre("dilations",e,t,n);return[i.conv3d(Zre("x",e,t,n),Zre("filter",e,t,n),[r[1],r[2],r[3]],s,o,[a[1],a[2],a[3]])]}case"AvgPool":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("kernelSize",e,t,n);return[i.avgPool(Zre("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s)]}case"MaxPool":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("kernelSize",e,t,n);return[i.maxPool(Zre("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s)]}case"MaxPoolWithArgmax":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("kernelSize",e,t,n),a=Zre("includeBatchInIndex",e,t,n),{result:l,indexes:u}=i.maxPoolWithArgmax(Zre("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s,a);return[l,u]}case"AvgPool3D":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("kernelSize",e,t,n);return[i.avgPool3d(Zre("x",e,t,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],s)]}case"MaxPool3D":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("kernelSize",e,t,n);return[i.maxPool3d(Zre("x",e,t,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],s)]}case"Dilation2D":{const r=Zre("strides",e,t,n),s=Zre("pad",e,t,n),o=Zre("dilations",e,t,n),a=r[1],l=r[2],u=o[1],c=o[2];return[i.dilation2d(Zre("x",e,t,n),Zre("filter",e,t,n),[a,l],s,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"creation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Fill":{const r=Zre("shape",e,t,n),s=Zre("dtype",e,t,n),o=Zre("value",e,t,n);return[i.fill(r,o,s)]}case"LinSpace":{const r=Zre("start",e,t,n),s=Zre("stop",e,t,n),o=Zre("num",e,t,n);return[i.linspace(r,s,o)]}case"Multinomial":{const r=Zre("logits",e,t,n),s=Zre("numSamples",e,t,n),o=Zre("seed",e,t,n);return[i.multinomial(r,s,o)]}case"OneHot":{const r=Zre("indices",e,t,n),s=Zre("depth",e,t,n),o=Zre("onValue",e,t,n),a=Zre("offValue",e,t,n),l=Zre("dtype",e,t,n);return[i.oneHot(r,s,o,a,l)]}case"Ones":return[i.ones(Zre("shape",e,t,n),Zre("dtype",e,t,n))];case"OnesLike":return[i.onesLike(Zre("x",e,t,n))];case"RandomStandardNormal":return[i.randomStandardNormal(Zre("shape",e,t,n),Zre("dtype",e,t,n),Zre("seed",e,t,n))];case"RandomUniform":return[i.randomUniform(Zre("shape",e,t,n),Zre("minval",e,t,n),Zre("maxval",e,t,n),Zre("dtype",e,t,n))];case"RandomUniformInt":return[i.randomUniformInt(Zre("shape",e,t,n),Zre("minval",e,t,n),Zre("maxval",e,t,n),Zre("seed",e,t,n))];case"Range":{const r=Zre("start",e,t,n),s=Zre("stop",e,t,n),o=Zre("step",e,t,n);return[i.range(r,s,o,Zre("dtype",e,t,n))]}case"TruncatedNormal":{const r=Zre("shape",e,t,n),s=Zre("mean",e,t,n),o=Zre("stdDev",e,t,n),a=Zre("seed",e,t,n);return[i.truncatedNormal(r,s,o,Zre("dtype",e,t,n),a)]}case"Zeros":return[i.zeros(Zre("shape",e,t,n),Zre("dtype",e,t,n))];case"ZerosLike":return[i.zerosLike(Zre("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"dynamic":return(async(e,t,n,i,r=Fe)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=qse(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(i,s,o,a,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=qse(e,t,n),u=Zre("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(i,s,o,a,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=qse(e,t,n);return[await r.image.nonMaxSuppressionAsync(i,s,o,a,l)]}case"Where":{const i=r.cast(Zre("condition",e,t,n),"bool"),s=[await r.whereAsync(i)];return i.dispose(),s}case"ListDiff":return r.setdiff1dAsync(Zre("x",e,t,n),Zre("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"LowerBound":{const r=Zre("sortedSequence",e,t,n),s=Zre("values",e,t,n);return[i.lowerBound(r,s)]}case"TopKV2":{const r=Zre("x",e,t,n),s=Zre("k",e,t,n),o=Zre("sorted",e,t,n),a=i.topk(r,s,o);return[a.values,a.indices]}case"UpperBound":{const r=Zre("sortedSequence",e,t,n),s=Zre("values",e,t,n);return[i.upperBound(r,s)]}case"Unique":{const r=Zre("x",e,t,n),s=i.unique(r);return[s.values,s.indices]}case"UniqueV2":{const r=Zre("x",e,t,n),s=Zre("axis",e,t,n),o=i.unique(r,s);return[o.values,o.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"image":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"ResizeBilinear":{const r=Zre("images",e,t,n),s=Zre("size",e,t,n),o=Zre("alignCorners",e,t,n),a=Zre("halfPixelCenters",e,t,n);return[i.image.resizeBilinear(r,[s[0],s[1]],o,a)]}case"ResizeNearestNeighbor":{const r=Zre("images",e,t,n),s=Zre("size",e,t,n),o=Zre("alignCorners",e,t,n),a=Zre("halfPixelCenters",e,t,n);return[i.image.resizeNearestNeighbor(r,[s[0],s[1]],o,a)]}case"CropAndResize":{const r=Zre("image",e,t,n),s=Zre("boxes",e,t,n),o=Zre("boxInd",e,t,n),a=Zre("cropSize",e,t,n),l=Zre("method",e,t,n),u=Zre("extrapolationValue",e,t,n);return[i.image.cropAndResize(r,s,o,a,l,u)]}case"ImageProjectiveTransformV3":{const r=Zre("images",e,t,n),s=Zre("transforms",e,t,n),o=Zre("outputShape",e,t,n),a=Zre("fillValue",e,t,n),l=Zre("interpolation",e,t,n),u=Zre("fillMode",e,t,n);return[i.image.transform(r,s,l.toLowerCase(),u.toLowerCase(),a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"graph":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=Zre("default",e,t,n);return[Qre(e.name,t,n)||r];case"Placeholder":return[Qre(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[rse(Zre("x",e,t,n))];case"IdentityN":return Zre("x",e,t,n).map(e=>rse(e));case"Shape":return[i.tensor1d(Zre("x",e,t,n).shape,"int32")];case"ShapeN":return Zre("x",e,t,n).map(e=>i.tensor1d(e.shape));case"Size":return[i.scalar(Zre("x",e,t,n).size,"int32")];case"Rank":return[i.scalar(Zre("x",e,t,n).rank,"int32")];case"NoOp":return[i.scalar(1)];case"Print":const s=Zre("x",e,t,n),o=Zre("data",e,t,n),a=Zre("message",e,t,n),l=Zre("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(a);for(let e=0;e((e,t,n,i=Fe)=>{switch(e.op){case"Equal":return[i.equal(Zre("a",e,t,n),Zre("b",e,t,n))];case"NotEqual":return[i.notEqual(Zre("a",e,t,n),Zre("b",e,t,n))];case"Greater":return[i.greater(Zre("a",e,t,n),Zre("b",e,t,n))];case"GreaterEqual":return[i.greaterEqual(Zre("a",e,t,n),Zre("b",e,t,n))];case"Less":return[i.less(Zre("a",e,t,n),Zre("b",e,t,n))];case"LessEqual":return[i.lessEqual(Zre("a",e,t,n),Zre("b",e,t,n))];case"LogicalAnd":return[i.logicalAnd(Zre("a",e,t,n),Zre("b",e,t,n))];case"LogicalNot":return[i.logicalNot(Zre("a",e,t,n))];case"LogicalOr":return[i.logicalOr(Zre("a",e,t,n),Zre("b",e,t,n))];case"Select":case"SelectV2":return[i.where(Zre("condition",e,t,n),Zre("a",e,t,n),Zre("b",e,t,n))];case"BitwiseAnd":return[i.bitwiseAnd(Zre("a",e,t,n),Zre("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"matrices":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[i.matMul(Zre("a",e,t,n),Zre("b",e,t,n),Zre("transposeA",e,t,n),Zre("transposeB",e,t,n))];case"Einsum":return[i.einsum(Zre("equation",e,t,n),...Zre("tensors",e,t,n))];case"Transpose":return[i.transpose(Zre("x",e,t,n),Zre("perm",e,t,n))];case"_FusedMatMul":const[r,s]=Zre("fusedOps",e,t,n),o="biasadd"===r,a="prelu"===s,l=Zre("numArgs",e,t,n),u=Zre("leakyreluAlpha",e,t,n);if(o){if(a&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,d]=Zre("args",e,t,n);return[i.fused.matMul({a:Zre("a",e,t,n),b:Zre("b",e,t,n),transposeA:Zre("transposeA",e,t,n),transposeB:Zre("transposeB",e,t,n),bias:c,activation:s,preluActivationWeights:d,leakyreluAlpha:u})];case"MatrixBandPart":return[i.linalg.bandPart(Zre("a",e,t,n),Zre("numLower",e,t,n),Zre("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"normalization":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"EuclideanNorm":return[i.euclideanNorm(Zre("x",e,t,n),Zre("axis",e,t,n),Zre("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[i.batchNorm(Zre("x",e,t,n),Zre("mean",e,t,n),Zre("variance",e,t,n),Zre("offset",e,t,n),Zre("scale",e,t,n),Zre("epsilon",e,t,n))];case"LRN":return[i.localResponseNormalization(Zre("x",e,t,n),Zre("radius",e,t,n),Zre("bias",e,t,n),Zre("alpha",e,t,n),Zre("beta",e,t,n))];case"Softmax":return[i.softmax(Zre("x",e,t,n))];case"LogSoftmax":return[i.logSoftmax(Zre("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"ragged":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:s}=i.raggedGather(Zre("paramsNestedSplits",e,t,n),Zre("paramsDenseValues",e,t,n),Zre("indices",e,t,n),Zre("outputRaggedRank",e,t,n));return r.concat(s)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:s}=i.raggedRange(Zre("starts",e,t,n),Zre("limits",e,t,n),Zre("splits",e,t,n));return[r,s]}case"RaggedTensorToTensor":return[i.raggedTensorToTensor(Zre("shape",e,t,n),Zre("values",e,t,n),Zre("defaultValue",e,t,n),Zre("rowPartitionTensors",e,t,n),Zre("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"reduction":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Max":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.max(Zre("x",e,t,n),r,s)]}case"Mean":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.mean(Zre("x",e,t,n),r,s)]}case"Min":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.min(Zre("x",e,t,n),r,s)]}case"Sum":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.sum(Zre("x",e,t,n),r,s)]}case"All":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.all(Zre("x",e,t,n),r,s)]}case"Any":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.any(Zre("x",e,t,n),r,s)]}case"ArgMax":{const r=Zre("axis",e,t,n);return[i.argMax(Zre("x",e,t,n),r)]}case"ArgMin":{const r=Zre("axis",e,t,n);return[i.argMin(Zre("x",e,t,n),r)]}case"Prod":{const r=Zre("axis",e,t,n),s=Zre("keepDims",e,t,n);return[i.prod(Zre("x",e,t,n),r,s)]}case"Cumprod":{const r=Zre("axis",e,t,n),s=Zre("exclusive",e,t,n),o=Zre("reverse",e,t,n);return[i.cumprod(Zre("x",e,t,n),r,s,o)]}case"Cumsum":{const r=Zre("axis",e,t,n),s=Zre("exclusive",e,t,n),o=Zre("reverse",e,t,n);return[i.cumsum(Zre("x",e,t,n),r,s,o)]}case"Bincount":const r=Zre("x",e,t,n),s=Zre("weights",e,t,n),o=Zre("size",e,t,n);return[i.bincount(r,s,o)];case"DenseBincount":{const r=Zre("x",e,t,n),s=Zre("weights",e,t,n),o=Zre("size",e,t,n),a=Zre("binaryOutput",e,t,n);return[i.denseBincount(r,s,o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"slice_join":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=Zre("n",e,t,n),s=Zre("axis",e,t,n);let o=Zre("tensors",e,t,n);return o=o.slice(0,r),[i.concat(o,s)]}case"Gather":{const r=Zre("x",e,t,n),s=Zre("indices",e,t,n);return[i.gather(r,i.cast(s,"int32"),0)]}case"GatherV2":{const r=Zre("axis",e,t,n),s=Zre("batchDims",e,t,n),o=Zre("x",e,t,n),a=Zre("indices",e,t,n);return[i.gather(o,i.cast(a,"int32"),r,s)]}case"Reverse":{const r=Zre("dims",e,t,n),s=[];for(let e=0;e{const r=Zre("axis",e,t,n),s=Zre("tensors",e,t,n),o=s[0].shape,a=i.squeeze(s[0]).shape,l=s.map(e=>{const t=p3.util.arraysEqual(e.shape,o);if(!t&&!p3.util.arraysEqual(i.squeeze(e).shape,a))throw new Error("the input tensors shape does not match");return t?e:i.reshape(e,o)});return[i.stack(l,r)]});case"Unpack":{const r=Zre("axis",e,t,n),s=Zre("tensor",e,t,n);return i.unstack(s,r)}case"Tile":{const r=Zre("reps",e,t,n);return[i.tile(Zre("x",e,t,n),r)]}case"Split":case"SplitV":{const r=Zre("axis",e,t,n),s=Zre("numOrSizeSplits",e,t,n),o=Zre("x",e,t,n);return i.split(o,s,r)}case"ScatterNd":{const r=Zre("indices",e,t,n),s=Zre("values",e,t,n),o=Zre("shape",e,t,n);return[i.scatterND(r,s,o)]}case"GatherNd":{const r=Zre("x",e,t,n),s=Zre("indices",e,t,n);return[i.gatherND(r,s)]}case"SparseToDense":{const r=Zre("sparseIndices",e,t,n),s=Zre("outputShape",e,t,n),o=Zre("sparseValues",e,t,n),a=Zre("defaultValue",e,t,n);return[i.sparseToDense(r,o,s,o.dtype===a.dtype?a:i.cast(a,o.dtype))]}case"TensorScatterUpdate":{const r=Zre("indices",e,t,n),s=Zre("values",e,t,n),o=Zre("tensor",e,t,n);return[i.tensorScatterUpdate(o,r,s)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"sparse":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:s,emptyRowIndicator:o,reverseIndexMap:a}=i.sparse.sparseFillEmptyRows(Zre("indices",e,t,n),Zre("values",e,t,n),Zre("denseShape",e,t,n),Zre("defaultValue",e,t,n));return[r,s,o,a]}case"SparseReshape":{const{outputIndices:r,outputShape:s}=i.sparse.sparseReshape(Zre("inputIndices",e,t,n),Zre("inputShape",e,t,n),Zre("newShape",e,t,n));return[r,s]}case"SparseSegmentMean":return[i.sparse.sparseSegmentMean(Zre("data",e,t,n),Zre("indices",e,t,n),Zre("segmentIds",e,t,n))];case"SparseSegmentSum":return[i.sparse.sparseSegmentSum(Zre("data",e,t,n),Zre("indices",e,t,n),Zre("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"spectral":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"FFT":return[i.fft(Zre("x",e,t,n))];case"IFFT":return[i.ifft(Zre("x",e,t,n))];case"RFFT":return[i.rfft(Zre("x",e,t,n))];case"IRFFT":return[i.irfft(Zre("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"string":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"StaticRegexReplace":return[i.string.staticRegexReplace(Zre("input",e,t,n),Zre("pattern",e,t,n),Zre("rewrite",e,t,n),Zre("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:s}=i.string.stringNGrams(Zre("data",e,t,n),Zre("dataSplits",e,t,n),Zre("separator",e,t,n),Zre("nGramWidths",e,t,n),Zre("leftPad",e,t,n),Zre("rightPad",e,t,n),Zre("padWidth",e,t,n),Zre("preserveShortSequences",e,t,n));return[r,s]}case"StringSplit":{const{indices:r,values:s,shape:o}=i.string.stringSplit(Zre("input",e,t,n),Zre("delimiter",e,t,n),Zre("skipEmpty",e,t,n));return[r,s,o]}case"StringToHashBucketFast":return[i.string.stringToHashBucketFast(Zre("input",e,t,n),Zre("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"transformation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Cast":return[i.cast(Zre("x",e,t,n),Zre("dtype",e,t,n))];case"ExpandDims":{const r=Zre("axis",e,t,n);return[i.expandDims(Zre("x",e,t,n),r)]}case"Squeeze":{const r=Zre("axis",e,t,n);return[i.squeeze(Zre("x",e,t,n),r)]}case"Reshape":return[i.reshape(Zre("x",e,t,n),Zre("shape",e,t,n))];case"EnsureShape":return[i.ensureShape(Zre("x",e,t,n),Zre("shape",e,t,n))];case"MirrorPad":return[i.mirrorPad(Zre("x",e,t,n),Zre("padding",e,t,n),Zre("mode",e,t,n))];case"PadV2":case"Pad":return[i.pad(Zre("x",e,t,n),Zre("padding",e,t,n),Zre("constantValue",e,t,n))];case"SpaceToBatchND":{const r=Zre("blockShape",e,t,n),s=Zre("paddings",e,t,n);return[i.spaceToBatchND(Zre("x",e,t,n),r,s)]}case"BatchToSpaceND":{const r=Zre("blockShape",e,t,n),s=Zre("crops",e,t,n);return[i.batchToSpaceND(Zre("x",e,t,n),r,s)]}case"DepthToSpace":{const r=Zre("blockSize",e,t,n),s=Zre("dataFormat",e,t,n).toUpperCase();return[i.depthToSpace(Zre("x",e,t,n),r,s)]}case"BroadcastTo":return[i.broadcastTo(Zre("x",e,t,n),Zre("shape",e,t,n))];case"BroadcastArgs":return[i.broadcastArgs(Zre("s0",e,t,n),Zre("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"hash_table":return(async(e,t,n,i)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=i.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=Zre("keyDType",e,t,n),s=Zre("valueDType",e,t,n),o=new Kse(r,s);return i.addHashTable(e.name,o),[o.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=Zre("tableHandle",e,t,n,i),s=Zre("keys",e,t,n),o=Zre("values",e,t,n),a=i.getHashTableById(r.id);return[await a.import(s,o)]}case"LookupTableFind":case"LookupTableFindV2":{const r=Zre("tableHandle",e,t,n,i),s=Zre("keys",e,t,n),o=Zre("defaultValue",e,t,n),a=i.getHashTableById(r.id);return[await a.find(s,o)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=Zre("tableHandle",e,t,n,i);return[i.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,i);case"custom":const s=qre(e.op);if(s&&s.customExecutor)return s.customExecutor(new $se(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return p3.util.isPromise(s)?s.then(e=>[].concat(e)):[].concat(s)}class Qse{constructor(e={},t={},n={},i={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=i,this.parseNodeNameCache=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -11828,7 +11828,7 @@ function Wse(e,t,n,i,r=u3.tidy){const s=((e,t,n)=>{switch(e.category){case"arith * limitations under the License. * ============================================================================= */ -function qse(e,t,n,i){const r=new Set,s=[];let o=null,a=null;const l=new Set,u=new Set(Object.keys(e).map(e=>Qre(e)[0]));i=i||[];const c=new Set(i.map(e=>Qre(e.name)[0])),d=[...t];for(;d.length>0;){const e=d.pop();(toe(e)||noe(e)||ioe(e))&&null==o&&(o=e,a=o.children.map(e=>e.name).filter(e=>r.has(e))),r.add(e.name),null==n[e.name]&&(u.has(e.name)||c.has(e.name)||(0!==e.inputs.length?e.inputs.forEach(e=>{l.has(e.name)||(l.add(e.name),d.push(e))}):s.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:o,syncInputs:a}}function Kse(e,t){const{usedNodes:n,inputs:i}=t,r=Object.keys(i).map(e=>Qre(e)[0]).map(t=>e.nodes[t]),s=e.initNodes||[],o=e=>n.has("string"==typeof e?e:e.name);function a(e){return[...new Map(e.map(e=>[e.name,e])).values()]}const l=a([...r,...e.weights,...s]).filter(o),u=a([...l,...Object.values(e.nodes)]).filter(o),c=new Map(u.map(e=>[e.name,e])),d={};for(const e of u){d[e.name]=d[e.name]||0;for(const t of e.children)o(t)||(d[t.name]=Number.POSITIVE_INFINITY),d[t.name]=(d[t.name]||0)+1}const h=Object.entries(d).filter(([,e])=>0===e).map(([e])=>e),p=[...h];for(;h.length>0;){const e=h.pop(),t=c.get(e);for(const e of t.children.filter(o))0===--d[e.name]&&(p.push(e.name),h.push(e.name))}const f=function(e,t){const n=new Map(e.map(e=>[e.name,e])),i=t.map(e=>e.name),r=new Set(i);for(;i.length>0;){const e=i.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),i.push(e.name))}const s=e.filter(e=>r.has(e.name));return s}(p.map(e=>c.get(e)),l);return function(e,t){const n=new Map(e.map((e,t)=>[e.name,t])),i=new Set(t.map(e=>e.name)),r=e=>i.has("string"==typeof e?e:e.name),s=new Set(e.map(e=>e.name)),o=e=>s.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(o)){if(!n.has(e.name))throw new Zse(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new Zse(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!r(t))for(const e of t.inputs){if(!n.has(e.name))throw new Zse(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new Zse(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class Zse extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const Qse=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),Jse=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),eoe=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function toe(e){return Qse.has(e.op)}function noe(e){return Jse.has(e.op)}function ioe(e){return eoe.has(e.op)} +function Jse(e,t,n,i){const r=new Set,s=[];let o=null,a=null;const l=new Set,u=new Set(Object.keys(e).map(e=>nse(e)[0]));i=i||[];const c=new Set(i.map(e=>nse(e.name)[0])),d=[...t];for(;d.length>0;){const e=d.pop();(soe(e)||ooe(e)||aoe(e))&&null==o&&(o=e,a=o.children.map(e=>e.name).filter(e=>r.has(e))),r.add(e.name),null==n[e.name]&&(u.has(e.name)||c.has(e.name)||(0!==e.inputs.length?e.inputs.forEach(e=>{l.has(e.name)||(l.add(e.name),d.push(e))}):s.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:o,syncInputs:a}}function eoe(e,t){const{usedNodes:n,inputs:i}=t,r=Object.keys(i).map(e=>nse(e)[0]).map(t=>e.nodes[t]),s=e.initNodes||[],o=e=>n.has("string"==typeof e?e:e.name);function a(e){return[...new Map(e.map(e=>[e.name,e])).values()]}const l=a([...r,...e.weights,...s]).filter(o),u=a([...l,...Object.values(e.nodes)]).filter(o),c=new Map(u.map(e=>[e.name,e])),d={};for(const e of u){d[e.name]=d[e.name]||0;for(const t of e.children)o(t)||(d[t.name]=Number.POSITIVE_INFINITY),d[t.name]=(d[t.name]||0)+1}const h=Object.entries(d).filter(([,e])=>0===e).map(([e])=>e),p=[...h];for(;h.length>0;){const e=h.pop(),t=c.get(e);for(const e of t.children.filter(o))0===--d[e.name]&&(p.push(e.name),h.push(e.name))}const f=function(e,t){const n=new Map(e.map(e=>[e.name,e])),i=t.map(e=>e.name),r=new Set(i);for(;i.length>0;){const e=i.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),i.push(e.name))}const s=e.filter(e=>r.has(e.name));return s}(p.map(e=>c.get(e)),l);return function(e,t){const n=new Map(e.map((e,t)=>[e.name,t])),i=new Set(t.map(e=>e.name)),r=e=>i.has("string"==typeof e?e:e.name),s=new Set(e.map(e=>e.name)),o=e=>s.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(o)){if(!n.has(e.name))throw new toe(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new toe(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!r(t))for(const e of t.inputs){if(!n.has(e.name))throw new toe(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new toe(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class toe extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const noe=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),ioe=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),roe=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function soe(e){return noe.has(e.op)}function ooe(e){return ioe.has(e.op)}function aoe(e){return roe.has(e.op)} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11845,7 +11845,7 @@ function qse(e,t,n,i){const r=new Set,s=[];let o=null,a=null;const l=new Set,u=n * limitations under the License. * ============================================================================= */ -class roe{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map(t=>e[t].map(e=>e.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach(t=>{this._functionExecutorMap[t]=new roe(e.functions[t],this)})}getCompilationKey(e,t){const n=e.map(e=>e.name).sort(),i=t.map(e=>e.name).sort();return n.join(this.SEPARATOR)+"--"+i.join(this.SEPARATOR)}compile(e,t){const n=qse(e,t,this.weightMap,this._initNodes),{missingInputs:i,dynamicNode:r,syncInputs:s}=n;if(null!=r)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(i.length>0){const n=t.map(e=>e.name),r=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${r}]. Missing the following inputs: [${i}]`)}const o=Kse(this.graph,n),a=function(e){const t=new Map(e.map((e,t)=>[e.name,t])),n=Number.MAX_SAFE_INTEGER,i=e.map((e,t)=>toe(e)?n:t),r=e=>{const n=i[t.get(e.name)];return null==n?-1:n},s=e.map((e,t)=>e.children.map(r).reduce((e,t)=>Math.max(e,t),i[t])),o=new Map;for(let t=0;tthis.cloneAndKeepTensor(e))}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this.cloneTensorList(t)]))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const i=n.map(e=>this.graph.nodes[Qre(e)[0]]),r=t.map(e=>Qre(e)[0]),s=new Set(r);let o=r.map(e=>this.graph.nodes[e]);0===o.length&&(o=this._outputs);const a=this.getCompilationKey(i,o);let l=this.compiledMap.get(a);null==l&&(l=this.compile(e,o),this.compiledMap.set(a,l));try{this.keepIntermediateTensors=(0,u3.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const u={},c={};return(0,u3.tidy)(()=>{const n=new Xse(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),i=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach(t=>{const[r,s]=Qre(t,n),o=[];o[s]=e[t],i[r]=o,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(o))});const r=this.getFrozenTensorIds(i),{orderedNodes:o,nodeLiveUntilMap:a}=l;for(const e of o){if(i[e.name])continue;const t=Wse(e,i,n,this._resourceManager);if(u3.util.isPromise(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);i[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,i,n,r,s,a.get(e.name))}return null==this.parent&&n.dispose(r),t.map(e=>Xre(e,i,n))})}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map(t=>e[t]).map(e=>e.map(e=>e.id)));return new Set(t)}checkTensorForDisposal(e,t,n,i,r,s,o){if(!toe(t)&&!s.has(e)){for(const i of n[e])null!=i&&(o[i.id]=(o[i.id]||0)+t.children.length);for(const e of t.inputs){if(toe(e))continue;const t=qre(e.name,n,i);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,i,r,s){function o(e){return toe(e)||r.has(e.name)}if(!toe(e)&&null!=s)for(const e of s){if(o(e))continue;const r=qre(e.name,t,n);for(const e of r)!e||e.kept||i.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,i={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=(0,u3.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const s=new Xse(this.weightMap,i,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const o=await this.executeWithControlFlow(e,s,t,n),a=t.map(e=>Xre(e,o,s)),l=a.map(e=>e.id),u=Object.keys(e).map(t=>e[t].id),c=new Set([...l,...u,...this.weightIds]);return Object.values(o).forEach(e=>{e.forEach(e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()})}),null==this.parent&&s.dispose(c),a}async executeFunctionAsync(e,t,n){const i=e.reduce((e,t,n)=>(e[this.inputs[n].name]=t,e),{});return this._executeAsync(i,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,i){const r=Object.keys(e),s=r.map(e=>this.graph.nodes[Qre(e)[0]]),o=n.map(e=>Qre(e)[0]),a=new Set(o);let l=o.map(e=>this.graph.nodes[e]);0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:d,syncInputs:h}=qse(e,l,this.weightMap,this._initNodes),p=[...s,...this.graph.weights,...this._initNodes||[]].map(e=>({node:e,contexts:t.currentContext})),f=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,i]=Qre(t),r=[];r[i]=e[t],f[n]=r});const m={},g=this.getFrozenTensorIds(f),_={};for(;p.length>0;){const e=this.processStack(s,p,t,f,_,g,a,m,u);await Promise.all(e)}null!=d||i||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=l.filter(e=>!toe(e)&&!Xre(e.name,f,t)).map(e=>e.name);if(y.length>0){let e="";throw null!=d&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,i,r,s,o,a,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&Wre("isConstant",e.node,i,n)&&([c]=Kre(e.node.name,n)),null==i[e.node.name]){const d=Wse(e.node,i,n,this._resourceManager);c||([c]=Kre(e.node.name,n));const h=n.currentContext;u3.util.isPromise(d)?u.push(d.then(u=>(i[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=h,this.checkTensorForDisposal(c,e.node,i,n,s,o,a),this.processChildNodes(e.node,t,n,i,r,l),u))):(i[c]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(d)),this.checkTensorForDisposal(c,e.node,i,n,s,o,a),this.processChildNodes(e.node,t,n,i,r,l))}else this.processChildNodes(e.node,t,n,i,r,l)}return u}processChildNodes(e,t,n,i,r,s){e.children.forEach(e=>{const[o]=Kre(e.name,n);!r[o]&&s.has(e.name)&&("Merge"===e.op?e.inputNames.some(e=>!!Xre(e,i,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every(e=>!!Xre(e,i,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:e})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(e=>e.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{const n=e[t],[i]=Qre(t),r=this.graph.nodes[i];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value,t=e.length===n.shape.length&&n.shape.every((t,n)=>-1===e[n]||e[n]===t);u3.util.assert(t,()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`)}r.attrParams.dtype&&r.attrParams.dtype.value&&u3.util.assert(n.dtype===r.attrParams.dtype.value,()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){var t,n;const i={};for(const r in e){const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=s?i[s.name]=e[r]:i[r]=e[r]}return i}checkInputs(e){const t=Object.keys(e).filter(e=>{const[t]=Qre(e);return null==this.graph.nodes[t]});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(e=>{var t,n;const i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=i?i.name:e},{})}checkOutputs(e){e.forEach(e=>{const[t]=Qre(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)})}}class soe{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}var ooe=__webpack_require__(77084); +class loe{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map(t=>e[t].map(e=>e.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach(t=>{this._functionExecutorMap[t]=new loe(e.functions[t],this)})}getCompilationKey(e,t){const n=e.map(e=>e.name).sort(),i=t.map(e=>e.name).sort();return n.join(this.SEPARATOR)+"--"+i.join(this.SEPARATOR)}compile(e,t){const n=Jse(e,t,this.weightMap,this._initNodes),{missingInputs:i,dynamicNode:r,syncInputs:s}=n;if(null!=r)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(i.length>0){const n=t.map(e=>e.name),r=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${r}]. Missing the following inputs: [${i}]`)}const o=eoe(this.graph,n),a=function(e){const t=new Map(e.map((e,t)=>[e.name,t])),n=Number.MAX_SAFE_INTEGER,i=e.map((e,t)=>soe(e)?n:t),r=e=>{const n=i[t.get(e.name)];return null==n?-1:n},s=e.map((e,t)=>e.children.map(r).reduce((e,t)=>Math.max(e,t),i[t])),o=new Map;for(let t=0;tthis.cloneAndKeepTensor(e))}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this.cloneTensorList(t)]))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const i=n.map(e=>this.graph.nodes[nse(e)[0]]),r=t.map(e=>nse(e)[0]),s=new Set(r);let o=r.map(e=>this.graph.nodes[e]);0===o.length&&(o=this._outputs);const a=this.getCompilationKey(i,o);let l=this.compiledMap.get(a);null==l&&(l=this.compile(e,o),this.compiledMap.set(a,l));try{this.keepIntermediateTensors=(0,p3.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const u={},c={};return(0,p3.tidy)(()=>{const n=new Qse(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),i=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach(t=>{const[r,s]=nse(t,n),o=[];o[s]=e[t],i[r]=o,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(o))});const r=this.getFrozenTensorIds(i),{orderedNodes:o,nodeLiveUntilMap:a}=l;for(const e of o){if(i[e.name])continue;const t=Zse(e,i,n,this._resourceManager);if(p3.util.isPromise(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);i[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,i,n,r,s,a.get(e.name))}return null==this.parent&&n.dispose(r),t.map(e=>Qre(e,i,n))})}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map(t=>e[t]).map(e=>e.map(e=>e.id)));return new Set(t)}checkTensorForDisposal(e,t,n,i,r,s,o){if(!soe(t)&&!s.has(e)){for(const i of n[e])null!=i&&(o[i.id]=(o[i.id]||0)+t.children.length);for(const e of t.inputs){if(soe(e))continue;const t=Jre(e.name,n,i);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,i,r,s){function o(e){return soe(e)||r.has(e.name)}if(!soe(e)&&null!=s)for(const e of s){if(o(e))continue;const r=Jre(e.name,t,n);for(const e of r)!e||e.kept||i.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,i={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=(0,p3.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const s=new Qse(this.weightMap,i,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const o=await this.executeWithControlFlow(e,s,t,n),a=t.map(e=>Qre(e,o,s)),l=a.map(e=>e.id),u=Object.keys(e).map(t=>e[t].id),c=new Set([...l,...u,...this.weightIds]);return Object.values(o).forEach(e=>{e.forEach(e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()})}),null==this.parent&&s.dispose(c),a}async executeFunctionAsync(e,t,n){const i=e.reduce((e,t,n)=>(e[this.inputs[n].name]=t,e),{});return this._executeAsync(i,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,i){const r=Object.keys(e),s=r.map(e=>this.graph.nodes[nse(e)[0]]),o=n.map(e=>nse(e)[0]),a=new Set(o);let l=o.map(e=>this.graph.nodes[e]);0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:d,syncInputs:h}=Jse(e,l,this.weightMap,this._initNodes),p=[...s,...this.graph.weights,...this._initNodes||[]].map(e=>({node:e,contexts:t.currentContext})),f=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,i]=nse(t),r=[];r[i]=e[t],f[n]=r});const m={},g=this.getFrozenTensorIds(f),_={};for(;p.length>0;){const e=this.processStack(s,p,t,f,_,g,a,m,u);await Promise.all(e)}null!=d||i||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=l.filter(e=>!soe(e)&&!Qre(e.name,f,t)).map(e=>e.name);if(y.length>0){let e="";throw null!=d&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,i,r,s,o,a,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&Zre("isConstant",e.node,i,n)&&([c]=ese(e.node.name,n)),null==i[e.node.name]){const d=Zse(e.node,i,n,this._resourceManager);c||([c]=ese(e.node.name,n));const h=n.currentContext;p3.util.isPromise(d)?u.push(d.then(u=>(i[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=h,this.checkTensorForDisposal(c,e.node,i,n,s,o,a),this.processChildNodes(e.node,t,n,i,r,l),u))):(i[c]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(d)),this.checkTensorForDisposal(c,e.node,i,n,s,o,a),this.processChildNodes(e.node,t,n,i,r,l))}else this.processChildNodes(e.node,t,n,i,r,l)}return u}processChildNodes(e,t,n,i,r,s){e.children.forEach(e=>{const[o]=ese(e.name,n);!r[o]&&s.has(e.name)&&("Merge"===e.op?e.inputNames.some(e=>!!Qre(e,i,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every(e=>!!Qre(e,i,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:e})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(e=>e.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{const n=e[t],[i]=nse(t),r=this.graph.nodes[i];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value,t=e.length===n.shape.length&&n.shape.every((t,n)=>-1===e[n]||e[n]===t);p3.util.assert(t,()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`)}r.attrParams.dtype&&r.attrParams.dtype.value&&p3.util.assert(n.dtype===r.attrParams.dtype.value,()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){var t,n;const i={};for(const r in e){const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=s?i[s.name]=e[r]:i[r]=e[r]}return i}checkInputs(e){const t=Object.keys(e).filter(e=>{const[t]=nse(e);return null==this.graph.nodes[t]});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(e=>{var t,n;const i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=i?i.name:e},{})}checkOutputs(e){e.forEach(e=>{const[t]=nse(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)})}}class uoe{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}var coe=__webpack_require__(77084); /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11862,9 +11862,9 @@ class roe{get weightIds(){return this.parent?this.parent.weightIds:this._weightI * limitations under the License. * ============================================================================= */ -const aoe="?tfjs-format=file",loe="model.json";class uoe{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},n=u3.io){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=n,null==t&&(this.loadOptions={}),this.resourceManager=new soe}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return u3.util.isPromise(e)?e.then(e=>null==e.getWeightStream?this.loadSync(e):this.loadStreaming(e)):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(null==e.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const t=await(0,ooe.s5)(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let i=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(i=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=i,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new roe(bse.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=bse.Instance.transformGraph(e.modelInitializer);this.initializer=new roe(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t=e instanceof u3.Tensor?[e]:e,n={};return t.forEach((e,t)=>n[this.structuredOutputKeys[t]]=e),n}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof u3.Tensor||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const i=n[t];null!=i.resourceId&&(e[t]=this.resourceIdToCapturedInput[i.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let i=0;return this.inputNodes.reduce((t,n)=>{var r,s,o;const a=null===(o=null===(s=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===s?void 0:s[n])||void 0===o?void 0:o.resourceId;return t[n]=null!=a?this.resourceIdToCapturedInput[a]:e[i++],t},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let i=0;i1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&(0,u3.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function coe(e,t={},n=u3.io){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&"string"==typeof e&&(e=function(e){e.endsWith("/")||(e+="/");return`${e}${loe}${aoe}`}(e));const i=new uoe(e,t,n);return await i.load(),i}function doe(e){if(null==e)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){const[n,i]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!(i&&i instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");const r=u3.io.getWeightSpecs(n.weightsManifest),s=u3.io.getModelArtifactsForJSONSync(n,r,i);t=u3.io.fromMemorySync(s)}else if("load"in e)t=e;else{if(!("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e))throw new Error("Unknown model format");t=u3.io.fromMemorySync(e)}const n=new uoe(t);return n.load(),n} +const doe="?tfjs-format=file",hoe="model.json";class poe{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},n=p3.io){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=n,null==t&&(this.loadOptions={}),this.resourceManager=new uoe}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return p3.util.isPromise(e)?e.then(e=>null==e.getWeightStream?this.loadSync(e):this.loadStreaming(e)):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(null==e.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const t=await(0,coe.s5)(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let i=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(i=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=i,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new loe(wse.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=wse.Instance.transformGraph(e.modelInitializer);this.initializer=new loe(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t=e instanceof p3.Tensor?[e]:e,n={};return t.forEach((e,t)=>n[this.structuredOutputKeys[t]]=e),n}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof p3.Tensor||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const i=n[t];null!=i.resourceId&&(e[t]=this.resourceIdToCapturedInput[i.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let i=0;return this.inputNodes.reduce((t,n)=>{var r,s,o;const a=null===(o=null===(s=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===s?void 0:s[n])||void 0===o?void 0:o.resourceId;return t[n]=null!=a?this.resourceIdToCapturedInput[a]:e[i++],t},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let i=0;i1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&(0,p3.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function foe(e,t={},n=p3.io){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&"string"==typeof e&&(e=function(e){e.endsWith("/")||(e+="/");return`${e}${hoe}${doe}`}(e));const i=new poe(e,t,n);return await i.load(),i}function moe(e){if(null==e)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){const[n,i]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!(i&&i instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");const r=p3.io.getWeightSpecs(n.weightsManifest),s=p3.io.getModelArtifactsForJSONSync(n,r,i);t=p3.io.fromMemorySync(s)}else if("load"in e)t=e;else{if(!("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e))throw new Error("Unknown model format");t=p3.io.fromMemorySync(e)}const n=new poe(t);return n.load(),n} /** @license See the LICENSE file. */ -const hoe="4.22.0"; +const goe="4.22.0"; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11881,7 +11881,7 @@ const hoe="4.22.0"; * limitations under the License. * ============================================================================= */ -var poe,foe=__webpack_require__(7391);function moe(e,t,n=new Map,i=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(i.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse){if(boe(e)){const r=Array.isArray(e)?[]:{};i.add(e);for(const s in e){const o=moe(e[s],t,n,i);r[s]=o}return i.delete(e),e.__proto__&&(r.__proto__=e.__proto__),r}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,r.value),r.value}function goe(e,t=yoe){return _oe(e,t)}function _oe(e,t,n=new Set){const i=e[0];if(n.has(i))throw new Error("Circular references are not supported.");const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse){if(boe(i)){const r=Array.isArray(i)?[]:{};n.add(i);for(const s in i){const i=_oe(e.map(e=>e[s]),t,n);r[s]=i}return n.delete(i),r}throw new Error(`Can't recurse into non-iterable type: ${i}`)}return r.value}function yoe(e){return null===e?null:boe(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function voe(e,t){const n=new Map;moe(e,t,n);for(const e of Array.from(n.keys())){const t=n.get(e);if(u3.util.isPromise(t)){const i=await t;n.set(e,i)}}return moe(e,t,n)}function boe(e){let t=!1;if(u3.env().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(80551);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof u3.Tensor)&&!(e instanceof Promise)&&!t)} +var _oe,yoe=__webpack_require__(7391);function voe(e,t,n=new Map,i=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(i.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse){if(woe(e)){const r=Array.isArray(e)?[]:{};i.add(e);for(const s in e){const o=voe(e[s],t,n,i);r[s]=o}return i.delete(e),e.__proto__&&(r.__proto__=e.__proto__),r}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,r.value),r.value}function boe(e,t=xoe){return Toe(e,t)}function Toe(e,t,n=new Set){const i=e[0];if(n.has(i))throw new Error("Circular references are not supported.");const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse){if(woe(i)){const r=Array.isArray(i)?[]:{};n.add(i);for(const s in i){const i=Toe(e.map(e=>e[s]),t,n);r[s]=i}return n.delete(i),r}throw new Error(`Can't recurse into non-iterable type: ${i}`)}return r.value}function xoe(e){return null===e?null:woe(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function Eoe(e,t){const n=new Map;voe(e,t,n);for(const e of Array.from(n.keys())){const t=n.get(e);if(p3.util.isPromise(t)){const i=await t;n.set(e,i)}}return voe(e,t,n)}function woe(e){let t=!1;if(p3.env().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(80551);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof p3.Tensor)&&!(e instanceof Promise)&&!t)} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11899,7 +11899,7 @@ var poe,foe=__webpack_require__(7391);function moe(e,t,n=new Map,i=new Set){if(n * * ============================================================================= */ -function Toe(e){ +function Ioe(e){ /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11917,7 +11917,7 @@ function Toe(e){ * * ============================================================================= */ -return function(e,t){return moe(e,t)}(e,xoe)}function xoe(e){return e instanceof u3.Tensor?{value:e.clone(),recurse:!1}:boe(e)?{value:null,recurse:!0}:{value:e,recurse:!1}} +return function(e,t){return voe(e,t)}(e,Aoe)}function Aoe(e){return e instanceof p3.Tensor?{value:e.clone(),recurse:!1}:woe(e)?{value:null,recurse:!0}:{value:e,recurse:!1}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11935,7 +11935,7 @@ return function(e,t){return moe(e,t)}(e,xoe)}function xoe(e){return e instanceof * * ============================================================================= */ -class Eoe{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}} +class Soe{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11953,7 +11953,7 @@ class Eoe{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)thro * * ============================================================================= */ -class woe extends Eoe{constructor(){super(woe.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),n=this.length();for(let e=0;e!0===e)}rowMajorBatch(e,t=!0){return new Doe(this,e,t)}columnMajorBatch(e,t=!0,n=yoe){return this.rowMajorBatch(e,t).map(e=>goe(e,n))}concatenate(e,t){return new Voe(Ioe([this,e]),t)}take(e){return e<0||null==e?this:new Noe(this,e)}skip(e){return e<0||null==e?this:new Roe(this,e)}prefetch(e){return new joe(this,e)}shuffle(e,t){return new Yoe(this,e,t)}serial(){return new koe(this)}}class Ooe extends Coe{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:Toe(e),done:!1}}}class Moe extends Coe{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class koe extends Coe{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}}class Roe extends Coe{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class Doe extends Coe{constructor(e,t,n=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){const e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class Foe extends Coe{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;u3.dispose(e.value)}}}class Loe extends Coe{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=u3.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),i=u3.tensor_util.getTensorsInContainer(n);for(const e of t)u3.tensor_util.isTensorInList(e,i)||e.dispose();return{value:n,done:!1}}}class Poe extends Coe{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class Boe extends Coe{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=u3.tensor_util.getTensorsInContainer(e.value),n=await this.transform(e.value),i=u3.tensor_util.getTensorsInContainer(n);for(const e of t)u3.tensor_util.isTensorInList(e,i)||e.dispose();return{value:n,done:!1}}}class $oe extends Coe{constructor(){super(),this.outputQueue=new woe,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class Uoe extends $oe{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=u3.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),i=u3.tensor_util.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(const e of t)u3.tensor_util.isTensorInList(e,i)||e.dispose();return!0}}class Voe extends Coe{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(poe||(poe={}));class zoe extends Coe{constructor(e,t=poe.FAIL){super(),this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;const i=await voe(this.iterators,function(e){if(e instanceof Coe){return{value:e.next().then(e=>(t++,e.done&&n++,e.value)),recurse:!1}}return{value:null,recurse:!0}});if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case poe.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case poe.SHORTEST:return{value:null,done:!0};case poe.LONGEST:}return this.count++,{value:i,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}}class joe extends Coe{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new Eoe(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class Yoe extends joe{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=foe.alea(n||u3.util.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}} +function Ooe(e){return new Noe(e)}function Moe(e){return new Doe(e)}function koe(e,t){return new Goe(e,t)}Coe.INITIAL_CAPACITY=32;class Roe{async toArray(){const e=[];let t=await this.next();for(;!t.done;)e.push(t.value),t=await this.next();return e}async toArrayForTest(){const e=this.prefetch(100),t=[];let n=await e.next();for(;!n.done;)t.push(n.value),n=await e.next();return t}async resolveFully(){let e=await this.next();for(;!e.done;)e=await this.next()}async resolveWhile(e){let t=await this.next(),n=e(t.value);for(;!t.done&&n;)t=await this.next(),n=e(t.value)}handleErrors(e){return new Voe(this,e)}filter(e){return new $oe(this,e)}map(e){return new Uoe(this,e)}mapAsync(e){return new zoe(this,e)}serialMapAsync(e){return new zoe(this,e).serial()}flatmap(e){return new Yoe(this,e)}async forEachAsync(e){return this.map(e).resolveFully()}async serialForEach(e){return this.serialMapAsync(e).resolveWhile(e=>!0===e)}rowMajorBatch(e,t=!0){return new Boe(this,e,t)}columnMajorBatch(e,t=!0,n=xoe){return this.rowMajorBatch(e,t).map(e=>boe(e,n))}concatenate(e,t){return new Goe(Ooe([this,e]),t)}take(e){return e<0||null==e?this:new Poe(this,e)}skip(e){return e<0||null==e?this:new Loe(this,e)}prefetch(e){return new Woe(this,e)}shuffle(e,t){return new Xoe(this,e,t)}serial(){return new Foe(this)}}class Noe extends Roe{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:Ioe(e),done:!1}}}class Doe extends Roe{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class Foe extends Roe{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}}class Loe extends Roe{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class Boe extends Roe{constructor(e,t,n=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){const e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class $oe extends Roe{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;p3.dispose(e.value)}}}class Uoe extends Roe{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=p3.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),i=p3.tensor_util.getTensorsInContainer(n);for(const e of t)p3.tensor_util.isTensorInList(e,i)||e.dispose();return{value:n,done:!1}}}class Voe extends Roe{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class zoe extends Roe{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=p3.tensor_util.getTensorsInContainer(e.value),n=await this.transform(e.value),i=p3.tensor_util.getTensorsInContainer(n);for(const e of t)p3.tensor_util.isTensorInList(e,i)||e.dispose();return{value:n,done:!1}}}class joe extends Roe{constructor(){super(),this.outputQueue=new Coe,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class Yoe extends joe{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=p3.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),i=p3.tensor_util.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(const e of t)p3.tensor_util.isTensorInList(e,i)||e.dispose();return!0}}class Goe extends Roe{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(_oe||(_oe={}));class Hoe extends Roe{constructor(e,t=_oe.FAIL){super(),this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;const i=await Eoe(this.iterators,function(e){if(e instanceof Roe){return{value:e.next().then(e=>(t++,e.done&&n++,e.value)),recurse:!1}}return{value:null,recurse:!0}});if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case _oe.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case _oe.SHORTEST:return{value:null,done:!0};case _oe.LONGEST:}return this.count++,{value:i,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}}class Woe extends Roe{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new Soe(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class Xoe extends Woe{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=yoe.alea(n||p3.util.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -11989,7 +11989,7 @@ function Ioe(e){return new Ooe(e)}function Aoe(e){return new Moe(e)}function Soe * * ============================================================================= */ -class Goe{constructor(){this.size=null}batch(e,t=!0){const n=this;let i;return u3.util.assert(e>0,()=>`batchSize needs to be positive, but it is\n ${e}`),i=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),Hoe(async()=>(await n.iterator()).columnMajorBatch(e,t,qoe),i)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,Hoe(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,Hoe(async()=>(await t.iterator()).filter(t=>u3.tidy(()=>e(t))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return Hoe(async()=>(await t.iterator()).map(t=>u3.tidy(()=>e(t))),this.size)}mapAsync(e){const t=this;return Hoe(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return Hoe(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,Hoe(async()=>Soe(Aoe(async()=>({value:await t.iterator(),done:!1})).take(e)),n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const i=this,r=foe.alea(t||u3.util.now().toString());return Hoe(async()=>{let t=r.int32();return n&&(t+=r.int32()),(await i.iterator()).shuffle(e,t.toString())},this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,Hoe(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function Hoe(e,t=null){return new class extends Goe{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function Woe(e){return Hoe(async()=>Ioe(e),e.length)}function Xoe(e){if(!boe(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;nfunction(e,t=poe.FAIL){return new zoe(e,t)}(await voe(e,e=>{if(e instanceof Goe)return{value:e.iterator(),recurse:!1};if(boe(e))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")}),poe.SHORTEST),t)}function qoe(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(i=n)||"object"!=typeof i&&"function"!=typeof i||Array.isArray(n)||"object"==typeof n&&n instanceof u3.Tensor||u3.util.isTypedArray(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof u3.Tensor?u3.stack(e):u3.tensor(e)}(e),recurse:!1}}var n,i;return{value:null,recurse:!0}}Goe.MAX_BUFFER_SIZE=1e4; +class qoe{constructor(){this.size=null}batch(e,t=!0){const n=this;let i;return p3.util.assert(e>0,()=>`batchSize needs to be positive, but it is\n ${e}`),i=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),Koe(async()=>(await n.iterator()).columnMajorBatch(e,t,Joe),i)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,Koe(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,Koe(async()=>(await t.iterator()).filter(t=>p3.tidy(()=>e(t))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return Koe(async()=>(await t.iterator()).map(t=>p3.tidy(()=>e(t))),this.size)}mapAsync(e){const t=this;return Koe(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return Koe(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,Koe(async()=>koe(Moe(async()=>({value:await t.iterator(),done:!1})).take(e)),n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const i=this,r=yoe.alea(t||p3.util.now().toString());return Koe(async()=>{let t=r.int32();return n&&(t+=r.int32()),(await i.iterator()).shuffle(e,t.toString())},this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,Koe(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function Koe(e,t=null){return new class extends qoe{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function Zoe(e){return Koe(async()=>Ooe(e),e.length)}function Qoe(e){if(!woe(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;nfunction(e,t=_oe.FAIL){return new Hoe(e,t)}(await Eoe(e,e=>{if(e instanceof qoe)return{value:e.iterator(),recurse:!1};if(woe(e))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")}),_oe.SHORTEST),t)}function Joe(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(i=n)||"object"!=typeof i&&"function"!=typeof i||Array.isArray(n)||"object"==typeof n&&n instanceof p3.Tensor||p3.util.isTypedArray(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof p3.Tensor?p3.stack(e):p3.tensor(e)}(e),recurse:!1}}var n,i;return{value:null,recurse:!0}}qoe.MAX_BUFFER_SIZE=1e4; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12007,7 +12007,7 @@ class Goe{constructor(){this.size=null}batch(e,t=!0){const n=this;let i;return u * * ============================================================================= */ -class Koe extends Goe{constructor(e){super(),this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split("\n").map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}} +class eae extends qoe{constructor(e){super(),this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split("\n").map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12025,7 +12025,7 @@ class Koe extends Goe{constructor(e){super(),this.input=e}async iterator(){retur * * ============================================================================= */ -const Zoe='"',Qoe=Symbol("out"),Joe=Symbol("field"),eae=Symbol("quote"),tae=Symbol("quoteafterquote"),nae=Symbol("quoteinquote");class iae extends Goe{async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){const e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&u3.util.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);const t=this.fullColumnNames.reduce((e,t)=>(e[t]=e[t]+1||1,e),{}),n=Object.keys(t).filter(e=>t[e]>1);if(u3.util.assert(0===n.length,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs)for(const e of Object.keys(this.columnConfigs)){if(-1===this.fullColumnNames.indexOf(e))throw new Error('The key "'+e+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const e=await this.base.iterator(),t=await e.next();if(t.done)throw new Error("No data was found for CSV parsing.");const n=t.value;return this.parseRow(n,!1)}return null}constructor(e,t){super(),this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new Koe(e),t||(t={}),this.hasHeader=!1!==t.hasHeader,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(u3.util.assert(null==t.delimiter,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(e=>this.makeDataElement(e))}makeDataElement(e){const t=this.parseRow(e),n={},i={};for(let r=0;r"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);const t=this.fullColumnNames.reduce((e,t)=>(e[t]=e[t]+1||1,e),{}),n=Object.keys(t).filter(e=>t[e]>1);if(p3.util.assert(0===n.length,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs)for(const e of Object.keys(this.columnConfigs)){if(-1===this.fullColumnNames.indexOf(e))throw new Error('The key "'+e+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const e=await this.base.iterator(),t=await e.next();if(t.done)throw new Error("No data was found for CSV parsing.");const n=t.value;return this.parseRow(n,!1)}return null}constructor(e,t){super(),this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new eae(e),t||(t={}),this.hasHeader=!1!==t.hasHeader,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(p3.util.assert(null==t.delimiter,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(e=>this.makeDataElement(e))}makeDataElement(e){const t=this.parseRow(e),n={},i={};for(let r=0;r14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=!1!==e.includeSpectrogram,this.includeWaveform=!0===e.includeWaveform,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(!(0,u3.env)().get("IS_BROWSER"))throw new Error("microphone API is only supported in browser environment.");const t=new rae(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})}catch(e){throw new Error(`Error thrown while initializing video stream: ${e.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");const e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`)}else this.sampleRateHz=this.audioContext.sampleRate;const t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t;const n=await this.getAudioData();if(this.includeSpectrogram){const t=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(t,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){const e=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(e,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){const e=[],t=[];let n=0;return new Promise(i=>{const r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-1/0&&i({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),i({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){const t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((e,i)=>n.set(e,i*t)),n}getTensorFromAudioDataArray(e,t){const n=new Float32Array(u3.util.sizeFromShape(t));return n.set(e,n.length-e.length),(0,u3.tensor)(n,t)}} +class lae extends Roe{constructor(e){super(),this.microphoneConfig=e,this.isClosed=!1,this.fftSize=e.fftSize||1024;const t=Math.log2(this.fftSize);if(this.fftSize<0||t<4||t>14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=!1!==e.includeSpectrogram,this.includeWaveform=!0===e.includeWaveform,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(!(0,p3.env)().get("IS_BROWSER"))throw new Error("microphone API is only supported in browser environment.");const t=new lae(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})}catch(e){throw new Error(`Error thrown while initializing video stream: ${e.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");const e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`)}else this.sampleRateHz=this.audioContext.sampleRate;const t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t;const n=await this.getAudioData();if(this.includeSpectrogram){const t=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(t,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){const e=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(e,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){const e=[],t=[];let n=0;return new Promise(i=>{const r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-1/0&&i({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),i({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){const t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((e,i)=>n.set(e,i*t)),n}getTensorFromAudioDataArray(e,t){const n=new Float32Array(p3.util.sizeFromShape(t));return n.set(e,n.length-e.length),(0,p3.tensor)(n,t)}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12061,7 +12061,7 @@ class rae extends Coe{constructor(e){super(),this.microphoneConfig=e,this.isClos * * ============================================================================= */ -class sae extends Coe{constructor(e,t){if(super(),this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=(0,u3.tensor1d)([0],"int32"),this.webcamConfig.centerCrop){const e=1*this.webcamConfig.resizeWidth/this.webcamVideoElement.width,t=1*this.webcamConfig.resizeHeight/this.webcamVideoElement.height,n=(1-e)/2,i=(1-t)/2,r=n+e,s=t+i;this.cropBox=(0,u3.tensor2d)([i,n,s,r],[1,4])}else this.cropBox=(0,u3.tensor2d)([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(!(0,u3.env)().get("IS_BROWSER"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}const n=new sae(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&u3.util.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=u3.browser.fromPixels(this.webcamVideoElement)}catch(e){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(e)}`)}if(!this.resize)return{value:e,done:!1};try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(e){throw new Error(`Error thrown cropping the video: ${e.message}`)}finally{e.dispose()}}needToResize(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}cropAndResizeFrame(e){return(0,u3.tidy)(()=>{const t=(0,u3.expandDims)((0,u3.cast)(e,"float32"),0);let n;n=u3.image.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");const i=n.shape;return(0,u3.reshape)(n,i.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}} +class uae extends Roe{constructor(e,t){if(super(),this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=(0,p3.tensor1d)([0],"int32"),this.webcamConfig.centerCrop){const e=1*this.webcamConfig.resizeWidth/this.webcamVideoElement.width,t=1*this.webcamConfig.resizeHeight/this.webcamVideoElement.height,n=(1-e)/2,i=(1-t)/2,r=n+e,s=t+i;this.cropBox=(0,p3.tensor2d)([i,n,s,r],[1,4])}else this.cropBox=(0,p3.tensor2d)([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(!(0,p3.env)().get("IS_BROWSER"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}const n=new uae(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&p3.util.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=p3.browser.fromPixels(this.webcamVideoElement)}catch(e){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(e)}`)}if(!this.resize)return{value:e,done:!1};try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(e){throw new Error(`Error thrown cropping the video: ${e.message}`)}finally{e.dispose()}}needToResize(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}cropAndResizeFrame(e){return(0,p3.tidy)(()=>{const t=(0,p3.expandDims)((0,p3.cast)(e,"float32"),0);let n;n=p3.image.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");const i=n.shape;return(0,p3.reshape)(n,i.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12079,7 +12079,7 @@ class sae extends Coe{constructor(e,t){if(super(),this.webcamVideoElement=e,this * * ============================================================================= */ -class oae{} +class cae{} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12097,7 +12097,7 @@ class oae{} * * ============================================================================= */ -class aae extends Coe{split(e){return new lae(this,e)}}class lae extends aae{constructor(e,t){super(),this.upstream=e,this.impl=new uae(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class uae extends $oe{constructor(e,t){super(),this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){const e=await this.upstream.next();if(e.done)return""!==this.carryover&&(this.outputQueue.push(this.carryover),this.carryover="",!0);const t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(const e of t.slice(0,-1))this.outputQueue.push(e);return this.carryover=t[t.length-1],!0}} +class dae extends Roe{split(e){return new hae(this,e)}}class hae extends dae{constructor(e,t){super(),this.upstream=e,this.impl=new pae(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class pae extends joe{constructor(e,t){super(),this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){const e=await this.upstream.next();if(e.done)return""!==this.carryover&&(this.outputQueue.push(this.carryover),this.carryover="",!0);const t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(const e of t.slice(0,-1))this.outputQueue.push(e);return this.carryover=t[t.length-1],!0}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12115,7 +12115,7 @@ class aae extends Coe{split(e){return new lae(this,e)}}class lae extends aae{con * * ============================================================================= */ -class cae extends Coe{decodeUTF8(){return new dae(this)}}class dae extends aae{constructor(e){super(),this.upstream=e,this.impl=new hae(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class hae extends $oe{constructor(e){if(super(),this.upstream=e,(0,u3.env)().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{const{StringDecoder:e}=__webpack_require__(4530);this.decoder=new e("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){const e=await this.upstream.next();let t,n;return!e.done&&(t=e.value,n=(0,u3.env)().get("IS_BROWSER")?this.decoder.decode(t,{stream:!0}):this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0)}} +class fae extends Roe{decodeUTF8(){return new mae(this)}}class mae extends dae{constructor(e){super(),this.upstream=e,this.impl=new gae(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class gae extends joe{constructor(e){if(super(),this.upstream=e,(0,p3.env)().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{const{StringDecoder:e}=__webpack_require__(4530);this.decoder=new e("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){const e=await this.upstream.next();let t,n;return!e.done&&(t=e.value,n=(0,p3.env)().get("IS_BROWSER")?this.decoder.decode(t,{stream:!0}):this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0)}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12133,7 +12133,7 @@ class cae extends Coe{decodeUTF8(){return new dae(this)}}class dae extends aae{c * * ============================================================================= */ -class pae extends cae{constructor(e,t={}){super(),this.file=e,this.options=t,u3.util.assert(e instanceof Uint8Array||!!(0,u3.env)().get("IS_BROWSER")&&(e instanceof File||e instanceof Blob),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1048576}summary(){return`FileChunks ${this.file}`}async next(){if(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))return{value:null,done:!0};const e=new Promise((e,t)=>{const n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{const i=new FileReader;i.onload=n=>{let r=i.result;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(r)},i.onabort=e=>t(new Error("Aborted")),i.onerror=e=>t(new Error(e.type));const r=this.file.slice(this.offset,n);i.readAsArrayBuffer(r)}this.offset=n});return{value:await e,done:!1}}}const fae=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity}); +class _ae extends fae{constructor(e,t={}){super(),this.file=e,this.options=t,p3.util.assert(e instanceof Uint8Array||!!(0,p3.env)().get("IS_BROWSER")&&(e instanceof File||e instanceof Blob),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1048576}summary(){return`FileChunks ${this.file}`}async next(){if(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))return{value:null,done:!0};const e=new Promise((e,t)=>{const n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{const i=new FileReader;i.onload=n=>{let r=i.result;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(r)},i.onabort=e=>t(new Error("Aborted")),i.onerror=e=>t(new Error(e.type));const r=this.file.slice(this.offset,n);i.readAsArrayBuffer(r)}this.offset=n});return{value:await e,done:!1}}}const yae=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity}); /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12151,7 +12151,7 @@ class pae extends cae{constructor(e,t={}){super(),this.file=e,this.options=t,u3. * * ============================================================================= */ -function mae(e){return"string"==typeof e&&"file://"===e.slice(0,7)} +function vae(e){return"string"==typeof e&&"file://"===e.slice(0,7)} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12169,7 +12169,7 @@ function mae(e){return"string"==typeof e&&"file://"===e.slice(0,7)} * * ============================================================================= */ -class gae extends oae{constructor(e,t={}){super(),this.input=e,this.options=t}async iterator(){if(mae(this.input)&&(0,u3.env)().get("IS_NODE")){const e=__webpack_require__(8108);this.input=e.readFileSync(this.input.slice(7))}return new pae(this.input,this.options)}} +class bae extends cae{constructor(e,t={}){super(),this.input=e,this.options=t}async iterator(){if(vae(this.input)&&(0,p3.env)().get("IS_NODE")){const e=__webpack_require__(8108);this.input=e.readFileSync(this.input.slice(7))}return new _ae(this.input,this.options)}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12187,7 +12187,7 @@ class gae extends oae{constructor(e,t={}){super(),this.input=e,this.options=t}as * * ============================================================================= */ -class _ae extends oae{constructor(e,t={}){super(),this.url=e,this.fileOptions=t}async iterator(){return mae(this.url)?new gae(this.url,this.fileOptions).iterator(): +class Tae extends cae{constructor(e,t={}){super(),this.url=e,this.fileOptions=t}async iterator(){return vae(this.url)?new bae(this.url,this.fileOptions).iterator(): /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12205,7 +12205,7 @@ class _ae extends oae{constructor(e,t={}){super(),this.url=e,this.fileOptions=t} * * ============================================================================= */ -async function(e,t={},n){let i,r;"string"==typeof e?i=e:(i=e.url,r=fae(e));const s=await(n||u3.util.fetch)(i,r);if(s.ok){const e=new Uint8Array(await s.arrayBuffer());return new pae(e,t)}throw new Error(s.statusText)}(this.url,this.fileOptions)}} +async function(e,t={},n){let i,r;"string"==typeof e?i=e:(i=e.url,r=yae(e));const s=await(n||p3.util.fetch)(i,r);if(s.ok){const e=new Uint8Array(await s.arrayBuffer());return new _ae(e,t)}throw new Error(s.statusText)}(this.url,this.fileOptions)}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -12223,9 +12223,9 @@ async function(e,t={},n){let i,r;"string"==typeof e?i=e:(i=e.url,r=fae(e));const * * ============================================================================= */ -function yae(e,t={}){return new iae(new _ae(e),t)}function vae(e){const t=Aoe(e);return Hoe(async()=>t)}function bae(e){return Hoe(async()=>{const t=await e();return Aoe(()=>t.next())})}async function Tae(e,t){return sae.create(e,t)}async function xae(e){return rae.create(e)} +function xae(e,t={}){return new aae(new Tae(e),t)}function Eae(e){const t=Moe(e);return Koe(async()=>t)}function wae(e){return Koe(async()=>{const t=await e();return Moe(()=>t.next())})}async function Iae(e,t){return uae.create(e,t)}async function Aae(e){return lae.create(e)} /** @license See the LICENSE file. */ -const Eae="4.22.0"; +const Sae="4.22.0"; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -12242,7 +12242,7 @@ const Eae="4.22.0"; * limitations under the License. * ============================================================================= */ -function wae(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&u3.util.assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the CPU backend.`)})} +function Cae(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&p3.util.assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the CPU backend.`)})} /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -12259,7 +12259,7 @@ function wae(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&u3.util.asser * limitations under the License. * ============================================================================= */ -const Iae=u3.kernel_impls.whereImpl;class Aae extends u3.KernelBackend{nextDataId(){return Aae.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new u3.DataStorage(this,(0,u3.engine)())}write(e,t,n){this.firstUse&&(this.firstUse=!1,(0,u3.env)().get("IS_NODE")&&u3.backend_util.warn("\n============================\nHi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. \n============================"));const i={id:this.nextDataId()};return this.data.set(i,{values:e,dtype:n,refCount:1}),i}makeTensorInfo(e,t,n){let i;if("string"===t&&null!=n&&n.length>0&&u3.util.isString(n[0])){const r=n.map(e=>u3.util.encodeString(e));i=this.write(r,e,t)}else i=this.write(n,e,t);return{dataId:i,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,i,r){this.data.set(e,{values:t,dtype:i,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){const e=this.readSync(n.real.dataId),t=this.readSync(n.imag.dataId);return u3.backend_util.mergeRealAndImagArrays(e,t)}return u3.util.convertBackendValuesAndArrayBuffer(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map(e=>u3.util.decodeString(e));return(0,u3.buffer)(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,u3.buffer)(e.shape,e.dtype,t)}makeOutput(e,t,n){return(0,u3.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(t,n,e),this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=u3.util.now();e();return{kernelMs:u3.util.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){wae([e],"where");const t=this.readSync(e.dataId);return Iae(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}} +const Oae=p3.kernel_impls.whereImpl;class Mae extends p3.KernelBackend{nextDataId(){return Mae.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new p3.DataStorage(this,(0,p3.engine)())}write(e,t,n){this.firstUse&&(this.firstUse=!1,(0,p3.env)().get("IS_NODE")&&p3.backend_util.warn("\n============================\nHi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. \n============================"));const i={id:this.nextDataId()};return this.data.set(i,{values:e,dtype:n,refCount:1}),i}makeTensorInfo(e,t,n){let i;if("string"===t&&null!=n&&n.length>0&&p3.util.isString(n[0])){const r=n.map(e=>p3.util.encodeString(e));i=this.write(r,e,t)}else i=this.write(n,e,t);return{dataId:i,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,i,r){this.data.set(e,{values:t,dtype:i,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){const e=this.readSync(n.real.dataId),t=this.readSync(n.imag.dataId);return p3.backend_util.mergeRealAndImagArrays(e,t)}return p3.util.convertBackendValuesAndArrayBuffer(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map(e=>p3.util.decodeString(e));return(0,p3.buffer)(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,p3.buffer)(e.shape,e.dtype,t)}makeOutput(e,t,n){return(0,p3.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(t,n,e),this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=p3.util.now();e();return{kernelMs:p3.util.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){Cae([e],"where");const t=this.readSync(e.dataId);return Oae(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12276,7 +12276,7 @@ const Iae=u3.kernel_impls.whereImpl;class Aae extends u3.KernelBackend{nextDataI * limitations under the License. * ============================================================================= */ -function Sae(e){const t=new Float32Array(e.length);for(let n=0;n{const{x:t}=e.inputs,n=e.backend;wae(t,"abs");let i=new Float32Array(u3.util.sizeFromShape(t.shape));return i=Sae(n.data.get(t.dataId).values),n.makeOutput(i,t.shape,t.dtype)}}; +function kae(e){const t=new Float32Array(e.length);for(let n=0;n{const{x:t}=e.inputs,n=e.backend;Cae(t,"abs");let i=new Float32Array(p3.util.sizeFromShape(t.shape));return i=kae(n.data.get(t.dataId).values),n.makeOutput(i,t.shape,t.dtype)}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12293,7 +12293,7 @@ function Sae(e){const t=new Float32Array(e.length);for(let n=0;n{const o=u3.backend_util.assertAndGetBroadcastShape(t,n),a=o.length,l=u3.util.computeStrides(o),u=u3.util.sizeFromShape(o),c=u3.util.getTypedArrayFromDType(s,u),d=t.length,h=n.length,p=u3.util.computeStrides(t),f=u3.util.computeStrides(n),m=u3.backend_util.getBroadcastDims(t,o),g=u3.backend_util.getBroadcastDims(n,o);if(m.length+g.length===0)for(let t=0;ts[e]=0);const o=u3.util.locToIndex(s,d,p),u=n.slice(-h);g.forEach(e=>u[e]=0);const _=u3.util.locToIndex(u,h,f);c[t]=e(i[o],r[_])}return[c,o]}} +function Nae(e){return(t,n,i,r,s)=>{const o=p3.backend_util.assertAndGetBroadcastShape(t,n),a=o.length,l=p3.util.computeStrides(o),u=p3.util.sizeFromShape(o),c=p3.util.getTypedArrayFromDType(s,u),d=t.length,h=n.length,p=p3.util.computeStrides(t),f=p3.util.computeStrides(n),m=p3.backend_util.getBroadcastDims(t,o),g=p3.backend_util.getBroadcastDims(n,o);if(m.length+g.length===0)for(let t=0;ts[e]=0);const o=p3.util.locToIndex(s,d,p),u=n.slice(-h);g.forEach(e=>u[e]=0);const _=p3.util.locToIndex(u,h,f);c[t]=e(i[o],r[_])}return[c,o]}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12310,7 +12310,7 @@ function Oae(e){return(t,n,i,r,s)=>{const o=u3.backend_util.assertAndGetBroadcas * limitations under the License. * ============================================================================= */ -function Mae(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,a=n.makeTensorInfo(i.shape,"complex64");return n.data.get(a.dataId).complexTensorInfos={real:n.makeTensorInfo(i.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",o)},a}const kae={kernelName:u3.Complex,backendName:"cpu",kernelFunc:Mae}; +function Dae(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,a=n.makeTensorInfo(i.shape,"complex64");return n.data.get(a.dataId).complexTensorInfos={real:n.makeTensorInfo(i.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",o)},a}const Fae={kernelName:p3.Complex,backendName:"cpu",kernelFunc:Dae}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12327,7 +12327,7 @@ function Mae(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.data.get(i.dat * limitations under the License. * ============================================================================= */ -function Rae(e,t,n="float32"){if("complex64"===n){return Mae({inputs:{real:Rae(e,t,"float32"),imag:Rae(e,t,"float32")},backend:e})}const i=u3.util.makeZerosTypedArray(u3.util.sizeFromShape(t),n);return e.makeTensorInfo(t,n,i)} +function Lae(e,t,n="float32"){if("complex64"===n){return Dae({inputs:{real:Lae(e,t,"float32"),imag:Lae(e,t,"float32")},backend:e})}const i=p3.util.makeZerosTypedArray(p3.util.sizeFromShape(t),n);return e.makeTensorInfo(t,n,i)} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12344,7 +12344,7 @@ function Rae(e,t,n="float32"){if("complex64"===n){return Mae({inputs:{real:Rae(e * limitations under the License. * ============================================================================= */ -function Nae(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}const Dae={kernelName:u3.Identity,backendName:"cpu",kernelFunc:Nae}; +function Pae(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}const Bae={kernelName:p3.Identity,backendName:"cpu",kernelFunc:Pae}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12361,7 +12361,7 @@ function Nae(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{d * limitations under the License. * ============================================================================= */ -function Fae(e){const{inputs:t,backend:n}=e,{input:i}=t,r=n.data.get(i.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}const Lae={kernelName:u3.Real,backendName:"cpu",kernelFunc:Fae}; +function $ae(e){const{inputs:t,backend:n}=e,{input:i}=t,r=n.data.get(i.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}const Uae={kernelName:p3.Real,backendName:"cpu",kernelFunc:$ae}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12378,7 +12378,7 @@ function Fae(e){const{inputs:t,backend:n}=e,{input:i}=t,r=n.data.get(i.dataId).c * limitations under the License. * ============================================================================= */ -function Pae(e,t,n,i){if("int32"===i){return[t,"int32",Int32Array.from(e)]}if("bool"===i){const i=u3.util.toTypedArray([0],n),[r,s]=Oae((e,t)=>e!==t?1:0)(t,[],e,i,"bool");return[s,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${i}`)}function Bae(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dtype:s}=i;if("complex64"===s){if("complex64"===r.dtype)return Nae({inputs:{x:r},backend:n});const e=Rae(n,r.shape,r.dtype),t=Bae({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),i=Mae({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),i}if("complex64"===r.dtype){const e=Fae({inputs:{input:r},backend:n}),t=Bae({inputs:{x:e},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(e),t}if(!u3.util.hasEncodingLoss(r.dtype,s)){const e=Nae({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:s}}const o=n.data.get(r.dataId).values,[a,l,u]=Pae(o,r.shape,r.dtype,s);return n.makeTensorInfo(a,l,u)}const $ae={kernelName:u3.Cast,backendName:"cpu",kernelFunc:Bae}; +function Vae(e,t,n,i){if("int32"===i){return[t,"int32",Int32Array.from(e)]}if("bool"===i){const i=p3.util.toTypedArray([0],n),[r,s]=Nae((e,t)=>e!==t?1:0)(t,[],e,i,"bool");return[s,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${i}`)}function zae(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dtype:s}=i;if("complex64"===s){if("complex64"===r.dtype)return Pae({inputs:{x:r},backend:n});const e=Lae(n,r.shape,r.dtype),t=zae({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),i=Dae({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),i}if("complex64"===r.dtype){const e=$ae({inputs:{input:r},backend:n}),t=zae({inputs:{x:e},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(e),t}if(!p3.util.hasEncodingLoss(r.dtype,s)){const e=Pae({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:s}}const o=n.data.get(r.dataId).values,[a,l,u]=Vae(o,r.shape,r.dtype,s);return n.makeTensorInfo(a,l,u)}const jae={kernelName:p3.Cast,backendName:"cpu",kernelFunc:zae}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12395,7 +12395,7 @@ function Pae(e,t,n,i){if("int32"===i){return[t,"int32",Int32Array.from(e)]}if("b * limitations under the License. * ============================================================================= */ -function Uae(e,t,n,i){return null==n?({inputs:n,backend:r})=>{const{a:s,b:o}=n,a=r;wae([s,o],e);const l=a.data.get(s.dataId).values,u=a.data.get(o.dataId).values,c="string"===s.dtype?u3.backend_util.fromUint8ToStringArray(l):l,d="string"===s.dtype?u3.backend_util.fromUint8ToStringArray(u):u,h=i||s.dtype,[p,f]=t(s.shape,o.shape,c,d,h);return a.makeTensorInfo(f,h,p)}:({inputs:e,backend:r})=>{const{a:s,b:o}=e,a=r;if("complex64"===s.dtype||"complex64"===o.dtype){const e=Bae({inputs:{x:s},backend:a,attrs:{dtype:"complex64"}}),t=a.data.get(e.dataId),i=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=a.data.get(i.dataId).values,u=a.data.get(r.dataId).values,c=Bae({inputs:{x:o},backend:a,attrs:{dtype:"complex64"}}),d=a.data.get(c.dataId),h=d.complexTensorInfos.real,p=d.complexTensorInfos.imag,f=a.data.get(h.dataId).values,m=a.data.get(p.dataId).values,[g,_,y]=n(s.shape,o.shape,l,u,f,m),v=a.makeTensorInfo(y,"float32",g),b=a.makeTensorInfo(y,"float32",_),T=Mae({inputs:{real:v,imag:b},backend:a});return a.disposeIntermediateTensorInfo(e),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(v),a.disposeIntermediateTensorInfo(b),T}{const e=a.data.get(s.dataId).values,n=a.data.get(o.dataId).values,r=i||s.dtype,[l,u]=t(s.shape,o.shape,e,n,r);return a.makeTensorInfo(u,r,l)}}}function Vae(e){return(t,n,i,r,s,o)=>{const a=u3.backend_util.assertAndGetBroadcastShape(t,n),l=u3.util.sizeFromShape(a),u=a.length,c=u3.util.computeStrides(a),d=u3.util.getTypedArrayFromDType("float32",l),h=u3.util.getTypedArrayFromDType("float32",l),p=u3.backend_util.getBroadcastDims(t,a),f=u3.backend_util.getBroadcastDims(n,a),m=u3.backend_util.mergeRealAndImagArrays(i,r),g=u3.backend_util.mergeRealAndImagArrays(s,o),_=t.length,y=u3.util.computeStrides(t),v=n.length,b=u3.util.computeStrides(n);if(p.length+f.length===0)for(let t=0;ti[e]=0);const r=u3.util.locToIndex(i,_,y),s=n.slice(-v);f.forEach(e=>s[e]=0);const o=u3.util.locToIndex(s,v,b),a=e(m[2*r],m[2*r+1],g[2*o],g[2*o+1]);d[t]=a.real,h[t]=a.imag}return[d,h,a]}} +function Yae(e,t,n,i){return null==n?({inputs:n,backend:r})=>{const{a:s,b:o}=n,a=r;Cae([s,o],e);const l=a.data.get(s.dataId).values,u=a.data.get(o.dataId).values,c="string"===s.dtype?p3.backend_util.fromUint8ToStringArray(l):l,d="string"===s.dtype?p3.backend_util.fromUint8ToStringArray(u):u,h=i||s.dtype,[p,f]=t(s.shape,o.shape,c,d,h);return a.makeTensorInfo(f,h,p)}:({inputs:e,backend:r})=>{const{a:s,b:o}=e,a=r;if("complex64"===s.dtype||"complex64"===o.dtype){const e=zae({inputs:{x:s},backend:a,attrs:{dtype:"complex64"}}),t=a.data.get(e.dataId),i=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=a.data.get(i.dataId).values,u=a.data.get(r.dataId).values,c=zae({inputs:{x:o},backend:a,attrs:{dtype:"complex64"}}),d=a.data.get(c.dataId),h=d.complexTensorInfos.real,p=d.complexTensorInfos.imag,f=a.data.get(h.dataId).values,m=a.data.get(p.dataId).values,[g,_,y]=n(s.shape,o.shape,l,u,f,m),v=a.makeTensorInfo(y,"float32",g),b=a.makeTensorInfo(y,"float32",_),T=Dae({inputs:{real:v,imag:b},backend:a});return a.disposeIntermediateTensorInfo(e),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(v),a.disposeIntermediateTensorInfo(b),T}{const e=a.data.get(s.dataId).values,n=a.data.get(o.dataId).values,r=i||s.dtype,[l,u]=t(s.shape,o.shape,e,n,r);return a.makeTensorInfo(u,r,l)}}}function Gae(e){return(t,n,i,r,s,o)=>{const a=p3.backend_util.assertAndGetBroadcastShape(t,n),l=p3.util.sizeFromShape(a),u=a.length,c=p3.util.computeStrides(a),d=p3.util.getTypedArrayFromDType("float32",l),h=p3.util.getTypedArrayFromDType("float32",l),p=p3.backend_util.getBroadcastDims(t,a),f=p3.backend_util.getBroadcastDims(n,a),m=p3.backend_util.mergeRealAndImagArrays(i,r),g=p3.backend_util.mergeRealAndImagArrays(s,o),_=t.length,y=p3.util.computeStrides(t),v=n.length,b=p3.util.computeStrides(n);if(p.length+f.length===0)for(let t=0;ti[e]=0);const r=p3.util.locToIndex(i,_,y),s=n.slice(-v);f.forEach(e=>s[e]=0);const o=p3.util.locToIndex(s,v,b),a=e(m[2*r],m[2*r+1],g[2*o],g[2*o+1]);d[t]=a.real,h[t]=a.imag}return[d,h,a]}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12412,7 +12412,7 @@ function Uae(e,t,n,i){return null==n?({inputs:n,backend:r})=>{const{a:s,b:o}=n,a * limitations under the License. * ============================================================================= */ -const zae=Oae((e,t)=>e+t),jae=Vae((e,t,n,i)=>({real:e+n,imag:t+i})),Yae=Uae(u3.Add,zae,jae),Gae={kernelName:u3.Add,backendName:"cpu",kernelFunc:Yae}; +const Hae=Nae((e,t)=>e+t),Wae=Gae((e,t,n,i)=>({real:e+n,imag:t+i})),Xae=Yae(p3.Add,Hae,Wae),qae={kernelName:p3.Add,backendName:"cpu",kernelFunc:Xae}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12429,7 +12429,7 @@ const zae=Oae((e,t)=>e+t),jae=Vae((e,t,n,i)=>({real:e+n,imag:t+i})),Yae=Uae(u3.A * limitations under the License. * ============================================================================= */ -function Hae(e,t,n,i,r){const s=u3.util.sizeFromShape(i),o=u3.util.makeZerosTypedArray(r,n);for(let n=0;n=r||(o[i]+=s>0?t[n]:1)}return o}function Wae(e,t,n,i=!1){const r=e.shape[0],s=e.shape[1],o=(0,u3.buffer)([r,n],t.dtype);for(let a=0;a=n||(i?o.set(1,a,s):t.size>0?o.set(o.get(a,s)+t.get(a,r),a,s):o.set(o.get(a,s)+1,a,s))}return o} +function Kae(e,t,n,i,r){const s=p3.util.sizeFromShape(i),o=p3.util.makeZerosTypedArray(r,n);for(let n=0;n=r||(o[i]+=s>0?t[n]:1)}return o}function Zae(e,t,n,i=!1){const r=e.shape[0],s=e.shape[1],o=(0,p3.buffer)([r,n],t.dtype);for(let a=0;a=n||(i?o.set(1,a,s):t.size>0?o.set(o.get(a,s)+t.get(a,r),a,s):o.set(o.get(a,s)+1,a,s))}return o} /** * @license * Copyright 2023 Google LLC. @@ -12446,7 +12446,7 @@ function Hae(e,t,n,i,r){const s=u3.util.sizeFromShape(i),o=u3.util.makeZerosType * limitations under the License. * ============================================================================= */ -const Xae=Oae((e,t)=>e&t),qae=Uae(u3.BitwiseAnd,Xae),Kae={kernelName:u3.BitwiseAnd,backendName:"cpu",kernelFunc:qae}; +const Qae=Nae((e,t)=>e&t),Jae=Yae(p3.BitwiseAnd,Qae),ele={kernelName:p3.BitwiseAnd,backendName:"cpu",kernelFunc:Jae}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12463,7 +12463,7 @@ const Xae=Oae((e,t)=>e&t),qae=Uae(u3.BitwiseAnd,Xae),Kae={kernelName:u3.BitwiseA * limitations under the License. * ============================================================================= */ -function Zae(e){return(t,n,i)=>{const r=u3.util.getArrayFromDType(n,t.length);for(let n=0;n{const r=p3.util.getArrayFromDType(n,t.length);for(let n=0;n{const r=u3.util.getArrayFromDType(n,t.length);fo * limitations under the License. * ============================================================================= */ -function Qae(e,t,n){return Jae(e,Zae(t),n)}function Jae(e,t,n){return({inputs:i,attrs:r,backend:s})=>{const{x:o}=i;wae(o,e);const a=s,l=a.data.get(o.dataId).values;let u;if("string"===o.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=u3.backend_util.fromUint8ToStringArray(l)}else u=l;const c=n||o.dtype,d=t(u,c,r);return a.makeTensorInfo(o.shape,c,d)}} +function nle(e,t,n){return ile(e,tle(t),n)}function ile(e,t,n){return({inputs:i,attrs:r,backend:s})=>{const{x:o}=i;Cae(o,e);const a=s,l=a.data.get(o.dataId).values;let u;if("string"===o.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=p3.backend_util.fromUint8ToStringArray(l)}else u=l;const c=n||o.dtype,d=t(u,c,r);return a.makeTensorInfo(o.shape,c,d)}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12497,7 +12497,7 @@ function Qae(e,t,n){return Jae(e,Zae(t),n)}function Jae(e,t,n){return({inputs:i, * limitations under the License. * ============================================================================= */ -const ele=Zae(e=>Math.ceil(e)),tle=Jae(u3.Ceil,ele),nle={kernelName:u3.Ceil,backendName:"cpu",kernelFunc:tle}; +const rle=tle(e=>Math.ceil(e)),sle=ile(p3.Ceil,rle),ole={kernelName:p3.Ceil,backendName:"cpu",kernelFunc:sle}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12514,7 +12514,7 @@ const ele=Zae(e=>Math.ceil(e)),tle=Jae(u3.Ceil,ele),nle={kernelName:u3.Ceil,back * limitations under the License. * ============================================================================= */ -function ile(e,t,n,i){const r=u3.util.getArrayFromDType(n,u3.util.sizeFromShape(t));if(i&&"string"!==n){let t=0;e.forEach(e=>{const n=u3.util.sizeFromShape(e.shape);r.set(e.vals,t),t+=n})}else{let i=0;e.forEach(e=>{const s="string"===n?u3.backend_util.fromUint8ToStringArray(e.vals):e.vals;let o=0;for(let n=0;n{const n=p3.util.sizeFromShape(e.shape);r.set(e.vals,t),t+=n})}else{let i=0;e.forEach(e=>{const s="string"===n?p3.backend_util.fromUint8ToStringArray(e.vals):e.vals;let o=0;for(let n=0;ne===t?1:0),sle=Uae(u3.Equal,rle,null,"bool"),ole={kernelName:u3.Equal,backendName:"cpu",kernelFunc:sle},ale=Zae(e=>Math.exp(e)),lle=Jae(u3.Exp,ale,"float32"),ule={kernelName:u3.Exp,backendName:"cpu",kernelFunc:lle},cle=Zae(e=>Math.expm1(e)),dle=Jae(u3.Expm1,cle),hle={kernelName:u3.Expm1,backendName:"cpu",kernelFunc:dle},ple=Zae(e=>Math.floor(e)),fle=Jae(u3.Floor,ple),mle={kernelName:u3.Floor,backendName:"cpu",kernelFunc:fle},gle=Oae((e,t)=>Math.floor(e/t)),_le=Uae(u3.FloorDiv,gle,null,"int32"),yle={kernelName:u3.FloorDiv,backendName:"cpu",kernelFunc:_le}; +const lle=Nae((e,t)=>e===t?1:0),ule=Yae(p3.Equal,lle,null,"bool"),cle={kernelName:p3.Equal,backendName:"cpu",kernelFunc:ule},dle=tle(e=>Math.exp(e)),hle=ile(p3.Exp,dle,"float32"),ple={kernelName:p3.Exp,backendName:"cpu",kernelFunc:hle},fle=tle(e=>Math.expm1(e)),mle=ile(p3.Expm1,fle),gle={kernelName:p3.Expm1,backendName:"cpu",kernelFunc:mle},_le=tle(e=>Math.floor(e)),yle=ile(p3.Floor,_le),vle={kernelName:p3.Floor,backendName:"cpu",kernelFunc:yle},ble=Nae((e,t)=>Math.floor(e/t)),Tle=Yae(p3.FloorDiv,ble,null,"int32"),xle={kernelName:p3.FloorDiv,backendName:"cpu",kernelFunc:Tle}; /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -12548,7 +12548,7 @@ const rle=Oae((e,t)=>e===t?1:0),sle=Uae(u3.Equal,rle,null,"bool"),ole={kernelNam * limitations under the License. * ============================================================================= */ -function vle(e,t,n,i,r,s,o,a,l){const u=(0,u3.buffer)([i,s],n);for(let n=0;n=l/s)throw new Error(`Invalid indices: ${i} does not index into ${a}`);for(let e=0;e=l/s)throw new Error(`Invalid indices: ${i} does not index into ${a}`);for(let e=0;ee>t?1:0),xle=Uae(u3.Greater,Tle,null,"bool"),Ele={kernelName:u3.Greater,backendName:"cpu",kernelFunc:xle},wle=Oae((e,t)=>e>=t?1:0),Ile=Uae(u3.GreaterEqual,wle,null,"bool"),Ale={kernelName:u3.GreaterEqual,backendName:"cpu",kernelFunc:Ile},Sle=Oae((e,t)=>ee<=t?1:0),kle=Uae(u3.LessEqual,Mle,null,"bool"),Rle={kernelName:u3.LessEqual,backendName:"cpu",kernelFunc:kle}; +const Ile=Nae((e,t)=>e>t?1:0),Ale=Yae(p3.Greater,Ile,null,"bool"),Sle={kernelName:p3.Greater,backendName:"cpu",kernelFunc:Ale},Cle=Nae((e,t)=>e>=t?1:0),Ole=Yae(p3.GreaterEqual,Cle,null,"bool"),Mle={kernelName:p3.GreaterEqual,backendName:"cpu",kernelFunc:Ole},kle=Nae((e,t)=>ee<=t?1:0),Fle=Yae(p3.LessEqual,Dle,null,"bool"),Lle={kernelName:p3.LessEqual,backendName:"cpu",kernelFunc:Fle}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12599,7 +12599,7 @@ const Tle=Oae((e,t)=>e>t?1:0),xle=Uae(u3.Greater,Tle,null,"bool"),Ele={kernelNam * limitations under the License. * ============================================================================= */ -function Nle(e,t,n){const i=(t-e)/(n-1),r=u3.util.makeZerosTypedArray(n,"float32");r[0]=e;for(let e=1;eMath.log(e)),Fle=Jae(u3.Log,Dle),Lle={kernelName:u3.Log,backendName:"cpu",kernelFunc:Fle}; +const Ble=tle(e=>Math.log(e)),$le=ile(p3.Log,Ble),Ule={kernelName:p3.Log,backendName:"cpu",kernelFunc:$le}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12633,7 +12633,7 @@ const Dle=Zae(e=>Math.log(e)),Fle=Jae(u3.Log,Dle),Lle={kernelName:u3.Log,backend * limitations under the License. * ============================================================================= */ -function Ple(e,t,n,i){const r=u3.util.getTypedArrayFromDType(i,u3.util.sizeFromShape(n));for(let n=0;ns)&&(s=t)}r[n]=s}return r} +function Vle(e,t,n,i){const r=p3.util.getTypedArrayFromDType(i,p3.util.sizeFromShape(n));for(let n=0;ns)&&(s=t)}r[n]=s}return r} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12650,7 +12650,7 @@ function Ple(e,t,n,i){const r=u3.util.getTypedArrayFromDType(i,u3.util.sizeFromS * limitations under the License. * ============================================================================= */ -const Ble=Oae((e,t)=>Math.max(e,t)),$le=Uae(u3.Maximum,Ble),Ule={kernelName:u3.Maximum,backendName:"cpu",kernelFunc:$le},Vle=Oae((e,t)=>Math.min(e,t)),zle=Uae(u3.Minimum,Vle),jle={kernelName:u3.Minimum,backendName:"cpu",kernelFunc:zle},Yle=Oae((e,t)=>e*t),Gle=Vae((e,t,n,i)=>({real:e*n-t*i,imag:e*i+t*n})),Hle=Uae(u3.Multiply,Yle,Gle),Wle={kernelName:u3.Multiply,backendName:"cpu",kernelFunc:Hle}; +const zle=Nae((e,t)=>Math.max(e,t)),jle=Yae(p3.Maximum,zle),Yle={kernelName:p3.Maximum,backendName:"cpu",kernelFunc:jle},Gle=Nae((e,t)=>Math.min(e,t)),Hle=Yae(p3.Minimum,Gle),Wle={kernelName:p3.Minimum,backendName:"cpu",kernelFunc:Hle},Xle=Nae((e,t)=>e*t),qle=Gae((e,t,n,i)=>({real:e*n-t*i,imag:e*i+t*n})),Kle=Yae(p3.Multiply,Xle,qle),Zle={kernelName:p3.Multiply,backendName:"cpu",kernelFunc:Kle}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12667,7 +12667,7 @@ const Ble=Oae((e,t)=>Math.max(e,t)),$le=Uae(u3.Maximum,Ble),Ule={kernelName:u3.M * limitations under the License. * ============================================================================= */ -function Xle(e,t,n){const i=u3.util.createScalarValue(-1,n);return Yle([],t,i,e,n)}const qle={kernelName:u3.Neg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;wae(i,"neg");const r=n.data.get(i.dataId).values,[s,o]=Xle(r,i.shape,i.dtype);return n.makeTensorInfo(o,i.dtype,s)}},Kle=Oae((e,t)=>e!==t?1:0),Zle=Uae(u3.NotEqual,Kle,null,"bool"),Qle={kernelName:u3.NotEqual,backendName:"cpu",kernelFunc:Zle}; +function Qle(e,t,n){const i=p3.util.createScalarValue(-1,n);return Xle([],t,i,e,n)}const Jle={kernelName:p3.Neg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;Cae(i,"neg");const r=n.data.get(i.dataId).values,[s,o]=Qle(r,i.shape,i.dtype);return n.makeTensorInfo(o,i.dtype,s)}},eue=Nae((e,t)=>e!==t?1:0),tue=Yae(p3.NotEqual,eue,null,"bool"),nue={kernelName:p3.NotEqual,backendName:"cpu",kernelFunc:tue}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12684,7 +12684,7 @@ function Xle(e,t,n){const i=u3.util.createScalarValue(-1,n);return Yle([],t,i,e, * limitations under the License. * ============================================================================= */ -function Jle(e,t,n,i,r){const s=t.length,o=u3.util.sizeFromShape(t),a=u3.util.computeStrides(t),l=u3.util.computeStrides(r),u=u3.util.getTypedArrayFromDType(n,u3.util.sizeFromShape(r));for(let t=0;tn.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(_,g,f)}};function rue(e,t,n,i){const r=[];let s=0;const o=t.length-1+n.length,a=new Array(o).fill(null).map(()=>[0]);!function(e,t){for(let n=0;nr)throw new Error("Ragged splits must not point past values");for(let e=1;ei[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,i);let l=1;for(let e=0;e=0){const e=a[r],t=e[e.length-1]-i[o];for(let e=o;en.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(_,g,f)}};function lue(e,t,n,i){const r=[];let s=0;const o=t.length-1+n.length,a=new Array(o).fill(null).map(()=>[0]);!function(e,t){for(let n=0;nr)throw new Error("Ragged splits must not point past values");for(let e=1;ei[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,i);let l=1;for(let e=0;e=0){const e=a[r],t=e[e.length-1]-i[o];for(let e=o;e{if(e<0||e>=n){const r=u3.util.indexToLoc(i,t.length,u3.util.computeStrides(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}})}(s,o,t[0][0]-1),0===i.length)throw new Error("params.rank must be nonzero");const l=i[0],{outSplits:u,valueSlices:c,numValues:d}=rue(s,o,e,l),h=function(e){const t=[];for(let n=0;nr[t]=e)}return t}(u),p=oue(n,i,r,c,d);return[h,p[0],p[1]]} +function(e,t,n){e.forEach((e,i)=>{if(e<0||e>=n){const r=p3.util.indexToLoc(i,t.length,p3.util.computeStrides(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}})}(s,o,t[0][0]-1),0===i.length)throw new Error("params.rank must be nonzero");const l=i[0],{outSplits:u,valueSlices:c,numValues:d}=lue(s,o,e,l),h=function(e){const t=[];for(let n=0;nr[t]=e)}return t}(u),p=cue(n,i,r,c,d);return[h,p[0],p[1]]} /** * @license * Copyright 2022 Google LLC. @@ -12752,7 +12752,7 @@ function(e,t,n){e.forEach((e,i)=>{if(e<0||e>=n){const r=u3.util.indexToLoc(i,t.l * limitations under the License. * ============================================================================= */ -const lue=2147483647;function uue(e,t,n,i,r,s,o){if(t.length>1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(o.length>1)throw new Error("deltas must be a scalar or vector");const a=0===t.length,l=0===r.length,u=0===o.length,c=[];a||c.push(t[0]),l||c.push(r[0]),u||c.push(o[0]);for(let e=1;e0&&rn)c=0;else if(c=Math.ceil(Math.abs((r-n)/o)),c>lue)throw new Error(`Requires ((limit - start) / delta) <= ${lue}`);h[t+1]=h[t]+c}const p=h[d],f=u3.util.getArrayFromDType(n,p);let m=0;for(let t=0;t1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(o.length>1)throw new Error("deltas must be a scalar or vector");const a=0===t.length,l=0===r.length,u=0===o.length,c=[];a||c.push(t[0]),l||c.push(r[0]),u||c.push(o[0]);for(let e=1;e0&&rn)c=0;else if(c=Math.ceil(Math.abs((r-n)/o)),c>hue)throw new Error(`Requires ((limit - start) / delta) <= ${hue}`);h[t+1]=h[t]+c}const p=h[d],f=p3.util.getArrayFromDType(n,p);let m=0;for(let t=0;t1)throw new Error(" * limitations under the License. * ============================================================================= */ -var cue=u3.backend_util.RowPartitionType;class due{constructor(e,t,n,i,r,s,o,a,l,u){this.shape=e,this.shapeShape=t,this.values=n,this.valuesShape=i,this.valuesDType=r,this.defaultValue=s,this.defaultValueShape=o,this.rowPartitionValues=a,this.rowPartitionValuesShapes=l,this.rowPartitionTypes=u3.backend_util.getRowPartitionTypesHelper(u),this.raggedRank=u3.backend_util.getRaggedRank(this.rowPartitionTypes)}getRowPartitionTypeByDimension(e){return this.rowPartitionTypes[0]===cue.FIRST_DIM_SIZE?this.rowPartitionTypes[e+1]:this.rowPartitionTypes[e]}getRowPartitionTensor(e){return this.rowPartitionTypes[0]===cue.FIRST_DIM_SIZE?this.rowPartitionValues[e+1]:this.rowPartitionValues[e]}getMaxWidth(e){const t=this.getRowPartitionTensor(e-1);switch(this.getRowPartitionTypeByDimension(e-1)){case cue.VALUE_ROWIDS:return due.getMaxWidthValueRowID(t);case cue.ROW_SPLITS:return due.getMaxWidthRowSplit(t);default:throw new Error(`Cannot handle partition type ${cue[this.getRowPartitionTypeByDimension(e-1)]}`)}}static getMaxWidthRowSplit(e){const t=e.length;if(0===t||1===t)return 0;let n=0;for(let i=0;in&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,i=e[0],r=0;for(let s=1;s"Final length of result must be equal to firstDimension."),r}calculateOutputIndexRowSplit(e,t,n,i){const r=e.length,s=[];for(let o=0;o0&&s.length!==e[r-1])throw new Error("Invalid row split size.");return s}calculateOutputIndexValueRowID(e,t,n,i){const r=e.length,s=[];if(0===r)return[];let o=0,a=e[0];if(a>=t.length)throw new Error(`Got currentValueRowId=${a}, which is not less than ${t.length}`);let l=t[a];s.push(l);for(let u=1;u=0&&(++o,o=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}s.push(l)}if(s.length!==e.length)throw new Error("Invalid row ids.");return s}calculateOutputIndex(e,t,n,i){const r=this.getRowPartitionTensor(e),s=this.getRowPartitionTypeByDimension(e);switch(s){case cue.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,i);case cue.ROW_SPLITS:if(r.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${r.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(r,t,n,i);default:throw new Error(`Unsupported partition type: ${cue[s]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case cue.FIRST_DIM_SIZE:return e[0];case cue.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case cue.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${cue[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let e=n.length-2;e>=0;--e)n[e]=n[e+1]*t[e+1];const i=pue(t,!1),r=u3.util.getArrayFromDType(this.valuesDType,u3.util.sizeFromShape(i));if(n[0]*t[0]>0){let s=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){s=this.calculateOutputIndex(e-1,s,n[e],t[e])}this.setOutput(this.raggedRank,s,r,i)}return[i,r]}setOutput(e,t,n,i){if(0===n.length)return;const r=this.values,s=n;let o=i.slice();o=o.slice(e+1);const a=u3.util.sizeFromShape(o),l=t.length;let u=this.defaultValue;if(u.length!==a&&1!==u.length){const e=this.defaultValueShape;(0,u3.tidy)(()=>{const t=(0,u3.reshape)(u,e),n=(0,u3.broadcastTo)(t,o);u=n.dataSync()})}let c=0,d=0,h=0;for(let e=0;e<=l;++e){let i=e=l){const e=n.length;i=Math.floor(e/a)}if(i>h)if(1===this.defaultValue.length)s.subarray(h*a,i*a).fill(this.defaultValue[0]),h=i;else for(;i>h;){hue(s.slice(h*a),u,a),++h}i<0?(c=e+1,d=h):(c=e,d=h,h=d+1)}else++h}}}function hue(e,t,n){for(let i=0;i= 0`);if(i<-1)throw new Error(`Dimension ${i} must be >= -1`);i=-1}n.push(i)}return n}function fue(e,t,n,i,r,s,o,a,l,u){return new due(e,t,n,i,r,s,o,a,l,u).compute()} +var fue=p3.backend_util.RowPartitionType;class mue{constructor(e,t,n,i,r,s,o,a,l,u){this.shape=e,this.shapeShape=t,this.values=n,this.valuesShape=i,this.valuesDType=r,this.defaultValue=s,this.defaultValueShape=o,this.rowPartitionValues=a,this.rowPartitionValuesShapes=l,this.rowPartitionTypes=p3.backend_util.getRowPartitionTypesHelper(u),this.raggedRank=p3.backend_util.getRaggedRank(this.rowPartitionTypes)}getRowPartitionTypeByDimension(e){return this.rowPartitionTypes[0]===fue.FIRST_DIM_SIZE?this.rowPartitionTypes[e+1]:this.rowPartitionTypes[e]}getRowPartitionTensor(e){return this.rowPartitionTypes[0]===fue.FIRST_DIM_SIZE?this.rowPartitionValues[e+1]:this.rowPartitionValues[e]}getMaxWidth(e){const t=this.getRowPartitionTensor(e-1);switch(this.getRowPartitionTypeByDimension(e-1)){case fue.VALUE_ROWIDS:return mue.getMaxWidthValueRowID(t);case fue.ROW_SPLITS:return mue.getMaxWidthRowSplit(t);default:throw new Error(`Cannot handle partition type ${fue[this.getRowPartitionTypeByDimension(e-1)]}`)}}static getMaxWidthRowSplit(e){const t=e.length;if(0===t||1===t)return 0;let n=0;for(let i=0;in&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,i=e[0],r=0;for(let s=1;s"Final length of result must be equal to firstDimension."),r}calculateOutputIndexRowSplit(e,t,n,i){const r=e.length,s=[];for(let o=0;o0&&s.length!==e[r-1])throw new Error("Invalid row split size.");return s}calculateOutputIndexValueRowID(e,t,n,i){const r=e.length,s=[];if(0===r)return[];let o=0,a=e[0];if(a>=t.length)throw new Error(`Got currentValueRowId=${a}, which is not less than ${t.length}`);let l=t[a];s.push(l);for(let u=1;u=0&&(++o,o=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}s.push(l)}if(s.length!==e.length)throw new Error("Invalid row ids.");return s}calculateOutputIndex(e,t,n,i){const r=this.getRowPartitionTensor(e),s=this.getRowPartitionTypeByDimension(e);switch(s){case fue.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,i);case fue.ROW_SPLITS:if(r.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${r.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(r,t,n,i);default:throw new Error(`Unsupported partition type: ${fue[s]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case fue.FIRST_DIM_SIZE:return e[0];case fue.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case fue.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${fue[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let e=n.length-2;e>=0;--e)n[e]=n[e+1]*t[e+1];const i=_ue(t,!1),r=p3.util.getArrayFromDType(this.valuesDType,p3.util.sizeFromShape(i));if(n[0]*t[0]>0){let s=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){s=this.calculateOutputIndex(e-1,s,n[e],t[e])}this.setOutput(this.raggedRank,s,r,i)}return[i,r]}setOutput(e,t,n,i){if(0===n.length)return;const r=this.values,s=n;let o=i.slice();o=o.slice(e+1);const a=p3.util.sizeFromShape(o),l=t.length;let u=this.defaultValue;if(u.length!==a&&1!==u.length){const e=this.defaultValueShape;(0,p3.tidy)(()=>{const t=(0,p3.reshape)(u,e),n=(0,p3.broadcastTo)(t,o);u=n.dataSync()})}let c=0,d=0,h=0;for(let e=0;e<=l;++e){let i=e=l){const e=n.length;i=Math.floor(e/a)}if(i>h)if(1===this.defaultValue.length)s.subarray(h*a,i*a).fill(this.defaultValue[0]),h=i;else for(;i>h;){gue(s.slice(h*a),u,a),++h}i<0?(c=e+1,d=h):(c=e,d=h,h=d+1)}else++h}}}function gue(e,t,n){for(let i=0;i= 0`);if(i<-1)throw new Error(`Dimension ${i} must be >= -1`);i=-1}n.push(i)}return n}function yue(e,t,n,i,r,s,o,a,l,u){return new mue(e,t,n,i,r,s,o,a,l,u).compute()} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12786,7 +12786,7 @@ var cue=u3.backend_util.RowPartitionType;class due{constructor(e,t,n,i,r,s,o,a,l * limitations under the License. * ============================================================================= */ -function mue(e,t,n,i){if(e===t||e1)return u3.util.makeZerosTypedArray(0,i);const r=Math.abs(Math.ceil((t-e)/n)),s=u3.util.makeZerosTypedArray(r,i);t1)return p3.util.makeZerosTypedArray(0,i);const r=Math.abs(Math.ceil((t-e)/n)),s=p3.util.makeZerosTypedArray(r,i);t1)return u3.util.makeZerosTyped * limitations under the License. * ============================================================================= */ -const gue=Zae(e=>1/Math.sqrt(e)),_ue=Jae(u3.Rsqrt,gue),yue={kernelName:u3.Rsqrt,backendName:"cpu",kernelFunc:_ue}; +const bue=tle(e=>1/Math.sqrt(e)),Tue=ile(p3.Rsqrt,bue),xue={kernelName:p3.Rsqrt,backendName:"cpu",kernelFunc:Tue}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12820,7 +12820,7 @@ const gue=Zae(e=>1/Math.sqrt(e)),_ue=Jae(u3.Rsqrt,gue),yue={kernelName:u3.Rsqrt, * limitations under the License. * ============================================================================= */ -function vue(e,t,n,i,r,s,o,a,l,u){const c=[i/r,r],d=e.values,h=t.values;if(0===i)return(0,u3.buffer)(n,t.dtype);const p=l instanceof u3.TensorBuffer?l:(0,u3.buffer)(c,t.dtype);"string"==typeof l||"number"==typeof l?p.values.fill(l):"boolean"==typeof l&&p.values.fill(+l);for(let e=0;e=i/r)throw new Error(`Invalid indices: ${s} does not index into ${n}`);for(let n=0;n=i/r)throw new Error(`Invalid indices: ${s} does not index into ${n}`);for(let n=0;n1/(1+Math.exp(-e))),Tue=Qae(u3.Sigmoid,e=>1/(1+Math.exp(-e))),xue={kernelName:u3.Sigmoid,backendName:"cpu",kernelFunc:Tue}; +const wue=tle(e=>1/(1+Math.exp(-e))),Iue=nle(p3.Sigmoid,e=>1/(1+Math.exp(-e))),Aue={kernelName:p3.Sigmoid,backendName:"cpu",kernelFunc:Iue}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12854,7 +12854,7 @@ const bue=Zae(e=>1/(1+Math.exp(-e))),Tue=Qae(u3.Sigmoid,e=>1/(1+Math.exp(-e))),x * limitations under the License. * ============================================================================= */ -function Eue(e,t,n,i,r){const s=u3.slice_util.isSliceContinous(i,t,n),o=u3.util.sizeFromShape(n),a=u3.util.computeStrides(i);if(s){const n=u3.slice_util.computeFlatOffset(t,a);return"string"===r?e.slice(n,n+o):e.subarray(n,n+o)}const l="string"===r?u3.backend_util.fromUint8ToStringArray(e):e,u=(0,u3.buffer)(i,r,l),c=(0,u3.buffer)(n,r);for(let e=0;ee+t[n]);c.set(u.get(...i),...n)}return"string"===r?u3.backend_util.fromStringArrayToUint8(c.values):c.values}function wue(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,size:o}=i;wae(r,"slice");const[a,l]=u3.slice_util.parseSliceParams(r,s,o);u3.slice_util.assertParamsValid(r,a,l);const u=Eue(n.data.get(r.dataId).values,a,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const Iue={kernelName:u3.Slice,backendName:"cpu",kernelFunc:wue}; +function Sue(e,t,n,i,r){const s=p3.slice_util.isSliceContinous(i,t,n),o=p3.util.sizeFromShape(n),a=p3.util.computeStrides(i);if(s){const n=p3.slice_util.computeFlatOffset(t,a);return"string"===r?e.slice(n,n+o):e.subarray(n,n+o)}const l="string"===r?p3.backend_util.fromUint8ToStringArray(e):e,u=(0,p3.buffer)(i,r,l),c=(0,p3.buffer)(n,r);for(let e=0;ee+t[n]);c.set(u.get(...i),...n)}return"string"===r?p3.backend_util.fromStringArrayToUint8(c.values):c.values}function Cue(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,size:o}=i;Cae(r,"slice");const[a,l]=p3.slice_util.parseSliceParams(r,s,o);p3.slice_util.assertParamsValid(r,a,l);const u=Sue(n.data.get(r.dataId).values,a,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const Oue={kernelName:p3.Slice,backendName:"cpu",kernelFunc:Cue}; /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -12871,7 +12871,7 @@ function Eue(e,t,n,i,r){const s=u3.slice_util.isSliceContinous(i,t,n),o=u3.util. * limitations under the License. * ============================================================================= */ -function Aue(e,t,n,i,r,s,o){const a=t[0],l=s[0],u=new Array(l),c=new Array(a),d=t[1];if(0===l){if(0!==a)throw new Error(u3.backend_util.getSparseFillEmptyRowsIndicesDenseShapeMismatch(a));return[u3.util.getArrayFromDType(n,0),[0,d],u3.util.getArrayFromDType(r,0),u,c]}let h=!0,p=0;const f=new Array(l).fill(0);for(let t=0;t=l)throw new Error(u3.backend_util.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(t,n,l));++f[n],h=h&&n>=p,p=n}let m=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(m&&h){const t=e,n=i;for(let e=0;e=l)throw new Error(p3.backend_util.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(t,n,l));++f[n],h=h&&n>=p,p=n}let m=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(m&&h){const t=e,n=i;for(let e=0;e0){h[d-1]=1;for(let e=d-2;e>=0;--e)h[e]=h[e+1]*i[e+1]}const p=[];if(a>0){p[a-1]=1;for(let e=a-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=u3.util.getArrayFromDType(n,o*a);for(let t=0;t0){h[d-1]=1;for(let e=d-2;e>=0;--e)h[e]=h[e+1]*i[e+1]}const p=[];if(a>0){p[a-1]=1;for(let e=a-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=p3.util.getArrayFromDType(n,o*a);for(let t=0;t0?r[a-1]+1:0;if(c<0)throw new Error(u3.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());const d=t.slice();d[0]=c;const h=d.reduce((e,t)=>e*t,1),p=u3.util.getArrayFromDType(n,h);if(0===a)return c>0&&p.fill(o),[p,d];if(c<=0)throw new Error(u3.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let f=0,m=1,g=0,_=r[f];for(;;){let t=0;if(m=t)throw new Error(u3.backend_util.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(_<0||_>=c)throw new Error(u3.backend_util.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(_,c));_>g&&p.fill(o,g*u,_*u);for(let t=f;t=l[0])throw new Error(u3.backend_util.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(t,i[t],l[0]));for(let t=0;ta)break}return g0?r[a-1]+1:0;if(c<0)throw new Error(p3.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());const d=t.slice();d[0]=c;const h=d.reduce((e,t)=>e*t,1),p=p3.util.getArrayFromDType(n,h);if(0===a)return c>0&&p.fill(o),[p,d];if(c<=0)throw new Error(p3.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let f=0,m=1,g=0,_=r[f];for(;;){let t=0;if(m=t)throw new Error(p3.backend_util.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(_<0||_>=c)throw new Error(p3.backend_util.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(_,c));_>g&&p.fill(o,g*u,_*u);for(let t=f;t=l[0])throw new Error(p3.backend_util.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(t,i[t],l[0]));for(let t=0;ta)break}return gMath.sqrt(e)),Mue=Qae(u3.Sqrt,e=>Math.sqrt(e)),kue={kernelName:u3.Sqrt,backendName:"cpu",kernelFunc:Mue},Rue=Oae((e,t)=>{const n=e-t;return n*n}),Nue=Uae(u3.SquaredDifference,Rue),Due={kernelName:u3.SquaredDifference,backendName:"cpu",kernelFunc:Nue},Fue=Zae((e,t)=>{const{pattern:n,replaceGlobal:i,rewrite:r}=t;return e.replace(new RegExp(n,i?"g":""),r)}),Lue=Jae(u3.StaticRegexReplace,Fue),Pue={kernelName:u3.StaticRegexReplace,backendName:"cpu",kernelFunc:Lue}; +const Nue=tle(e=>Math.sqrt(e)),Due=nle(p3.Sqrt,e=>Math.sqrt(e)),Fue={kernelName:p3.Sqrt,backendName:"cpu",kernelFunc:Due},Lue=Nae((e,t)=>{const n=e-t;return n*n}),Pue=Yae(p3.SquaredDifference,Lue),Bue={kernelName:p3.SquaredDifference,backendName:"cpu",kernelFunc:Pue},$ue=tle((e,t)=>{const{pattern:n,replaceGlobal:i,rewrite:r}=t;return e.replace(new RegExp(n,i?"g":""),r)}),Uue=ile(p3.StaticRegexReplace,$ue),Vue={kernelName:p3.StaticRegexReplace,backendName:"cpu",kernelFunc:Uue}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -12939,7 +12939,7 @@ const Oue=Zae(e=>Math.sqrt(e)),Mue=Qae(u3.Sqrt,e=>Math.sqrt(e)),kue={kernelName: * limitations under the License. * ============================================================================= */ -function Bue(e,t,n,i){const r=(0,u3.buffer)(e,t.dtype);for(let e=0;e0?0:o-a);let h=0;h+=l*this.leftPad.length;for(let t=0;te.forEach(e=>p[f++]=e);for(let e=0;e0){m(e[d+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r=e;if(i=i&&t[r]<=n,!i)throw new Error(`Invalid split value ${t[r]}, must be in [${e}, ${n}]`);e=t[r]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const r=i-1,s=u3.util.getArrayFromDType("int32",i);if(0===n||0===i){const e=new Array(n);for(let e=0;e<=r;++e)s[e]=0;return[e,s]}s[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let i=0;this.nGramWidths.forEach(e=>{i+=this.getNumNGrams(n,e)}),this.preserveShort&&n>0&&0===i&&(i=1),s[e]=s[e-1]+i}const o=new Array(s[r]);for(let n=0;n{const a=t[n+1]-t[n],l=this.getNumNGrams(a,s);this.createNGrams(e,i,o,r,l,s),r+=l}),this.preserveShort&&r===s[n]){const s=t[n+1]-t[n];if(0===s)continue;const a=s+2*this.padWidth,l=1;this.createNGrams(e,i,o,r,l,a)}}return[o,s]}}function Uue(e,t,n,i,r,s,o,a){return new $ue(n,i,r,s,o,a).compute(e,t)} +class jue{constructor(e,t,n,i,r,s){this.separator=p3.util.encodeString(e),this.nGramWidths=t,this.leftPad=p3.util.encodeString(n),this.rightPad=p3.util.encodeString(i),this.padWidth=r,this.preserveShort=s}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}createNGrams(e,t,n,i,r,s){for(let o=0;o0?0:o-a);let h=0;h+=l*this.leftPad.length;for(let t=0;te.forEach(e=>p[f++]=e);for(let e=0;e0){m(e[d+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r=e;if(i=i&&t[r]<=n,!i)throw new Error(`Invalid split value ${t[r]}, must be in [${e}, ${n}]`);e=t[r]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const r=i-1,s=p3.util.getArrayFromDType("int32",i);if(0===n||0===i){const e=new Array(n);for(let e=0;e<=r;++e)s[e]=0;return[e,s]}s[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let i=0;this.nGramWidths.forEach(e=>{i+=this.getNumNGrams(n,e)}),this.preserveShort&&n>0&&0===i&&(i=1),s[e]=s[e-1]+i}const o=new Array(s[r]);for(let n=0;n{const a=t[n+1]-t[n],l=this.getNumNGrams(a,s);this.createNGrams(e,i,o,r,l,s),r+=l}),this.preserveShort&&r===s[n]){const s=t[n+1]-t[n];if(0===s)continue;const a=s+2*this.padWidth,l=1;this.createNGrams(e,i,o,r,l,a)}}return[o,s]}}function Yue(e,t,n,i,r,s,o,a){return new jue(n,i,r,s,o,a).compute(e,t)} /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -12973,7 +12973,7 @@ class $ue{constructor(e,t,n,i,r,s){this.separator=u3.util.encodeString(e),this.n * limitations under the License. * ============================================================================= */ -function Vue(e,t,n,i){if(!e.length)return;if(0===t.length){for(let t=0;te-t),Gue=Vae((e,t,n,i)=>({real:e-n,imag:t-i})),Hue=Uae(u3.Sub,Yue,Gue),Wue={kernelName:u3.Sub,backendName:"cpu",kernelFunc:Hue}; +const Xue=Nae((e,t)=>e-t),que=Gae((e,t,n,i)=>({real:e-n,imag:t-i})),Kue=Yae(p3.Sub,Xue,que),Zue={kernelName:p3.Sub,backendName:"cpu",kernelFunc:Kue}; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -13024,7 +13024,7 @@ const Yue=Oae((e,t)=>e-t),Gue=Vae((e,t,n,i)=>({real:e-n,imag:t-i})),Hue=Uae(u3.S * limitations under the License. * ============================================================================= */ -function Xue(e,t){const n=new Array(e.rank);for(let i=0;i{const n=t.value-e.value;return 0===n?e.index-t.index:n};function Kue(e,t,n=0,i=e.length-1){for(;i>n;){if(i-n>600){const r=i-n+1,s=t-n+1,o=Math.log(r),a=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*a*(r-a)/r)*Math.sign(s-r/2);Kue(e,t,Math.max(n,Math.floor(t-s*a/r+l)),Math.min(i,Math.floor(t+(r-s)*a/r+l)))}const r=e[t];let s=n,o=i;for(u3.util.swap(e,n,t),que(e[i],r)>0&&u3.util.swap(e,n,i);s0;)o-=1}0===que(e[n],r)?u3.util.swap(e,n,o):(o+=1,u3.util.swap(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}}function Zue(e,t,n,i,r){const s=t[t.length-1],[o,a]=[e.length/s,s],l=u3.util.getTypedArrayFromDType(n,o*i),u=u3.util.getTypedArrayFromDType("int32",o*i);for(let t=0;to[t]={value:e,index:t}),i{const n=t.value-e.value;return 0===n?e.index-t.index:n};function ece(e,t,n=0,i=e.length-1){for(;i>n;){if(i-n>600){const r=i-n+1,s=t-n+1,o=Math.log(r),a=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*a*(r-a)/r)*Math.sign(s-r/2);ece(e,t,Math.max(n,Math.floor(t-s*a/r+l)),Math.min(i,Math.floor(t+(r-s)*a/r+l)))}const r=e[t];let s=n,o=i;for(p3.util.swap(e,n,t),Jue(e[i],r)>0&&p3.util.swap(e,n,i);s0;)o-=1}0===Jue(e[n],r)?p3.util.swap(e,n,o):(o+=1,p3.util.swap(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}}function tce(e,t,n,i,r){const s=t[t.length-1],[o,a]=[e.length/s,s],l=p3.util.getTypedArrayFromDType(n,o*i),u=p3.util.getTypedArrayFromDType("int32",o*i);for(let t=0;to[t]={value:e,index:t}),i{const n=t.value-e.value;return 0===n?e.index-t.index:n};functi * limitations under the License. * ============================================================================= */ -function Que(e,t,n,i){const r=u3.util.parseAxisParam(t,n)[0],s=[1,n[0],1];for(let e=0;e{for(let n=0;n{for(let n=0;nnew Aae,1); +(0,p3.registerBackend)("cpu",()=>new Mae,1); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13110,7 +13110,7 @@ const Jue="4.22.0"; * limitations under the License. * ============================================================================= */ -const ece=Qae(u3.Elu,e=>e>=0?e:Math.exp(e)-1),tce={kernelName:u3.Elu,backendName:"cpu",kernelFunc:ece}; +const rce=nle(p3.Elu,e=>e>=0?e:Math.exp(e)-1),sce={kernelName:p3.Elu,backendName:"cpu",kernelFunc:rce}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13127,7 +13127,7 @@ const ece=Qae(u3.Elu,e=>e>=0?e:Math.exp(e)-1),tce={kernelName:u3.Elu,backendName * limitations under the License. * ============================================================================= */ -function nce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i;wae([r],"leakyRelu");const o=u3.util.sizeFromShape(r.shape),a=n.data.get(r.dataId).values,l=u3.util.getTypedArrayFromDType("float32",o);for(let e=0;ee<0?t*e:e);function sce(e){const{inputs:t,backend:n}=e,{x:i,alpha:r}=t;wae([i,r],"prelu");const s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,[a,l]=rce(i.shape,r.shape,s,o,"float32");return n.makeTensorInfo(l,"float32",a)}const oce={kernelName:u3.Prelu,backendName:"cpu",kernelFunc:sce},ace=Qae(u3.Relu,e=>Math.max(0,e)),lce={kernelName:u3.Relu,backendName:"cpu",kernelFunc:ace},uce=Qae(u3.Relu6,e=>Math.min(Math.max(0,e),6)),cce={kernelName:u3.Relu6,backendName:"cpu",kernelFunc:uce}; +function oce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i;Cae([r],"leakyRelu");const o=p3.util.sizeFromShape(r.shape),a=n.data.get(r.dataId).values,l=p3.util.getTypedArrayFromDType("float32",o);for(let e=0;ee<0?t*e:e);function uce(e){const{inputs:t,backend:n}=e,{x:i,alpha:r}=t;Cae([i,r],"prelu");const s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,[a,l]=lce(i.shape,r.shape,s,o,"float32");return n.makeTensorInfo(l,"float32",a)}const cce={kernelName:p3.Prelu,backendName:"cpu",kernelFunc:uce},dce=nle(p3.Relu,e=>Math.max(0,e)),hce={kernelName:p3.Relu,backendName:"cpu",kernelFunc:dce},pce=nle(p3.Relu6,e=>Math.min(Math.max(0,e),6)),fce={kernelName:p3.Relu6,backendName:"cpu",kernelFunc:pce}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13144,7 +13144,7 @@ function nce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i;wae([r], * limitations under the License. * ============================================================================= */ -function dce(e,t,n,i,r){if("linear"===n)return Nae({inputs:{x:t},backend:e});if("relu"===n)return ace({inputs:{x:t},backend:e});if("elu"===n)return ece({inputs:{x:t},backend:e});if("relu6"===n)return uce({inputs:{x:t},backend:e});if("prelu"===n)return sce({inputs:{x:t,alpha:i},backend:e});if("leakyrelu"===n)return nce({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return Tue({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)} +function mce(e,t,n,i,r){if("linear"===n)return Pae({inputs:{x:t},backend:e});if("relu"===n)return dce({inputs:{x:t},backend:e});if("elu"===n)return rce({inputs:{x:t},backend:e});if("relu6"===n)return pce({inputs:{x:t},backend:e});if("prelu"===n)return uce({inputs:{x:t,alpha:i},backend:e});if("leakyrelu"===n)return oce({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return Iue({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13161,7 +13161,7 @@ function dce(e,t,n,i,r){if("linear"===n)return Nae({inputs:{x:t},backend:e});if( * limitations under the License. * ============================================================================= */ -function hce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=u3.util.sizeFromShape(r.shape),a=u3.util.inferFromImplicitShape(s,o),l=u3.util.sizeFromShape(a);u3.util.assert(o===l,()=>`The new shape (${a}) has ${l} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`),n.incRef(r.dataId);const u=n.data.get(r.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=a,t.shape=a}return{dataId:r.dataId,shape:a,dtype:r.dtype}}const pce={kernelName:u3.Reshape,backendName:"cpu",kernelFunc:hce}; +function gce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=p3.util.sizeFromShape(r.shape),a=p3.util.inferFromImplicitShape(s,o),l=p3.util.sizeFromShape(a);p3.util.assert(o===l,()=>`The new shape (${a}) has ${l} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`),n.incRef(r.dataId);const u=n.data.get(r.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=a,t.shape=a}return{dataId:r.dataId,shape:a,dtype:r.dtype}}const _ce={kernelName:p3.Reshape,backendName:"cpu",kernelFunc:gce}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13178,7 +13178,7 @@ function hce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=u3.uti * limitations under the License. * ============================================================================= */ -function fce(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s}=t,{transposeA:o,transposeB:a}=i;wae([r,s],"matMul");const l=r.shape.length,u=s.shape.length,c=o?r.shape[l-2]:r.shape[l-1],d=a?s.shape[u-1]:s.shape[u-2],h=o?r.shape[l-1]:r.shape[l-2],p=a?s.shape[u-2]:s.shape[u-1],f=r.shape.slice(0,-2),m=s.shape.slice(0,-2),g=u3.util.sizeFromShape(f),_=u3.util.sizeFromShape(m),y=u3.broadcast_util.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)).concat([h,p]);u3.util.assert(c===d,()=>`Error in matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${o} and transposeB=${a} must match.`);const v=a?[_,p,d]:[_,d,p],b=hce({inputs:{x:r},backend:n,attrs:{shape:o?[g,c,h]:[g,h,c]}}),T=hce({inputs:{x:s},backend:n,attrs:{shape:v}}),x=o?b.shape[1]:b.shape[2],E=o?b.shape[2]:b.shape[1],w=a?T.shape[1]:T.shape[2],I=Math.max(g,_),A=n.data.get(b.dataId).values,S=n.data.get(T.dataId).values,C=u3.util.computeStrides(b.shape),O=u3.util.computeStrides(T.shape),[M,k,R]=o?[C[0],1,C[1]]:[C[0],C[1],1],[N,D,F]=a?[1,O[1],O[0]]:[O[1],1,O[0]],L=E*w,P=(0,u3.buffer)([I,E,w],b.dtype),B=P.values,$=n.blockSize;for(let e=0;e`Error in matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${o} and transposeB=${a} must match.`);const v=a?[_,p,d]:[_,d,p],b=gce({inputs:{x:r},backend:n,attrs:{shape:o?[g,c,h]:[g,h,c]}}),T=gce({inputs:{x:s},backend:n,attrs:{shape:v}}),x=o?b.shape[1]:b.shape[2],E=o?b.shape[2]:b.shape[1],w=a?T.shape[1]:T.shape[2],I=Math.max(g,_),A=n.data.get(b.dataId).values,S=n.data.get(T.dataId).values,C=p3.util.computeStrides(b.shape),O=p3.util.computeStrides(T.shape),[M,k,R]=o?[C[0],1,C[1]]:[C[0],C[1],1],[N,D,F]=a?[1,O[1],O[0]]:[O[1],1,O[0]],L=E*w,P=(0,p3.buffer)([I,E,w],b.dtype),B=P.values,$=n.blockSize;for(let e=0;eMath.acos(e)),yce={kernelName:u3.Acos,backendName:"cpu",kernelFunc:_ce},vce=Qae(u3.Acosh,e=>Math.acosh(e)),bce={kernelName:u3.Acosh,backendName:"cpu",kernelFunc:vce};const Tce={kernelName:u3.AddN,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationWeights:a}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:d}=i;let h,p,f;const m=[];h=yce({inputs:{a:r,b:s},attrs:{transposeA:l,transposeB:u},backend:n}),o&&(p=Xae({inputs:{a:h,b:o},backend:n}),m.push(h),h=p),c&&(f=mce(n,h,c,a,d),m.push(h),h=f);for(const e of m)n.disposeIntermediateTensorInfo(e);return h}},Tce=nle(p3.Acos,e=>Math.acos(e)),xce={kernelName:p3.Acos,backendName:"cpu",kernelFunc:Tce},Ece=nle(p3.Acosh,e=>Math.acosh(e)),wce={kernelName:p3.Acosh,backendName:"cpu",kernelFunc:Ece};const Ice={kernelName:p3.AddN,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13212,7 +13212,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationW * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,i=t;wae(t,"addN");const r=i.map(e=>n.data.get(e.dataId).values),s=(0,u3.buffer)(i[0].shape,i[0].dtype),o=s.values;for(let e=0;en.data.get(e.dataId).values),s=(0,p3.buffer)(i[0].shape,i[0].dtype),o=s.values;for(let e=0;en.dat * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;wae(r,"all");const a=u3.util.parseAxisParam(s,r.shape);let l=a;const u=u3.backend_util.getAxesPermutation(l,r.shape.length);let c=r;null!=u&&(c=eue({inputs:{x:r},backend:n,attrs:{perm:u}}),l=u3.backend_util.getInnerMostAxes(l.length,r.shape.length)),u3.backend_util.assertAxesAreInnerMostDims("all",l,c.shape.length);const[d,h]=u3.backend_util.computeOutAndReduceShapes(c.shape,l),p=u3.util.sizeFromShape(h),f=u3.util.makeZerosTypedArray(u3.util.sizeFromShape(d),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;en&&(n=r,i=e)}p[e]=i}return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(c,"int32",p)}};const Ice={kernelName:u3.ArgMin,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;Cae(r,"argMax");let o=p3.util.parseAxisParam(s,r.shape);const a=p3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=rue({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=p3.backend_util.getInnerMostAxes(o.length,l.shape.length)),o=[o[0]],p3.backend_util.assertAxesAreInnerMostDims("argMax",o,l.shape.length);const[c,d]=p3.backend_util.computeOutAndReduceShapes(l.shape,o),h=p3.util.sizeFromShape(c),p=p3.util.makeZerosTypedArray(h,"int32"),f=p3.util.sizeFromShape(d),m=n.data.get(l.dataId).values;for(let e=0;en&&(n=r,i=e)}p[e]=i}return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(c,"int32",p)}};const Oce={kernelName:p3.ArgMin,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13280,7 +13280,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;wae(r,"argMax * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;wae(r,"argMin");let o=u3.util.parseAxisParam(s,r.shape);const a=u3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=eue({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=u3.backend_util.getInnerMostAxes(o.length,l.shape.length)),o=[o[0]],u3.backend_util.assertAxesAreInnerMostDims("argMin",o,l.shape.length);const[c,d]=u3.backend_util.computeOutAndReduceShapes(l.shape,o),h=u3.util.sizeFromShape(c),p=u3.util.makeZerosTypedArray(h,"int32"),f=u3.util.sizeFromShape(d),m=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(c,"int32",p)}},Ace=Qae(u3.Asin,e=>Math.asin(e)),Sce={kernelName:u3.Asin,backendName:"cpu",kernelFunc:Ace},Cce=Qae(u3.Asinh,e=>Math.asinh(e)),Oce={kernelName:u3.Asinh,backendName:"cpu",kernelFunc:Cce},Mce=Qae(u3.Atan,e=>Math.atan(e)),kce={kernelName:u3.Atan,backendName:"cpu",kernelFunc:Mce},Rce=Oae((e,t)=>Math.atan2(e,t)),Nce=Uae(u3.Atan2,Rce),Dce={kernelName:u3.Atan2,backendName:"cpu",kernelFunc:Nce},Fce=Qae(u3.Atanh,e=>Math.atanh(e)),Lce={kernelName:u3.Atanh,backendName:"cpu",kernelFunc:Fce}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;Cae(r,"argMin");let o=p3.util.parseAxisParam(s,r.shape);const a=p3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=rue({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=p3.backend_util.getInnerMostAxes(o.length,l.shape.length)),o=[o[0]],p3.backend_util.assertAxesAreInnerMostDims("argMin",o,l.shape.length);const[c,d]=p3.backend_util.computeOutAndReduceShapes(l.shape,o),h=p3.util.sizeFromShape(c),p=p3.util.makeZerosTypedArray(h,"int32"),f=p3.util.sizeFromShape(d),m=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(c,"int32",p)}},Mce=nle(p3.Asin,e=>Math.asin(e)),kce={kernelName:p3.Asin,backendName:"cpu",kernelFunc:Mce},Rce=nle(p3.Asinh,e=>Math.asinh(e)),Nce={kernelName:p3.Asinh,backendName:"cpu",kernelFunc:Rce},Dce=nle(p3.Atan,e=>Math.atan(e)),Fce={kernelName:p3.Atan,backendName:"cpu",kernelFunc:Dce},Lce=Nae((e,t)=>Math.atan2(e,t)),Pce=Yae(p3.Atan2,Lce),Bce={kernelName:p3.Atan2,backendName:"cpu",kernelFunc:Pce},$ce=nle(p3.Atanh,e=>Math.atanh(e)),Uce={kernelName:p3.Atanh,backendName:"cpu",kernelFunc:$ce}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13297,7 +13297,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;wae(r,"argMin * limitations under the License. * ============================================================================= */ -function Pce(e,t,n,i,r,s){const o=r.strideHeight,a=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,d=r.effectiveFilterWidth,h=r.padInfo.top,p=r.padInfo.left,f="max"===s?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=(0,u3.buffer)(r.outShape,n),g=m.values,_=r.outShape[1]*r.outShape[2]*r.outShape[3],y=r.outShape[2]*r.outShape[3],v=r.outShape[3];for(let t=0;t_?_=o:"avg"===s&&(y+=o,b++)}if(isNaN(_))break}g[E+n*v+t]="avg"===s?y/b:_}}}return m}function Bce(e,t,n,i,r=!1,s=!1){const o=(0,u3.buffer)(i.outShape,"int32"),a=i.strideHeight,l=i.strideWidth,u=i.dilationHeight,c=i.dilationWidth,d=i.effectiveFilterHeight,h=i.effectiveFilterWidth,p=i.padInfo.top,f=i.padInfo.left,m=(0,u3.buffer)(t,n,e);for(let e=0;eb&&(b=u,T=r?s?((e*i.inHeight+n)*i.inWidth+a)*i.inChannels+t:(n*i.inWidth+a)*i.inChannels+t:o*h+l)}}o.set(T,e,n,a,t)}}return o}function $ce(e,t,n,i,r,s){const o=r.strideDepth,a=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,d=r.dilationWidth,h=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,_=r.padInfo.left,y="max"===s?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,v=(0,u3.buffer)(r.outShape,n),b=v.values,T=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],E=r.outShape[3]*r.outShape[4],w=r.outShape[4];for(let t=0;tx?x=r:"avg"===s&&(E+=r,I++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}b[g+t]="avg"===s?E/Math.max(I,1):x}}}}return v}const Uce={kernelName:u3.AvgPool,backendName:"cpu",kernelFunc: +function Vce(e,t,n,i,r,s){const o=r.strideHeight,a=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,d=r.effectiveFilterWidth,h=r.padInfo.top,p=r.padInfo.left,f="max"===s?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=(0,p3.buffer)(r.outShape,n),g=m.values,_=r.outShape[1]*r.outShape[2]*r.outShape[3],y=r.outShape[2]*r.outShape[3],v=r.outShape[3];for(let t=0;t_?_=o:"avg"===s&&(y+=o,b++)}if(isNaN(_))break}g[E+n*v+t]="avg"===s?y/b:_}}}return m}function zce(e,t,n,i,r=!1,s=!1){const o=(0,p3.buffer)(i.outShape,"int32"),a=i.strideHeight,l=i.strideWidth,u=i.dilationHeight,c=i.dilationWidth,d=i.effectiveFilterHeight,h=i.effectiveFilterWidth,p=i.padInfo.top,f=i.padInfo.left,m=(0,p3.buffer)(t,n,e);for(let e=0;eb&&(b=u,T=r?s?((e*i.inHeight+n)*i.inWidth+a)*i.inChannels+t:(n*i.inWidth+a)*i.inChannels+t:o*h+l)}}o.set(T,e,n,a,t)}}return o}function jce(e,t,n,i,r,s){const o=r.strideDepth,a=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,d=r.dilationWidth,h=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,_=r.padInfo.left,y="max"===s?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,v=(0,p3.buffer)(r.outShape,n),b=v.values,T=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],E=r.outShape[3]*r.outShape[4],w=r.outShape[4];for(let t=0;tx?x=r:"avg"===s&&(E+=r,I++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}b[g+t]="avg"===s?E/Math.max(I,1):x}}}}return v}const Yce={kernelName:p3.AvgPool,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13314,7 +13314,7 @@ function Pce(e,t,n,i,r,s){const o=r.strideHeight,a=r.strideWidth,l=r.dilationHei * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;wae(r,"avgPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;u3.util.assert(u3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=u3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&u3.util.arraysEqual(u.inShape,u.outShape))c=Nae({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=u3.util.computeStrides(r.shape),i=Pce(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,i.values)}return c}};const Vce={kernelName:u3.AvgPool3D,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;Cae(r,"avgPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=p3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&p3.util.arraysEqual(u.inShape,u.outShape))c=Pae({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=p3.util.computeStrides(r.shape),i=Vce(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,i.values)}return c}};const Gce={kernelName:p3.AvgPool3D,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13331,7 +13331,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;wae(r,"avgPool");const{f * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i;wae(r,"avgPool3d");const c=u3.backend_util.computePool3DInfo(r.shape,s,o,1,a,l,u),d=$ce(n.data.get(r.dataId).values,r.shape,r.dtype,u3.util.computeStrides(r.shape),c,"avg");return n.makeTensorInfo(d.shape,"float32",d.values)}};const zce={kernelName:u3.AvgPool3DGrad,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i;Cae(r,"avgPool3d");const c=p3.backend_util.computePool3DInfo(r.shape,s,o,1,a,l,u),d=jce(n.data.get(r.dataId).values,r.shape,r.dtype,p3.util.computeStrides(r.shape),c,"avg");return n.makeTensorInfo(d.shape,"float32",d.values)}};const Hce={kernelName:p3.AvgPool3DGrad,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13348,7 +13348,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o, * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=i;wae([r,s],"avgPool3DGrad");const c=u3.backend_util.computePool3DInfo(s.shape,o,a,1,l,u),d=c.strideDepth,h=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,_=c.dilationDepth,y=c.dilationHeight,v=c.dilationWidth,b=c.effectiveFilterDepth,T=c.effectiveFilterHeight,x=c.effectiveFilterWidth,E=b-1-c.padInfo.front,w=x-1-c.padInfo.left,I=T-1-c.padInfo.top,A=(0,u3.buffer)(s.shape,"float32"),S=1/(f*m*g),C=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(i)!==i))for(let n=0;n=c.outHeight||Math.floor(r)!==r))for(let n=0;n=c.outWidth||Math.floor(s)!==s)continue;l+=C.get(e,i,r,s,t)}}}A.set(l*S,e,n,i,r,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const jce={kernelName:u3.AvgPoolGrad,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=i;Cae([r,s],"avgPool3DGrad");const c=p3.backend_util.computePool3DInfo(s.shape,o,a,1,l,u),d=c.strideDepth,h=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,_=c.dilationDepth,y=c.dilationHeight,v=c.dilationWidth,b=c.effectiveFilterDepth,T=c.effectiveFilterHeight,x=c.effectiveFilterWidth,E=b-1-c.padInfo.front,w=x-1-c.padInfo.left,I=T-1-c.padInfo.top,A=(0,p3.buffer)(s.shape,"float32"),S=1/(f*m*g),C=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(i)!==i))for(let n=0;n=c.outHeight||Math.floor(r)!==r))for(let n=0;n=c.outWidth||Math.floor(s)!==s)continue;l+=C.get(e,i,r,s,t)}}}A.set(l*S,e,n,i,r,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const Wce={kernelName:p3.AvgPoolGrad,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13365,7 +13365,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;wae([r,s],"avgPoolGrad");const{filterSize:a,strides:l,pad:u}=i,c=u3.backend_util.computePool2DInfo(o.shape,a,l,1,u),d=c.strideHeight,h=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,_=c.effectiveFilterHeight,y=c.effectiveFilterWidth,v=y-1-c.padInfo.left,b=_-1-c.padInfo.top,T=(0,u3.buffer)(o.shape,"float32"),x=1/(p*f),E=n.data.get(r.dataId).values,w=(0,u3.buffer)(r.shape,"float32",E);for(let e=0;e=c.outHeight||Math.floor(i)!==i))for(let n=0;n=c.outWidth||Math.floor(r)!==r)continue;o+=w.get(e,i,r,t)}}T.set(o*x,e,n,i,t)}return n.makeTensorInfo(T.shape,T.dtype,T.values)}};const Yce={kernelName:u3.FusedBatchNorm,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;Cae([r,s],"avgPoolGrad");const{filterSize:a,strides:l,pad:u}=i,c=p3.backend_util.computePool2DInfo(o.shape,a,l,1,u),d=c.strideHeight,h=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,_=c.effectiveFilterHeight,y=c.effectiveFilterWidth,v=y-1-c.padInfo.left,b=_-1-c.padInfo.top,T=(0,p3.buffer)(o.shape,"float32"),x=1/(p*f),E=n.data.get(r.dataId).values,w=(0,p3.buffer)(r.shape,"float32",E);for(let e=0;e=c.outHeight||Math.floor(i)!==i))for(let n=0;n=c.outWidth||Math.floor(r)!==r)continue;o+=w.get(e,i,r,t)}}T.set(o*x,e,n,i,t)}return n.makeTensorInfo(T.shape,T.dtype,T.values)}};const Xce={kernelName:p3.FusedBatchNorm,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13382,7 +13382,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;wae([r,s]," * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,scale:s,offset:o,mean:a,variance:l}=t;u3.util.assert(a.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),u3.util.assert(null==o||a.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),u3.util.assert(null==s||a.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),wae([r,a,l,s,o],"batchNorm");let{varianceEpsilon:u}=i;null==u&&(u=.001);const c=n.data.get(r.dataId).values,d=n.data.get(a.dataId).values,h=n.data.get(l.dataId).values,p=s?n.data.get(s.dataId).values:new Float32Array([1]),f=o?n.data.get(o.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,_=p.length,y=h.length,v=d.length;let b=0,T=0,x=0,E=0;for(let e=0;e=g&&(b=0),T>=v&&(T=0),x>=_&&(x=0),E>=y&&(E=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};const Gce={kernelName:u3.BatchToSpaceND,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,scale:s,offset:o,mean:a,variance:l}=t;p3.util.assert(a.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),p3.util.assert(null==o||a.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),p3.util.assert(null==s||a.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Cae([r,a,l,s,o],"batchNorm");let{varianceEpsilon:u}=i;null==u&&(u=.001);const c=n.data.get(r.dataId).values,d=n.data.get(a.dataId).values,h=n.data.get(l.dataId).values,p=s?n.data.get(s.dataId).values:new Float32Array([1]),f=o?n.data.get(o.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,_=p.length,y=h.length,v=d.length;let b=0,T=0,x=0,E=0;for(let e=0;e=g&&(b=0),T>=v&&(T=0),x>=_&&(x=0),E>=y&&(E=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};const qce={kernelName:p3.BatchToSpaceND,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13399,7 +13399,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,scale:s,offset:o,mean:a,var * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i;wae([r],"batchToSpaceND");const a=s.reduce((e,t)=>e*t),l=u3.backend_util.getReshaped(r.shape,s,a),u=u3.backend_util.getPermuted(l.length,s.length),c=u3.backend_util.getReshapedPermuted(r.shape,s,a),d=u3.backend_util.getSliceBeginCoords(o,s.length),h=u3.backend_util.getSliceSize(c,o,s.length),p=hce({inputs:{x:r},backend:n,attrs:{shape:l}}),f=eue({inputs:{x:p},backend:n,attrs:{perm:u}}),m=hce({inputs:{x:f},backend:n,attrs:{shape:c}}),g=wue({inputs:{x:m},backend:n,attrs:{begin:d,size:h}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};const Hce={kernelName:u3.Bincount,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i;Cae([r],"batchToSpaceND");const a=s.reduce((e,t)=>e*t),l=p3.backend_util.getReshaped(r.shape,s,a),u=p3.backend_util.getPermuted(l.length,s.length),c=p3.backend_util.getReshapedPermuted(r.shape,s,a),d=p3.backend_util.getSliceBeginCoords(o,s.length),h=p3.backend_util.getSliceSize(c,o,s.length),p=gce({inputs:{x:r},backend:n,attrs:{shape:l}}),f=rue({inputs:{x:p},backend:n,attrs:{perm:u}}),m=gce({inputs:{x:f},backend:n,attrs:{shape:c}}),g=Cue({inputs:{x:m},backend:n,attrs:{begin:d,size:h}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};const Kce={kernelName:p3.Bincount,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13416,7 +13416,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=Hae(n.data.get(r.dataId).values,n.data.get(s.dataId).values,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,a)}};const Wce={kernelName:u3.BroadcastArgs,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=Kae(n.data.get(r.dataId).values,n.data.get(s.dataId).values,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,a)}};const Zce={kernelName:p3.BroadcastArgs,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -13433,7 +13433,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=H * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{s0:i,s1:r}=t,s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,a=u3.backend_util.assertAndGetBroadcastShape(Array.from(s),Array.from(o));return n.makeTensorInfo([a.length],"int32",Int32Array.from(a))}},Xce=Qae(u3.ClipByValue,(e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,i=new Float32Array(u3.util.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,o=r.complexTensorInfos.imag,a=n.data.get(s.dataId).values,l=n.data.get(o.dataId).values;for(let e=0;e{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,i=new Float32Array(p3.util.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,o=r.complexTensorInfos.imag,a=n.data.get(s.dataId).values,l=n.data.get(o.dataId).values;for(let e=0;ee.shape);u3.backend_util.assertParamsConsistent(o,s);let a=u3.backend_util.computeOutShape(t.map(e=>e.shape),s);if(0===u3.util.sizeFromShape(a))return n.makeTensorInfo(a,t[0].dtype,[]);const l=t.filter(e=>u3.util.sizeFromShape(e.shape)>0);if(1===l.length)return Nae({inputs:{x:l[0]},backend:n});if("complex64"===l[0].dtype){const e=l.map(e=>Fae({inputs:{input:e},backend:n})),t=l.map(e=>Zce({inputs:{input:e},backend:n})),i=Jce({inputs:e,backend:n,attrs:{axis:s}}),r=Jce({inputs:t,backend:n,attrs:{axis:s}}),o=Mae({inputs:{real:i,imag:r},backend:n});return e.forEach(e=>n.disposeIntermediateTensorInfo(e)),t.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(r),o}const u=l.map(e=>{const t=u3.util.sizeFromShape(e.shape.slice(s));return hce({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})}),c=u.map(e=>({vals:n.data.get(e.dataId).values,shape:e.shape}));a=u3.backend_util.computeOutShape(u.map(e=>e.shape),1);const d=1===u[0].shape[0],h=ile(c,a,t[0].dtype,d),p=u3.backend_util.computeOutShape(l.map(e=>e.shape),s),f=n.makeTensorInfo(p,t[0].dtype,h);return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}const ede={kernelName:u3.Concat,backendName:"cpu",kernelFunc:Jce}; +function ide(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=p3.util.parseAxisParam(r,t[0].shape)[0],o=t.map(e=>e.shape);p3.backend_util.assertParamsConsistent(o,s);let a=p3.backend_util.computeOutShape(t.map(e=>e.shape),s);if(0===p3.util.sizeFromShape(a))return n.makeTensorInfo(a,t[0].dtype,[]);const l=t.filter(e=>p3.util.sizeFromShape(e.shape)>0);if(1===l.length)return Pae({inputs:{x:l[0]},backend:n});if("complex64"===l[0].dtype){const e=l.map(e=>$ae({inputs:{input:e},backend:n})),t=l.map(e=>tde({inputs:{input:e},backend:n})),i=ide({inputs:e,backend:n,attrs:{axis:s}}),r=ide({inputs:t,backend:n,attrs:{axis:s}}),o=Dae({inputs:{real:i,imag:r},backend:n});return e.forEach(e=>n.disposeIntermediateTensorInfo(e)),t.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(r),o}const u=l.map(e=>{const t=p3.util.sizeFromShape(e.shape.slice(s));return gce({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})}),c=u.map(e=>({vals:n.data.get(e.dataId).values,shape:e.shape}));a=p3.backend_util.computeOutShape(u.map(e=>e.shape),1);const d=1===u[0].shape[0],h=ale(c,a,t[0].dtype,d),p=p3.backend_util.computeOutShape(l.map(e=>e.shape),s),f=n.makeTensorInfo(p,t[0].dtype,h);return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}const rde={kernelName:p3.Concat,backendName:"cpu",kernelFunc:ide}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13484,7 +13484,7 @@ function Jce(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=u3.util.parseAx * limitations under the License. * ============================================================================= */ -function tde(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dataFormat:l,dilations:u,dimRoundingMode:c}=i;wae([r,s],"conv2d");const d=u3.backend_util.convertConv2DDataFormat(l),h=u3.backend_util.computeConv2DInfo(r.shape,s.shape,o,u,a,c,!1,d),p=h.filterHeight,f=h.filterWidth,m=h.dilationHeight,g=h.dilationWidth,_=h.padInfo.left,y=h.padInfo.top,v="channelsLast"===h.dataFormat,b=new u3.TensorBuffer(h.outShape,r.dtype),T=u3.util.computeStrides(r.shape),x=u3.util.computeStrides(s.shape),E=T[0],w=v?T[1]:T[2],I=v?T[2]:1,A=v?1:T[1],S=b.strides[0],C=v?b.strides[1]:b.strides[2],O=v?b.strides[2]:1,M=v?1:b.strides[1],k=n.data.get(r.dataId).values,R=n.data.get(s.dataId).values,N=b.values;for(let e=0;e=h.inHeight)continue;const s=e*x[0],o=t+n*w;for(let e=0;e=h.inWidth)continue;const r=o+i*I;let a=s+e*x[1];for(let e=0;e=h.inHeight)continue;const s=e*x[0],o=t+n*w;for(let e=0;e=h.inWidth)continue;const r=o+i*I;let a=s+e*x[1];for(let e=0;e=u.inDepth)continue;const s=e*I[0],o=t+n*w[1];for(let e=0;e=u.inHeight)continue;const r=s+e*I[1],a=o+i*w[2];for(let e=0;e=u.inWidth)continue;const s=r+e*I[2],o=a+t*u.inChannels;let l=s;for(let e=0;e=u.inDepth)continue;const s=e*I[0],o=t+n*w[1];for(let e=0;e=u.inHeight)continue;const r=s+e*I[1],a=o+i*w[2];for(let e=0;e=u.inWidth)continue;const s=r+e*I[2],o=a+t*u.inChannels;let l=s;for(let e=0;eMath.cos(e)),ude={kernelName:u3.Cos,backendName:"cpu",kernelFunc:lde},cde=Qae(u3.Cosh,e=>Math.cosh(e)),dde={kernelName:u3.Cosh,backendName:"cpu",kernelFunc:cde};const hde={kernelName:u3.CropAndResize,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides:a,inputShape:l}=i;Cae([r],"conv3dBackpropInputV2");const u=p3.util.computeStrides(r.shape),c=p3.util.computeStrides(s.shape),d=p3.backend_util.computeConv3DInfo(l,s.shape,a,1,o),h=new p3.TensorBuffer(d.inShape,"float32"),p=h.values,[f,m,g,_]=h.strides,y=n.data.get(r.dataId).values,[v,b,T,x]=u,E=n.data.get(s.dataId).values,[w,I,A,S]=c,{batchSize:C,filterDepth:O,filterHeight:M,filterWidth:k,inChannels:R,inDepth:N,inHeight:D,inWidth:F,outChannels:L,outDepth:P,outHeight:B,outWidth:$,strideDepth:U,strideHeight:V,strideWidth:z}=d,j=O-1-d.padInfo.front,Y=M-1-d.padInfo.top,G=k-1-d.padInfo.left;for(let e=0;eMath.cos(e)),pde={kernelName:p3.Cos,backendName:"cpu",kernelFunc:hde},fde=nle(p3.Cosh,e=>Math.cosh(e)),mde={kernelName:p3.Cosh,backendName:"cpu",kernelFunc:fde};const gde={kernelName:p3.CropAndResize,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13586,7 +13586,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r,boxes:s,boxInd:o}=t,{cropSize:a,method:l,extrapolationValue:u}=i,[c,d,h,p]=r.shape,f=s.shape[0],[m,g]=a,_=(0,u3.buffer)([f,m,g,p],"float32"),y=n.data.get(s.dataId).values,v=n.data.get(o.dataId).values,b=n.data.get(r.dataId).values,T=u3.util.computeStrides(r.shape),x=u3.util.computeStrides(_.shape);for(let e=0;e=c)continue;const a=m>1?(r-n)*(d-1)/(m-1):0,f=g>1?(s-i)*(h-1)/(g-1):0;for(let t=0;t1?n*(d-1)+t*a:.5*(n+r)*(d-1);if(c<0||c>d-1)for(let n=0;n1?i*(h-1)+l*f:.5*(i+s)*(h-1);if(c<0||c>h-1){for(let n=0;n1?i*(h-1)+n*f:.5*(i+s)*(h-1);if(r<0||r>h-1){for(let i=0;i=c)continue;const a=m>1?(r-n)*(d-1)/(m-1):0,f=g>1?(s-i)*(h-1)/(g-1):0;for(let t=0;t1?n*(d-1)+t*a:.5*(n+r)*(d-1);if(c<0||c>d-1)for(let n=0;n1?i*(h-1)+l*f:.5*(i+s)*(h-1);if(c<0||c>h-1){for(let n=0;n1?i*(h-1)+n*f:.5*(i+s)*(h-1);if(r<0||r>h-1){for(let i=0;ie+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${o}`);const a=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],d=l*s,h=u*s,p=c/(s*s),f=n.data.get(r.dataId).values,m=new Float32Array(a*d*h*p);let g=0;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${o}`);const a=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],d=l*s,h=u*s,p=c/(s*s),f=n.data.get(r.dataId).values,m=new Float32Array(a*d*h*p);let g=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${h}'`);const p=u3.backend_util.computeConv2DInfo(r.shape,s.shape,o,h,a,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:_,padInfo:y}=p,v=y.left,b=y.top,T=p.outChannels/p.inChannels,x=new u3.TensorBuffer(p.outShape,r.dtype),E=n.data.get(r.dataId).values,w=n.data.get(s.dataId).values,I=x.values;for(let e=0;e=p.inHeight)continue;const s=e*d[0],o=t+n*c[1];for(let e=0;e=p.inWidth)continue;const r=s+e*d[1],a=o+i*p.inChannels;let l=t,u=r;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${h}'`);const p=p3.backend_util.computeConv2DInfo(r.shape,s.shape,o,h,a,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:_,padInfo:y}=p,v=y.left,b=y.top,T=p.outChannels/p.inChannels,x=new p3.TensorBuffer(p.outShape,r.dtype),E=n.data.get(r.dataId).values,w=n.data.get(s.dataId).values,I=x.values;for(let e=0;e=p.inHeight)continue;const s=e*d[0],o=t+n*c[1];for(let e=0;e=p.inWidth)continue;const r=s+e*d[1],a=o+i*p.inChannels;let l=t,u=r;for(let e=0;e{const{x:i,filter:r}=e,{strides:s,pad:o,dilations:a}=n,l=t,u=l.data.get(i.dataId).values,c=i.shape.length,d=l.data.get(r.dataId).values,h=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:_,outWidth:y,padInfo:v,strideHeight:b,strideWidth:T,filterHeight:x,filterWidth:E,dilationHeight:w,dilationWidth:I,outShape:A}=u3.backend_util.computeDilation2DInfo(i.shape,r.shape,s,o,"NHWC",a),S=u3.util.sizeFromShape(A),C=A.length,O=u3.util.getArrayFromDType(i.dtype,S);for(let e=0;e=0&&s=0&&pl&&(l=m)}}}O[u3.util.locToIndex([e,t,s,a],C,u3.util.computeStrides(A))]=l}}}return{dataId:l.write(u3.util.toTypedArray(O,i.dtype),A,i.dtype),shape:A,dtype:i.dtype}}},Ede={kernelName:u3.Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r,dy:s}=e,{strides:o,pad:a,dilations:l}=n,u=t,c=u3.util.toNestedArray(i.shape,u.data.get(i.dataId).values),d=u3.util.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:h,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:_,padInfo:y,strideHeight:v,strideWidth:b,filterHeight:T,filterWidth:x,dilationHeight:E,dilationWidth:w,outShape:I}=u3.backend_util.computeDilation2DInfo(i.shape,r.shape,o,a,"NHWC",l);u3.util.assert(s.rank===I.length,()=>`Error in ${u3.Dilation2DBackpropFilter}, dy must have the same rank as output ${I.length}, but got ${s.rank}`);const A=u3.util.toNestedArray(I,u.data.get(s.dataId).values),S=u3.util.makeZerosNestedTypedArray(r.shape,r.dtype);for(let e=0;e=0&&i=0&&uo&&(o=r,a=t,l=n)}}}S[a][l][s]+=A[e][t][i][s]}}}return{dataId:u.write(u3.util.toTypedArray(S,i.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},wde={kernelName:u3.Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r,dy:s}=e,{strides:o,pad:a,dilations:l}=n,u=t,c=u3.util.toNestedArray(i.shape,u.data.get(i.dataId).values),d=u3.util.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:h,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:_,padInfo:y,strideHeight:v,strideWidth:b,filterHeight:T,filterWidth:x,dilationHeight:E,dilationWidth:w,outShape:I}=u3.backend_util.computeDilation2DInfo(i.shape,r.shape,o,a,"NHWC",l);u3.util.assert(s.rank===I.length,()=>`Error in ${u3.Dilation2DBackpropInput}, dy must have the same rank as output ${I.length}, but got ${s.rank}`);const A=u3.util.toNestedArray(I,u.data.get(s.dataId).values),S=u3.util.makeZerosNestedTypedArray(i.shape,i.dtype);for(let e=0;e=0&&i=0&&uo&&(o=r,a=i,l=u)}}}S[e][a][l][s]+=A[e][t][i][s]}}}return{dataId:u.write(u3.util.toTypedArray(S,i.dtype),i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}};const Ide={kernelName:u3.Draw,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=p3.util.sizeFromShape(i.shape),s=n.data.get(i.dataId).values,o=(0,p3.buffer)([r,r],i.dtype),a=o.values;for(let e=0;e{const{x:i,filter:r}=e,{strides:s,pad:o,dilations:a}=n,l=t,u=l.data.get(i.dataId).values,c=i.shape.length,d=l.data.get(r.dataId).values,h=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:_,outWidth:y,padInfo:v,strideHeight:b,strideWidth:T,filterHeight:x,filterWidth:E,dilationHeight:w,dilationWidth:I,outShape:A}=p3.backend_util.computeDilation2DInfo(i.shape,r.shape,s,o,"NHWC",a),S=p3.util.sizeFromShape(A),C=A.length,O=p3.util.getArrayFromDType(i.dtype,S);for(let e=0;e=0&&s=0&&pl&&(l=m)}}}O[p3.util.locToIndex([e,t,s,a],C,p3.util.computeStrides(A))]=l}}}return{dataId:l.write(p3.util.toTypedArray(O,i.dtype),A,i.dtype),shape:A,dtype:i.dtype}}},Sde={kernelName:p3.Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r,dy:s}=e,{strides:o,pad:a,dilations:l}=n,u=t,c=p3.util.toNestedArray(i.shape,u.data.get(i.dataId).values),d=p3.util.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:h,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:_,padInfo:y,strideHeight:v,strideWidth:b,filterHeight:T,filterWidth:x,dilationHeight:E,dilationWidth:w,outShape:I}=p3.backend_util.computeDilation2DInfo(i.shape,r.shape,o,a,"NHWC",l);p3.util.assert(s.rank===I.length,()=>`Error in ${p3.Dilation2DBackpropFilter}, dy must have the same rank as output ${I.length}, but got ${s.rank}`);const A=p3.util.toNestedArray(I,u.data.get(s.dataId).values),S=p3.util.makeZerosNestedTypedArray(r.shape,r.dtype);for(let e=0;e=0&&i=0&&uo&&(o=r,a=t,l=n)}}}S[a][l][s]+=A[e][t][i][s]}}}return{dataId:u.write(p3.util.toTypedArray(S,i.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Cde={kernelName:p3.Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r,dy:s}=e,{strides:o,pad:a,dilations:l}=n,u=t,c=p3.util.toNestedArray(i.shape,u.data.get(i.dataId).values),d=p3.util.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:h,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:_,padInfo:y,strideHeight:v,strideWidth:b,filterHeight:T,filterWidth:x,dilationHeight:E,dilationWidth:w,outShape:I}=p3.backend_util.computeDilation2DInfo(i.shape,r.shape,o,a,"NHWC",l);p3.util.assert(s.rank===I.length,()=>`Error in ${p3.Dilation2DBackpropInput}, dy must have the same rank as output ${I.length}, but got ${s.rank}`);const A=p3.util.toNestedArray(I,u.data.get(s.dataId).values),S=p3.util.makeZerosNestedTypedArray(i.shape,i.dtype);for(let e=0;e=0&&i=0&&uo&&(o=r,a=i,l=u)}}}S[e][a][l][s]+=A[e][t][i][s]}}}return{dataId:u.write(p3.util.toTypedArray(S,i.dtype),i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}};const Ode={kernelName:p3.Draw,backendName:"cpu",kernelFunc: /** * @license * Copyright 2023 Google LLC. @@ -13756,7 +13756,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r}=t,{canvas:s,options:o} * limitations under the License. * ============================================================================= */ -function Ade(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;let a;wae(r,"sum"),a="bool"===r.dtype?Bae({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):Nae({inputs:{x:r},backend:n});const l=a.shape.length,u=u3.util.parseAxisParam(s,a.shape),c=u3.backend_util.getAxesPermutation(u,l);let d=u,h=a;null!=c&&(h=eue({inputs:{x:a},backend:n,attrs:{perm:c}}),d=u3.backend_util.getInnerMostAxes(d.length,l)),u3.backend_util.assertAxesAreInnerMostDims("sum",d,h.shape.length);const[p,f]=u3.backend_util.computeOutAndReduceShapes(h.shape,d);let m=Rae(n,p,u3.backend_util.upcastType(h.dtype,"int32"));const g=u3.util.sizeFromShape(f),_=n.data.get(m.dataId).values,y=n.data.get(h.dataId).values;for(let e=0;e<_.length;++e){const t=e*g;let n=0;for(let e=0;e=0&&(h=Ade({inputs:{x:h},backend:n,attrs:{axis:u[e]-(o.length-p),keepDims:!1}}),f.push(h)),p--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}};const Ode={kernelName:u3.EluGrad,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,summedDims:a,idDims:l}=p3.backend_util.decodeEinsumEquation(r,s.length);p3.backend_util.checkEinsumDimSizes(o.length,l,s);const{path:u,steps:c}=p3.backend_util.getEinsumComputePath(a,l),d=c.length;let h=null,p=o.length;const f=[];for(let e=0;e=0&&(h=Mde({inputs:{x:h},backend:n,attrs:{axis:u[e]-(o.length-p),keepDims:!1}}),f.push(h)),p--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}};const Nde={kernelName:p3.EluGrad,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13790,7 +13790,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,su * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{dy:i,y:r}=t;wae([i,r],"eluGrad");const s=new Float32Array(u3.util.sizeFromShape(r.shape)),o=n.data.get(r.dataId).values,a=n.data.get(i.dataId).values;for(let e=0;e=0?a[e]:a[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",s)}},Mde=u3.backend_util.ERF_P,kde=u3.backend_util.ERF_A1,Rde=u3.backend_util.ERF_A2,Nde=u3.backend_util.ERF_A3,Dde=u3.backend_util.ERF_A4,Fde=u3.backend_util.ERF_A5,Lde=Qae(u3.Erf,e=>{const t=Math.sign(e),n=Math.abs(e),i=1/(1+Mde*n);return t*(1-((((Fde*i+Dde)*i+Nde)*i+Rde)*i+kde)*i*Math.exp(-n*n))}),Pde={kernelName:u3.Erf,backendName:"cpu",kernelFunc:Lde}; +function(e){const{inputs:t,backend:n}=e,{dy:i,y:r}=t;Cae([i,r],"eluGrad");const s=new Float32Array(p3.util.sizeFromShape(r.shape)),o=n.data.get(r.dataId).values,a=n.data.get(i.dataId).values;for(let e=0;e=0?a[e]:a[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",s)}},Dde=p3.backend_util.ERF_P,Fde=p3.backend_util.ERF_A1,Lde=p3.backend_util.ERF_A2,Pde=p3.backend_util.ERF_A3,Bde=p3.backend_util.ERF_A4,$de=p3.backend_util.ERF_A5,Ude=nle(p3.Erf,e=>{const t=Math.sign(e),n=Math.abs(e),i=1/(1+Dde*n);return t*(1-(((($de*i+Bde)*i+Pde)*i+Lde)*i+Fde)*i*Math.exp(-n*n))}),Vde={kernelName:p3.Erf,backendName:"cpu",kernelFunc:Ude}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13807,7 +13807,7 @@ function(e){const{inputs:t,backend:n}=e,{dy:i,y:r}=t;wae([i,r],"eluGrad");const * limitations under the License. * ============================================================================= */ -function Bde(e){const{inputs:t,backend:n,attrs:i}=e,{input:r}=t,{dim:s}=i,o=r.shape.length,a=r.shape.slice();let l=s;return s<0&&(u3.util.assert(-(o+1)<=s,()=>`Axis must be in the interval [${-(o+1)}, ${o}]`),l=o+s+1),a.splice(l,0,1),hce({inputs:{x:r},backend:n,attrs:{shape:a}})}const $de={kernelName:u3.ExpandDims,backendName:"cpu",kernelFunc:Bde},Ude=Oae((e,t)=>e/t),Vde=Uae(u3.RealDiv,Ude),zde={kernelName:u3.RealDiv,backendName:"cpu",kernelFunc:Vde}; +function zde(e){const{inputs:t,backend:n,attrs:i}=e,{input:r}=t,{dim:s}=i,o=r.shape.length,a=r.shape.slice();let l=s;return s<0&&(p3.util.assert(-(o+1)<=s,()=>`Axis must be in the interval [${-(o+1)}, ${o}]`),l=o+s+1),a.splice(l,0,1),gce({inputs:{x:r},backend:n,attrs:{shape:a}})}const jde={kernelName:p3.ExpandDims,backendName:"cpu",kernelFunc:zde},Yde=Nae((e,t)=>e/t),Gde=Yae(p3.RealDiv,Yde),Hde={kernelName:p3.RealDiv,backendName:"cpu",kernelFunc:Gde}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13824,7 +13824,7 @@ function Bde(e){const{inputs:t,backend:n,attrs:i}=e,{input:r}=t,{dim:s}=i,o=r.sh * limitations under the License. * ============================================================================= */ -function jde(e,t,n){const i=e.shape,r=i[0],s=i[1],o=n.data.get(e.dataId),a=o.complexTensorInfos.real,l=o.complexTensorInfos.imag,u=[r,s],c=u3.util.sizeFromShape(u),d=u3.util.getTypedArrayFromDType("float32",c),h=u3.util.getTypedArrayFromDType("float32",c);for(let e=0;e{const{image:i}=e,r=n,s=u3.util.getTypedArrayFromDType(i.dtype,u3.util.sizeFromShape(i.shape)),[o,a,l,u]=i.shape,c=r.data.get(i.dataId).values;for(let e=0;e=0&&o{const{image:i}=e,r=n,s=p3.util.getTypedArrayFromDType(i.dtype,p3.util.sizeFromShape(i.shape)),[o,a,l,u]=i.shape,c=r.data.get(i.dataId).values;for(let e=0;e=0&&o=0,()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`)}let d=a;null==a&&(d=0);const h=u3.util.sizeFromShape(s.shape),p=u3.backend_util.segment_util.collectGatherOpShapeInfo(r,s,l,d),f=hce({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=hce({inputs:{x:s},backend:n,attrs:{shape:[p.batchSize,h/p.batchSize]}}),g=[p.batchSize,p.outerSize,h/p.batchSize,p.sliceSize],_=n.bufferSync(m),y=ble(n.bufferSync(f),_,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,y.dtype,y.values)}};const ehe={kernelName:u3.IFFT,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,batchDims:a}=i;Cae([r,s],"gatherV2");const l=p3.util.parseAxisParam(o,r.shape)[0],u=n.data.get(s.dataId).values,c=r.shape[l];for(let e=0;e=0,()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`)}let d=a;null==a&&(d=0);const h=p3.util.sizeFromShape(s.shape),p=p3.backend_util.segment_util.collectGatherOpShapeInfo(r,s,l,d),f=gce({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=gce({inputs:{x:s},backend:n,attrs:{shape:[p.batchSize,h/p.batchSize]}}),g=[p.batchSize,p.outerSize,h/p.batchSize,p.sliceSize],_=n.bufferSync(m),y=wle(n.bufferSync(f),_,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,y.dtype,y.values)}};const rhe={kernelName:p3.IFFT,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13960,7 +13960,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,batchD * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{input:i}=t,r=u3.util.sizeFromShape(i.shape),s=i.shape[i.shape.length-1],o=hce({inputs:{x:i},backend:n,attrs:{shape:[r/s,s]}}),a=jde(o,!0,n),l=hce({inputs:{x:a},backend:n,attrs:{shape:i.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(a),l}},the=Qae(u3.IsFinite,e=>Number.isFinite(e)?1:0,"bool"),nhe={kernelName:u3.IsFinite,backendName:"cpu",kernelFunc:the},ihe=Qae(u3.IsInf,e=>Math.abs(e)===1/0?1:0,"bool"),rhe={kernelName:u3.IsInf,backendName:"cpu",kernelFunc:ihe},she=Qae(u3.IsNan,e=>Number.isNaN(e)?1:0,"bool"),ohe={kernelName:u3.IsNan,backendName:"cpu",kernelFunc:she};const ahe={kernelName:u3.LinSpace,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{input:i}=t,r=p3.util.sizeFromShape(i.shape),s=i.shape[i.shape.length-1],o=gce({inputs:{x:i},backend:n,attrs:{shape:[r/s,s]}}),a=Wde(o,!0,n),l=gce({inputs:{x:a},backend:n,attrs:{shape:i.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(a),l}},she=nle(p3.IsFinite,e=>Number.isFinite(e)?1:0,"bool"),ohe={kernelName:p3.IsFinite,backendName:"cpu",kernelFunc:she},ahe=nle(p3.IsInf,e=>Math.abs(e)===1/0?1:0,"bool"),lhe={kernelName:p3.IsInf,backendName:"cpu",kernelFunc:ahe},uhe=nle(p3.IsNan,e=>Number.isNaN(e)?1:0,"bool"),che={kernelName:p3.IsNan,backendName:"cpu",kernelFunc:uhe};const dhe={kernelName:p3.LinSpace,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13977,7 +13977,7 @@ function(e){const{inputs:t,backend:n}=e,{input:i}=t,r=u3.util.sizeFromShape(i.sh * limitations under the License. * ============================================================================= */ -function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=Nle(i,r,s);return t.makeTensorInfo([o.length],"float32",o)}},lhe=Qae(u3.Log1p,e=>Math.log1p(e)),uhe={kernelName:u3.Log1p,backendName:"cpu",kernelFunc:lhe},che=Oae((e,t)=>e&&t),dhe=Uae(u3.LogicalAnd,che,null,"bool"),hhe={kernelName:u3.LogicalAnd,backendName:"cpu",kernelFunc:dhe},phe=Qae(u3.LogicalNot,e=>e?0:1,"bool"),fhe={kernelName:u3.LogicalNot,backendName:"cpu",kernelFunc:phe},mhe=Oae((e,t)=>e||t),ghe=Uae(u3.LogicalOr,mhe,null,"bool"),_he={kernelName:u3.LogicalOr,backendName:"cpu",kernelFunc:ghe};const yhe={kernelName:u3.LRN,backendName:"cpu",kernelFunc: +function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=Ple(i,r,s);return t.makeTensorInfo([o.length],"float32",o)}},hhe=nle(p3.Log1p,e=>Math.log1p(e)),phe={kernelName:p3.Log1p,backendName:"cpu",kernelFunc:hhe},fhe=Nae((e,t)=>e&&t),mhe=Yae(p3.LogicalAnd,fhe,null,"bool"),ghe={kernelName:p3.LogicalAnd,backendName:"cpu",kernelFunc:mhe},_he=nle(p3.LogicalNot,e=>e?0:1,"bool"),yhe={kernelName:p3.LogicalNot,backendName:"cpu",kernelFunc:_he},vhe=Nae((e,t)=>e||t),bhe=Yae(p3.LogicalOr,vhe,null,"bool"),The={kernelName:p3.LogicalOr,backendName:"cpu",kernelFunc:bhe};const xhe={kernelName:p3.LRN,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -13994,7 +13994,7 @@ function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=Nle(i,r,s);ret * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{depthRadius:s,bias:o,alpha:a,beta:l}=i;wae(r,"LRN");const u=r.shape[3],c=u-1,d=n.data.get(r.dataId).values,h=u3.util.sizeFromShape(r.shape),p=new Float32Array(h);function f(e){const t=e%u;let n=e-t+Math.max(0,t-s);const i=e-t+Math.min(t+s,c);let r=0;for(;n<=i;n++){const e=d[n];r+=e*e}return r}for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=u3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&u3.util.arraysEqual(u.inShape,u.outShape))c=Nae({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=u3.util.computeStrides(r.shape),i=Pce(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,i.values)}return c}};const Ehe={kernelName:u3.MaxPool3D,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;Cae(r,"maxPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=p3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&p3.util.arraysEqual(u.inShape,u.outShape))c=Pae({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=p3.util.computeStrides(r.shape),i=Vce(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,i.values)}return c}};const She={kernelName:p3.MaxPool3D,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14062,7 +14062,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;wae(r,"maxPool");const{f * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i;wae(r,"maxPool3d");const c=u3.backend_util.computePool3DInfo(r.shape,s,o,1,a,l,u),d=$ce(n.data.get(r.dataId).values,r.shape,r.dtype,u3.util.computeStrides(r.shape),c,"max");return n.makeTensorInfo(d.shape,"float32",d.values)}};const whe={kernelName:u3.MaxPool3DGrad,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i;Cae(r,"maxPool3d");const c=p3.backend_util.computePool3DInfo(r.shape,s,o,1,a,l,u),d=jce(n.data.get(r.dataId).values,r.shape,r.dtype,p3.util.computeStrides(r.shape),c,"max");return n.makeTensorInfo(d.shape,"float32",d.values)}};const Che={kernelName:p3.MaxPool3DGrad,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14079,7 +14079,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o, * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=i;wae([r,s],"maxPool3DGrad");const c=u3.backend_util.computePool3DInfo(s.shape,o,a,1,l,u),d=function(e,t){const n=(0,u3.buffer)(t.outShape,"int32"),i=t.strideDepth,r=t.strideHeight,s=t.strideWidth,o=t.dilationDepth,a=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,d=t.effectiveFilterWidth,h=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=w&&(w=a,I=n*c*d+r*c+o)}}}n.set(I,m,_,i,r,g)}}}return n}(n.bufferSync(s),c),h=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,_=c.dilationWidth,y=c.effectiveFilterDepth,v=c.effectiveFilterHeight,b=c.effectiveFilterWidth,T=y-1-c.padInfo.front,x=b-1-c.padInfo.left,E=v-1-c.padInfo.top,w=(0,u3.buffer)(s.shape,"float32"),I=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(i)!==i))for(let r=0;r=c.outHeight||Math.floor(s)!==s))for(let o=0;o=c.outWidth||Math.floor(u)!==u)continue;const h=y*v*b-1-d.get(e,i,s,u,t)===n*v*b+r*b+o?1:0;if(0===h)continue;l+=I.get(e,i,s,u,t)*h}}}w.set(l,e,n,i,r,t)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}};const Ihe={kernelName:u3.MaxPoolGrad,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=i;Cae([r,s],"maxPool3DGrad");const c=p3.backend_util.computePool3DInfo(s.shape,o,a,1,l,u),d=function(e,t){const n=(0,p3.buffer)(t.outShape,"int32"),i=t.strideDepth,r=t.strideHeight,s=t.strideWidth,o=t.dilationDepth,a=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,d=t.effectiveFilterWidth,h=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=w&&(w=a,I=n*c*d+r*c+o)}}}n.set(I,m,_,i,r,g)}}}return n}(n.bufferSync(s),c),h=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,_=c.dilationWidth,y=c.effectiveFilterDepth,v=c.effectiveFilterHeight,b=c.effectiveFilterWidth,T=y-1-c.padInfo.front,x=b-1-c.padInfo.left,E=v-1-c.padInfo.top,w=(0,p3.buffer)(s.shape,"float32"),I=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(i)!==i))for(let r=0;r=c.outHeight||Math.floor(s)!==s))for(let o=0;o=c.outWidth||Math.floor(u)!==u)continue;const h=y*v*b-1-d.get(e,i,s,u,t)===n*v*b+r*b+o?1:0;if(0===h)continue;l+=I.get(e,i,s,u,t)*h}}}w.set(l,e,n,i,r,t)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}};const Ohe={kernelName:p3.MaxPoolGrad,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14096,7 +14096,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;wae([s,o],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:d}=i,h=u3.backend_util.computePool2DInfo(a.shape,l,u,1,c,d),p=n.data.get(a.dataId).values,f=(0,u3.buffer)(h.outShape,a.dtype,Bce(p,a.shape,a.dtype,h).values),m=h.strideHeight,g=h.strideWidth,_=h.dilationHeight,y=h.dilationWidth,v=h.effectiveFilterHeight,b=h.effectiveFilterWidth,T=b-1-h.padInfo.left,x=v-1-h.padInfo.top,E=(0,u3.buffer)(a.shape,"float32"),w=n.data.get(r.dataId).values,I=(0,u3.buffer)(r.shape,"float32",w);for(let e=0;e=h.outHeight||Math.floor(i)!==i))for(let r=0;r=h.outWidth||Math.floor(a)!==a)continue;const l=v*b-1-f.get(e,i,a,t)===n*b+r?1:0;if(0===l)continue;o+=I.get(e,i,a,t)*l}}E.set(o,e,n,i,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;Cae([s,o],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:d}=i,h=p3.backend_util.computePool2DInfo(a.shape,l,u,1,c,d),p=n.data.get(a.dataId).values,f=(0,p3.buffer)(h.outShape,a.dtype,zce(p,a.shape,a.dtype,h).values),m=h.strideHeight,g=h.strideWidth,_=h.dilationHeight,y=h.dilationWidth,v=h.effectiveFilterHeight,b=h.effectiveFilterWidth,T=b-1-h.padInfo.left,x=v-1-h.padInfo.top,E=(0,p3.buffer)(a.shape,"float32"),w=n.data.get(r.dataId).values,I=(0,p3.buffer)(r.shape,"float32",w);for(let e=0;e=h.outHeight||Math.floor(i)!==i))for(let r=0;r=h.outWidth||Math.floor(a)!==a)continue;const l=v*b-1-f.get(e,i,a,t)===n*b+r?1:0;if(0===l)continue;o+=I.get(e,i,a,t)*l}}E.set(o,e,n,i,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14113,7 +14113,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;wa * limitations under the License. * ============================================================================= */ -const Ahe={kernelName:u3.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{filterSize:r,strides:s,pad:o,includeBatchInIndex:a}=t,l=n;wae(i,"MaxPoolWithArgmax");const u=l.data.get(i.dataId).values,c=u3.backend_util.computePool2DInfo(i.shape,r,s,[1,1],o),[d,h]= +const Mhe={kernelName:p3.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{filterSize:r,strides:s,pad:o,includeBatchInIndex:a}=t,l=n;Cae(i,"MaxPoolWithArgmax");const u=l.data.get(i.dataId).values,c=p3.backend_util.computePool2DInfo(i.shape,r,s,[1,1],o),[d,h]= /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14130,7 +14130,7 @@ const Ahe={kernelName:u3.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:({inputs * limitations under the License. * ============================================================================= */ -function(e,t,n,i,r){const s=Pce(e,0,n,u3.util.computeStrides(t),r,"max"),o=Bce(e,t,n,r,!0,i);return[s.values,o.values]}(u,i.shape,i.dtype,a,c),p=l.write(d,c.outShape,i.dtype),f=l.write(h,c.outShape,i.dtype);return[{dataId:p,shape:c.outShape,dtype:i.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const She={kernelName:u3.Mean,backendName:"cpu",kernelFunc: +function(e,t,n,i,r){const s=Vce(e,0,n,p3.util.computeStrides(t),r,"max"),o=zce(e,t,n,r,!0,i);return[s.values,o.values]}(u,i.shape,i.dtype,a,c),p=l.write(d,c.outShape,i.dtype),f=l.write(h,c.outShape,i.dtype);return[{dataId:p,shape:c.outShape,dtype:i.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const khe={kernelName:p3.Mean,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14147,7 +14147,7 @@ function(e,t,n,i,r){const s=Pce(e,0,n,u3.util.computeStrides(t),r,"max"),o=Bce(e * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=u3.util.parseAxisParam(s,r.shape),l=u3.backend_util.computeOutAndReduceShapes(r.shape,a)[1],u=u3.util.sizeFromShape(l),c=[],d=n.makeTensorInfo([],"float32",new Float32Array([u]));c.push(d);const h=Bae({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});c.push(h);const p=Vde({inputs:{a:h,b:d},backend:n});c.push(p);const f=Ade({inputs:{x:p},backend:n,attrs:{axis:s,keepDims:o}});return c.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}};const Che={kernelName:u3.Min,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=p3.util.parseAxisParam(s,r.shape),l=p3.backend_util.computeOutAndReduceShapes(r.shape,a)[1],u=p3.util.sizeFromShape(l),c=[],d=n.makeTensorInfo([],"float32",new Float32Array([u]));c.push(d);const h=zae({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});c.push(h);const p=Gde({inputs:{a:h,b:d},backend:n});c.push(p);const f=Mde({inputs:{x:p},backend:n,attrs:{axis:s,keepDims:o}});return c.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}};const Rhe={kernelName:p3.Min,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14164,7 +14164,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a= * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;wae(r,"min");const a=u3.util.parseAxisParam(s,r.shape);let l=a;const u=u3.backend_util.getAxesPermutation(l,r.shape.length);let c=r;null!=u&&(c=eue({inputs:{x:r},backend:n,attrs:{perm:u}}),l=u3.backend_util.getInnerMostAxes(l.length,r.shape.length)),u3.backend_util.assertAxesAreInnerMostDims("min",l,c.shape.length);const[d,h]=u3.backend_util.computeOutAndReduceShapes(c.shape,l),p=u3.util.sizeFromShape(h),f=u3.util.makeZerosTypedArray(u3.util.sizeFromShape(d),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;ee[0]+r.shape[t]+e[1]),l=s.map(e=>e[0]),u=s.map((e,t)=>e[0]+r.shape[t]),c="reflect"===o?0:1,d=n.data.get(r.dataId).values,h=r.shape.length,p=u3.util.computeStrides(r.shape),f=u3.util.sizeFromShape(a),m=a.length,g=u3.util.computeStrides(a),_=u3.util.getTypedArrayFromDType(r.dtype,f);for(let e=0;e=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map((e,t)=>e-l[t]);const n=u3.util.locToIndex(t,h,p);_[e]=d[n]}return{dataId:n.write(_,a,r.dtype),shape:a,dtype:r.dtype}}},Mhe=Oae((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),khe=Uae(u3.Mod,Mhe),Rhe={kernelName:u3.Mod,backendName:"cpu",kernelFunc:khe}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,mode:o}=i;Cae(r,"mirrorPad");const a=s.map((e,t)=>e[0]+r.shape[t]+e[1]),l=s.map(e=>e[0]),u=s.map((e,t)=>e[0]+r.shape[t]),c="reflect"===o?0:1,d=n.data.get(r.dataId).values,h=r.shape.length,p=p3.util.computeStrides(r.shape),f=p3.util.sizeFromShape(a),m=a.length,g=p3.util.computeStrides(a),_=p3.util.getTypedArrayFromDType(r.dtype,f);for(let e=0;e=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map((e,t)=>e-l[t]);const n=p3.util.locToIndex(t,h,p);_[e]=d[n]}return{dataId:n.write(_,a,r.dtype),shape:a,dtype:r.dtype}}},Dhe=Nae((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),Fhe=Yae(p3.Mod,Dhe),Lhe={kernelName:p3.Mod,backendName:"cpu",kernelFunc:Fhe}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14198,7 +14198,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,mode:o}=i;wa * limitations under the License. * ============================================================================= */ -function Nhe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=r.shape.length;let a=s;if(-1===a&&(a=o-1),a!==o-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${o} and dim was ${a}`);const l=u3.util.parseAxisParam([a],r.shape),u=bhe({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=u3.backend_util.expandShapeToKeepDim(u.shape,l),d=hce({inputs:{x:u},backend:n,attrs:{shape:c}}),h=Hue({inputs:{a:r,b:d},backend:n}),p=lle({inputs:{x:h},backend:n}),f=Ade({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=hce({inputs:{x:f},backend:n,attrs:{shape:c}}),g=Vde({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const Dhe={kernelName:u3.Softmax,backendName:"cpu",kernelFunc:Nhe};const Fhe={kernelName:u3.Multinomial,backendName:"cpu",kernelFunc: +function Phe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=r.shape.length;let a=s;if(-1===a&&(a=o-1),a!==o-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${o} and dim was ${a}`);const l=p3.util.parseAxisParam([a],r.shape),u=whe({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=p3.backend_util.expandShapeToKeepDim(u.shape,l),d=gce({inputs:{x:u},backend:n,attrs:{shape:c}}),h=Kue({inputs:{a:r,b:d},backend:n}),p=hle({inputs:{x:h},backend:n}),f=Mde({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=gce({inputs:{x:f},backend:n,attrs:{shape:c}}),g=Gde({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const Bhe={kernelName:p3.Softmax,backendName:"cpu",kernelFunc:Phe};const $he={kernelName:p3.Multinomial,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14215,7 +14215,7 @@ function Nhe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=r.s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{numSamples:s,seed:o,normalized:a}=i;wae(r,"multinomial");const l=a?r:Nhe({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],c=l.shape[1],d=n.data.get(l.dataId).values,h=[u,s],p=u3.util.makeZerosTypedArray(u3.util.sizeFromShape(h),"int32");for(let e=0;e=0&&d[e]=0&&d[e]{u3.util.assertShapesMatch(s,e.shape,"All tensors passed to stack must have matching shapes"),u3.util.assert(o===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const a=[],l=Jce({inputs:t.map(e=>{const t=Bde({inputs:{input:e},backend:n,attrs:{dim:r}});return a.push(t),t}),backend:n,attrs:{axis:r}});return a.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}const Whe={kernelName:u3.Pack,backendName:"cpu",kernelFunc:Hhe};const Xhe={kernelName:u3.PadV2,backendName:"cpu",kernelFunc: +function Khe(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)return zde({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const s=t[0].shape,o=t[0].dtype;t.forEach(e=>{p3.util.assertShapesMatch(s,e.shape,"All tensors passed to stack must have matching shapes"),p3.util.assert(o===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const a=[],l=ide({inputs:t.map(e=>{const t=zde({inputs:{input:e},backend:n,attrs:{dim:r}});return a.push(t),t}),backend:n,attrs:{axis:r}});return a.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}const Zhe={kernelName:p3.Pack,backendName:"cpu",kernelFunc:Khe};const Qhe={kernelName:p3.PadV2,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14300,7 +14300,7 @@ function Hhe(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)r * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValue:o}=i;wae(r,"pad");const a=s.map((e,t)=>e[0]+r.shape[t]+e[1]),l=s.map(e=>e[0]),u=n.data.get(r.dataId).values,c=u3.util.sizeFromShape(r.shape),d=r.shape.length,h=u3.util.computeStrides(r.shape),p=u3.util.sizeFromShape(a),f=a.length,m=u3.util.computeStrides(a),g=u3.util.getTypedArrayFromDType(r.dtype,p);0!==o&&g.fill(o);for(let e=0;ee+l[t]);g[u3.util.locToIndex(t,f,m)]=u[e]}return{dataId:n.write(g,a,r.dtype),shape:a,dtype:r.dtype}}},qhe=Oae((e,t)=>Math.pow(e,t)),Khe=Uae(u3.Pow,qhe),Zhe={kernelName:u3.Pow,backendName:"cpu",kernelFunc:Khe};const Qhe={kernelName:u3.RaggedGather,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValue:o}=i;Cae(r,"pad");const a=s.map((e,t)=>e[0]+r.shape[t]+e[1]),l=s.map(e=>e[0]),u=n.data.get(r.dataId).values,c=p3.util.sizeFromShape(r.shape),d=r.shape.length,h=p3.util.computeStrides(r.shape),p=p3.util.sizeFromShape(a),f=a.length,m=p3.util.computeStrides(a),g=p3.util.getTypedArrayFromDType(r.dtype,p);0!==o&&g.fill(o);for(let e=0;ee+l[t]);g[p3.util.locToIndex(t,f,m)]=u[e]}return{dataId:n.write(g,a,r.dtype),shape:a,dtype:r.dtype}}},Jhe=Nae((e,t)=>Math.pow(e,t)),epe=Yae(p3.Pow,Jhe),tpe={kernelName:p3.Pow,backendName:"cpu",kernelFunc:epe};const npe={kernelName:p3.RaggedGather,backendName:"cpu",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -14317,7 +14317,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValu * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:o}=t,{outputRaggedRank:a}=i,l=r.map(e=>n.data.get(e.dataId).values),u=r.map(e=>e.shape),c=n.data.get(s.dataId).values,d=n.data.get(o.dataId).values,[h,p,f]=aue(l,u,c,s.shape,s.dtype,d,o.shape),m=h.map(e=>n.makeTensorInfo([e.length],"int32",e)),g=n.makeTensorInfo(f,s.dtype,p);return m.concat([g])}};const Jhe={kernelName:u3.RaggedRange,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:o}=t,{outputRaggedRank:a}=i,l=r.map(e=>n.data.get(e.dataId).values),u=r.map(e=>e.shape),c=n.data.get(s.dataId).values,d=n.data.get(o.dataId).values,[h,p,f]=due(l,u,c,s.shape,s.dtype,d,o.shape),m=h.map(e=>n.makeTensorInfo([e.length],"int32",e)),g=n.makeTensorInfo(f,s.dtype,p);return m.concat([g])}};const ipe={kernelName:p3.RaggedRange,backendName:"cpu",kernelFunc: /** * @license * Copyright 2022 Google LLC. @@ -14334,7 +14334,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDens * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=uue(o,i.shape,i.dtype,a,r.shape,l,s.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],i.dtype,c)]}};const epe={kernelName:u3.RaggedTensorToTensor,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=pue(o,i.shape,i.dtype,a,r.shape,l,s.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],i.dtype,c)]}};const rpe={kernelName:p3.RaggedTensorToTensor,backendName:"cpu",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -14351,7 +14351,7 @@ function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.data. * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o,rowPartitionTensors:a}=t,{rowPartitionTypes:l}=i,u=n.data.get(r.dataId).values,c=n.data.get(s.dataId).values,d=n.data.get(o.dataId).values,h=a.map(e=>n.data.get(e.dataId).values),p=a.map(e=>e.shape),[f,m]=fue(u,r.shape,c,s.shape,s.dtype,d,o.shape,h,p,l);return n.makeTensorInfo(f,s.dtype,m)}};const tpe={kernelName:u3.Range,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o,rowPartitionTensors:a}=t,{rowPartitionTypes:l}=i,u=n.data.get(r.dataId).values,c=n.data.get(s.dataId).values,d=n.data.get(o.dataId).values,h=a.map(e=>n.data.get(e.dataId).values),p=a.map(e=>e.shape),[f,m]=yue(u,r.shape,c,s.shape,s.dtype,d,o.shape,h,p,l);return n.makeTensorInfo(f,s.dtype,m)}};const spe={kernelName:p3.Range,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14368,7 +14368,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o * limitations under the License. * ============================================================================= */ -function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,dtype:s,step:o}=n,a=mue(i,r,o,s);return t.makeTensorInfo([a.length],s,a)}},npe=Qae(u3.Reciprocal,e=>1/e),ipe={kernelName:u3.Reciprocal,backendName:"cpu",kernelFunc:npe};const rpe={kernelName:u3.ResizeBilinear,backendName:"cpu",kernelFunc: +function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,dtype:s,step:o}=n,a=vue(i,r,o,s);return t.makeTensorInfo([a.length],s,a)}},ope=nle(p3.Reciprocal,e=>1/e),ape={kernelName:p3.Reciprocal,backendName:"cpu",kernelFunc:ope};const lpe={kernelName:p3.ResizeBilinear,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14385,7 +14385,7 @@ function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,dtype:s,step:o}=n,a=mue(i * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i;wae(r,"resizeBilinear");const l=u3.util.computeStrides(r.shape),[u,c]=a,[d,h,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(u3.util.sizeFromShape([d,u,c,f])),_=[s&&u>1?h-1:h,s&&c>1?p-1:p],y=[s&&u>1?u-1:u,s&&c>1?c-1:c];let v=0;const b=_[0]/y[0],T=_[1]/y[1];for(let e=0;e1?h-1:h,s&&c>1?p-1:p],y=[s&&u>1?u-1:u,s&&c>1?c-1:c];let v=0;const b=_[0]/y[0],T=_[1]/y[1];for(let e=0;e1?u-1:u,o&&p>1?c-1:c],g=[o&&h>1?h-1:h,o&&p>1?p-1:p],_=m[0]/g[0],y=m[1]/g[1],v=n.data.get(s.dataId).values;let b=0;for(let e=0;e1?u-1:u,o&&p>1?c-1:c],g=[o&&h>1?h-1:h,o&&p>1?p-1:p],_=m[0]/g[0],y=m[1]/g[1],v=n.data.get(s.dataId).values;let b=0;for(let e=0;e1?h-1:h,s&&c>1?p-1:p],y=[s&&u>1?u-1:u,s&&c>1?c-1:c],v=_[0]/y[0],b=_[1]/y[1];let T=0;for(let e=0;e1?h-1:h,s&&c>1?p-1:p],y=[s&&u>1?u-1:u,s&&c>1?c-1:c],v=_[0]/y[0],b=_[1]/y[1];let T=0;for(let e=0;e1?c-1:c,o&&f>1?d-1:d],y=[o&&p>1?p-1:p,o&&f>1?f-1:f],v=_[0]/y[0],b=_[1]/y[1],T=1/v,x=1/b,E=2*Math.ceil(T)+2,w=2*Math.ceil(x)+2;for(let e=0;e=p)continue;const h=t+u*l[1],m=u*v;if(e===Math.min(c-1,o?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=h+t*l[2],s=t*b;i===Math.min(d-1,o?Math.round(s):Math.floor(s))&&(a+=g[r+n])}}m[s+n]=a}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const lpe={kernelName:u3.Reverse,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i;Cae([s,r],"resizeNearestNeighborGrad");const a=p3.util.computeStrides(r.shape),l=p3.util.computeStrides(s.shape),[u,c,d,h]=r.shape,[,p,f]=s.shape,m=new Float32Array(u*c*d*h),g=n.data.get(s.dataId).values,_=[o&&p>1?c-1:c,o&&f>1?d-1:d],y=[o&&p>1?p-1:p,o&&f>1?f-1:f],v=_[0]/y[0],b=_[1]/y[1],T=1/v,x=1/b,E=2*Math.ceil(T)+2,w=2*Math.ceil(x)+2;for(let e=0;e=p)continue;const h=t+u*l[1],m=u*v;if(e===Math.min(c-1,o?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=h+t*l[2],s=t*b;i===Math.min(d-1,o?Math.round(s):Math.floor(s))&&(a+=g[r+n])}}m[s+n]=a}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const hpe={kernelName:p3.Reverse,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14453,7 +14453,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners: * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i;wae(r,"reverse");const o=r.shape.length,a=u3.util.parseAxisParam(s,r.shape);if(0===o)return Nae({inputs:{x:r},backend:n});const l=new u3.TensorBuffer(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e]),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},upe={kernelName:u3.RotateWithOffset,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,{radians:r,fillValue:s,center:o}=t,a=n,l=u3.util.getTypedArrayFromDType(i.dtype,u3.util.sizeFromShape(i.shape)),[u,c,d,h]=i.shape,[p,f]=u3.backend_util.getImageCenter(o,c,d),m=Math.sin(r),g=Math.cos(r),_=a.data.get(i.dataId).values;for(let e=0;e=0&&b=0&&T{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),dpe={kernelName:u3.Round,backendName:"cpu",kernelFunc:cpe};const hpe={kernelName:u3.ScatterNd,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i;Cae(r,"reverse");const o=r.shape.length,a=p3.util.parseAxisParam(s,r.shape);if(0===o)return Pae({inputs:{x:r},backend:n});const l=new p3.TensorBuffer(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e]),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},ppe={kernelName:p3.RotateWithOffset,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,{radians:r,fillValue:s,center:o}=t,a=n,l=p3.util.getTypedArrayFromDType(i.dtype,p3.util.sizeFromShape(i.shape)),[u,c,d,h]=i.shape,[p,f]=p3.backend_util.getImageCenter(o,c,d),m=Math.sin(r),g=Math.cos(r),_=a.data.get(i.dataId).values;for(let e=0;e=0&&b=0&&T{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),mpe={kernelName:p3.Round,backendName:"cpu",kernelFunc:fpe};const gpe={kernelName:p3.ScatterNd,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14470,7 +14470,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i;wae(r,"revers * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=u3.backend_util.calculateShapes(s,r,o),h=vue(n.bufferSync(r),n.bufferSync(s),o,d,u,l,a,c,0,!0);return n.makeTensorInfo(o,h.dtype,h.values)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=p3.backend_util.calculateShapes(s,r,o),h=Eue(n.bufferSync(r),n.bufferSync(s),o,d,u,l,a,c,0,!0);return n.makeTensorInfo(o,h.dtype,h.values)}}; /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -14487,7 +14487,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o * limitations under the License. * ============================================================================= */ -function ppe(e,t){let n=0,i=e.length,r=0;for(;n1||1===r.shape.length?1:u3.util.sizeFromShape(r.shape.slice(1));for(let e=0;ee>=0?ype*e:_pe*(Math.exp(e)-1)),bpe={kernelName:u3.Selu,backendName:"cpu",kernelFunc:vpe},Tpe=Qae(u3.Sign,e=>e<0?-1:e>0?1:0),xpe={kernelName:u3.Sign,backendName:"cpu",kernelFunc:Tpe},Epe=Qae(u3.Sin,e=>Math.sin(e)),wpe={kernelName:u3.Sin,backendName:"cpu",kernelFunc:Epe},Ipe=Qae(u3.Sinh,e=>Math.sinh(e)),Ape={kernelName:u3.Sinh,backendName:"cpu",kernelFunc:Ipe},Spe=Math.log(1.1920928955078125e-7)+2,Cpe=Qae(u3.Softplus,e=>{const t=e>-Spe,n=e1||1===r.shape.length?1:p3.util.sizeFromShape(r.shape.slice(1));for(let e=0;ee>=0?xpe*e:Tpe*(Math.exp(e)-1)),wpe={kernelName:p3.Selu,backendName:"cpu",kernelFunc:Epe},Ipe=nle(p3.Sign,e=>e<0?-1:e>0?1:0),Ape={kernelName:p3.Sign,backendName:"cpu",kernelFunc:Ipe},Spe=nle(p3.Sin,e=>Math.sin(e)),Cpe={kernelName:p3.Sin,backendName:"cpu",kernelFunc:Spe},Ope=nle(p3.Sinh,e=>Math.sinh(e)),Mpe={kernelName:p3.Sinh,backendName:"cpu",kernelFunc:Ope},kpe=Math.log(1.1920928955078125e-7)+2,Rpe=nle(p3.Softplus,e=>{const t=e>-kpe,n=eNumber(e)))),n.makeTensorInfo([m.length],i.dtype,new Int32Array(m))]}};const Rpe={kernelName:u3.SparseReshape,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,defaultValue:o}=t;if(1!==s.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(2!==i.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${o.shape}`);const a=n.data.get(i.dataId).values,l=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,c=n.data.get(o.dataId).values[0],[d,h,p,f,m]=Mue(a,i.shape,i.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(h,i.dtype,d),n.makeTensorInfo([h[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([m.length],i.dtype,new Int32Array(m))]}};const Lpe={kernelName:p3.SparseReshape,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14572,7 +14572,7 @@ function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,default * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s}=t;if(2!==i.shape.length)throw new Error(`Input indices should be a matrix but received shape\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.data.get(r.dataId).values),a=n.data.get(i.dataId).values,l=Array.from(n.data.get(s.dataId).values),[u,c,d]=Sue(a,i.shape,i.dtype,o,l);return[n.makeTensorInfo(c,i.dtype,u),n.makeTensorInfo([d.length],s.dtype,new Int32Array(d))]}};const Npe={kernelName:u3.SparseSegmentMean,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s}=t;if(2!==i.shape.length)throw new Error(`Input indices should be a matrix but received shape\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.data.get(r.dataId).values),a=n.data.get(i.dataId).values,l=Array.from(n.data.get(s.dataId).values),[u,c,d]=kue(a,i.shape,i.dtype,o,l);return[n.makeTensorInfo(c,i.dtype,u),n.makeTensorInfo([d.length],s.dtype,new Int32Array(d))]}};const Ppe={kernelName:p3.SparseSegmentMean,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14589,7 +14589,7 @@ function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s} * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");const o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=Cue(o,i.shape,i.dtype,a,l,!0);return n.makeTensorInfo(c,i.dtype,u)}};const Dpe={kernelName:u3.SparseSegmentSum,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");const o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=Rue(o,i.shape,i.dtype,a,l,!0);return n.makeTensorInfo(c,i.dtype,u)}};const Bpe={kernelName:p3.SparseSegmentSum,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14606,7 +14606,7 @@ function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");const o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=Cue(o,i.shape,i.dtype,a,l);return n.makeTensorInfo(c,i.dtype,u)}};const Fpe={kernelName:u3.SparseToDense,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");const o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=Rue(o,i.shape,i.dtype,a,l);return n.makeTensorInfo(c,i.dtype,u)}};const $pe={kernelName:p3.SparseToDense,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14623,7 +14623,7 @@ function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s,defaultValue:o}=t,{outputShape:a}=i,{sliceRank:l,numUpdates:u,sliceSize:c,strides:d,outputSize:h}=u3.backend_util.calculateShapes(s,r,a),p=!1,f=n.bufferSync(r);let m;switch(s.dtype){case"bool":m=vue(f,n.bufferSync(s),a,h,c,u,l,d,Boolean(n.data.get(o.dataId).values[0]),p);break;case"float32":m=vue(f,n.bufferSync(s),a,h,c,u,l,d,n.data.get(o.dataId).values[0],p);break;case"int32":m=vue(f,n.bufferSync(s),a,h,c,u,l,d,n.data.get(o.dataId).values[0],p);break;case"string":m=vue(f,n.bufferSync(s),a,h,c,u,l,d,u3.util.decodeString(n.data.get(o.dataId).values[0]),p);break;default:throw new Error(`Unsupported type ${s.dtype}`)}return n.makeTensorInfo(a,m.dtype,m.values)}};const Lpe={kernelName:u3.SplitV,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s,defaultValue:o}=t,{outputShape:a}=i,{sliceRank:l,numUpdates:u,sliceSize:c,strides:d,outputSize:h}=p3.backend_util.calculateShapes(s,r,a),p=!1,f=n.bufferSync(r);let m;switch(s.dtype){case"bool":m=Eue(f,n.bufferSync(s),a,h,c,u,l,d,Boolean(n.data.get(o.dataId).values[0]),p);break;case"float32":m=Eue(f,n.bufferSync(s),a,h,c,u,l,d,n.data.get(o.dataId).values[0],p);break;case"int32":m=Eue(f,n.bufferSync(s),a,h,c,u,l,d,n.data.get(o.dataId).values[0],p);break;case"string":m=Eue(f,n.bufferSync(s),a,h,c,u,l,d,p3.util.decodeString(n.data.get(o.dataId).values[0]),p);break;default:throw new Error(`Unsupported type ${s.dtype}`)}return n.makeTensorInfo(a,m.dtype,m.values)}};const Upe={kernelName:p3.SplitV,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14640,7 +14640,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s, * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis:o}=i,a=u3.util.parseAxisParam(o,r.shape)[0],l=u3.backend_util.prepareSplitSize(r,s,a),u=new Array(r.shape.length).fill(0),c=r.shape.slice();return l.map(e=>{const t=[...c];t[a]=e;const i=wue({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[a]+=e,i})}},Ppe={kernelName:u3.Square,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,i=t;wae(n,"square");const r=i.data.get(n.dataId).values,s=new Float32Array(r.length);for(let e=0;e{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),$pe={kernelName:u3.Step,backendName:"cpu",kernelFunc:Bpe};const Upe={kernelName:u3.StridedSlice,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis:o}=i,a=p3.util.parseAxisParam(o,r.shape)[0],l=p3.backend_util.prepareSplitSize(r,s,a),u=new Array(r.shape.length).fill(0),c=r.shape.slice();return l.map(e=>{const t=[...c];t[a]=e;const i=Cue({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[a]+=e,i})}},Vpe={kernelName:p3.Square,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,i=t;Cae(n,"square");const r=i.data.get(n.dataId).values,s=new Float32Array(r.length);for(let e=0;e{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),jpe={kernelName:p3.Step,backendName:"cpu",kernelFunc:zpe};const Ype={kernelName:p3.StridedSlice,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14657,7 +14657,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis: * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:d,shrinkAxisMask:h}=i;wae(r,"stridedSlice");const{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:y,end:v,strides:b}=u3.slice_util.sliceInfo(r.shape,s,o,a,l,u,c,d,h);let T;if(m)T=hce({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||_){u3.util.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);const e=u3.slice_util.computeOutShape(y,v,b),t=wue({inputs:{x:r},backend:n,attrs:{begin:y,size:e}});T=hce({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=Bue(p,n.bufferSync(r),b,y);T=n.makeTensorInfo(f,e.dtype,e.values)}return T}};const Vpe={kernelName:u3.StringNGrams,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:d,shrinkAxisMask:h}=i;Cae(r,"stridedSlice");const{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:y,end:v,strides:b}=p3.slice_util.sliceInfo(r.shape,s,o,a,l,u,c,d,h);let T;if(m)T=gce({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||_){p3.util.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);const e=p3.slice_util.computeOutShape(y,v,b),t=Cue({inputs:{x:r},backend:n,attrs:{begin:y,size:e}});T=gce({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=zue(p,n.bufferSync(r),b,y);T=n.makeTensorInfo(f,e.dtype,e.values)}return T}};const Gpe={kernelName:p3.StringNGrams,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14674,7 +14674,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftPad:o,rightPad:a,padWidth:l,preserveShortSequences:u}=i,{data:c,dataSplits:d}=t,h=n.data.get(c.dataId).values,p=n.data.get(d.dataId).values,[f,m]=Uue(h,p,r,s,o,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(d.shape,"int32",m)]}};const zpe={kernelName:u3.StringSplit,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftPad:o,rightPad:a,padWidth:l,preserveShortSequences:u}=i,{data:c,dataSplits:d}=t,h=n.data.get(c.dataId).values,p=n.data.get(d.dataId).values,[f,m]=Yue(h,p,r,s,o,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(d.shape,"int32",m)]}};const Hpe={kernelName:p3.StringSplit,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14691,7 +14691,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftP * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const a=n.data.get(s.dataId).values,l=n.data.get(o.dataId).values[0],[u,c,d]=zue(a,l,r),h=c.length;return[n.makeTensorInfo([h,2],"int32",u),n.makeTensorInfo([h],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};const jpe={kernelName:u3.StringToHashBucketFast,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const a=n.data.get(s.dataId).values,l=n.data.get(o.dataId).values[0],[u,c,d]=Hue(a,l,r),h=c.length;return[n.makeTensorInfo([h,2],"int32",u),n.makeTensorInfo([h],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};const Wpe={kernelName:p3.StringToHashBucketFast,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14708,7 +14708,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimit * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const o=jue(n.data.get(s.dataId).values,r);return n.makeTensorInfo(s.shape,"int32",o)}},Ype=Qae(u3.Tan,e=>Math.tan(e)),Gpe={kernelName:u3.Tan,backendName:"cpu",kernelFunc:Ype},Hpe=Qae(u3.Tanh,e=>Math.tanh(e)),Wpe={kernelName:u3.Tanh,backendName:"cpu",kernelFunc:Hpe};const Xpe={kernelName:u3.TensorScatterUpdate,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const o=Wue(n.data.get(s.dataId).values,r);return n.makeTensorInfo(s.shape,"int32",o)}},Xpe=nle(p3.Tan,e=>Math.tan(e)),qpe={kernelName:p3.Tan,backendName:"cpu",kernelFunc:Xpe},Kpe=nle(p3.Tanh,e=>Math.tanh(e)),Zpe={kernelName:p3.Tanh,backendName:"cpu",kernelFunc:Kpe};const Qpe={kernelName:p3.TensorScatterUpdate,backendName:"cpu",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -14725,7 +14725,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if( * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{tensor:i,indices:r,updates:s}=t,{sliceRank:o,numUpdates:a,sliceSize:l,strides:u,outputSize:c}=u3.backend_util.calculateShapes(s,r,i.shape),d=n.bufferSync(r),h=n.bufferSync(s),p=n.bufferSync(i),f=vue(d,h,i.shape,c,l,a,o,u,p,!1);return n.makeTensorInfo(i.shape,f.dtype,f.values)}};const qpe={kernelName:u3.Tile,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{tensor:i,indices:r,updates:s}=t,{sliceRank:o,numUpdates:a,sliceSize:l,strides:u,outputSize:c}=p3.backend_util.calculateShapes(s,r,i.shape),d=n.bufferSync(r),h=n.bufferSync(s),p=n.bufferSync(i),f=Eue(d,h,i.shape,c,l,a,o,u,p,!1);return n.makeTensorInfo(i.shape,f.dtype,f.values)}};const Jpe={kernelName:p3.Tile,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14742,7 +14742,7 @@ function(e){const{inputs:t,backend:n}=e,{tensor:i,indices:r,updates:s}=t,{sliceR * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;wae(r,"tile");const o=Xue(n.bufferSync(r),s);return n.makeTensorInfo(o.shape,o.dtype,o.values)}};const Kpe={kernelName:u3.TopK,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;Cae(r,"tile");const o=Que(n.bufferSync(r),s);return n.makeTensorInfo(o.shape,o.dtype,o.values)}};const efe={kernelName:p3.TopK,backendName:"cpu",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -14759,7 +14759,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;wae(r,"tile") * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{k:s,sorted:o}=i;wae(r,"topk");const a=n.data.get(r.dataId).values,[l,u]=Zue(a,r.shape,r.dtype,s,o);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(u.shape,u.dtype,u.values)]}};const Zpe={kernelName:u3.Transform,backendName:"cpu",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{k:s,sorted:o}=i;Cae(r,"topk");const a=n.data.get(r.dataId).values,[l,u]=tce(a,r.shape,r.dtype,s,o);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(u.shape,u.dtype,u.values)]}};const tfe={kernelName:p3.Transform,backendName:"cpu",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -14776,7 +14776,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{k:s,sorted:o}=i;wae(r," * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,attrs:n,backend:i}=e,{image:r,transforms:s}=t,{interpolation:o,fillMode:a,fillValue:l,outputShape:u}=n,[c,d,h,p]=r.shape,[f,m]=null!=u?u:[d,h],g=[c,f,m,p],_=u3.util.computeStrides(r.shape),y=_[0],v=_[1],b=_[2],T=u3.util.computeStrides(g),x=T[0],E=T[1],w=T[2],I=u3.util.getTypedArrayFromDType(r.dtype,u3.util.sizeFromShape(g));I.fill(l);const A=i.data.get(r.dataId).values,S=i.data.get(s.dataId).values;for(let e=0;et-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return u3.util.clamp(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return u3.util.clamp(0,n,t-1)}(e,t);case"nearest":return function(e,t){return u3.util.clamp(0,e,t-1)}(e,t);default:return function(e){return e}(e)}}function Jpe(e,t,n,i,r,s,o,a,l,u,c){return 0<=a&&at-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return p3.util.clamp(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return p3.util.clamp(0,n,t-1)}(e,t);case"nearest":return function(e,t){return p3.util.clamp(0,e,t-1)}(e,t);default:return function(e){return e}(e)}}function ife(e,t,n,i,r,s,o,a,l,u,c){return 0<=a&&an.disposeIntermediateTensorInfo(e)),d}},sfe=[gce,Cae,yce,bce,Gae,Tce,xce,Ece,wce,Ice,Sce,Oce,kce,Dce,Lce,Uce,Vce,zce,jce,mce,Yce,Gce,Hce,Kae,Wce,$ae,nle,qce,kae,Kce,ede,nde,ide,rde,sde,ode,ade,ude,dde,hde,pde,fde,mde,gde,yde,vde,bde,Tde,xde,Ede,wde,Ide,Cde,tce,Ode,ole,Pde,ule,$de,hle,Hde,Xde,qde,mle,yle,Kde,Zde,Qde,Jde,Ele,Ale,Dae,ehe,Qce,nhe,rhe,ohe,ice,Ole,Rle,ahe,Lle,uhe,hhe,fhe,_he,yhe,vhe,The,Ule,xhe,Ehe,whe,Ihe,Ahe,She,Che,jle,Ohe,Rhe,Fhe,Wle,qle,Phe,$he,Vhe,Qle,zhe,Ghe,Whe,Xhe,Zhe,oce,iue,Qhe,Jhe,epe,tpe,Lae,zde,ipe,lce,cce,pce,rpe,spe,ope,ape,lpe,upe,dpe,yue,hpe,mpe,gpe,bpe,xue,xpe,wpe,Ape,Iue,Dhe,Ope,Mpe,kpe,Rpe,Npe,Dpe,Fpe,Lpe,kue,Ppe,Due,Pue,$pe,Upe,Vpe,zpe,jpe,Wue,Sde,Gpe,Wpe,Xpe,qpe,Kpe,Zpe,tue,nfe,ife,rfe,Yhe];for(const e of sfe)(0,u3.registerKernel)(e); +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,segmentIds:s}=t,{numSegments:o}=i;Cae(r,"unsortedSegmentSum");const a=[],l=[],u=r.shape.length-s.shape.length;let c=s;for(let e=0;en.disposeIntermediateTensorInfo(e)),d}},ufe=[bce,Rae,xce,wce,qae,Ice,Ace,Sce,Cce,Oce,kce,Nce,Fce,Bce,Uce,Yce,Gce,Hce,Wce,vce,Xce,qce,Kce,ele,Zce,jae,ole,Jce,Fae,ede,rde,ode,ade,lde,ude,cde,dde,pde,mde,gde,_de,yde,vde,bde,xde,Ede,wde,Ide,Ade,Sde,Cde,Ode,Rde,sce,Nde,cle,Vde,ple,jde,gle,Kde,Qde,Jde,vle,xle,ehe,the,nhe,ihe,Sle,Mle,Bae,rhe,nde,ohe,lhe,che,ace,Nle,Lle,dhe,Ule,phe,ghe,yhe,The,xhe,Ehe,Ihe,Yle,Ahe,She,Che,Ohe,Mhe,khe,Rhe,Wle,Nhe,Lhe,$he,Zle,Jle,Vhe,jhe,Ghe,nue,Hhe,qhe,Zhe,Qhe,tpe,cce,aue,npe,ipe,rpe,spe,Uae,Hde,ape,hce,fce,_ce,lpe,upe,cpe,dpe,hpe,ppe,mpe,xue,gpe,vpe,bpe,wpe,Aue,Ape,Cpe,Mpe,Oue,Bhe,Npe,Dpe,Fpe,Lpe,Ppe,Bpe,$pe,Upe,Fue,Vpe,Bue,Vue,jpe,Ype,Gpe,Hpe,Wpe,Zue,kde,qpe,Zpe,Qpe,Jpe,efe,tfe,sue,ofe,afe,lfe,Xhe];for(const e of ufe)(0,p3.registerKernel)(e); /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -14844,7 +14844,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,segmentIds:s}=t,{numSegment * limitations under the License. * ============================================================================= */ -const ofe={},afe={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function lfe(e,t){ofe[e]=t}function ufe(e,t){if(!(e in ofe)||null!=t){const n=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==t?function(e){if((0,u3.env)().getBool("IS_SAFARI")||"undefined"==typeof OffscreenCanvas||2!==e){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}return new OffscreenCanvas(300,150)}(e):t;n.addEventListener("webglcontextlost",t=>{t.preventDefault(),delete ofe[e]},!1),(0,u3.env)().getBool("SOFTWARE_WEBGL_ENABLED")&&(afe.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",afe)||n.getContext("experimental-webgl",afe);return n.getContext("webgl2",afe)}(e,t);if(null===n)return console.log("Could not get context for WebGL version",e),null;ofe[e]=n}const n=ofe[e];return null==n||n.isContextLost()?(delete ofe[e],ufe(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),ofe[e])} +const cfe={},dfe={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function hfe(e,t){cfe[e]=t}function pfe(e,t){if(!(e in cfe)||null!=t){const n=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==t?function(e){if((0,p3.env)().getBool("IS_SAFARI")||"undefined"==typeof OffscreenCanvas||2!==e){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}return new OffscreenCanvas(300,150)}(e):t;n.addEventListener("webglcontextlost",t=>{t.preventDefault(),delete cfe[e]},!1),(0,p3.env)().getBool("SOFTWARE_WEBGL_ENABLED")&&(dfe.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",dfe)||n.getContext("experimental-webgl",dfe);return n.getContext("webgl2",dfe)}(e,t);if(null===n)return console.log("Could not get context for WebGL version",e),null;cfe[e]=n}const n=cfe[e];return null==n||n.isContextLost()?(delete cfe[e],pfe(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),cfe[e])} /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -14861,7 +14861,7 @@ const ofe={},afe={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuf * limitations under the License. * ============================================================================= */ -var cfe,dfe,hfe;function pfe(e,t){return[t,e]}function ffe(e){const t=u3.util.sizeFromShape(e),n=Math.ceil(t/4);return u3.util.sizeToSquarishShape(n)}function mfe(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function gfe(e,t){const n=e;let i,r,s,o,a,l,u,c,d,h;return 2===(0,u3.env)().getNumber("WEBGL_VERSION")?(i=n.R32F,r=n.R16F,s=n.RGBA16F,o=n.RGBA32F,a=n.RED,u=4,c=1,d=n.HALF_FLOAT,h=n.FLOAT,l=n.RGBA8):(i=e.RGBA,r=e.RGBA,s=e.RGBA,o=n.RGBA,a=e.RGBA,u=4,c=4,d=null!=t?t.HALF_FLOAT_OES:null,h=e.FLOAT,l=e.RGBA),{internalFormatFloat:i,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:d,textureTypeFloat:h}} +var ffe,mfe,gfe;function _fe(e,t){return[t,e]}function yfe(e){const t=p3.util.sizeFromShape(e),n=Math.ceil(t/4);return p3.util.sizeToSquarishShape(n)}function vfe(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function bfe(e,t){const n=e;let i,r,s,o,a,l,u,c,d,h;return 2===(0,p3.env)().getNumber("WEBGL_VERSION")?(i=n.R32F,r=n.R16F,s=n.RGBA16F,o=n.RGBA32F,a=n.RED,u=4,c=1,d=n.HALF_FLOAT,h=n.FLOAT,l=n.RGBA8):(i=e.RGBA,r=e.RGBA,s=e.RGBA,o=n.RGBA,a=e.RGBA,u=4,c=4,d=null!=t?t.HALF_FLOAT_OES:null,h=e.FLOAT,l=e.RGBA),{internalFormatFloat:i,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:d,textureTypeFloat:h}} /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -14878,7 +14878,7 @@ var cfe,dfe,hfe;function pfe(e,t){return[t,e]}function ffe(e){const t=u3.util.si * limitations under the License. * ============================================================================= */ -function _fe(e,t){const n=t();return(0,u3.env)().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+Tfe(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(cfe||(cfe={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(dfe||(dfe={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(hfe||(hfe={}));const yfe=5.96e-8,vfe=65504;function bfe(e){return!!((0,u3.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||yfee.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function Efe(e,t){const n=Wfe(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(_fe(e,()=>e.shaderSource(n,t)),_fe(e,()=>e.compileShader(n)),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function wfe(e,t){const n=Wfe(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(_fe(e,()=>e.shaderSource(n,t)),_fe(e,()=>e.compileShader(n)),(0,u3.env)().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw Afe(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}const Ife=/ERROR: [0-9]+:([0-9]+):/g;function Afe(e,t){const n=Ife.exec(t);if(null==n)return console.log(`Couldn't parse line number in error: ${t}`),void console.log(e);const i=+n[1],r=e.split("\n"),s=r.length.toString().length+2,o=r.map((e,t)=>u3.util.rightPad((t+1).toString(),s)+e);let a=0;for(let e=0;ee.createProgram(),"Unable to create WebGLProgram.")}function Cfe(e,t){if(_fe(e,()=>e.linkProgram(t)),!(0,u3.env)().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function Ofe(e,t){if(_fe(e,()=>e.validateProgram(t)),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function Mfe(e,t){const n=Wfe(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return _fe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),_fe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function kfe(e,t){const n=Wfe(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return _fe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),_fe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function Rfe(){return 2===(0,u3.env)().getNumber("WEBGL_VERSION")?1:4}function Nfe(e){return Wfe(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Dfe(e,t){const n=(0,u3.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){throw new Error("Requested texture size "+`[${e}x${t}]`+" is invalid.")}if(e>n||t>n){throw new Error("Requested texture size "+`[${e}x${t}]`+" greater than WebGL maximum on this browser / GPU "+`[${n}x${n}]`+".")}}function Ffe(e){return Wfe(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function Lfe(e,t,n,i,r,s,o){const a=e.getAttribLocation(t,n);return-1!==a&&(_fe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,i)),_fe(e,()=>e.vertexAttribPointer(a,r,e.FLOAT,!1,s,o)),_fe(e,()=>e.enableVertexAttribArray(a)),!0)}function Pfe(e,t,n){Xfe(e,n),_fe(e,()=>e.activeTexture(e.TEXTURE0+n)),_fe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function Bfe(e,t){Xfe(e,t),_fe(e,()=>e.activeTexture(e.TEXTURE0+t)),_fe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function $fe(e,t,n){return Wfe(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function Ufe(e,t,n){return e.getUniformLocation(t,n)}function Vfe(e,t,n,i){_fe(e,()=>Pfe(e,t,i)),_fe(e,()=>e.uniform1i(n,i))}function zfe(e){_fe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),_fe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),_fe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function jfe(e,t,n){_fe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),_fe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function Yfe(e,t){_fe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),_fe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function Gfe(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Hfe(e,t))}function Hfe(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function Wfe(e,t,n){const i=_fe(e,()=>t());if(null==i)throw new Error(n);return i}function Xfe(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,i=t+e.TEXTURE0;if(in){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function qfe(e,t=2){return u3.util.sizeFromShape(e.slice(0,e.length-t))}function Kfe(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function Zfe(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[qfe(e),...Kfe(e)]),t}function Qfe(e,t=!1){let n=(0,u3.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE"),i=(0,u3.env)().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(i===1/0&&(0,u3.env)().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(i=n/2),t&&(n*=2,i*=2,1===(e=e.map((t,n)=>n>=e.length-2?u3.util.nearestLargerEven(e[n]):e[n])).length&&(e=[2,e[0]])),2!==e.length){const t=u3.util.squeezeShape(e);e=t.newShape}let r=u3.util.sizeFromShape(e),s=null;e.length<=1&&r<=n?s=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?s=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?s=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?s=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?s=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(s=[e[0],e[1]*e[2]*e[3]]);const o=null!=s&&Math.max(...s)>i&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(null==s||o)if(t){const t=qfe(e);let n=2,i=2;e.length&&([n,i]=Kfe(e)),r=t*(n/2)*(i/2),s=u3.util.sizeToSquarishShape(r).map(e=>2*e)}else s=u3.util.sizeToSquarishShape(r);return s}function Jfe(e){return e%2==0}function eme(e,t){if(e=e.slice(-2),t=t.slice(-2),u3.util.arraysEqual(e,t))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e[e.length-1],i=t[t.length-1];if(n===i)return!0;if(Jfe(n)&&Jfe(i)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&Jfe(e[0])&&Jfe(t[0])}let tme,nme;function ime(e){if(null==tme){const t=ufe(e);tme=t.getParameter(t.MAX_TEXTURE_SIZE)}return tme}function rme(){tme=null}function sme(){nme=null}function ome(e){if(null==nme){const t=ufe(e);nme=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,nme)}function ame(e){if(0===e)return 0;let t;const n=ufe(e);return t=lme(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:lme(n,"EXT_disjoint_timer_query")?1:0,t}function lme(e,t){return null!=e.getExtension(t)}function ume(e){try{if(null!=ufe(e))return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function cme(e){if(0===e)return!1;const t=ufe(e);if(1===e){if(!lme(t,"OES_texture_float"))return!1}else if(!lme(t,"EXT_color_buffer_float"))return!1;return hme(t)}function dme(e){if(0===e)return!1;const t=ufe(e);if(1!==e){if(lme(t,"EXT_color_buffer_float"))return hme(t);const e="EXT_color_buffer_half_float";if(lme(t,e)){const n=t.getExtension(e);return function(e,t){const n=gfe(e,t),i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);const r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0);const a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(i),e.deleteFramebuffer(o),a}(t,n)}return!1}if(!lme(t,"OES_texture_float"))return!1;if(!lme(t,"WEBGL_color_buffer_float"))return!1;return hme(t)}function hme(e){const t=gfe(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(i),r}function pme(e){if(2!==e)return!1;return null!=ufe(e).fenceSync}function fme(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&u3.util.assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the WebGL backend.`)})} +function Tfe(e,t){const n=t();return(0,p3.env)().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+Ife(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(ffe||(ffe={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(mfe||(mfe={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(gfe||(gfe={}));const xfe=5.96e-8,Efe=65504;function wfe(e){return!!((0,p3.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||xfee.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function Sfe(e,t){const n=Zfe(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(Tfe(e,()=>e.shaderSource(n,t)),Tfe(e,()=>e.compileShader(n)),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function Cfe(e,t){const n=Zfe(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(Tfe(e,()=>e.shaderSource(n,t)),Tfe(e,()=>e.compileShader(n)),(0,p3.env)().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw Mfe(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}const Ofe=/ERROR: [0-9]+:([0-9]+):/g;function Mfe(e,t){const n=Ofe.exec(t);if(null==n)return console.log(`Couldn't parse line number in error: ${t}`),void console.log(e);const i=+n[1],r=e.split("\n"),s=r.length.toString().length+2,o=r.map((e,t)=>p3.util.rightPad((t+1).toString(),s)+e);let a=0;for(let e=0;ee.createProgram(),"Unable to create WebGLProgram.")}function Rfe(e,t){if(Tfe(e,()=>e.linkProgram(t)),!(0,p3.env)().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function Nfe(e,t){if(Tfe(e,()=>e.validateProgram(t)),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function Dfe(e,t){const n=Zfe(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return Tfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),Tfe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function Ffe(e,t){const n=Zfe(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return Tfe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),Tfe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function Lfe(){return 2===(0,p3.env)().getNumber("WEBGL_VERSION")?1:4}function Pfe(e){return Zfe(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Bfe(e,t){const n=(0,p3.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){throw new Error("Requested texture size "+`[${e}x${t}]`+" is invalid.")}if(e>n||t>n){throw new Error("Requested texture size "+`[${e}x${t}]`+" greater than WebGL maximum on this browser / GPU "+`[${n}x${n}]`+".")}}function $fe(e){return Zfe(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function Ufe(e,t,n,i,r,s,o){const a=e.getAttribLocation(t,n);return-1!==a&&(Tfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,i)),Tfe(e,()=>e.vertexAttribPointer(a,r,e.FLOAT,!1,s,o)),Tfe(e,()=>e.enableVertexAttribArray(a)),!0)}function Vfe(e,t,n){Qfe(e,n),Tfe(e,()=>e.activeTexture(e.TEXTURE0+n)),Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function zfe(e,t){Qfe(e,t),Tfe(e,()=>e.activeTexture(e.TEXTURE0+t)),Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function jfe(e,t,n){return Zfe(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function Yfe(e,t,n){return e.getUniformLocation(t,n)}function Gfe(e,t,n,i){Tfe(e,()=>Vfe(e,t,i)),Tfe(e,()=>e.uniform1i(n,i))}function Hfe(e){Tfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),Tfe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),Tfe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function Wfe(e,t,n){Tfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),Tfe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function Xfe(e,t){Tfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),Tfe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function qfe(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Kfe(e,t))}function Kfe(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function Zfe(e,t,n){const i=Tfe(e,()=>t());if(null==i)throw new Error(n);return i}function Qfe(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,i=t+e.TEXTURE0;if(in){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function Jfe(e,t=2){return p3.util.sizeFromShape(e.slice(0,e.length-t))}function eme(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function tme(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[Jfe(e),...eme(e)]),t}function nme(e,t=!1){let n=(0,p3.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE"),i=(0,p3.env)().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(i===1/0&&(0,p3.env)().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(i=n/2),t&&(n*=2,i*=2,1===(e=e.map((t,n)=>n>=e.length-2?p3.util.nearestLargerEven(e[n]):e[n])).length&&(e=[2,e[0]])),2!==e.length){const t=p3.util.squeezeShape(e);e=t.newShape}let r=p3.util.sizeFromShape(e),s=null;e.length<=1&&r<=n?s=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?s=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?s=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?s=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?s=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(s=[e[0],e[1]*e[2]*e[3]]);const o=null!=s&&Math.max(...s)>i&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(null==s||o)if(t){const t=Jfe(e);let n=2,i=2;e.length&&([n,i]=eme(e)),r=t*(n/2)*(i/2),s=p3.util.sizeToSquarishShape(r).map(e=>2*e)}else s=p3.util.sizeToSquarishShape(r);return s}function ime(e){return e%2==0}function rme(e,t){if(e=e.slice(-2),t=t.slice(-2),p3.util.arraysEqual(e,t))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e[e.length-1],i=t[t.length-1];if(n===i)return!0;if(ime(n)&&ime(i)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&ime(e[0])&&ime(t[0])}let sme,ome;function ame(e){if(null==sme){const t=pfe(e);sme=t.getParameter(t.MAX_TEXTURE_SIZE)}return sme}function lme(){sme=null}function ume(){ome=null}function cme(e){if(null==ome){const t=pfe(e);ome=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,ome)}function dme(e){if(0===e)return 0;let t;const n=pfe(e);return t=hme(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:hme(n,"EXT_disjoint_timer_query")?1:0,t}function hme(e,t){return null!=e.getExtension(t)}function pme(e){try{if(null!=pfe(e))return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function fme(e){if(0===e)return!1;const t=pfe(e);if(1===e){if(!hme(t,"OES_texture_float"))return!1}else if(!hme(t,"EXT_color_buffer_float"))return!1;return gme(t)}function mme(e){if(0===e)return!1;const t=pfe(e);if(1!==e){if(hme(t,"EXT_color_buffer_float"))return gme(t);const e="EXT_color_buffer_half_float";if(hme(t,e)){const n=t.getExtension(e);return function(e,t){const n=bfe(e,t),i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);const r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0);const a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(i),e.deleteFramebuffer(o),a}(t,n)}return!1}if(!hme(t,"OES_texture_float"))return!1;if(!hme(t,"WEBGL_color_buffer_float"))return!1;return gme(t)}function gme(e){const t=bfe(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(i),r}function _me(e){if(2!==e)return!1;return null!=pfe(e).fenceSync}function yme(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&p3.util.assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the WebGL backend.`)})} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -14895,7 +14895,7 @@ function _fe(e,t){const n=t();return(0,u3.env)().getBool("DEBUG")&&function(e){c * limitations under the License. * ============================================================================= */ -const mme=(0,u3.env)(); +const vme=(0,p3.env)(); /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -14912,7 +14912,7 @@ const mme=(0,u3.env)(); * limitations under the License. * ============================================================================= */ -function gme(){let e,t,n,i,r,s,o,a,l,u;return 2===(0,u3.env)().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",i="in",r="texture",s="outputColor",o="out vec4 outputColor;",a=(0,u3.env)().getBool("WEBGL2_ISNAN_CUSTOM")?"\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ":"",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",i="varying",r="texture2D",s="gl_FragColor",o="",a="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:i,texture2D:r,output:s,defineOutput:o,defineSpecialNaN:a,defineSpecialInf:l,defineRound:u}} +function bme(){let e,t,n,i,r,s,o,a,l,u;return 2===(0,p3.env)().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",i="in",r="texture",s="outputColor",o="out vec4 outputColor;",a=(0,p3.env)().getBool("WEBGL2_ISNAN_CUSTOM")?"\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ":"",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",i="varying",r="texture2D",s="gl_FragColor",o="",a="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:i,texture2D:r,output:s,defineOutput:o,defineSpecialNaN:a,defineSpecialInf:l,defineRound:u}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -14929,7 +14929,7 @@ function gme(){let e,t,n,i,r,s,o,a,l,u;return 2===(0,u3.env)().getNumber("WEBGL_ * limitations under the License. * ============================================================================= */ -function _me(e,t,n="index"){const i=u3.util.computeStrides(t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`).join("")}function yme(e,t,n="index"){const i=u3.util.computeStrides(t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`).join("")}function vme(e,t,n="index"){const i=function(e,t){const n=e.length,i=e.map(e=>`${t}[${e}]`),r=new Array(n-1);r[n-2]=i[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${i[e+1]})`;return r}(e.map((e,t)=>t),t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / ${i[r]}`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${i[r]}`:`index -= ${e[r]} * ${i[r]}`};`).join("")}function bme(e){const t=u3.util.computeStrides(e).map(e=>e.toString());return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}mme.registerFlag("HAS_WEBGL",()=>mme.getNumber("WEBGL_VERSION")>0),mme.registerFlag("WEBGL_VERSION",()=>ume(2)?2:ume(1)?1:0),mme.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1),mme.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>2===mme.get("WEBGL_VERSION")),mme.registerFlag("WEBGL_CPU_FORWARD",()=>!0),mme.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1),mme.registerFlag("WEBGL_PACK",()=>mme.getBool("HAS_WEBGL")),mme.registerFlag("WEBGL_PACK_NORMALIZATION",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_CLIP",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_REDUCE",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_LAZILY_UNPACK",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_CONV_IM2COL",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>mme.getBool("WEBGL_PACK")),mme.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>ime(mme.getNumber("WEBGL_VERSION"))),mme.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>ome(mme.getNumber("WEBGL_VERSION"))),mme.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const e=mme.getNumber("WEBGL_VERSION");return 0===e?0:ame(e)}),mme.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>mme.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!u3.device_util.isMobile()),mme.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>cme(mme.getNumber("WEBGL_VERSION"))),mme.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>!mme.getBool("WEBGL_FORCE_F16_TEXTURES")&&mme.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")),mme.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>dme(mme.getNumber("WEBGL_VERSION"))),mme.registerFlag("WEBGL_FENCE_API_ENABLED",()=>pme(mme.getNumber("WEBGL_VERSION"))),mme.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>mme.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0),mme.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if("number"!=typeof e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)}),mme.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>u3.device_util.isMobile()?1:-1,e=>{if("number"!=typeof e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)}),mme.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128),mme.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1),mme.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5),mme.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128),mme.registerFlag("WEBGL_EXP_CONV",()=>!1),mme.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>mme.getBool("IS_TEST")),mme.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0),mme.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1),mme.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1),mme.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);const Tme="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:xme}=u3.backend_util;function Eme(e,t,n){const i=[];if(e.forEach(e=>{const t=u3.util.sizeFromShape(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?i.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(i.push(`uniform sampler2D ${e.name};`),i.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=Dme(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:i.push(`uniform int ${e.name}Shape;`);break;case 2:i.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:i.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:i.push(`uniform ivec4 ${e.name}Shape;`)}i.push(`uniform ivec2 ${e.name}TexShape;`)}}),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:i.push("uniform int outShape;");break;case 2:i.push("uniform ivec2 outShape;"),i.push("uniform int outShapeStrides;");break;case 3:i.push("uniform ivec3 outShape;"),i.push("uniform ivec2 outShapeStrides;");break;case 4:i.push("uniform ivec4 outShape;"),i.push("uniform ivec3 outShapeStrides;")}i.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach(e=>{i.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)});const r=i.join("\n"),s=e.map(e=>function(e,t,n=!1,i){let r="";r+=n?Ime(e,i):wme(e,i);const s=e.shapeInfo.logicalShape,o=t.logicalShape;s.length<=o.length&&(r+=n?function(e,t){const n=e.name,i=n.charAt(0).toUpperCase()+n.slice(1),r="get"+i+"AtOutCoords",s=e.shapeInfo.logicalShape.length,o=t.logicalShape.length,a=xme(e.shapeInfo.logicalShape,t.logicalShape),l=Nme(o),u=o-s;let c;const d=["x","y","z","w","u","v"];c=0===s?"":o<2&&a.length>=1?"coords = 0;":a.map(e=>`coords.${d[e+u]} = 0;`).join("\n");let h="";h=o<2&&s>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${d[t+u]}`).join(", ");let p="return outputValue;";const f=1===u3.util.sizeFromShape(e.shapeInfo.logicalShape),m=u3.util.sizeFromShape(t.logicalShape),g=1===m;if(1!==s||f||g){if(f&&!g)p=1===o?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(a.length){const e=s-2,t=s-1;a.indexOf(e)>-1&&a.indexOf(t)>-1?p="return vec4(outputValue.x);":a.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":a.indexOf(t)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${r}() {\n ${l} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${i}(${h});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,i=n.charAt(0).toUpperCase()+n.slice(1),r="get"+i+"AtOutCoords",s=t.texShape,o=e.shapeInfo.texShape,a=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&a===l&&null==e.shapeInfo.flatOffset&&u3.util.arraysEqual(o,s))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=Nme(l),c=xme(e.shapeInfo.logicalShape,t.logicalShape),d=l-a;let h;const p=["x","y","z","w","u","v"];h=0===a?"":l<2&&c.length>=1?"coords = 0;":c.map(e=>`coords.${p[e+d]} = 0;`).join("\n");let f="";f=l<2&&a>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${p[t+d]}`).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${h}\n return get${i}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms)).join("\n"),o=t.texShape,a=gme(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(a);let u,c,d=function(e){const t=`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFs} vec2 resultUV;\n ${e.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${e.defineSpecialNaN}\n ${e.defineSpecialInf}\n ${e.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${Ame}\n ${Sme}\n ${Cme}\n `;return t}(a);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return Mme();case 1:return function(e,t,n){const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===i[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${i[1]}.0);\n }\n `;if(1===i[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${i[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n return 2 * (resTexRC.x * ${i[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(u3.util.arraysEqual(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${i[0]}, ${i[1]}));\n }\n `;const r=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n\n int index = resTexRC.x * ${i[1]} + resTexRC.y;\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec2(r, c);\n }\n `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),s=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n int index = resTexRC.x * ${i[1]} + resTexRC.y;\n\n int b = index / ${s};\n index -= b * ${s};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),s=r*Math.ceil(e[e.length-2]/2);let o=s,a="",l="b, r, c";for(let t=2;t1&&!u3.util.arraysEqual(t,n)&&i.lengthe[t]).join(", ")}function Pme(e,t,n){const i=[],r=[];let s,o,a,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===(0,u3.env)().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const s={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(s.shape=e.getUniformLocation(n,`${r}Shape`,c),s.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),i.push(s)}if(t.enableShapeUniforms&&(s=e.getUniformLocation(n,"outShape",c),a=e.getUniformLocation(n,"outShapeStrides",c),o=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const i of t.customUniforms)r.push(e.getUniformLocation(n,i.name,c));return{variablesLocations:i,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:a,outTexShapeLocation:o}}function Bme(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach((e,n)=>{const i=e.logicalShape,r=t[n],s=r.shape;if(!u3.util.arraysEqual(i,s))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${i} and ${s} must match`);if(e.isUniform&&r.isUniform)return;const o=e.texShape,a=r.isUniform?null:r.texData.texShape;if(!u3.util.arraysEqual(o,a))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${a} must match`)})}function $me(e){return(0,u3.env)().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4} +function Tme(e,t,n="index"){const i=p3.util.computeStrides(t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`).join("")}function xme(e,t,n="index"){const i=p3.util.computeStrides(t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`).join("")}function Eme(e,t,n="index"){const i=function(e,t){const n=e.length,i=e.map(e=>`${t}[${e}]`),r=new Array(n-1);r[n-2]=i[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${i[e+1]})`;return r}(e.map((e,t)=>t),t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / ${i[r]}`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${i[r]}`:`index -= ${e[r]} * ${i[r]}`};`).join("")}function wme(e){const t=p3.util.computeStrides(e).map(e=>e.toString());return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}vme.registerFlag("HAS_WEBGL",()=>vme.getNumber("WEBGL_VERSION")>0),vme.registerFlag("WEBGL_VERSION",()=>pme(2)?2:pme(1)?1:0),vme.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1),vme.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>2===vme.get("WEBGL_VERSION")),vme.registerFlag("WEBGL_CPU_FORWARD",()=>!0),vme.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1),vme.registerFlag("WEBGL_PACK",()=>vme.getBool("HAS_WEBGL")),vme.registerFlag("WEBGL_PACK_NORMALIZATION",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_CLIP",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_REDUCE",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_LAZILY_UNPACK",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_CONV_IM2COL",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>vme.getBool("WEBGL_PACK")),vme.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>ame(vme.getNumber("WEBGL_VERSION"))),vme.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>cme(vme.getNumber("WEBGL_VERSION"))),vme.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const e=vme.getNumber("WEBGL_VERSION");return 0===e?0:dme(e)}),vme.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>vme.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!p3.device_util.isMobile()),vme.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>fme(vme.getNumber("WEBGL_VERSION"))),vme.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>!vme.getBool("WEBGL_FORCE_F16_TEXTURES")&&vme.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")),vme.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>mme(vme.getNumber("WEBGL_VERSION"))),vme.registerFlag("WEBGL_FENCE_API_ENABLED",()=>_me(vme.getNumber("WEBGL_VERSION"))),vme.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>vme.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0),vme.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if("number"!=typeof e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)}),vme.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>p3.device_util.isMobile()?1:-1,e=>{if("number"!=typeof e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)}),vme.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128),vme.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1),vme.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5),vme.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128),vme.registerFlag("WEBGL_EXP_CONV",()=>!1),vme.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>vme.getBool("IS_TEST")),vme.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0),vme.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1),vme.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1),vme.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);const Ime="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:Ame}=p3.backend_util;function Sme(e,t,n){const i=[];if(e.forEach(e=>{const t=p3.util.sizeFromShape(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?i.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(i.push(`uniform sampler2D ${e.name};`),i.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=Bme(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:i.push(`uniform int ${e.name}Shape;`);break;case 2:i.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:i.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:i.push(`uniform ivec4 ${e.name}Shape;`)}i.push(`uniform ivec2 ${e.name}TexShape;`)}}),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:i.push("uniform int outShape;");break;case 2:i.push("uniform ivec2 outShape;"),i.push("uniform int outShapeStrides;");break;case 3:i.push("uniform ivec3 outShape;"),i.push("uniform ivec2 outShapeStrides;");break;case 4:i.push("uniform ivec4 outShape;"),i.push("uniform ivec3 outShapeStrides;")}i.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach(e=>{i.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)});const r=i.join("\n"),s=e.map(e=>function(e,t,n=!1,i){let r="";r+=n?Ome(e,i):Cme(e,i);const s=e.shapeInfo.logicalShape,o=t.logicalShape;s.length<=o.length&&(r+=n?function(e,t){const n=e.name,i=n.charAt(0).toUpperCase()+n.slice(1),r="get"+i+"AtOutCoords",s=e.shapeInfo.logicalShape.length,o=t.logicalShape.length,a=Ame(e.shapeInfo.logicalShape,t.logicalShape),l=Pme(o),u=o-s;let c;const d=["x","y","z","w","u","v"];c=0===s?"":o<2&&a.length>=1?"coords = 0;":a.map(e=>`coords.${d[e+u]} = 0;`).join("\n");let h="";h=o<2&&s>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${d[t+u]}`).join(", ");let p="return outputValue;";const f=1===p3.util.sizeFromShape(e.shapeInfo.logicalShape),m=p3.util.sizeFromShape(t.logicalShape),g=1===m;if(1!==s||f||g){if(f&&!g)p=1===o?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(a.length){const e=s-2,t=s-1;a.indexOf(e)>-1&&a.indexOf(t)>-1?p="return vec4(outputValue.x);":a.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":a.indexOf(t)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${r}() {\n ${l} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${i}(${h});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,i=n.charAt(0).toUpperCase()+n.slice(1),r="get"+i+"AtOutCoords",s=t.texShape,o=e.shapeInfo.texShape,a=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&a===l&&null==e.shapeInfo.flatOffset&&p3.util.arraysEqual(o,s))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=Pme(l),c=Ame(e.shapeInfo.logicalShape,t.logicalShape),d=l-a;let h;const p=["x","y","z","w","u","v"];h=0===a?"":l<2&&c.length>=1?"coords = 0;":c.map(e=>`coords.${p[e+d]} = 0;`).join("\n");let f="";f=l<2&&a>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${p[t+d]}`).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${h}\n return get${i}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms)).join("\n"),o=t.texShape,a=bme(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(a);let u,c,d=function(e){const t=`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFs} vec2 resultUV;\n ${e.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${e.defineSpecialNaN}\n ${e.defineSpecialInf}\n ${e.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${Mme}\n ${kme}\n ${Rme}\n `;return t}(a);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return Dme();case 1:return function(e,t,n){const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===i[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${i[1]}.0);\n }\n `;if(1===i[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${i[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n return 2 * (resTexRC.x * ${i[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(p3.util.arraysEqual(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${i[0]}, ${i[1]}));\n }\n `;const r=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n\n int index = resTexRC.x * ${i[1]} + resTexRC.y;\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec2(r, c);\n }\n `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),s=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n int index = resTexRC.x * ${i[1]} + resTexRC.y;\n\n int b = index / ${s};\n index -= b * ${s};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),s=r*Math.ceil(e[e.length-2]/2);let o=s,a="",l="b, r, c";for(let t=2;t1&&!p3.util.arraysEqual(t,n)&&i.lengthe[t]).join(", ")}function Vme(e,t,n){const i=[],r=[];let s,o,a,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===(0,p3.env)().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const s={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(s.shape=e.getUniformLocation(n,`${r}Shape`,c),s.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),i.push(s)}if(t.enableShapeUniforms&&(s=e.getUniformLocation(n,"outShape",c),a=e.getUniformLocation(n,"outShapeStrides",c),o=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const i of t.customUniforms)r.push(e.getUniformLocation(n,i.name,c));return{variablesLocations:i,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:a,outTexShapeLocation:o}}function zme(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach((e,n)=>{const i=e.logicalShape,r=t[n],s=r.shape;if(!p3.util.arraysEqual(i,s))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${i} and ${s} must match`);if(e.isUniform&&r.isUniform)return;const o=e.texShape,a=r.isUniform?null:r.texData.texShape;if(!p3.util.arraysEqual(o,a))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${a} must match`)})}function jme(e){return(0,p3.env)().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -14946,7 +14946,7 @@ function _me(e,t,n="index"){const i=u3.util.computeStrides(t);return i.map((t,r) * limitations under the License. * ============================================================================= */ -class Ume{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=cfe.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=gme();this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?yme(["r","c","d"],e):_me(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}} +class Yme{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=ffe.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=bme();this.outputShape=e,this.enableShapeUniforms=jme(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?xme(["r","c","d"],e):Tme(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -14963,7 +14963,7 @@ class Ume{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.pack * limitations under the License. * ============================================================================= */ -class Vme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=cfe.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=gme();this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?yme(["r","c","d"],e):_me(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}} +class Gme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=ffe.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=bme();this.outputShape=e,this.enableShapeUniforms=jme(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?xme(["r","c","d"],e):Tme(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -14980,7 +14980,7 @@ class Vme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.pack * limitations under the License. * ============================================================================= */ -class zme{constructor(e){this.variableNames=["A"],this.outTexUsage=dfe.DOWNLOAD;const t=gme();this.outputShape=e,this.userCode=`\n ${Tme}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}} +class Hme{constructor(e){this.variableNames=["A"],this.outTexUsage=mfe.DOWNLOAD;const t=bme();this.outputShape=e,this.userCode=`\n ${Ime}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -14997,7 +14997,7 @@ class zme{constructor(e){this.variableNames=["A"],this.outTexUsage=dfe.DOWNLOAD; * limitations under the License. * ============================================================================= */ -class jme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=dfe.DOWNLOAD;const t=gme();this.outputShape=e,this.userCode=`\n ${Tme}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}} +class Wme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=mfe.DOWNLOAD;const t=bme();this.outputShape=e,this.userCode=`\n ${Ime}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15014,7 +15014,7 @@ class jme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.pack * limitations under the License. * ============================================================================= */ -const Yme={R:0,G:1,B:2,A:3};class Gme{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const i=gme();this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let s="";for(let e=0;ee.bindTexture(a,o)),_fe(e,()=>e.texParameteri(a,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),_fe(e,()=>e.texParameteri(a,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),_fe(e,()=>e.texParameteri(a,e.TEXTURE_MIN_FILTER,e.NEAREST)),_fe(e,()=>e.texParameteri(a,e.TEXTURE_MAG_FILTER,e.NEAREST)),1===(0,u3.env)().getNumber("WEBGL_VERSION")?_fe(e,()=>e.texImage2D(a,0,i,t,n,0,r,s,null)):_fe(e,()=>e.texStorage2D(a,1,i,t,n)),_fe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),{texture:o,texShape:[n,t]}}function Zme(e){return e.internalFormatFloat}function Qme(e,t,n,i){const[r,s]=pfe(t,n);return Kme(e,r,s,Zme(i),i.textureFormatFloat,e.FLOAT)}function Jme(e){return e.internalFormatHalfFloat}function ege(e,t,n,i){const[r,s]=pfe(t,n);return Kme(e,r,s,Jme(i),i.textureFormatFloat,i.textureTypeHalfFloat)}function tge(e){return e.downloadTextureFormat}function nge(e,t,n,i){const[r,s]=pfe(t,n);return Kme(e,r,s,tge(i),e.RGBA,e.UNSIGNED_BYTE)}function ige(e){return e.internalFormatPackedFloat}function rge(e,t,n,i){const[r,s]=mfe(t,n);return Kme(e,r,s,ige(i),e.RGBA,e.FLOAT)}function sge(e){return e.internalFormatPackedHalfFloat}function oge(e,t,n,i){const[r,s]=mfe(t,n);return Kme(e,r,s,sge(i),e.RGBA,i.textureTypeHalfFloat)}function age(e,t,n){_fe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n));return Lfe(e,t,"clipSpacePos",n,3,20,0)&&Lfe(e,t,"uv",n,2,20,12)}function lge(e,t,n,i,r,s){let o,a,l;_fe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),r instanceof Uint8Array?(o=new Uint8Array(n*i*4),a=e.UNSIGNED_BYTE,l=e.RGBA):(o=new Float32Array(n*i*4),a=e.FLOAT,l=s.internalFormatPackedFloat),o.set(r),2===(0,u3.env)().getNumber("WEBGL_VERSION")?_fe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,i,e.RGBA,a,o)):_fe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,i,0,e.RGBA,a,o)),_fe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function uge(e,t,n){_fe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?2===(0,u3.env)().getNumber("WEBGL_VERSION")?_fe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data)):_fe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):2===(0,u3.env)().getNumber("WEBGL_VERSION")?_fe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n)):_fe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),_fe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function cge(e,t,n,i){const r=e.createBuffer();_fe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));const s=16*t*n;return _fe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),_fe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),_fe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function dge(e,t,n){const i=e,r=new Float32Array(n);return i.bindBuffer(i.PIXEL_PACK_BUFFER,t),i.getBufferSubData(i.PIXEL_PACK_BUFFER,0,r),i.bindBuffer(i.PIXEL_PACK_BUFFER,null),r}function hge(e,t,n,i){const[r,s]=pfe(t,n),o=new Uint8Array(t*n*4);return _fe(e,()=>e.readPixels(0,0,r,s,i.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function pge(e,t,n,i,r,s,o,a){const l=e,u=new Float32Array(function(e,t){const[n,i]=mfe(e,t);return n*i*4}(s,o));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function fge(e,t,n){const i=new Float32Array(t*n*4);return _fe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,i)),i} +function Zme(e){const t=bme();return Sfe(e,`${t.version}\n precision highp float;\n ${t.attribute} vec3 clipSpacePos;\n ${t.attribute} vec2 uv;\n ${t.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`)}function Qme(e){return Dfe(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function Jme(e){return Ffe(e,new Uint16Array([0,1,2,2,1,3]))}function ege(e,t,n,i,r,s){Bfe(t,n);const o=Pfe(e),a=e.TEXTURE_2D;return Tfe(e,()=>e.bindTexture(a,o)),Tfe(e,()=>e.texParameteri(a,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),Tfe(e,()=>e.texParameteri(a,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),Tfe(e,()=>e.texParameteri(a,e.TEXTURE_MIN_FILTER,e.NEAREST)),Tfe(e,()=>e.texParameteri(a,e.TEXTURE_MAG_FILTER,e.NEAREST)),1===(0,p3.env)().getNumber("WEBGL_VERSION")?Tfe(e,()=>e.texImage2D(a,0,i,t,n,0,r,s,null)):Tfe(e,()=>e.texStorage2D(a,1,i,t,n)),Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),{texture:o,texShape:[n,t]}}function tge(e){return e.internalFormatFloat}function nge(e,t,n,i){const[r,s]=_fe(t,n);return ege(e,r,s,tge(i),i.textureFormatFloat,e.FLOAT)}function ige(e){return e.internalFormatHalfFloat}function rge(e,t,n,i){const[r,s]=_fe(t,n);return ege(e,r,s,ige(i),i.textureFormatFloat,i.textureTypeHalfFloat)}function sge(e){return e.downloadTextureFormat}function oge(e,t,n,i){const[r,s]=_fe(t,n);return ege(e,r,s,sge(i),e.RGBA,e.UNSIGNED_BYTE)}function age(e){return e.internalFormatPackedFloat}function lge(e,t,n,i){const[r,s]=vfe(t,n);return ege(e,r,s,age(i),e.RGBA,e.FLOAT)}function uge(e){return e.internalFormatPackedHalfFloat}function cge(e,t,n,i){const[r,s]=vfe(t,n);return ege(e,r,s,uge(i),e.RGBA,i.textureTypeHalfFloat)}function dge(e,t,n){Tfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n));return Ufe(e,t,"clipSpacePos",n,3,20,0)&&Ufe(e,t,"uv",n,2,20,12)}function hge(e,t,n,i,r,s){let o,a,l;Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),r instanceof Uint8Array?(o=new Uint8Array(n*i*4),a=e.UNSIGNED_BYTE,l=e.RGBA):(o=new Float32Array(n*i*4),a=e.FLOAT,l=s.internalFormatPackedFloat),o.set(r),2===(0,p3.env)().getNumber("WEBGL_VERSION")?Tfe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,i,e.RGBA,a,o)):Tfe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,i,0,e.RGBA,a,o)),Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function pge(e,t,n){Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?2===(0,p3.env)().getNumber("WEBGL_VERSION")?Tfe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data)):Tfe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):2===(0,p3.env)().getNumber("WEBGL_VERSION")?Tfe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n)):Tfe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),Tfe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function fge(e,t,n,i){const r=e.createBuffer();Tfe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));const s=16*t*n;return Tfe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),Tfe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),Tfe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function mge(e,t,n){const i=e,r=new Float32Array(n);return i.bindBuffer(i.PIXEL_PACK_BUFFER,t),i.getBufferSubData(i.PIXEL_PACK_BUFFER,0,r),i.bindBuffer(i.PIXEL_PACK_BUFFER,null),r}function gge(e,t,n,i){const[r,s]=_fe(t,n),o=new Uint8Array(t*n*4);return Tfe(e,()=>e.readPixels(0,0,r,s,i.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function _ge(e,t,n,i,r,s,o,a){const l=e,u=new Float32Array(function(e,t){const[n,i]=vfe(e,t);return n*i*4}(s,o));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function yge(e,t,n){const i=new Float32Array(t*n*4);return Tfe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,i)),i} /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15065,7 +15065,7 @@ function Wme(e){const t=gme();return Efe(e,`${t.version}\n precision highp fl * limitations under the License. * ============================================================================= */ -class mge{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=(0,u3.env)().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,lfe(t,e)):this.gl=ufe(t),e=this.gl,2===(0,u3.env)().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>_fe(t,()=>t.createVertexArray()),this.bindVertexArray=e=>_fe(t,()=>t.bindVertexArray(e)),this.deleteVertexArray=e=>_fe(t,()=>t.deleteVertexArray(e)),this.getVertexArray=()=>_fe(t,()=>t.getParameter(t.VERTEX_ARRAY_BINDING))}else if(null!=e){const t=e.getExtension("OES_vertex_array_object");if(null==t)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>_fe(e,()=>t.createVertexArrayOES()),this.bindVertexArray=n=>_fe(e,()=>t.bindVertexArrayOES(n)),this.deleteVertexArray=n=>_fe(e,()=>t.deleteVertexArrayOES(n)),this.getVertexArray=()=>_fe(e,()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES))}let n="WEBGL_color_buffer_float";const i="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===(0,u3.env)().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=xfe(this.gl,e),lme(this.gl,t))this.textureHalfFloatExtension=xfe(this.gl,t);else if((0,u3.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),lme(this.gl,i))this.colorBufferHalfFloatExtension=xfe(this.gl,i);else if((0,u3.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",lme(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!lme(this.gl,i))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(i)}this.vertexBuffer=Xme(this.gl),this.indexBuffer=qme(this.gl),this.framebuffer=Ffe(this.gl),this.textureConfig=gfe(this.gl,this.textureHalfFloatExtension)}get debug(){return(0,u3.env)().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;_fe(e,()=>e.finish()),_fe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),_fe(e,()=>e.deleteFramebuffer(this.framebuffer)),_fe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),_fe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),_fe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),Qme(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),ege(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),nge(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),uge(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,i){this.throwIfDisposed(),lge(this.gl,e,t,n,i,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),oge(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),rge(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(Yfe(this.gl,this.framebuffer),this.outputTexture=null),_fe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>hge(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,i,r,s){return pge(this.gl,e,0,0,0,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return dge(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const i=cge(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),i}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if((0,u3.env)().getBool("WEBGL_FENCE_API_ENABLED")){const i=e,r=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=i.clientWaitSync(r,0,0);return e===i.ALREADY_SIGNALED||e===i.CONDITION_SATISFIED},t=r}else(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>fge(this.gl,t,n))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=Wme(t));const n=Sfe(t);_fe(t,()=>t.attachShader(n,this.vertexShader)),_fe(t,()=>t.attachShader(n,e)),Cfe(t,n);const i=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&Ofe(t,i),i}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;_fe(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),age(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(_fe(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&Ofe(this.gl,this.program),_fe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?$fe(this.gl,e,t):Ufe(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),_fe(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),Vfe(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[i,r]=mfe(t,n);this.setOutputMatrixTextureDriver(e,i,r)}setOutputMatrixWriteRegion(e,t,n,i){this.setOutputMatrixWriteRegionDriver(n,e,i,t)}setOutputPackedMatrixWriteRegion(e,t,n,i){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&Ofe(this.gl,this.program),Gfe(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){const e=this.getVertexArray();console.assert(e===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}_fe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),_fe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=xfe(this.gl,2===(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await u3.util.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),i=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),i&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=function(e){let t=0;for(;te.isDoneFn));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in(0,u3.env)().platform&&(n=(0,u3.env)().platform.setTimeoutCustom.bind((0,u3.env)().platform)),u3.util.repeatedTry(()=>(this.pollItems(),0===this.itemsToPoll.length),()=>0,null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),jfe(this.gl,e,this.framebuffer),this.debug&&Gfe(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(jfe(this.gl,this.outputTexture,this.framebuffer),this.debug&&Gfe(this.gl)):Yfe(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const i=this.gl;jfe(i,e,this.framebuffer),this.debug&&Gfe(i),this.outputTexture=e,_fe(i,()=>i.viewport(0,0,t,n)),_fe(i,()=>i.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,i){this.throwIfDisposed(),_fe(this.gl,()=>this.gl.scissor(e,t,n,i))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}} +class vge{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=(0,p3.env)().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,hfe(t,e)):this.gl=pfe(t),e=this.gl,2===(0,p3.env)().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>Tfe(t,()=>t.createVertexArray()),this.bindVertexArray=e=>Tfe(t,()=>t.bindVertexArray(e)),this.deleteVertexArray=e=>Tfe(t,()=>t.deleteVertexArray(e)),this.getVertexArray=()=>Tfe(t,()=>t.getParameter(t.VERTEX_ARRAY_BINDING))}else if(null!=e){const t=e.getExtension("OES_vertex_array_object");if(null==t)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>Tfe(e,()=>t.createVertexArrayOES()),this.bindVertexArray=n=>Tfe(e,()=>t.bindVertexArrayOES(n)),this.deleteVertexArray=n=>Tfe(e,()=>t.deleteVertexArrayOES(n)),this.getVertexArray=()=>Tfe(e,()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES))}let n="WEBGL_color_buffer_float";const i="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===(0,p3.env)().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=Afe(this.gl,e),hme(this.gl,t))this.textureHalfFloatExtension=Afe(this.gl,t);else if((0,p3.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),hme(this.gl,i))this.colorBufferHalfFloatExtension=Afe(this.gl,i);else if((0,p3.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",hme(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!hme(this.gl,i))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(i)}this.vertexBuffer=Qme(this.gl),this.indexBuffer=Jme(this.gl),this.framebuffer=$fe(this.gl),this.textureConfig=bfe(this.gl,this.textureHalfFloatExtension)}get debug(){return(0,p3.env)().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;Tfe(e,()=>e.finish()),Tfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),Tfe(e,()=>e.deleteFramebuffer(this.framebuffer)),Tfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),Tfe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),Tfe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),nge(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),rge(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),oge(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),pge(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,i){this.throwIfDisposed(),hge(this.gl,e,t,n,i,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),cge(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),lge(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(Xfe(this.gl,this.framebuffer),this.outputTexture=null),Tfe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>gge(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,i,r,s){return _ge(this.gl,e,0,0,0,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return mge(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const i=fge(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),i}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if((0,p3.env)().getBool("WEBGL_FENCE_API_ENABLED")){const i=e,r=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=i.clientWaitSync(r,0,0);return e===i.ALREADY_SIGNALED||e===i.CONDITION_SATISFIED},t=r}else(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>yge(this.gl,t,n))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=Zme(t));const n=kfe(t);Tfe(t,()=>t.attachShader(n,this.vertexShader)),Tfe(t,()=>t.attachShader(n,e)),Rfe(t,n);const i=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&Nfe(t,i),i}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;Tfe(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),dge(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(Tfe(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&Nfe(this.gl,this.program),Tfe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?jfe(this.gl,e,t):Yfe(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),Tfe(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),Gfe(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[i,r]=vfe(t,n);this.setOutputMatrixTextureDriver(e,i,r)}setOutputMatrixWriteRegion(e,t,n,i){this.setOutputMatrixWriteRegionDriver(n,e,i,t)}setOutputPackedMatrixWriteRegion(e,t,n,i){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&Nfe(this.gl,this.program),qfe(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){const e=this.getVertexArray();console.assert(e===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}Tfe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),Tfe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=Afe(this.gl,2===(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await p3.util.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),i=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),i&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=function(e){let t=0;for(;te.isDoneFn));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in(0,p3.env)().platform&&(n=(0,p3.env)().platform.setTimeoutCustom.bind((0,p3.env)().platform)),p3.util.repeatedTry(()=>(this.pollItems(),0===this.itemsToPoll.length),()=>0,null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),Wfe(this.gl,e,this.framebuffer),this.debug&&qfe(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(Wfe(this.gl,this.outputTexture,this.framebuffer),this.debug&&qfe(this.gl)):Xfe(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const i=this.gl;Wfe(i,e,this.framebuffer),this.debug&&qfe(i),this.outputTexture=e,Tfe(i,()=>i.viewport(0,0,t,n)),Tfe(i,()=>i.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,i){this.throwIfDisposed(),Tfe(this.gl,()=>this.gl.scissor(e,t,n,i))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15082,7 +15082,7 @@ class mge{constructor(e){this.outputTexture=null,this.program=null,this.disposed * limitations under the License. * ============================================================================= */ -const{addImpl:gge,bincountImpl:_ge,bincountReduceImpl:yge,bitwiseAndImpl:vge,castImpl:bge,ceilImpl:Tge,concatImpl:xge,equalImpl:Ege,expImpl:wge,expm1Impl:Ige,floorImpl:Age,gatherNdImpl:Sge,gatherV2Impl:Cge,greaterImpl:Oge,greaterEqualImpl:Mge,lessImpl:kge,lessEqualImpl:Rge,linSpaceImpl:Nge,logImpl:Dge,maxImpl:Fge,maximumImpl:Lge,minimumImpl:Pge,multiplyImpl:Bge,negImpl:$ge,notEqualImpl:Uge,prodImpl:Vge,raggedGatherImpl:zge,raggedRangeImpl:jge,raggedTensorToTensorImpl:Yge,rangeImpl:Gge,rsqrtImpl:Hge,scatterImpl:Wge,sigmoidImpl:Xge,simpleAbsImpl:qge,sliceImpl:Kge,sparseFillEmptyRowsImpl:Zge,sparseReshapeImpl:Qge,sparseSegmentReductionImpl:Jge,sqrtImpl:e_e,staticRegexReplaceImpl:t_e,stridedSliceImpl:n_e,stringNGramsImpl:i_e,stringSplitImpl:r_e,stringToHashBucketFastImpl:s_e,subImpl:o_e,tileImpl:a_e,topKImpl:l_e,transposeImpl:u_e,uniqueImpl:c_e}=Pe; +const{addImpl:bge,bincountImpl:Tge,bincountReduceImpl:xge,bitwiseAndImpl:Ege,castImpl:wge,ceilImpl:Ige,concatImpl:Age,equalImpl:Sge,expImpl:Cge,expm1Impl:Oge,floorImpl:Mge,gatherNdImpl:kge,gatherV2Impl:Rge,greaterImpl:Nge,greaterEqualImpl:Dge,lessImpl:Fge,lessEqualImpl:Lge,linSpaceImpl:Pge,logImpl:Bge,maxImpl:$ge,maximumImpl:Uge,minimumImpl:Vge,multiplyImpl:zge,negImpl:jge,notEqualImpl:Yge,prodImpl:Gge,raggedGatherImpl:Hge,raggedRangeImpl:Wge,raggedTensorToTensorImpl:Xge,rangeImpl:qge,rsqrtImpl:Kge,scatterImpl:Zge,sigmoidImpl:Qge,simpleAbsImpl:Jge,sliceImpl:e_e,sparseFillEmptyRowsImpl:t_e,sparseReshapeImpl:n_e,sparseSegmentReductionImpl:i_e,sqrtImpl:r_e,staticRegexReplaceImpl:s_e,stridedSliceImpl:o_e,stringNGramsImpl:a_e,stringSplitImpl:l_e,stringToHashBucketFastImpl:u_e,subImpl:c_e,tileImpl:d_e,topKImpl:h_e,transposeImpl:p_e,uniqueImpl:f_e}=Pe; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15099,7 +15099,7 @@ const{addImpl:gge,bincountImpl:_ge,bincountReduceImpl:yge,bitwiseAndImpl:vge,cas * limitations under the License. * ============================================================================= */ -function d_e(e,t){return["x","y","z","w","u","v"].slice(0,t).map(t=>`${e}.${t}`)}function h_e(e,t){return 1===t?[e]:d_e(e,t)} +function m_e(e,t){return["x","y","z","w","u","v"].slice(0,t).map(t=>`${e}.${t}`)}function g_e(e,t){return 1===t?[e]:m_e(e,t)} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15116,7 +15116,7 @@ function d_e(e,t){return["x","y","z","w","u","v"].slice(0,t).map(t=>`${e}.${t}`) * limitations under the License. * ============================================================================= */ -class p_e{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=$me(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=h_e("rc",this.rank),t=Nme(this.rank),n=this.getOutOfBoundsCondition(e),i=this.getSetup(e),r=this.getOutput(e);this.userCode=`\n void main() {\n ${t} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${i}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let i=0;i<=1;i++){let r=`${0===n?"r":"rp1"}, ${0===i?"c":"cp1"}`;for(let t=2;t ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n= ${n};\n bool rEdge = rp1 >= ${i};\n `}getOutput(e){const t=this.getSourceCoordsArr(e);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}} +class __e{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=jme(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=g_e("rc",this.rank),t=Pme(this.rank),n=this.getOutOfBoundsCondition(e),i=this.getSetup(e),r=this.getOutput(e);this.userCode=`\n void main() {\n ${t} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${i}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let i=0;i<=1;i++){let r=`${0===n?"r":"rp1"}, ${0===i?"c":"cp1"}`;for(let t=2;t ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n= ${n};\n bool rEdge = rp1 >= ${i};\n `}getOutput(e){const t=this.getSourceCoordsArr(e);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15133,7 +15133,7 @@ class p_e{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.p * limitations under the License. * ============================================================================= */ -class f_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n ${t}\n ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${e>0?"}":""}\n `}var i,r;this.userCode=`\n ${i=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?vme(["r","c","d"],"inputShape"):_me(["r","c","d"],i)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":bme(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}} +class y_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=jme(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n ${t}\n ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${e>0?"}":""}\n `}var i,r;this.userCode=`\n ${i=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?Eme(["r","c","d"],"inputShape"):Tme(["r","c","d"],i)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":wme(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}} /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15150,7 +15150,7 @@ class f_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.pa * limitations under the License. * ============================================================================= */ -class m_e{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,n){const i=__e(t,n),r=y_e(e,i,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const s=g_e(e,i,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let o;return i===hfe.PACKED_2X2_FLOAT32?o=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):i===hfe.PACKED_2X2_FLOAT16?o=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):i===hfe.UNPACKED_FLOAT32?o=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):i===hfe.UNPACKED_FLOAT16?o=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):i===hfe.PACKED_4X1_UNSIGNED_BYTE&&(o=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(o),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),o}releaseTexture(e,t,n,i){if(null==this.freeTextures)return;const r=__e(n,i),s=y_e(t,r,i);s in this.freeTextures||(this.freeTextures[s]=[]);const o=g_e(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,i),a=(0,u3.env)().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==a&&this._numBytesAllocated>a?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=o):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=o),this.numUsedTextures--;const l=this.usedTextures[s],u=l&&l.indexOf(e);if(null==u||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});for(const e in this.usedTextures)this.usedTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function g_e(e,t,n,i,r){const s=function(e,t){switch(e){case hfe.PACKED_2X2_FLOAT32:return ige(t);case hfe.PACKED_2X2_FLOAT16:return sge(t);case hfe.UNPACKED_FLOAT32:return Zme(t);case hfe.UNPACKED_FLOAT16:return Jme(t);case hfe.PACKED_4X1_UNSIGNED_BYTE:return tge(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,i);let o;if(r){const[t,n]=mfe(e[0],e[1]);o=t*n}else{const[t,n]=pfe(e[0],e[1]);o=t*n}const a=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;if(t===n.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(n,s);return o*a}function __e(e,t){if(e===dfe.UPLOAD)return hfe.PACKED_2X2_FLOAT32;if(e===dfe.RENDER||null==e)return function(e){return(0,u3.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?hfe.PACKED_2X2_FLOAT32:hfe.UNPACKED_FLOAT32:e?hfe.PACKED_2X2_FLOAT16:hfe.UNPACKED_FLOAT16}(t);if(e===dfe.DOWNLOAD||e===dfe.PIXELS)return hfe.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function y_e(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`} +class v_e{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,n){const i=T_e(t,n),r=x_e(e,i,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const s=b_e(e,i,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let o;return i===gfe.PACKED_2X2_FLOAT32?o=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):i===gfe.PACKED_2X2_FLOAT16?o=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):i===gfe.UNPACKED_FLOAT32?o=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):i===gfe.UNPACKED_FLOAT16?o=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):i===gfe.PACKED_4X1_UNSIGNED_BYTE&&(o=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(o),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),o}releaseTexture(e,t,n,i){if(null==this.freeTextures)return;const r=T_e(n,i),s=x_e(t,r,i);s in this.freeTextures||(this.freeTextures[s]=[]);const o=b_e(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,i),a=(0,p3.env)().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==a&&this._numBytesAllocated>a?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=o):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=o),this.numUsedTextures--;const l=this.usedTextures[s],u=l&&l.indexOf(e);if(null==u||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});for(const e in this.usedTextures)this.usedTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function b_e(e,t,n,i,r){const s=function(e,t){switch(e){case gfe.PACKED_2X2_FLOAT32:return age(t);case gfe.PACKED_2X2_FLOAT16:return uge(t);case gfe.UNPACKED_FLOAT32:return tge(t);case gfe.UNPACKED_FLOAT16:return ige(t);case gfe.PACKED_4X1_UNSIGNED_BYTE:return sge(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,i);let o;if(r){const[t,n]=vfe(e[0],e[1]);o=t*n}else{const[t,n]=_fe(e[0],e[1]);o=t*n}const a=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;if(t===n.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(n,s);return o*a}function T_e(e,t){if(e===mfe.UPLOAD)return gfe.PACKED_2X2_FLOAT32;if(e===mfe.RENDER||null==e)return function(e){return(0,p3.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?gfe.PACKED_2X2_FLOAT32:gfe.UNPACKED_FLOAT32:e?gfe.PACKED_2X2_FLOAT16:gfe.UNPACKED_FLOAT16}(t);if(e===mfe.DOWNLOAD||e===mfe.PIXELS)return gfe.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function x_e(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`} /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15167,7 +15167,7 @@ class m_e{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTexture * limitations under the License. * ============================================================================= */ -class v_e{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const b_e="if (isnan(x)) return x;",T_e="return abs(x);";const x_e=b_e+"\n return (x < 0.0) ? 0.0 : x;\n",E_e=b_e+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",w_e="return x;";class I_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}} +class E_e{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=jme(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const w_e="if (isnan(x)) return x;",I_e="return abs(x);";const A_e=w_e+"\n return (x < 0.0) ? 0.0 : x;\n",S_e=w_e+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",C_e="return x;";class O_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=jme(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15184,7 +15184,7 @@ class v_e{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enab * limitations under the License. * ============================================================================= */ -class A_e{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=$me(this.outputShape.length);const t=e.length,n=h_e("rc",t),i=Nme(t),r=function(e,t){if(1===e)return"rc";let n="";for(let i=0;it.push(e))}const t=this.texData.get(e),{values:n,shape:i,slice:r,dtype:s,complexTensorInfos:o,isPacked:a}=t;if(null!=r){let t;t=a?new I_e(i,w_e):new v_e(i,w_e);const n=this.runWebGLProgram(t,[{dataId:e,shape:i,dtype:s}],s),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if((0,u3.env)().getBool("DEBUG")&&!(0,u3.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===(0,u3.env)().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,c=null;if("complex64"!==s&&(0,u3.env)().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...ffe(i))}if(this.pendingRead.set(e,[]),"complex64"!==s&&await this.gpgpu.createAndWaitForFence(),"complex64"===s){const e=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]),t=e[0],n=e[1];u=u3.backend_util.mergeRealAndImagArrays(t,n)}else if(null==c)u=this.getValuesFromTexture(e);else{const e=u3.util.sizeFromShape(i);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;_fe(e,()=>e.deleteBuffer(c))}const d=this.convertAndCacheOnCPU(e,u),h=this.pendingRead.get(e);return this.pendingRead.delete(e),h.forEach(e=>e(d)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&(0,u3.engine)().removeDataId(e,this),this.pendingDeletes--),d}readToGPU(e,t={}){const n=this.texData.get(e),{values:i,shape:r,slice:s,dtype:o,isPacked:a,texture:l}=n;if("complex64"===o)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=s){let n;n=a?new I_e(r,w_e):new v_e(r,w_e);const i=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:o}],o),s=this.readToGPU(i,t);return this.disposeIntermediateTensorInfo(i),s}if(null==l)throw null!=i?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const u=this.decode(e,t.customTexShape),c=(0,u3.engine)().makeTensorFromTensorInfo(u),d=this.texData.get(u.dataId);return Object.assign({tensorRef:c},d.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map(e=>u3.util.decodeString(e));return(0,u3.buffer)(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,u3.buffer)(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){const t=this.activeTimers,n=[];let i=!1;null==this.programTimersStack?(this.programTimersStack=n,i=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=u3.util.flatten(this.activeTimers.map(e=>e.query)).filter(e=>null!=e),s=u3.util.flatten(this.activeTimers.map(e=>e.name)).filter(e=>null!=e);this.activeTimers=t,i&&(this.programTimersStack=null);const o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if((0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);o.kernelMs=u3.util.sum(e),o.getExtraProfileInfo=()=>e.map((e,t)=>({name:s[t],ms:e})).map(e=>`${e.name}: ${e.ms}`).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:u3.util.now(),endMs:null}}endTimer(e){return(0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=u3.util.now(),e)}async getQueryTime(e){if((0,u3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:i,usage:r,isPacked:s,slice:o}=this.texData.get(e),a=o&&o.origDataId||e,l=this.dataRefCount.get(a);l>1?this.dataRefCount.set(a,l-1):(this.dataRefCount.delete(a),null!=t&&(this.numBytesInGPU-=this.computeBytes(i,n),this.textureManager.releaseTexture(t,i,r,s)));const u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=O_e){return(0,u3.env)().getBool("WEBGL_CPU_FORWARD")&&e.every(e=>null==this.texData.get(e.dataId).texture&&u3.util.sizeFromShape(e.shape)0&&u3.util.isString(n[0])){const r=n.map(e=>u3.util.encodeString(e));i=this.write(r,e,t)}else i=this.write(n,e,t);return this.texData.get(i).usage=null,{dataId:i,shape:e,dtype:t}}makeOutput(e,t,n){return(0,u3.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new A_e(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new p_e(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[qfe(e.shape),...Kfe(e.shape)],i={dtype:e.dtype,shape:n,dataId:e.dataId},r=[qfe(t),...Kfe(t)],s=new f_e(r,n),o=[n],a=this.runWebGLProgram(s,[i],e.dtype,o,!0);return{dataId:a.dataId,shape:t,dtype:a.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:i,shape:r,dtype:s}=n;if(null!=t){const e=u3.util.sizeFromShape(r),n=t[0]*t[1]*4;u3.util.assert(e<=n,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}const o=Zfe(r);let a;a=i?new Vme(o):new Ume(o);const l=[null!=t?t:ffe(o)];return{dtype:s,shape:r,dataId:this.runWebGLProgram(a,[{shape:o,dtype:s,dataId:e}],s,l,!0,t).dataId}}runWebGLProgram(e,t,n,i,r=!1,s){const o=this.makeTensorInfo(e.outputShape,n),a=this.texData.get(o.dataId);if(e.packedOutput&&(a.isPacked=!0),e.outPackingScheme===cfe.DENSE){const t=null!=s?s:ffe(e.outputShape);a.texShape=t.map(e=>2*e)}if(null!=e.outTexUsage&&(a.usage=e.outTexUsage),0===u3.util.sizeFromShape(o.shape))return a.values=u3.util.getTypedArrayFromDType(o.dtype,0),o;const l=[],u=t.map(t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&u3.util.sizeFromShape(t.shape)<=(0,u3.env)().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!eme(n.shape,t.shape)){const e=t,i=t.shape;t.shape=n.shape,t=this.packedReshape(t,i),l.push(t),n=this.texData.get(t.dataId),e.shape=i}return{shape:t.shape,texData:n,isUniform:!1}});this.uploadToGPU(o.dataId);const c={shape:o.shape,texData:a,isUniform:!1},d=function(e,t,n){let i="";t.concat(n).forEach(t=>{const r=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const s=t.texData.texShape,{useSqueezeShape:o,uniformShape:a,keptDims:l}=Dme(e.packedInputs,t.shape,s);let u="",c="",d="";if(1===a.length&&e.packedInputs){const e=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==a.length||e.packedInputs){if(a.length>2&&!e.packedInputs){const e=u3.util.computeStrides(a);d=`${e[0]===s[1]}_${e[e.length-1]===s[1]}`}}else c=`${a[0]>1}_${a[1]>1}`;const h=t.shape.length,p=2===a.length&&u3.util.arraysEqual(t.shape,s),f=1===u3.util.sizeFromShape(t.shape),m=u3.backend_util.getBroadcastDims(t.shape,n.shape),g=!e.packedInputs&&h===n.shape.length&&u3.util.arraysEqual(s,n.texData.texShape),_=e.packedInputs||a.length>2?"":`${s[0]>1}_${s[1]>1}`;i+=`${h}_${g}_${o?l:""}_${a.length}_${f}_${m}_${p}_${u}_${c}_${d}_${_}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;i+=`${t.shape}_${e}_${r}`}});const r=e.userCode;let s=e.constructor.name;return s+="_"+i+"_"+r+`${(0,u3.env)().getNumber("WEBGL_VERSION")}`,s}(e,u,c),h=this.getAndSaveBinary(d,()=> +const k_e=p3.kernel_impls.whereImpl,R_e={};const N_e=(0,p3.env)().getNumber("CPU_HANDOFF_SIZE_THRESHOLD");class D_e extends p3.KernelBackend{nextDataId(){return D_e.nextDataId++}constructor(e){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!(0,p3.env)().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let t;if(null!=e){if(e instanceof vge)t=e;else{const n=pfe((0,p3.env)().getNumber("WEBGL_VERSION"),e);t=new vge(n)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{const e=pfe((0,p3.env)().getNumber("WEBGL_VERSION"));t=new vge(e),this.binaryCache=((n=(0,p3.env)().getNumber("WEBGL_VERSION"))in R_e||(R_e[n]={}),R_e[n]),this.gpgpuCreatedLocally=!0}var n;this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new v_e(this.gpgpu),this.numMBBeforeWarning=null==(0,p3.env)().global.screen?1024:(0,p3.env)().global.screen.height*(0,p3.env)().global.screen.width*window.devicePixelRatio*600/1024/1024,this.texData=new p3.DataStorage(this,(0,p3.engine)())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,t,n,i,r,s){const o=this.makeTensorInfo(t,n),a=this.texData.get(o.dataId);a.isPacked=!1,a.texture={texture:e,texShape:[i,r]},a.texShape=[i,r];const l=tme(t),u=new qme(l,!1,s),c=this.runWebGLProgram(u,[o],n,[[i,r]]);return c.shape=t,a.texture=null,this.disposeIntermediateTensorInfo(o),c.dataId}write(e,t,n){if(((0,p3.env)().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||(0,p3.env)().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===n&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const i={id:this.nextDataId()};return this.texData.set(i,{shape:t,dtype:n,values:e,usage:mfe.UPLOAD,refCount:1}),i}refCount(e){if(this.texData.has(e)){return this.texData.get(e).refCount}return 0}incRef(e){this.texData.get(e).refCount++}decRef(e){if(this.texData.has(e)){this.texData.get(e).refCount--}}move(e,t,n,i,r){if((0,p3.env)().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===i)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:i,values:t,usage:mfe.UPLOAD,refCount:r})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){const t=this.texData.get(e),{values:n,dtype:i,complexTensorInfos:r,slice:s,shape:o,isPacked:a}=t;if(null!=s){let t;t=a?new O_e(o,C_e):new E_e(o,C_e);const n=this.runWebGLProgram(t,[{dataId:e,shape:o,dtype:i}],i),r=this.readSync(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===i)return n;const l=null!=this.activeTimers;let u,c;if(l&&(u=p3.util.now()),"complex64"===i){const e=this.readSync(r.real.dataId),t=this.readSync(r.imag.dataId);c=p3.backend_util.mergeRealAndImagArrays(e,t)}else c=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=p3.util.now()-u),this.convertAndCacheOnCPU(e,c)}async read(e){if(this.pendingRead.has(e)){const t=this.pendingRead.get(e);return new Promise(e=>t.push(e))}const t=this.texData.get(e),{values:n,shape:i,slice:r,dtype:s,complexTensorInfos:o,isPacked:a}=t;if(null!=r){let t;t=a?new O_e(i,C_e):new E_e(i,C_e);const n=this.runWebGLProgram(t,[{dataId:e,shape:i,dtype:s}],s),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if((0,p3.env)().getBool("DEBUG")&&!(0,p3.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===(0,p3.env)().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,c=null;if("complex64"!==s&&(0,p3.env)().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...yfe(i))}if(this.pendingRead.set(e,[]),"complex64"!==s&&await this.gpgpu.createAndWaitForFence(),"complex64"===s){const e=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]),t=e[0],n=e[1];u=p3.backend_util.mergeRealAndImagArrays(t,n)}else if(null==c)u=this.getValuesFromTexture(e);else{const e=p3.util.sizeFromShape(i);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;Tfe(e,()=>e.deleteBuffer(c))}const d=this.convertAndCacheOnCPU(e,u),h=this.pendingRead.get(e);return this.pendingRead.delete(e),h.forEach(e=>e(d)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&(0,p3.engine)().removeDataId(e,this),this.pendingDeletes--),d}readToGPU(e,t={}){const n=this.texData.get(e),{values:i,shape:r,slice:s,dtype:o,isPacked:a,texture:l}=n;if("complex64"===o)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=s){let n;n=a?new O_e(r,C_e):new E_e(r,C_e);const i=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:o}],o),s=this.readToGPU(i,t);return this.disposeIntermediateTensorInfo(i),s}if(null==l)throw null!=i?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const u=this.decode(e,t.customTexShape),c=(0,p3.engine)().makeTensorFromTensorInfo(u),d=this.texData.get(u.dataId);return Object.assign({tensorRef:c},d.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map(e=>p3.util.decodeString(e));return(0,p3.buffer)(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,p3.buffer)(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){const t=this.activeTimers,n=[];let i=!1;null==this.programTimersStack?(this.programTimersStack=n,i=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=p3.util.flatten(this.activeTimers.map(e=>e.query)).filter(e=>null!=e),s=p3.util.flatten(this.activeTimers.map(e=>e.name)).filter(e=>null!=e);this.activeTimers=t,i&&(this.programTimersStack=null);const o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if((0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);o.kernelMs=p3.util.sum(e),o.getExtraProfileInfo=()=>e.map((e,t)=>({name:s[t],ms:e})).map(e=>`${e.name}: ${e.ms}`).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:p3.util.now(),endMs:null}}endTimer(e){return(0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=p3.util.now(),e)}async getQueryTime(e){if((0,p3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:i,usage:r,isPacked:s,slice:o}=this.texData.get(e),a=o&&o.origDataId||e,l=this.dataRefCount.get(a);l>1?this.dataRefCount.set(a,l-1):(this.dataRefCount.delete(a),null!=t&&(this.numBytesInGPU-=this.computeBytes(i,n),this.textureManager.releaseTexture(t,i,r,s)));const u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=N_e){return(0,p3.env)().getBool("WEBGL_CPU_FORWARD")&&e.every(e=>null==this.texData.get(e.dataId).texture&&p3.util.sizeFromShape(e.shape)0&&p3.util.isString(n[0])){const r=n.map(e=>p3.util.encodeString(e));i=this.write(r,e,t)}else i=this.write(n,e,t);return this.texData.get(i).usage=null,{dataId:i,shape:e,dtype:t}}makeOutput(e,t,n){return(0,p3.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new M_e(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new __e(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[Jfe(e.shape),...eme(e.shape)],i={dtype:e.dtype,shape:n,dataId:e.dataId},r=[Jfe(t),...eme(t)],s=new y_e(r,n),o=[n],a=this.runWebGLProgram(s,[i],e.dtype,o,!0);return{dataId:a.dataId,shape:t,dtype:a.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:i,shape:r,dtype:s}=n;if(null!=t){const e=p3.util.sizeFromShape(r),n=t[0]*t[1]*4;p3.util.assert(e<=n,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}const o=tme(r);let a;a=i?new Gme(o):new Yme(o);const l=[null!=t?t:yfe(o)];return{dtype:s,shape:r,dataId:this.runWebGLProgram(a,[{shape:o,dtype:s,dataId:e}],s,l,!0,t).dataId}}runWebGLProgram(e,t,n,i,r=!1,s){const o=this.makeTensorInfo(e.outputShape,n),a=this.texData.get(o.dataId);if(e.packedOutput&&(a.isPacked=!0),e.outPackingScheme===ffe.DENSE){const t=null!=s?s:yfe(e.outputShape);a.texShape=t.map(e=>2*e)}if(null!=e.outTexUsage&&(a.usage=e.outTexUsage),0===p3.util.sizeFromShape(o.shape))return a.values=p3.util.getTypedArrayFromDType(o.dtype,0),o;const l=[],u=t.map(t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&p3.util.sizeFromShape(t.shape)<=(0,p3.env)().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!rme(n.shape,t.shape)){const e=t,i=t.shape;t.shape=n.shape,t=this.packedReshape(t,i),l.push(t),n=this.texData.get(t.dataId),e.shape=i}return{shape:t.shape,texData:n,isUniform:!1}});this.uploadToGPU(o.dataId);const c={shape:o.shape,texData:a,isUniform:!1},d=function(e,t,n){let i="";t.concat(n).forEach(t=>{const r=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const s=t.texData.texShape,{useSqueezeShape:o,uniformShape:a,keptDims:l}=Bme(e.packedInputs,t.shape,s);let u="",c="",d="";if(1===a.length&&e.packedInputs){const e=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==a.length||e.packedInputs){if(a.length>2&&!e.packedInputs){const e=p3.util.computeStrides(a);d=`${e[0]===s[1]}_${e[e.length-1]===s[1]}`}}else c=`${a[0]>1}_${a[1]>1}`;const h=t.shape.length,p=2===a.length&&p3.util.arraysEqual(t.shape,s),f=1===p3.util.sizeFromShape(t.shape),m=p3.backend_util.getBroadcastDims(t.shape,n.shape),g=!e.packedInputs&&h===n.shape.length&&p3.util.arraysEqual(s,n.texData.texShape),_=e.packedInputs||a.length>2?"":`${s[0]>1}_${s[1]>1}`;i+=`${h}_${g}_${o?l:""}_${a.length}_${f}_${m}_${p}_${u}_${c}_${d}_${_}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;i+=`${t.shape}_${e}_${r}`}});const r=e.userCode;let s=e.constructor.name;return s+="_"+i+"_"+r+`${(0,p3.env)().getNumber("WEBGL_VERSION")}`,s}(e,u,c),h=this.getAndSaveBinary(d,()=> /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15218,9 +15218,9 @@ const S_e=u3.kernel_impls.whereImpl,C_e={};const O_e=(0,u3.env)().getNumber("CPU * limitations under the License. * ============================================================================= */ -function(e,t,n,i){const r=n.map((e,n)=>{const i={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(i.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:i}}),s=r.map(e=>e.shapeInfo),o={logicalShape:i.shape,texShape:i.texData.texShape,isUniform:!1,isPacked:i.texData.isPacked,flatOffset:null},a=Eme(r,o,t),l=wfe(e.gl,a),u=e.createProgram(l);return(0,u3.env)().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:a,webGLProgram:u,inShapeInfos:s,outShapeInfo:o,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:a,webGLProgram:u,inShapeInfos:s,outShapeInfo:o},Pme(e,t,u)))}(this.gpgpu,e,u,c)),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),(0,u3.env)().get("ENGINE_COMPILE_ONLY")||function(e,t,n,i,r){t.program.enableShapeUniforms||(Bme(t.inShapeInfos,n),Bme([t.outShapeInfo],[i]));const s=i.texData.texture,o=i.texData.texShape;i.texData.isPacked?e.setOutputPackedMatrixTexture(s.texture,o[0],o[1]):e.setOutputMatrixTexture(s.texture,o[0],o[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===(0,u3.env)().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let i=0;ithis.disposeIntermediateTensorInfo(e)),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=(0,u3.env)().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=u3.util.now();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!(0,u3.env)().getBool("WEBGL_LAZILY_UNPACK")&&a.isPacked&&!1===r){const e=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),e}return o}compileAndRun(e,t,n,i,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,i,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!(0,u3.env)().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]})}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=(0,u3.tidy)(()=>{if(!(0,u3.env)().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=(0,u3.env)().getBool("DEBUG");(0,u3.env)().set("DEBUG",!1);const t=this.abs((0,u3.scalar)(1e-8)).dataSync()[0];if((0,u3.env)().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:i,values:r,texture:s,usage:o,isPacked:a}=t;if(null!=s)return;const l=null!=this.activeTimers;let u;l&&(u=u3.util.now());let c=t.texShape;if(null==c&&(c=Qfe(n,a),t.texShape=c),null!=r){const e=Zfe(n);let s,o=c[1],d=c[0];const h=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!a&&h||([o,d]=mfe(c[0],c[1])),s=a?new Hme(e,h):new Gme(e,h);const p=h?[d,o]:c,f=this.makeTensorInfo(p,i),m=this.texData.get(f.dataId);m.usage=h?dfe.PIXELS:dfe.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),o,d,r);const g=[[d,o]],_=!0,y=this.runWebGLProgram(s,[f],i,g,_),v=this.texData.get(y.dataId);t.texShape=v.texShape,t.isPacked=v.isPacked,t.usage=v.usage,(0,u3.env)().get("ENGINE_COMPILE_ONLY")?this.disposeData(y.dataId):(t.texture=v.texture,t.values=null,this.texData.delete(y.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=u3.util.now()-u)}else{const e=this.acquireTexture(c,o,i,a);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:i}=n;return null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1024*this.numMBBeforeWarning*1024){const e=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${e} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,i)}computeBytes(e,t){return e[0]*e[1]*u3.util.bytesPerElement(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}for(const[,t]of Object.entries(this.binaryCache)){const n=new Promise(e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}});e.push(n)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await(0,u3.nextFrame)(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw Afe(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.");throw new Error("Failed to link vertex and fragment shaders.")}return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:n,infLoc:i,nanLoc:r,outShapeLocation:s,outShapeStridesLocation:o,outTexShapeLocation:a}=Pme(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=i,e.nanLoc=r,e.outShapeLocation=s,e.outShapeStridesLocation=o,e.outTexShapeLocation=a}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:i,height:r,width:s,channels:o}=e,a=(0,u3.engine)().backend;if(!a.gpgpu.gl.isTexture(i))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=a.writeTexture(i,t,n,r,s,o);return(0,u3.engine)().makeTensorFromDataId(l,t,n,a)}}M_e.nextDataId=0; +function(e,t,n,i){const r=n.map((e,n)=>{const i={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(i.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:i}}),s=r.map(e=>e.shapeInfo),o={logicalShape:i.shape,texShape:i.texData.texShape,isUniform:!1,isPacked:i.texData.isPacked,flatOffset:null},a=Sme(r,o,t),l=Cfe(e.gl,a),u=e.createProgram(l);return(0,p3.env)().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:a,webGLProgram:u,inShapeInfos:s,outShapeInfo:o,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:a,webGLProgram:u,inShapeInfos:s,outShapeInfo:o},Vme(e,t,u)))}(this.gpgpu,e,u,c)),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),(0,p3.env)().get("ENGINE_COMPILE_ONLY")||function(e,t,n,i,r){t.program.enableShapeUniforms||(zme(t.inShapeInfos,n),zme([t.outShapeInfo],[i]));const s=i.texData.texture,o=i.texData.texShape;i.texData.isPacked?e.setOutputPackedMatrixTexture(s.texture,o[0],o[1]):e.setOutputMatrixTexture(s.texture,o[0],o[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===(0,p3.env)().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let i=0;ithis.disposeIntermediateTensorInfo(e)),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=(0,p3.env)().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=p3.util.now();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!(0,p3.env)().getBool("WEBGL_LAZILY_UNPACK")&&a.isPacked&&!1===r){const e=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),e}return o}compileAndRun(e,t,n,i,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,i,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!(0,p3.env)().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]})}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=(0,p3.tidy)(()=>{if(!(0,p3.env)().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=(0,p3.env)().getBool("DEBUG");(0,p3.env)().set("DEBUG",!1);const t=this.abs((0,p3.scalar)(1e-8)).dataSync()[0];if((0,p3.env)().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:i,values:r,texture:s,usage:o,isPacked:a}=t;if(null!=s)return;const l=null!=this.activeTimers;let u;l&&(u=p3.util.now());let c=t.texShape;if(null==c&&(c=nme(n,a),t.texShape=c),null!=r){const e=tme(n);let s,o=c[1],d=c[0];const h=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!a&&h||([o,d]=vfe(c[0],c[1])),s=a?new Kme(e,h):new qme(e,h);const p=h?[d,o]:c,f=this.makeTensorInfo(p,i),m=this.texData.get(f.dataId);m.usage=h?mfe.PIXELS:mfe.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),o,d,r);const g=[[d,o]],_=!0,y=this.runWebGLProgram(s,[f],i,g,_),v=this.texData.get(y.dataId);t.texShape=v.texShape,t.isPacked=v.isPacked,t.usage=v.usage,(0,p3.env)().get("ENGINE_COMPILE_ONLY")?this.disposeData(y.dataId):(t.texture=v.texture,t.values=null,this.texData.delete(y.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=p3.util.now()-u)}else{const e=this.acquireTexture(c,o,i,a);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:i}=n;return null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1024*this.numMBBeforeWarning*1024){const e=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${e} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,i)}computeBytes(e,t){return e[0]*e[1]*p3.util.bytesPerElement(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}for(const[,t]of Object.entries(this.binaryCache)){const n=new Promise(e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}});e.push(n)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await(0,p3.nextFrame)(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw Mfe(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.");throw new Error("Failed to link vertex and fragment shaders.")}return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:n,infLoc:i,nanLoc:r,outShapeLocation:s,outShapeStridesLocation:o,outTexShapeLocation:a}=Vme(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=i,e.nanLoc=r,e.outShapeLocation=s,e.outShapeStridesLocation=o,e.outTexShapeLocation=a}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:i,height:r,width:s,channels:o}=e,a=(0,p3.engine)().backend;if(!a.gpgpu.gl.isTexture(i))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=a.writeTexture(i,t,n,r,s,o);return(0,p3.engine)().makeTensorFromDataId(l,t,n,a)}}D_e.nextDataId=0; /** @license See the LICENSE file. */ -const k_e="4.22.0"; +const F_e="4.22.0"; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -15237,7 +15237,7 @@ const k_e="4.22.0"; * limitations under the License. * ============================================================================= */ -function R_e(){(0,u3.env)().set("WEBGL_FORCE_F16_TEXTURES",!0)} +function L_e(){(0,p3.env)().set("WEBGL_FORCE_F16_TEXTURES",!0)} /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -15254,7 +15254,7 @@ function R_e(){(0,u3.env)().set("WEBGL_FORCE_F16_TEXTURES",!0)} * limitations under the License. * ============================================================================= */ -u3.device_util.isBrowser()&&(0,u3.registerBackend)("webgl",()=>new M_e,2);const N_e={forceHalfFloat:R_e},D_e="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class F_e{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=u3.backend_util.assertAndGetBroadcastShape(t,n),this.enableShapeUniforms=$me(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}} +p3.device_util.isBrowser()&&(0,p3.registerBackend)("webgl",()=>new D_e,2);const P_e={forceHalfFloat:L_e},B_e="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class $_e{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=p3.backend_util.assertAndGetBroadcastShape(t,n),this.enableShapeUniforms=jme(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15271,7 +15271,7 @@ u3.device_util.isBrowser()&&(0,u3.registerBackend)("webgl",()=>new M_e,2);const * limitations under the License. * ============================================================================= */ -const L_e="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n";class P_e{constructor(e,t,n,i=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=u3.backend_util.assertAndGetBroadcastShape(t,n);const r=this.outputShape.length;this.enableShapeUniforms=$me(r);let s="";if(i)if(0===r||1===u3.util.sizeFromShape(this.outputShape))s="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(s=`\n ${Nme(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?s+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":s+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=h_e("coords",r);this.enableShapeUniforms?s+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= outShape[${r} - 2];\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= outShape[${r} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:s+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= ${this.outputShape[r-2]};\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= ${this.outputShape[r-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${s}\n\n setOutput(result);\n }\n `}} +const U_e="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n";class V_e{constructor(e,t,n,i=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=p3.backend_util.assertAndGetBroadcastShape(t,n);const r=this.outputShape.length;this.enableShapeUniforms=jme(r);let s="";if(i)if(0===r||1===p3.util.sizeFromShape(this.outputShape))s="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(s=`\n ${Pme(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?s+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":s+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=g_e("coords",r);this.enableShapeUniforms?s+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= outShape[${r} - 2];\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= outShape[${r} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:s+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= ${this.outputShape[r-2]};\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= ${this.outputShape[r-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${s}\n\n setOutput(result);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15288,7 +15288,7 @@ const L_e="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN * limitations under the License. * ============================================================================= */ -function B_e(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}const $_e={kernelName:u3.Identity,backendName:"webgl",kernelFunc:B_e}; +function z_e(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}const j_e={kernelName:p3.Identity,backendName:"webgl",kernelFunc:z_e}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15305,7 +15305,7 @@ function B_e(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{d * limitations under the License. * ============================================================================= */ -function U_e(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.makeTensorInfo(i.shape,"complex64"),o=n.texData.get(s.dataId),a=B_e({inputs:{x:i},backend:n}),l=B_e({inputs:{x:r},backend:n});return o.complexTensorInfos={real:a,imag:l},s}const V_e={kernelName:u3.Complex,backendName:"webgl",kernelFunc:U_e},z_e="return (a < 0.) ? b * a : a;",j_e="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const Y_e={kernelName:u3.LeakyRelu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i,o=n.makeTensorInfo([],"float32",u3.util.createScalarValue(s,"float32")),a=(0,u3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new P_e(j_e,r.shape,o.shape):new F_e(z_e,r.shape,o.shape),l=n.runWebGLProgram(a,[r,o],"float32");return n.disposeIntermediateTensorInfo(o),l}},G_e="return (a < 0.) ? b * a : a;",H_e="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const W_e={kernelName:u3.Prelu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i,alpha:r}=t,s=(0,u3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new P_e(H_e,i.shape,r.shape):new F_e(G_e,i.shape,r.shape);return n.runWebGLProgram(s,[i,r],"float32")}},X_e="if (isnan(x)) return x;";function q_e({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:i}){return({inputs:r,backend:s})=>{const{x:o}=r,a=s,l=i||o.dtype;if(a.shouldExecuteOnCPU([o])&&null!=n){const e=a.texData.get(o.dataId),t=n(e.values,l);return a.makeTensorInfo(o.shape,l,t)}let u;return u=(0,u3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new I_e(o.shape,t):new v_e(o.shape,e),a.runWebGLProgram(u,[o],l)}}function K_e({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:i=!1,cpuKernelImpl:r,dtype:s}){return({inputs:o,backend:a})=>{const{a:l,b:u}=o,c=a;if(i&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[i,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map(t=>{const[n,i]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},s={dataId:i.dataId,dtype:i.dtype,shape:u.shape},o=new F_e(e,l.shape,u.shape);return c.runWebGLProgram(o,[r,s],(0,u3.upcastType)(n.dtype,i.dtype))}),s=U_e({inputs:{real:i,imag:r},backend:c});return c.disposeIntermediateTensorInfo(i),c.disposeIntermediateTensorInfo(r),s}const d=s||(0,u3.upcastType)(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||c.shouldExecuteOnCPU([l,u]))&&null!=r){const e=c.texData.get(l.dataId).values,t=c.texData.get(u.dataId).values,n="string"===l.dtype?u3.backend_util.fromUint8ToStringArray(e):e,i="string"===l.dtype?u3.backend_util.fromUint8ToStringArray(t):t,[s,o]=r(l.shape,u.shape,n,i,d),a=c.makeTensorInfo(o,d);return c.texData.get(a.dataId).values=s,a}let h;return h=(0,u3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new P_e(t,l.shape,u.shape,n):new F_e(e,l.shape,u.shape),c.runWebGLProgram(h,[l,u],d)}}function Z_e(e,t=!1){if("linear"===e)return"return x;";if("relu"===e)return t?"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n":x_e;if("elu"===e)return t?"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n":"return (x >= 0.0) ? x : (exp(x) - 1.0);";if("relu6"===e)return t?"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n":E_e;if("prelu"===e)return t?H_e:G_e;if("leakyrelu"===e)return t?j_e:z_e;if("sigmoid"===e)return"return 1.0 / (1.0 + exp(-1.0 * x));";throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)} +function Y_e(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.makeTensorInfo(i.shape,"complex64"),o=n.texData.get(s.dataId),a=z_e({inputs:{x:i},backend:n}),l=z_e({inputs:{x:r},backend:n});return o.complexTensorInfos={real:a,imag:l},s}const G_e={kernelName:p3.Complex,backendName:"webgl",kernelFunc:Y_e},H_e="return (a < 0.) ? b * a : a;",W_e="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const X_e={kernelName:p3.LeakyRelu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i,o=n.makeTensorInfo([],"float32",p3.util.createScalarValue(s,"float32")),a=(0,p3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new V_e(W_e,r.shape,o.shape):new $_e(H_e,r.shape,o.shape),l=n.runWebGLProgram(a,[r,o],"float32");return n.disposeIntermediateTensorInfo(o),l}},q_e="return (a < 0.) ? b * a : a;",K_e="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const Z_e={kernelName:p3.Prelu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i,alpha:r}=t,s=(0,p3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new V_e(K_e,i.shape,r.shape):new $_e(q_e,i.shape,r.shape);return n.runWebGLProgram(s,[i,r],"float32")}},Q_e="if (isnan(x)) return x;";function J_e({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:i}){return({inputs:r,backend:s})=>{const{x:o}=r,a=s,l=i||o.dtype;if(a.shouldExecuteOnCPU([o])&&null!=n){const e=a.texData.get(o.dataId),t=n(e.values,l);return a.makeTensorInfo(o.shape,l,t)}let u;return u=(0,p3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new O_e(o.shape,t):new E_e(o.shape,e),a.runWebGLProgram(u,[o],l)}}function eye({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:i=!1,cpuKernelImpl:r,dtype:s}){return({inputs:o,backend:a})=>{const{a:l,b:u}=o,c=a;if(i&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[i,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map(t=>{const[n,i]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},s={dataId:i.dataId,dtype:i.dtype,shape:u.shape},o=new $_e(e,l.shape,u.shape);return c.runWebGLProgram(o,[r,s],(0,p3.upcastType)(n.dtype,i.dtype))}),s=Y_e({inputs:{real:i,imag:r},backend:c});return c.disposeIntermediateTensorInfo(i),c.disposeIntermediateTensorInfo(r),s}const d=s||(0,p3.upcastType)(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||c.shouldExecuteOnCPU([l,u]))&&null!=r){const e=c.texData.get(l.dataId).values,t=c.texData.get(u.dataId).values,n="string"===l.dtype?p3.backend_util.fromUint8ToStringArray(e):e,i="string"===l.dtype?p3.backend_util.fromUint8ToStringArray(t):t,[s,o]=r(l.shape,u.shape,n,i,d),a=c.makeTensorInfo(o,d);return c.texData.get(a.dataId).values=s,a}let h;return h=(0,p3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new V_e(t,l.shape,u.shape,n):new $_e(e,l.shape,u.shape),c.runWebGLProgram(h,[l,u],d)}}function tye(e,t=!1){if("linear"===e)return"return x;";if("relu"===e)return t?"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n":A_e;if("elu"===e)return t?"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n":"return (x >= 0.0) ? x : (exp(x) - 1.0);";if("relu6"===e)return t?"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n":S_e;if("prelu"===e)return t?K_e:q_e;if("leakyrelu"===e)return t?W_e:H_e;if("sigmoid"===e)return"return 1.0 / (1.0 + exp(-1.0 * x));";throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15322,7 +15322,7 @@ function U_e(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.makeTensorInfo * limitations under the License. * ============================================================================= */ -class Q_e{constructor(e,t,n,i=!1,r=!1,s=!1,o=null,a=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=$me(this.outputShape.length);const u=i?e[1]:e[2],c=Math.ceil(u/2),d=i?"i * 2, rc.y":"rc.y, i * 2",h=r?"rc.z, i * 2":"i * 2, rc.z",p=i?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";o&&(m=a?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${o}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${o}\n }`:`vec4 activation(vec4 x) {\n ${o}\n }`,g="result = activation(result);");const _=s?"result += getBiasAtOutCoords();":"";s&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let y="rc.x",v="rc.x";e[0]`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`);const c=o.texData.get(r.dataId);return!c.isPacked||eme(r.shape,l)||null!==c.texture&&eme(c.shape,l)?(o.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}): +function uye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=n,a=p3.util.sizeFromShape(r.shape),l=p3.util.inferFromImplicitShape(s,a),u=p3.util.sizeFromShape(l);p3.util.assert(a===u,()=>`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`);const c=o.texData.get(r.dataId);return!c.isPacked||rme(r.shape,l)||null!==c.texture&&rme(c.shape,l)?(o.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}): /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15390,7 +15390,7 @@ function sye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=n,a=u3 * limitations under the License. * ============================================================================= */ -function(e,t,n){const i=[qfe(e.shape),...Kfe(e.shape)],r={dtype:e.dtype,shape:i,dataId:e.dataId},s=[qfe(t),...Kfe(t)],o=new f_e(s,i),a=[i],l=n.runWebGLProgram(o,[r],e.dtype,a,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,o)}const oye={kernelName:u3.Reshape,backendName:"webgl",kernelFunc:sye}; +function(e,t,n){const i=[Jfe(e.shape),...eme(e.shape)],r={dtype:e.dtype,shape:i,dataId:e.dataId},s=[Jfe(t),...eme(t)],o=new y_e(s,i),a=[i],l=n.runWebGLProgram(o,[r],e.dtype,a,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,o)}const cye={kernelName:p3.Reshape,backendName:"webgl",kernelFunc:uye}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15407,7 +15407,7 @@ function(e,t,n){const i=[qfe(e.shape),...Kfe(e.shape)],r={dtype:e.dtype,shape:i, * limitations under the License. * ============================================================================= */ -class aye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:i,inSize:r,outSize:s}=e;this.outputShape=[i,s];const o=4*Math.floor(n/4),a=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${u3.util.isInt(e)?e.toPrecision(2):e}, ones);`}let u="";r%n>0&&(u=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${u}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${o}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${l}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===a}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===a}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===a}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${l}\n }\n setOutput(sumValue);\n }\n `}} +class dye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:i,inSize:r,outSize:s}=e;this.outputShape=[i,s];const o=4*Math.floor(n/4),a=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${p3.util.isInt(e)?e.toPrecision(2):e}, ones);`}let u="";r%n>0&&(u=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${u}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${o}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${l}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===a}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===a}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===a}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${l}\n }\n setOutput(sumValue);\n }\n `}} /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15424,7 +15424,7 @@ class aye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize * limitations under the License. * ============================================================================= */ -class lye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:i,inSize:r,outSize:s}=e;this.outputShape=[i,s];let o="0.0",a="";"prod"===t?o="1.0":"min"===t?(o="1.0 / 1e-20",a="min"):"max"===t&&(o="-1.0 / 1e-20",a="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let d=`\n if (${"sum"===t}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===t}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${a}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${a}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,h="vec4";"all"===t?(o="1.0",d="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",h="bvec4"):"any"===t&&(o="0.0",d="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",h="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${o};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${o});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${d}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${d}\n } else if (${2===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${d}\n } else if (${3===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${d}\n }\n setOutput(${l});\n }\n `}}function uye(e,t,n,i){const r= +class hye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:i,inSize:r,outSize:s}=e;this.outputShape=[i,s];let o="0.0",a="";"prod"===t?o="1.0":"min"===t?(o="1.0 / 1e-20",a="min"):"max"===t&&(o="-1.0 / 1e-20",a="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let d=`\n if (${"sum"===t}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===t}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${a}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${a}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,h="vec4";"all"===t?(o="1.0",d="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",h="bvec4"):"any"===t&&(o="0.0",d="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",h="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${o};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${o});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${d}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${d}\n } else if (${2===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${d}\n } else if (${3===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${d}\n }\n setOutput(${l});\n }\n `}}function pye(e,t,n,i){const r= /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15441,7 +15441,7 @@ class lye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize * limitations under the License. * ============================================================================= */ -function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const n=t.length?t[t.length-1].outSize:e[1],i=u3.backend_util.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:i,outSize:Math.ceil(n/i)})}return t}(e.shape);let s=e;for(let o=0;o6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],i=new Array(t);for(let t=0;t6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],i=new Array(t);for(let t=0;t6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const i=Nme(this.rank),r=d_e("rc",this.rank),s=new Array(this.rank);for(let e=0;e6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const i=Pme(this.rank),r=m_e("rc",this.rank),s=new Array(this.rank);for(let e=0;e`Error in matMul: inner shapes (${d}) and (${h}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${i} must match.`);const b=n?[_,d,p]:[_,p,d],T=i?[y,f,h]:[y,h,f],x=sye({inputs:{x:e},backend:r,attrs:{shape:b}}),E=sye({inputs:{x:t},backend:r,attrs:{shape:T}}),w=[x,E],I=Math.max(_,y),A=n?x.shape[1]:x.shape[2],S=null!=s,C=null!=o,O="leakyrelu"===l,M=null!=l?Z_e(l,!0):null;let k;if((1===p||1===f)&&A>1e3&&!1===(S||C||O||null!=M)){let e=x,t=E;n&&(e=mye({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),w.push(e)),i&&(t=mye({inputs:{x:E},backend:r,attrs:{perm:[0,2,1]}}),w.push(t));const s=1===f;let o=e;1!==f&&(o=sye({inputs:{x:e},backend:r,attrs:{shape:[I,A,1]}}),w.push(o));const a=1===f?2:1;let l=t;s&&(l=sye({inputs:{x:t},backend:r,attrs:{shape:[I,1,A]}}),w.push(l));const u=iye({inputs:{a:o,b:l},backend:r});k=pye({inputs:{x:u},backend:r,attrs:{axis:a,keepDims:!0}}),w.push(u)}else{const l=(0,u3.upcastType)(e.dtype,t.dtype),u=new Q_e(b,T,[I,p,f],n,i,S,M,C,O),c=[x,E];if(null!=s&&c.push(s),C&&c.push(o),O){const e=r.makeTensorInfo([],"float32",u3.util.createScalarValue(a,"float32"));c.push(e),w.push(e)}k=r.runWebGLProgram(u,c,l)}const R=sye({inputs:{x:k},backend:r,attrs:{shape:v}});w.push(k);for(const e of w)r.disposeIntermediateTensorInfo(e);return R}const yye={kernelName:u3._FusedMatMul,backendName:"webgl",kernelFunc: +function vye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{perm:s}=i,o=n,a=r.shape.length,l=new Array(a);for(let e=0;e`Error in matMul: inner shapes (${d}) and (${h}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${i} must match.`);const b=n?[_,d,p]:[_,p,d],T=i?[y,f,h]:[y,h,f],x=uye({inputs:{x:e},backend:r,attrs:{shape:b}}),E=uye({inputs:{x:t},backend:r,attrs:{shape:T}}),w=[x,E],I=Math.max(_,y),A=n?x.shape[1]:x.shape[2],S=null!=s,C=null!=o,O="leakyrelu"===l,M=null!=l?tye(l,!0):null;let k;if((1===p||1===f)&&A>1e3&&!1===(S||C||O||null!=M)){let e=x,t=E;n&&(e=vye({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),w.push(e)),i&&(t=vye({inputs:{x:E},backend:r,attrs:{perm:[0,2,1]}}),w.push(t));const s=1===f;let o=e;1!==f&&(o=uye({inputs:{x:e},backend:r,attrs:{shape:[I,A,1]}}),w.push(o));const a=1===f?2:1;let l=t;s&&(l=uye({inputs:{x:t},backend:r,attrs:{shape:[I,1,A]}}),w.push(l));const u=aye({inputs:{a:o,b:l},backend:r});k=_ye({inputs:{x:u},backend:r,attrs:{axis:a,keepDims:!0}}),w.push(u)}else{const l=(0,p3.upcastType)(e.dtype,t.dtype),u=new nye(b,T,[I,p,f],n,i,S,M,C,O),c=[x,E];if(null!=s&&c.push(s),C&&c.push(o),O){const e=r.makeTensorInfo([],"float32",p3.util.createScalarValue(a,"float32"));c.push(e),w.push(e)}k=r.runWebGLProgram(u,c,l)}const R=uye({inputs:{x:k},backend:r,attrs:{shape:v}});w.push(k);for(const e of w)r.disposeIntermediateTensorInfo(e);return R}const xye={kernelName:p3._FusedMatMul,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15560,7 +15560,7 @@ function mye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{perm:s}=i,o=n,a=r.s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationWeights:a}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:d}=i;return _ye({a:r,b:s,transposeA:l,transposeB:u,backend:n,bias:o,preluActivationWeights:a,leakyreluAlpha:d,activation:c})}},vye="return abs(x);";const bye={kernelName:u3.Abs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;if(n.shouldExecuteOnCPU([i])&&"complex64"!==i.dtype){const e=n.texData.get(i.dataId),t=qge(e.values);return n.makeTensorInfo(i.shape,i.dtype,t)}let r;return r=(0,u3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new I_e(i.shape,vye):new v_e(i.shape,vye),n.runWebGLProgram(r,[i],i.dtype)}},Tye=q_e({opSnippet:b_e+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),xye={kernelName:u3.Acos,backendName:"webgl",kernelFunc:Tye},Eye=q_e({opSnippet:b_e+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),wye={kernelName:u3.Acosh,backendName:"webgl",kernelFunc:Eye},Iye="return a + b;",Aye=K_e({opSnippet:Iye,packedOpSnippet:Iye,supportsComplex:!0,cpuKernelImpl:gge}),Sye={kernelName:u3.Add,backendName:"webgl",kernelFunc:Aye}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationWeights:a}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:d}=i;return Tye({a:r,b:s,transposeA:l,transposeB:u,backend:n,bias:o,preluActivationWeights:a,leakyreluAlpha:d,activation:c})}},Eye="return abs(x);";const wye={kernelName:p3.Abs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;if(n.shouldExecuteOnCPU([i])&&"complex64"!==i.dtype){const e=n.texData.get(i.dataId),t=Jge(e.values);return n.makeTensorInfo(i.shape,i.dtype,t)}let r;return r=(0,p3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new O_e(i.shape,Eye):new E_e(i.shape,Eye),n.runWebGLProgram(r,[i],i.dtype)}},Iye=J_e({opSnippet:w_e+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),Aye={kernelName:p3.Acos,backendName:"webgl",kernelFunc:Iye},Sye=J_e({opSnippet:w_e+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),Cye={kernelName:p3.Acosh,backendName:"webgl",kernelFunc:Sye},Oye="return a + b;",Mye=eye({opSnippet:Oye,packedOpSnippet:Oye,supportsComplex:!0,cpuKernelImpl:bge}),kye={kernelName:p3.Add,backendName:"webgl",kernelFunc:Mye}; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -15577,7 +15577,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationW * limitations under the License. * ============================================================================= */ -class Cye{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);const n=[];this.variableNames.forEach(e=>{n.push(`float v${e} = get${e}AtOutCoords();`)});const i=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${i};\n setOutput(result);\n }\n `}} +class Rye{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);const n=[];this.variableNames.forEach(e=>{n.push(`float v${e} = get${e}AtOutCoords();`)});const i=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${i};\n setOutput(result);\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -15594,7 +15594,7 @@ class Cye{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableN * limitations under the License. * ============================================================================= */ -class Oye{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);const n=[];this.variableNames.forEach(e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)});const i=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${i};\n setOutput(result);\n }\n `}}const Mye={kernelName:u3.AddN,backendName:"webgl",kernelFunc: +class Nye{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);const n=[];this.variableNames.forEach(e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)});const i=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${i};\n setOutput(result);\n }\n `}}const Dye={kernelName:p3.AddN,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15611,7 +15611,7 @@ class Oye{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedO * limitations under the License. * ============================================================================= */ -function e(t){const{inputs:n,backend:i}=t,r=n;if(1===r.length)return B_e({inputs:{x:r[0]},backend:i});if(r.length>(0,u3.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:i}),s=e({inputs:r.slice(t),backend:i});return e({inputs:[n,s],backend:i})}const s=r.map(e=>e.dtype).reduce((e,t)=>(0,u3.upcastType)(e,t)),o=r.map(e=>e.shape),a=(0,u3.env)().getBool("WEBGL_PACK")?new Oye(r[0].shape,o):new Cye(r[0].shape,o);return i.runWebGLProgram(a,r,s)}};const kye={kernelName:u3.All,backendName:"webgl",kernelFunc: +function e(t){const{inputs:n,backend:i}=t,r=n;if(1===r.length)return z_e({inputs:{x:r[0]},backend:i});if(r.length>(0,p3.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:i}),s=e({inputs:r.slice(t),backend:i});return e({inputs:[n,s],backend:i})}const s=r.map(e=>e.dtype).reduce((e,t)=>(0,p3.upcastType)(e,t)),o=r.map(e=>e.shape),a=(0,p3.env)().getBool("WEBGL_PACK")?new Nye(r[0].shape,o):new Rye(r[0].shape,o);return i.runWebGLProgram(a,r,s)}};const Fye={kernelName:p3.All,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15628,7 +15628,7 @@ function e(t){const{inputs:n,backend:i}=t,r=n;if(1===r.length)return B_e({inputs * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=u3.util.parseAxisParam(s,r.shape);let u=l;const c=u3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=mye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=u3.backend_util.getInnerMostAxes(u.length,a)),u3.backend_util.assertAxesAreInnerMostDims("all",u,a);const[h,p]=u3.backend_util.computeOutAndReduceShapes(d.shape,u),f=sye({inputs:{x:d},backend:n,attrs:{shape:[-1,u3.util.sizeFromShape(p)]}}),m=uye(f,f.dtype,"all",n);let g;if(o){g=sye({inputs:{x:m},backend:n,attrs:{shape:u3.backend_util.expandShapeToKeepDim(h,l)}})}else g=sye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}};const Rye={kernelName:u3.Any,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=p3.util.parseAxisParam(s,r.shape);let u=l;const c=p3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=vye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=p3.backend_util.getInnerMostAxes(u.length,a)),p3.backend_util.assertAxesAreInnerMostDims("all",u,a);const[h,p]=p3.backend_util.computeOutAndReduceShapes(d.shape,u),f=uye({inputs:{x:d},backend:n,attrs:{shape:[-1,p3.util.sizeFromShape(p)]}}),m=pye(f,f.dtype,"all",n);let g;if(o){g=uye({inputs:{x:m},backend:n,attrs:{shape:p3.backend_util.expandShapeToKeepDim(h,l)}})}else g=uye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}};const Lye={kernelName:p3.Any,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15645,7 +15645,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a= * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=u3.util.parseAxisParam(s,r.shape);let u=l;const c=u3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=mye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=u3.backend_util.getInnerMostAxes(u.length,a)),u3.backend_util.assertAxesAreInnerMostDims("any",u,a);const[h,p]=u3.backend_util.computeOutAndReduceShapes(d.shape,u),f=sye({inputs:{x:d},backend:n,attrs:{shape:[-1,u3.util.sizeFromShape(p)]}}),m=uye(f,f.dtype,"any",n);let g;if(o){g=sye({inputs:{x:m},backend:n,attrs:{shape:u3.backend_util.expandShapeToKeepDim(h,l)}})}else g=sye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=p3.util.parseAxisParam(s,r.shape);let u=l;const c=p3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=vye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=p3.backend_util.getInnerMostAxes(u.length,a)),p3.backend_util.assertAxesAreInnerMostDims("any",u,a);const[h,p]=p3.backend_util.computeOutAndReduceShapes(d.shape,u),f=uye({inputs:{x:d},backend:n,attrs:{shape:[-1,p3.util.sizeFromShape(p)]}}),m=pye(f,f.dtype,"any",n);let g;if(o){g=uye({inputs:{x:m},backend:n,attrs:{shape:p3.backend_util.expandShapeToKeepDim(h,l)}})}else g=uye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15662,7 +15662,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a= * limitations under the License. * ============================================================================= */ -class Nye{constructor(e,t,n){this.variableNames=["A"];const{windowSize:i,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];const o="max"===t?">":"<",a=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${i};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${i}; i++) {\n int inIdx = ${a};\n float candidate = getA(batch, inIdx);\n if (candidate ${o} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}} +class Pye{constructor(e,t,n){this.variableNames=["A"];const{windowSize:i,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];const o="max"===t?">":"<",a=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${i};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${i}; i++) {\n int inIdx = ${a};\n float candidate = getA(batch, inIdx);\n if (candidate ${o} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -15679,7 +15679,7 @@ class Nye{constructor(e,t,n){this.variableNames=["A"];const{windowSize:i,batchSi * limitations under the License. * ============================================================================= */ -class Dye{constructor(e,t,n,i){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,u3.util.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);const r=e[e.length-1],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),i||this.variableNames.push("bestIndicesA");const o=this.outputShape,a=o.length,l=Nme(a),u=h_e("coords",a);let c,d;if(1===s){d=a+1;const e=Nme(d);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[a-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[a-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[a-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[a-2]};`}else d=a,c=`\n ${l} sourceLocR = coords;\n ++${u[a-1]};\n ${l} sourceLocG = coords;\n ++${u[a-2]};\n ${l} sourceLocA = coords;\n --${u[a-1]};\n ${l} sourceLocB = coords;\n --${u[a-2]};`;const h=["x","y","z","w","u","v"].slice(0,d),p="."+h[d-1],f=h.map(e=>"int "+e),m=h_e("sourceLocR",d-1).concat("inIdx.r"),g=h_e("sourceLocG",d-1).concat("inIdx.g"),_=h_e("sourceLocB",d-1).concat("inIdx.b"),y=h_e("sourceLocA",d-1).concat("inIdx.a"),v="max"===n?"greaterThan":"lessThan",b=i?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${_.join()}),\n getBestIndicesAChannel(${y.join()})));`,T=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${_.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${y.join()}) : 0.)`,x=i?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${h.join()}),\n vec2(${h.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${h.join()}),\n vec2(${h.slice(-2).join()}));\n }\n ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[a-1]} < ${o[a-1]-1};\n bool hasNextRow = ${u[a-2]} < ${o[a-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p},\n sourceLocB${p}, sourceLocA${p}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${T};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${b}\n vec4 candidate = ${T};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${v}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}} +class Bye{constructor(e,t,n,i){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,p3.util.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);const r=e[e.length-1],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),i||this.variableNames.push("bestIndicesA");const o=this.outputShape,a=o.length,l=Pme(a),u=g_e("coords",a);let c,d;if(1===s){d=a+1;const e=Pme(d);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[a-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[a-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[a-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[a-2]};`}else d=a,c=`\n ${l} sourceLocR = coords;\n ++${u[a-1]};\n ${l} sourceLocG = coords;\n ++${u[a-2]};\n ${l} sourceLocA = coords;\n --${u[a-1]};\n ${l} sourceLocB = coords;\n --${u[a-2]};`;const h=["x","y","z","w","u","v"].slice(0,d),p="."+h[d-1],f=h.map(e=>"int "+e),m=g_e("sourceLocR",d-1).concat("inIdx.r"),g=g_e("sourceLocG",d-1).concat("inIdx.g"),_=g_e("sourceLocB",d-1).concat("inIdx.b"),y=g_e("sourceLocA",d-1).concat("inIdx.a"),v="max"===n?"greaterThan":"lessThan",b=i?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${_.join()}),\n getBestIndicesAChannel(${y.join()})));`,T=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${_.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${y.join()}) : 0.)`,x=i?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${h.join()}),\n vec2(${h.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${h.join()}),\n vec2(${h.slice(-2).join()}));\n }\n ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[a-1]} < ${o[a-1]-1};\n bool hasNextRow = ${u[a-2]} < ${o[a-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p},\n sourceLocB${p}, sourceLocA${p}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${T};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${b}\n vec4 candidate = ${T};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${v}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15696,7 +15696,7 @@ class Dye{constructor(e,t,n,i){this.variableNames=["A"],this.packedInputs=!0,thi * limitations under the License. * ============================================================================= */ -function Fye(e,t,n,i=null){let r=t.shape[0],s=t.shape[1];null!=i&&(r=i.shape[0],s=i.shape[1]);const o=u3.backend_util.computeOptimalWindowSize(s),a={windowSize:o,inSize:s,batchSize:r,outSize:Math.ceil(s/o)},l=new Nye(a,n,null==i),u=[t];null!=i&&u.push(i);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const d=Fye(e,t,n,c);return e.disposeIntermediateTensorInfo(c),d}function Lye(e,t,n,i=null){const r=null!=i?i.shape:t.shape,s=r[r.length-1],o=u3.backend_util.computeOptimalWindowSize(s),a=new Dye(r,o,n,null==i),l=null==i?[t]:[t,i],u=e.runWebGLProgram(a,l,"int32");if(u.shape.length===t.shape.length){const i=Lye(e,t,n,u);return e.disposeIntermediateTensorInfo(u),i}return u}function Pye(e,t,n,i){const r=[n];if(u3.backend_util.assertAxesAreInnerMostDims("arg"+i.charAt(0).toUpperCase()+i.slice(1),r,t.shape.length),!(0,u3.env)().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],s=e.texData.get(t.dataId);let o=t;null!==s&&s.isPacked&&(o=e.unpackTensor(t),n.push(o));const[a,l]=u3.backend_util.computeOutAndReduceShapes(o.shape,r),u=u3.util.sizeFromShape(l),c=sye({inputs:{x:o},backend:e,attrs:{shape:[-1,u]}});n.push(c);const d=Fye(e,c,i);n.push(d);const h=sye({inputs:{x:d},backend:e,attrs:{shape:a}});return n.forEach(t=>e.disposeIntermediateTensorInfo(t)),h}return Lye(e,t,i)}const Bye={kernelName:u3.ArgMax,backendName:"webgl",kernelFunc: +function $ye(e,t,n,i=null){let r=t.shape[0],s=t.shape[1];null!=i&&(r=i.shape[0],s=i.shape[1]);const o=p3.backend_util.computeOptimalWindowSize(s),a={windowSize:o,inSize:s,batchSize:r,outSize:Math.ceil(s/o)},l=new Pye(a,n,null==i),u=[t];null!=i&&u.push(i);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const d=$ye(e,t,n,c);return e.disposeIntermediateTensorInfo(c),d}function Uye(e,t,n,i=null){const r=null!=i?i.shape:t.shape,s=r[r.length-1],o=p3.backend_util.computeOptimalWindowSize(s),a=new Bye(r,o,n,null==i),l=null==i?[t]:[t,i],u=e.runWebGLProgram(a,l,"int32");if(u.shape.length===t.shape.length){const i=Uye(e,t,n,u);return e.disposeIntermediateTensorInfo(u),i}return u}function Vye(e,t,n,i){const r=[n];if(p3.backend_util.assertAxesAreInnerMostDims("arg"+i.charAt(0).toUpperCase()+i.slice(1),r,t.shape.length),!(0,p3.env)().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],s=e.texData.get(t.dataId);let o=t;null!==s&&s.isPacked&&(o=e.unpackTensor(t),n.push(o));const[a,l]=p3.backend_util.computeOutAndReduceShapes(o.shape,r),u=p3.util.sizeFromShape(l),c=uye({inputs:{x:o},backend:e,attrs:{shape:[-1,u]}});n.push(c);const d=$ye(e,c,i);n.push(d);const h=uye({inputs:{x:d},backend:e,attrs:{shape:a}});return n.forEach(t=>e.disposeIntermediateTensorInfo(t)),h}return Uye(e,t,i)}const zye={kernelName:p3.ArgMax,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15713,7 +15713,7 @@ function Fye(e,t,n,i=null){let r=t.shape[0],s=t.shape[1];null!=i&&(r=i.shape[0], * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=u3.util.parseAxisParam(s,r.shape);const a=u3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=mye({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=u3.backend_util.getInnerMostAxes(o.length,l.shape.length)),u3.backend_util.assertAxesAreInnerMostDims("argMax",[o[0]],l.shape.length);const c=Pye(n,l,o[0],"max");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}};const $ye={kernelName:u3.ArgMin,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=p3.util.parseAxisParam(s,r.shape);const a=p3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=vye({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=p3.backend_util.getInnerMostAxes(o.length,l.shape.length)),p3.backend_util.assertAxesAreInnerMostDims("argMax",[o[0]],l.shape.length);const c=Vye(n,l,o[0],"max");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}};const jye={kernelName:p3.ArgMin,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15730,7 +15730,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=u3.util * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=u3.util.parseAxisParam(s,r.shape);const a=u3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=mye({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=u3.backend_util.getInnerMostAxes(o.length,l.shape.length)),u3.backend_util.assertAxesAreInnerMostDims("argMin",[o[0]],l.shape.length);const c=Pye(n,l,o[0],"min");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}},Uye=q_e({opSnippet:b_e+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),Vye={kernelName:u3.Asin,backendName:"webgl",kernelFunc:Uye},zye=q_e({opSnippet:b_e+"return log(x + sqrt(x * x + 1.0));"}),jye={kernelName:u3.Asinh,backendName:"webgl",kernelFunc:zye},Yye=q_e({opSnippet:b_e+"\n return atan(x);\n"}),Gye={kernelName:u3.Atan,backendName:"webgl",kernelFunc:Yye},Hye=K_e({opSnippet:D_e+"\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n "+L_e+"\n return result;\n"}),Wye={kernelName:u3.Atan2,backendName:"webgl",kernelFunc:Hye},Xye=q_e({opSnippet:b_e+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),qye={kernelName:u3.Atanh,backendName:"webgl",kernelFunc:Xye}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=p3.util.parseAxisParam(s,r.shape);const a=p3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=vye({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=p3.backend_util.getInnerMostAxes(o.length,l.shape.length)),p3.backend_util.assertAxesAreInnerMostDims("argMin",[o[0]],l.shape.length);const c=Vye(n,l,o[0],"min");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}},Yye=J_e({opSnippet:w_e+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),Gye={kernelName:p3.Asin,backendName:"webgl",kernelFunc:Yye},Hye=J_e({opSnippet:w_e+"return log(x + sqrt(x * x + 1.0));"}),Wye={kernelName:p3.Asinh,backendName:"webgl",kernelFunc:Hye},Xye=J_e({opSnippet:w_e+"\n return atan(x);\n"}),qye={kernelName:p3.Atan,backendName:"webgl",kernelFunc:Xye},Kye=eye({opSnippet:B_e+"\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n "+U_e+"\n return result;\n"}),Zye={kernelName:p3.Atan2,backendName:"webgl",kernelFunc:Kye},Qye=J_e({opSnippet:w_e+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),Jye={kernelName:p3.Atanh,backendName:"webgl",kernelFunc:Qye}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15747,7 +15747,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=u3.util * limitations under the License. * ============================================================================= */ -class Kye{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const s=e.filterWidth,o=e.strideHeight,a=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,d=e.effectiveFilterWidth,h=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let _="0.0";if(f||(_="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${o}, ${a});\n const ivec2 pads = ivec2(${h}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${i?r?m:g:`wR * ${d} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let y=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(y="avgValue / max(count, 1.0)");const v=4*Math.floor(s/4),b=s%4,T=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${o}, ${a});\n const ivec2 pads = ivec2(${h}, ${p});\n const float initializationValue = ${_};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${_});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${v}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${T}\n }\n\n int xC = xCCorner + ${v};\n if (${1===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${2===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${3===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${T}\n }\n }\n setOutput(${y});\n }\n `}}class Zye{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const s=e.filterWidth,o=e.strideDepth,a=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,d=e.dilationWidth,h=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,_=e.padInfo.left;this.outputShape=e.outShape;const y="avg"===t;let v="0.0";if(y||(v="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${o}, ${a}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${_});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${h};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${d}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${i?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const T=4*Math.floor(s/4),x=s%4,E=`\n if (${y}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${o}, ${a}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${_});\n const float initializationValue = ${v};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${v});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${h};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${T}; wC += 4) {\n int xC = xCCorner + wC * ${d};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n getValue(batch, xD, xR, xC + 2 * ${d}, ch),\n getValue(batch, xD, xR, xC + 3 * ${d}, ch)\n );\n\n ${E}\n }\n\n int xC = xCCorner + ${T};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${2===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${3===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n getValue(batch, xD, xR, xC + 2 * ${d}, ch),\n initializationValue\n );\n\n ${E}\n }\n }\n }\n setOutput(${b});\n }\n `}}const Qye={kernelName:u3.AvgPool,backendName:"webgl",kernelFunc: +class eve{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const s=e.filterWidth,o=e.strideHeight,a=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,d=e.effectiveFilterWidth,h=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let _="0.0";if(f||(_="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${o}, ${a});\n const ivec2 pads = ivec2(${h}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${i?r?m:g:`wR * ${d} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let y=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(y="avgValue / max(count, 1.0)");const v=4*Math.floor(s/4),b=s%4,T=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${o}, ${a});\n const ivec2 pads = ivec2(${h}, ${p});\n const float initializationValue = ${_};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${_});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${v}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${T}\n }\n\n int xC = xCCorner + ${v};\n if (${1===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${2===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${3===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${T}\n }\n }\n setOutput(${y});\n }\n `}}class tve{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const s=e.filterWidth,o=e.strideDepth,a=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,d=e.dilationWidth,h=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,_=e.padInfo.left;this.outputShape=e.outShape;const y="avg"===t;let v="0.0";if(y||(v="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${o}, ${a}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${_});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${h};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${d}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${i?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const T=4*Math.floor(s/4),x=s%4,E=`\n if (${y}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${o}, ${a}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${_});\n const float initializationValue = ${v};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${v});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${h};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${T}; wC += 4) {\n int xC = xCCorner + wC * ${d};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n getValue(batch, xD, xR, xC + 2 * ${d}, ch),\n getValue(batch, xD, xR, xC + 3 * ${d}, ch)\n );\n\n ${E}\n }\n\n int xC = xCCorner + ${T};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${2===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${3===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n getValue(batch, xD, xR, xC + 2 * ${d}, ch),\n initializationValue\n );\n\n ${E}\n }\n }\n }\n setOutput(${b});\n }\n `}}const nve={kernelName:p3.AvgPool,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15764,7 +15764,7 @@ class Kye{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n) * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;fme(r,"avgPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;u3.util.assert(u3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=u3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);if(1===u.filterWidth&&1===u.filterHeight&&u3.util.arraysEqual(u.inShape,u.outShape))return B_e({inputs:{x:r},backend:n});const c=new Kye(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const Jye={kernelName:u3.AvgPool3D,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;yme(r,"avgPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=p3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);if(1===u.filterWidth&&1===u.filterHeight&&p3.util.arraysEqual(u.inShape,u.outShape))return z_e({inputs:{x:r},backend:n});const c=new eve(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const ive={kernelName:p3.AvgPool3D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15781,7 +15781,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;fme(r,"avgPool");const{f * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i,c=u3.backend_util.computePool3DInfo(r.shape,s,o,[1,1,1],a,l,u),d=new Zye(c,"avg",!1);return n.runWebGLProgram(d,[r],"float32")}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i,c=p3.backend_util.computePool3DInfo(r.shape,s,o,[1,1,1],a,l,u),d=new tve(c,"avg",!1);return n.runWebGLProgram(d,[r],"float32")}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15798,7 +15798,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o, * limitations under the License. * ============================================================================= */ -class eve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,o=e.dilationWidth,a=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=a-1-e.padInfo.top,c=l-1-e.padInfo.left,d=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${d});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${a};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${o}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class tve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,i=e.filterWidth,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,d=e.effectiveFilterHeight,h=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=d-1-e.padInfo.top,m=h-1-e.padInfo.left,g=1/(t*n*i);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${m});\n const float avgMultiplier = float(${g});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${a}) {\n float dyD = float(dyDCorner + wD) / ${r}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${d};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${o}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const nve={kernelName:u3.AvgPool3DGrad,backendName:"webgl",kernelFunc: +class rve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,o=e.dilationWidth,a=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=a-1-e.padInfo.top,c=l-1-e.padInfo.left,d=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${d});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${a};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${o}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class sve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,i=e.filterWidth,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,d=e.effectiveFilterHeight,h=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=d-1-e.padInfo.top,m=h-1-e.padInfo.left,g=1/(t*n*i);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${m});\n const float avgMultiplier = float(${g});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${a}) {\n float dyD = float(dyDCorner + wD) / ${r}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${d};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${o}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const ove={kernelName:p3.AvgPool3DGrad,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15815,7 +15815,7 @@ class eve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;co * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize:a,strides:l,pad:u,dimRoundingMode:c}=i,d=u3.backend_util.computePool3DInfo(o.shape,a,l,[1,1,1],u,c),h=new tve(d);return n.runWebGLProgram(h,[r],o.dtype)}};const ive={kernelName:u3.AvgPoolGrad,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize:a,strides:l,pad:u,dimRoundingMode:c}=i,d=p3.backend_util.computePool3DInfo(o.shape,a,l,[1,1,1],u,c),h=new sve(d);return n.runWebGLProgram(h,[r],o.dtype)}};const ave={kernelName:p3.AvgPoolGrad,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15832,7 +15832,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;fme([r,s],"avgPoolGrad");const{filterSize:a,strides:l,pad:u}=i,c=u3.backend_util.computePool2DInfo(o.shape,a,l,1,u),d=new eve(c);return n.runWebGLProgram(d,[r],o.dtype)}};const rve={kernelName:u3.BatchMatMul,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;yme([r,s],"avgPoolGrad");const{filterSize:a,strides:l,pad:u}=i,c=p3.backend_util.computePool2DInfo(o.shape,a,l,1,u),d=new rve(c);return n.runWebGLProgram(d,[r],o.dtype)}};const lve={kernelName:p3.BatchMatMul,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15849,7 +15849,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;fme([r,s]," * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s}=t,{transposeA:o,transposeB:a}=i;return _ye({a:r,b:s,transposeA:o,transposeB:a,backend:n})}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s}=t,{transposeA:o,transposeB:a}=i;return Tye({a:r,b:s,transposeA:o,transposeB:a,backend:n})}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15866,7 +15866,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s}=t,{transposeA:o,transp * limitations under the License. * ============================================================================= */ -class sve{constructor(e,t,n,i,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],u3.backend_util.assertAndGetBroadcastShape(e,t),u3.backend_util.assertAndGetBroadcastShape(e,n);let o="0.0";null!=i&&(u3.backend_util.assertAndGetBroadcastShape(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let a="1.0";null!=r&&(u3.backend_util.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${o};\n float scale = ${a};\n float inv = scale * inversesqrt(variance + float(${s}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}} +class uve{constructor(e,t,n,i,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],p3.backend_util.assertAndGetBroadcastShape(e,t),p3.backend_util.assertAndGetBroadcastShape(e,n);let o="0.0";null!=i&&(p3.backend_util.assertAndGetBroadcastShape(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let a="1.0";null!=r&&(p3.backend_util.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${o};\n float scale = ${a};\n float inv = scale * inversesqrt(variance + float(${s}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -15883,7 +15883,7 @@ class sve{constructor(e,t,n,i,r,s){this.outputShape=[],this.variableNames=["x"," * limitations under the License. * ============================================================================= */ -class ove{constructor(e,t,n,i,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],u3.backend_util.assertAndGetBroadcastShape(e,t),u3.backend_util.assertAndGetBroadcastShape(e,n);let o="vec4(0.0)";null!=i&&(u3.backend_util.assertAndGetBroadcastShape(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let a="vec4(1.0)";null!=r&&(u3.backend_util.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${o};\n vec4 scale = ${a};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${s}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}} +class cve{constructor(e,t,n,i,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],p3.backend_util.assertAndGetBroadcastShape(e,t),p3.backend_util.assertAndGetBroadcastShape(e,n);let o="vec4(0.0)";null!=i&&(p3.backend_util.assertAndGetBroadcastShape(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let a="vec4(1.0)";null!=r&&(p3.backend_util.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${o};\n vec4 scale = ${a};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${s}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15900,7 +15900,7 @@ class ove{constructor(e,t,n,i,r,s){this.packedInputs=!0,this.packedOutput=!0,thi * limitations under the License. * ============================================================================= */ -const ave={kernelName:u3.FusedBatchNorm,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,mean:r,variance:s,offset:o,scale:a}=e;u3.util.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),u3.util.assert(null==o||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),u3.util.assert(null==a||r.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[i,r,s];let c=null;null!=o&&(c=o.shape,u.push(o));let d=null;null!=a&&(d=a.shape,u.push(a));const h=(0,u3.env)().getBool("WEBGL_PACK_NORMALIZATION")?new ove(i.shape,r.shape,s.shape,c,d,l):new sve(i.shape,r.shape,s.shape,c,d,l);return t.runWebGLProgram(h,u,u[0].dtype)}}; +const dve={kernelName:p3.FusedBatchNorm,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,mean:r,variance:s,offset:o,scale:a}=e;p3.util.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),p3.util.assert(null==o||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),p3.util.assert(null==a||r.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[i,r,s];let c=null;null!=o&&(c=o.shape,u.push(o));let d=null;null!=a&&(d=a.shape,u.push(a));const h=(0,p3.env)().getBool("WEBGL_PACK_NORMALIZATION")?new cve(i.shape,r.shape,s.shape,c,d,l):new uve(i.shape,r.shape,s.shape,c,d,l);return t.runWebGLProgram(h,u,u[0].dtype)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -15917,7 +15917,7 @@ const ave={kernelName:u3.FusedBatchNorm,backendName:"webgl",kernelFunc:({inputs: * limitations under the License. * ============================================================================= */ -class lve{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=Nme(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return uve.slice(0,e).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let i;i=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map((e,t)=>`sourceLoc.${uve[t]} = start[${t}] + coords.${uve[t]};`).join("\n")}\n `,this.userCode=`\n void main() {\n ${i}\n setOutput(getSource(${n}));\n }\n `}}const uve=["x","y","z","w","u","v"]; +class hve{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=Pme(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return pve.slice(0,e).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let i;i=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map((e,t)=>`sourceLoc.${pve[t]} = start[${t}] + coords.${pve[t]};`).join("\n")}\n `,this.userCode=`\n void main() {\n ${i}\n setOutput(getSource(${n}));\n }\n `}}const pve=["x","y","z","w","u","v"]; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -15934,7 +15934,7 @@ class lve{constructor(e){this.variableNames=["source"],this.outputShape=e,this.r * limitations under the License. * ============================================================================= */ -class cve{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=Nme(this.rank),n=h_e("coords",this.rank),i=h_e("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${i.slice(-2).join()})`,s=`getChannel(getSource(${i.join()}), ${r})`,o=`\n result.x = ${s};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${i[this.rank-1]};\n result.y = ${s};\n --${i[this.rank-1]};\n }\n `,a=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${i[this.rank-2]};\n result.z = ${s};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${i[this.rank-1]};\n result.w = ${s};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map((e,t)=>`start[${t}]`).join()});`:e.map((e,t)=>`${i[t]} = ${n[t]} + start[${t}];`).join("\n");this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${o}\n ${a}\n setOutput(result);\n }\n `}}function dve(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,size:o}=i,[a,l]=u3.slice_util.parseSliceParams(r,s,o);if(u3.slice_util.assertParamsValid(r,a,l),0===u3.util.sizeFromShape(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=Kge(e.values,a,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=u3.slice_util.isSliceContinous(r.shape,a,l);if(u||!c){const e=(0,u3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new cve(l):new lve(l),t=[a];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId), +class fve{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=Pme(this.rank),n=g_e("coords",this.rank),i=g_e("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${i.slice(-2).join()})`,s=`getChannel(getSource(${i.join()}), ${r})`,o=`\n result.x = ${s};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${i[this.rank-1]};\n result.y = ${s};\n --${i[this.rank-1]};\n }\n `,a=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${i[this.rank-2]};\n result.z = ${s};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${i[this.rank-1]};\n result.w = ${s};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map((e,t)=>`start[${t}]`).join()});`:e.map((e,t)=>`${i[t]} = ${n[t]} + start[${t}];`).join("\n");this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${o}\n ${a}\n setOutput(result);\n }\n `}}function mve(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,size:o}=i,[a,l]=p3.slice_util.parseSliceParams(r,s,o);if(p3.slice_util.assertParamsValid(r,a,l),0===p3.util.sizeFromShape(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=e_e(e.values,a,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=p3.slice_util.isSliceContinous(r.shape,a,l);if(u||!c){const e=(0,p3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new fve(l):new hve(l),t=[a];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId), /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15951,7 +15951,7 @@ class cve{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this * limitations under the License. * ============================================================================= */ -function(e,t,n,i){const r=i.texData.get(e.dataId),s=i.makeTensorInfo(n,e.dtype),o=i.texData.get(s.dataId);Object.assign(o,r),o.refCount=1,o.shape=n,o.dtype=e.dtype;let a=u3.slice_util.computeFlatOffset(t,u3.util.computeStrides(e.shape));r.slice&&(a+=r.slice.flatOffset),o.slice={flatOffset:a,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=i.dataRefCount.get(o.slice.origDataId)||1;return i.dataRefCount.set(o.slice.origDataId,l+1),s}(r,a,l,n)}const hve={kernelName:u3.Slice,backendName:"webgl",kernelFunc:dve},pve={kernelName:u3.BatchToSpaceND,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i;u3.util.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const a=s.reduce((e,t)=>e*t),l=u3.backend_util.getReshaped(r.shape,s,a),u=u3.backend_util.getPermuted(l.length,s.length),c=u3.backend_util.getReshapedPermuted(r.shape,s,a),d=u3.backend_util.getSliceBeginCoords(o,s.length),h=u3.backend_util.getSliceSize(c,o,s.length),p=[],f=sye({inputs:{x:r},backend:n,attrs:{shape:l}}),m=mye({inputs:{x:f},backend:n,attrs:{perm:u}}),g=sye({inputs:{x:m},backend:n,attrs:{shape:c}}),_=dve({inputs:{x:g},backend:n,attrs:{begin:d,size:h}});return p.push(f),p.push(m),p.push(g),p.forEach(e=>n.disposeIntermediateTensorInfo(e)),_}};const fve={kernelName:u3.Bincount,backendName:"webgl",kernelFunc: +function(e,t,n,i){const r=i.texData.get(e.dataId),s=i.makeTensorInfo(n,e.dtype),o=i.texData.get(s.dataId);Object.assign(o,r),o.refCount=1,o.shape=n,o.dtype=e.dtype;let a=p3.slice_util.computeFlatOffset(t,p3.util.computeStrides(e.shape));r.slice&&(a+=r.slice.flatOffset),o.slice={flatOffset:a,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=i.dataRefCount.get(o.slice.origDataId)||1;return i.dataRefCount.set(o.slice.origDataId,l+1),s}(r,a,l,n)}const gve={kernelName:p3.Slice,backendName:"webgl",kernelFunc:mve},_ve={kernelName:p3.BatchToSpaceND,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i;p3.util.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const a=s.reduce((e,t)=>e*t),l=p3.backend_util.getReshaped(r.shape,s,a),u=p3.backend_util.getPermuted(l.length,s.length),c=p3.backend_util.getReshapedPermuted(r.shape,s,a),d=p3.backend_util.getSliceBeginCoords(o,s.length),h=p3.backend_util.getSliceSize(c,o,s.length),p=[],f=uye({inputs:{x:r},backend:n,attrs:{shape:l}}),m=vye({inputs:{x:f},backend:n,attrs:{perm:u}}),g=uye({inputs:{x:m},backend:n,attrs:{shape:c}}),_=mve({inputs:{x:g},backend:n,attrs:{begin:d,size:h}});return p.push(f),p.push(m),p.push(g),p.forEach(e=>n.disposeIntermediateTensorInfo(e)),_}};const yve={kernelName:p3.Bincount,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -15968,7 +15968,7 @@ function(e,t,n,i){const r=i.texData.get(e.dataId),s=i.makeTensorInfo(n,e.dtype), * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=n.readSync(r.dataId),l=n.readSync(s.dataId),u=_ge(a,l,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,u)}};const mve={kernelName:u3.BitwiseAnd,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:i,b:r}=t,s=(0,u3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"),o=(0,u3.env)().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([i,r])||1===o){const e=n.texData.get(i.dataId).values,t=n.texData.get(r.dataId).values,[s,o]=vge(i.shape,r.shape,e,t,i.dtype),a=n.makeTensorInfo(o,i.dtype);return n.texData.get(a.dataId).values=s,a}let a;return a=s?new P_e("\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n",i.shape,r.shape,!1):new F_e("\n return float(int(a.r) & int(b.r));\n",i.shape,r.shape),n.runWebGLProgram(a,[i,r],i.dtype)}};const gve={kernelName:u3.BroadcastArgs,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=n.readSync(r.dataId),l=n.readSync(s.dataId),u=Tge(a,l,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,u)}};const vve={kernelName:p3.BitwiseAnd,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:i,b:r}=t,s=(0,p3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"),o=(0,p3.env)().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([i,r])||1===o){const e=n.texData.get(i.dataId).values,t=n.texData.get(r.dataId).values,[s,o]=Ege(i.shape,r.shape,e,t,i.dtype),a=n.makeTensorInfo(o,i.dtype);return n.texData.get(a.dataId).values=s,a}let a;return a=s?new V_e("\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n",i.shape,r.shape,!1):new $_e("\n return float(int(a.r) & int(b.r));\n",i.shape,r.shape),n.runWebGLProgram(a,[i,r],i.dtype)}};const bve={kernelName:p3.BroadcastArgs,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -15985,7 +15985,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=n * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{s0:i,s1:r}=t,s=n.readSync(i.dataId),o=n.readSync(r.dataId),a=u3.backend_util.assertAndGetBroadcastShape(Array.from(s),Array.from(o));return n.makeTensorInfo([a.length],"int32",Int32Array.from(a))}},_ve=K_e({opSnippet:"return float(a != b);",cpuKernelImpl:Uge,dtype:"bool"}),yve={kernelName:u3.NotEqual,backendName:"webgl",kernelFunc:_ve}; +function(e){const{inputs:t,backend:n}=e,{s0:i,s1:r}=t,s=n.readSync(i.dataId),o=n.readSync(r.dataId),a=p3.backend_util.assertAndGetBroadcastShape(Array.from(s),Array.from(o));return n.makeTensorInfo([a.length],"int32",Int32Array.from(a))}},Tve=eye({opSnippet:"return float(a != b);",cpuKernelImpl:Yge,dtype:"bool"}),xve={kernelName:p3.NotEqual,backendName:"webgl",kernelFunc:Tve}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16002,7 +16002,7 @@ function(e){const{inputs:t,backend:n}=e,{s0:i,s1:r}=t,s=n.readSync(i.dataId),o=n * limitations under the License. * ============================================================================= */ -function vve(e){const{inputs:t,backend:n}=e,{input:i}=t;return B_e({inputs:{x:n.texData.get(i.dataId).complexTensorInfos.real},backend:n})}const bve={kernelName:u3.Real,backendName:"webgl",kernelFunc:vve};const Tve={kernelName:u3.Cast,backendName:"webgl",kernelFunc: +function Eve(e){const{inputs:t,backend:n}=e,{input:i}=t;return z_e({inputs:{x:n.texData.get(i.dataId).complexTensorInfos.real},backend:n})}const wve={kernelName:p3.Real,backendName:"webgl",kernelFunc:Eve};const Ive={kernelName:p3.Cast,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16019,7 +16019,7 @@ function vve(e){const{inputs:t,backend:n}=e,{input:i}=t;return B_e({inputs:{x:n. * limitations under the License. * ============================================================================= */ -function e(t){const{inputs:n,backend:i,attrs:r}=t,{x:s}=n,{dtype:o}=r;if("complex64"===o){if("complex64"===s.dtype)return B_e({inputs:{x:s},backend:i});const t=u3.zeros(s.shape),n=e({inputs:{x:s},backend:i,attrs:{dtype:"float32"}}),r=U_e({inputs:{real:n,imag:t},backend:i});return t.dispose(),i.disposeIntermediateTensorInfo(n),r}if("complex64"===s.dtype){const t=vve({inputs:{input:s},backend:i}),n=e({inputs:{x:t},backend:i,attrs:{dtype:o}});return i.disposeIntermediateTensorInfo(t),n}if(!u3.util.hasEncodingLoss(s.dtype,o)){const e=B_e({inputs:{x:s},backend:i});return{dataId:e.dataId,shape:e.shape,dtype:o}}if(i.shouldExecuteOnCPU([s])){const e=i.texData.get(s.dataId).values,[t,n,r]=bge(e,s.shape,s.dtype,o);return i.makeTensorInfo(t,n,r)}if("int32"===o)return function(e,t){const n=new v_e(e.shape,"return float(int(x));"),i=t.runWebGLProgram(n,[e],"int32");return{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}(s,i);if("bool"===o){const e=i.makeTensorInfo([],"bool",u3.util.getTypedArrayFromDType("bool",1)),t=_ve({inputs:{a:s,b:e},backend:i});return i.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${s.dtype} to ${o}`)}},xve="return ceil(x);",Eve=q_e({opSnippet:xve,packedOpSnippet:xve,cpuKernelImpl:Tge}),wve={kernelName:u3.Ceil,backendName:"webgl",kernelFunc:Eve}; +function e(t){const{inputs:n,backend:i,attrs:r}=t,{x:s}=n,{dtype:o}=r;if("complex64"===o){if("complex64"===s.dtype)return z_e({inputs:{x:s},backend:i});const t=p3.zeros(s.shape),n=e({inputs:{x:s},backend:i,attrs:{dtype:"float32"}}),r=Y_e({inputs:{real:n,imag:t},backend:i});return t.dispose(),i.disposeIntermediateTensorInfo(n),r}if("complex64"===s.dtype){const t=Eve({inputs:{input:s},backend:i}),n=e({inputs:{x:t},backend:i,attrs:{dtype:o}});return i.disposeIntermediateTensorInfo(t),n}if(!p3.util.hasEncodingLoss(s.dtype,o)){const e=z_e({inputs:{x:s},backend:i});return{dataId:e.dataId,shape:e.shape,dtype:o}}if(i.shouldExecuteOnCPU([s])){const e=i.texData.get(s.dataId).values,[t,n,r]=wge(e,s.shape,s.dtype,o);return i.makeTensorInfo(t,n,r)}if("int32"===o)return function(e,t){const n=new E_e(e.shape,"return float(int(x));"),i=t.runWebGLProgram(n,[e],"int32");return{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}(s,i);if("bool"===o){const e=i.makeTensorInfo([],"bool",p3.util.getTypedArrayFromDType("bool",1)),t=Tve({inputs:{a:s,b:e},backend:i});return i.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${s.dtype} to ${o}`)}},Ave="return ceil(x);",Sve=J_e({opSnippet:Ave,packedOpSnippet:Ave,cpuKernelImpl:Ige}),Cve={kernelName:p3.Ceil,backendName:"webgl",kernelFunc:Sve}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16036,7 +16036,7 @@ function e(t){const{inputs:n,backend:i,attrs:r}=t,{x:s}=n,{dtype:o}=r;if("comple * limitations under the License. * ============================================================================= */ -class Ive{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}} +class Ove{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16053,7 +16053,7 @@ class Ive{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"mi * limitations under the License. * ============================================================================= */ -class Ave{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}const Sve={kernelName:u3.ClipByValue,backendName:"webgl",kernelFunc: +class Mve{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}const kve={kernelName:p3.ClipByValue,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16070,7 +16070,7 @@ class Ave{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.pack * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{clipValueMin:s,clipValueMax:o}=i;let a;a=(0,u3.env)().getBool("WEBGL_PACK_CLIP")?new Ave(r.shape):new Ive(r.shape);const l=[[s],[o]];return n.runWebGLProgram(a,[r],r.dtype,l)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{clipValueMin:s,clipValueMax:o}=i;let a;a=(0,p3.env)().getBool("WEBGL_PACK_CLIP")?new Mve(r.shape):new Ove(r.shape);const l=[[s],[o]];return n.runWebGLProgram(a,[r],r.dtype,l)}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16087,7 +16087,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{clipValueMin:s,clipValu * limitations under the License. * ============================================================================= */ -class Cve{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}} +class Rve{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16104,7 +16104,7 @@ class Cve{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,t * limitations under the License. * ============================================================================= */ -function Ove(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const Mve={kernelName:u3.ComplexAbs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=n.texData.get(i.dataId),s=new Cve(i.shape),o=[Ove(i,r.complexTensorInfos.real),Ove(i,r.complexTensorInfos.imag)];return n.runWebGLProgram(s,o,o[0].dtype)}}; +function Nve(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const Dve={kernelName:p3.ComplexAbs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=n.texData.get(i.dataId),s=new Rve(i.shape),o=[Nve(i,r.complexTensorInfos.real),Nve(i,r.complexTensorInfos.imag)];return n.runWebGLProgram(s,o,o[0].dtype)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16121,7 +16121,7 @@ function Ove(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const Mve= * limitations under the License. * ============================================================================= */ -class kve{constructor(e){this.outputShape=[],this.outputShape=u3.backend_util.computeOutShape(e,1),this.variableNames=e.map((e,t)=>`T${t}`);const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n`T${t}`);const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n`T${t}`);const a=new Array(e.length-1);a[0]=e[0][t];for(let n=1;n= ${a[e-1]}) {\n return getChannel(\n getT${e}(${Nve(o,l,t)}),\n vec2(${Nve(u,l,t)}));\n }`}const h=a.length,p=a[a.length-1];d+=`\n return getChannel(\n getT${h}(${Nve(o,l,p)}),\n vec2(${Nve(u,l,p)}));`,this.userCode=`\n float getValue(${o.map(e=>"int "+e)}) {\n ${d}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${s}), 0., 0., 0.);\n\n ${s[i-1]} = ${s[i-1]} + 1;\n if (${s[i-1]} < ${n[i-1]}) {\n result.g = getValue(${s});\n }\n\n ${s[i-2]} = ${s[i-2]} + 1;\n if (${s[i-2]} < ${n[i-2]}) {\n result.a = getValue(${s});\n }\n\n ${s[i-1]} = ${s[i-1]} - 1;\n if (${s[i-2]} < ${n[i-2]} &&\n ${s[i-1]} < ${n[i-1]}) {\n result.b = getValue(${s});\n }\n setOutput(result);\n }\n `}}function Nve(e,t,n){const i=e.indexOf(t);return e.map((e,t)=>t===i?`${e} - ${n}`:e).join()} +class Lve{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=p3.backend_util.computeOutShape(e,t);const n=this.outputShape,i=n.length,r=Pme(i),s=g_e("coords",i),o=["x","y","z","w","u","v"].slice(0,i);this.variableNames=e.map((e,t)=>`T${t}`);const a=new Array(e.length-1);a[0]=e[0][t];for(let n=1;n= ${a[e-1]}) {\n return getChannel(\n getT${e}(${Pve(o,l,t)}),\n vec2(${Pve(u,l,t)}));\n }`}const h=a.length,p=a[a.length-1];d+=`\n return getChannel(\n getT${h}(${Pve(o,l,p)}),\n vec2(${Pve(u,l,p)}));`,this.userCode=`\n float getValue(${o.map(e=>"int "+e)}) {\n ${d}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${s}), 0., 0., 0.);\n\n ${s[i-1]} = ${s[i-1]} + 1;\n if (${s[i-1]} < ${n[i-1]}) {\n result.g = getValue(${s});\n }\n\n ${s[i-2]} = ${s[i-2]} + 1;\n if (${s[i-2]} < ${n[i-2]}) {\n result.a = getValue(${s});\n }\n\n ${s[i-1]} = ${s[i-1]} - 1;\n if (${s[i-2]} < ${n[i-2]} &&\n ${s[i-1]} < ${n[i-1]}) {\n result.b = getValue(${s});\n }\n setOutput(result);\n }\n `}}function Pve(e,t,n){const i=e.indexOf(t);return e.map((e,t)=>t===i?`${e} - ${n}`:e).join()} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16155,7 +16155,7 @@ class Rve{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.output * limitations under the License. * ============================================================================= */ -function Dve(e){const{inputs:t,backend:n}=e,{input:i}=t;return B_e({inputs:{x:n.texData.get(i.dataId).complexTensorInfos.imag},backend:n})}const Fve={kernelName:u3.Imag,backendName:"webgl",kernelFunc:Dve}; +function Bve(e){const{inputs:t,backend:n}=e,{input:i}=t;return z_e({inputs:{x:n.texData.get(i.dataId).complexTensorInfos.imag},backend:n})}const $ve={kernelName:p3.Imag,backendName:"webgl",kernelFunc:Bve}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16172,7 +16172,7 @@ function Dve(e){const{inputs:t,backend:n}=e,{input:i}=t;return B_e({inputs:{x:n. * limitations under the License. * ============================================================================= */ -function Lve(e,t,n){const i=e[0].dtype;if("complex64"===i){const i=e.map(e=>vve({inputs:{input:e},backend:n})),r=e.map(e=>Dve({inputs:{input:e},backend:n})),s=Lve(i,t,n),o=Lve(r,t,n),a=U_e({inputs:{real:s,imag:o},backend:n});return i.forEach(e=>n.disposeIntermediateTensorInfo(e)),r.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(o),a}let r=n.shouldExecuteOnCPU(e);if("string"===i&&(r=!0),r){const r=e.map(e=>{const i=u3.util.sizeFromShape(e.shape.slice(t));return sye({inputs:{x:e},backend:n,attrs:{shape:[-1,i]}})}),s=r.map(e=>({vals:n.readSync(e.dataId),shape:e.shape})),o=u3.backend_util.computeOutShape(r.map(e=>e.shape),1),a=1===r[0].shape[0],l=xge(s,o,i,a),u=u3.backend_util.computeOutShape(e.map(e=>e.shape),t),c=n.makeTensorInfo(u,i,l);return r.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}const s=e.filter(e=>u3.util.sizeFromShape(e.shape)>0),o=(0,u3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(1===s.length){const t=o?new v_e(e[0].shape,w_e):new I_e(e[0].shape,w_e);return n.runWebGLProgram(t,e,i)}const a=(0,u3.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>a){const e=[];for(let i=0;ie.shape),t);return n.runWebGLProgram(e,s,i)}const{tensors2D:l,outShape:u}=function(e,t,n){const i=u3.backend_util.computeOutShape(e.map(e=>e.shape),t),r=e.map(e=>sye({inputs:{x:e},attrs:{shape:[-1,u3.util.sizeFromShape(e.shape.slice(t))]},backend:n}));return{tensors2D:r,outShape:i}}(s,t,n),c=new kve(l.map(e=>e.shape)),d=n.runWebGLProgram(c,l,i);l.forEach(e=>n.disposeIntermediateTensorInfo(e));const h=sye({inputs:{x:d},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(d),h} +function Uve(e,t,n){const i=e[0].dtype;if("complex64"===i){const i=e.map(e=>Eve({inputs:{input:e},backend:n})),r=e.map(e=>Bve({inputs:{input:e},backend:n})),s=Uve(i,t,n),o=Uve(r,t,n),a=Y_e({inputs:{real:s,imag:o},backend:n});return i.forEach(e=>n.disposeIntermediateTensorInfo(e)),r.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(o),a}let r=n.shouldExecuteOnCPU(e);if("string"===i&&(r=!0),r){const r=e.map(e=>{const i=p3.util.sizeFromShape(e.shape.slice(t));return uye({inputs:{x:e},backend:n,attrs:{shape:[-1,i]}})}),s=r.map(e=>({vals:n.readSync(e.dataId),shape:e.shape})),o=p3.backend_util.computeOutShape(r.map(e=>e.shape),1),a=1===r[0].shape[0],l=Age(s,o,i,a),u=p3.backend_util.computeOutShape(e.map(e=>e.shape),t),c=n.makeTensorInfo(u,i,l);return r.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}const s=e.filter(e=>p3.util.sizeFromShape(e.shape)>0),o=(0,p3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(1===s.length){const t=o?new E_e(e[0].shape,C_e):new O_e(e[0].shape,C_e);return n.runWebGLProgram(t,e,i)}const a=(0,p3.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>a){const e=[];for(let i=0;ie.shape),t);return n.runWebGLProgram(e,s,i)}const{tensors2D:l,outShape:u}=function(e,t,n){const i=p3.backend_util.computeOutShape(e.map(e=>e.shape),t),r=e.map(e=>uye({inputs:{x:e},attrs:{shape:[-1,p3.util.sizeFromShape(e.shape.slice(t))]},backend:n}));return{tensors2D:r,outShape:i}}(s,t,n),c=new Fve(l.map(e=>e.shape)),d=n.runWebGLProgram(c,l,i);l.forEach(e=>n.disposeIntermediateTensorInfo(e));const h=uye({inputs:{x:d},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(d),h} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16189,7 +16189,7 @@ function Lve(e,t,n){const i=e[0].dtype;if("complex64"===i){const i=e.map(e=>vve( * limitations under the License. * ============================================================================= */ -function Pve(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=u3.util.parseAxisParam(r,t[0].shape)[0],o=t.map(e=>e.shape);u3.backend_util.assertParamsConsistent(o,s);const a=u3.backend_util.computeOutShape(t.map(e=>e.shape),s);if(0===u3.util.sizeFromShape(a))return n.makeTensorInfo(a,t[0].dtype,[]);const l=t.filter(e=>u3.util.sizeFromShape(e.shape)>0);return 1===l.length?B_e({inputs:{x:l[0]},backend:n}):Lve(l,s,n)}const Bve={kernelName:u3.Concat,backendName:"webgl",kernelFunc:Pve}; +function Vve(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=p3.util.parseAxisParam(r,t[0].shape)[0],o=t.map(e=>e.shape);p3.backend_util.assertParamsConsistent(o,s);const a=p3.backend_util.computeOutShape(t.map(e=>e.shape),s);if(0===p3.util.sizeFromShape(a))return n.makeTensorInfo(a,t[0].dtype,[]);const l=t.filter(e=>p3.util.sizeFromShape(e.shape)>0);return 1===l.length?z_e({inputs:{x:l[0]},backend:n}):Uve(l,s,n)}const zve={kernelName:p3.Concat,backendName:"webgl",kernelFunc:Vve}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16206,7 +16206,7 @@ function Pve(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=u3.util.parseAx * limitations under the License. * ============================================================================= */ -class $ve{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const s=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,d=e.filterHeight,h=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,_=m?2:3,y=m?3:1;let v="",b="";n&&(v=i?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,b="result = activation(result);");const T=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${v}\n\n const ivec2 strides = ivec2(${a}, ${l});\n const ivec2 pads = ivec2(${s}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${y}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${_}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${d}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${m}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${m}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${m}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${m}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${T}\n ${b}\n setOutput(result);\n }\n `}}class Uve{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,i=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,d=e.filterHeight,h=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${s}, ${o});\n const ivec3 pads = ivec3(${t}, ${n}, ${i});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${a};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${d}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}} +class jve{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const s=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,d=e.filterHeight,h=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,_=m?2:3,y=m?3:1;let v="",b="";n&&(v=i?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,b="result = activation(result);");const T=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${v}\n\n const ivec2 strides = ivec2(${a}, ${l});\n const ivec2 pads = ivec2(${s}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${y}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${_}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${d}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${m}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${m}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${m}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${m}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${T}\n ${b}\n setOutput(result);\n }\n `}}class Yve{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,i=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,d=e.filterHeight,h=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${s}, ${o});\n const ivec3 pads = ivec3(${t}, ${n}, ${i});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${a};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${d}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}} /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -16223,7 +16223,7 @@ class $ve{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this * limitations under the License. * ============================================================================= */ -class Vve{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=$me(this.outputShape.length);const s=e.padInfo.left,o=e.strideWidth,a=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,c=u;let d="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(d+=`\n xC = xCCorner + ${n*a};\n `,1===o){if(n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n `,d+=1===a&&n>0?`\n xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n } else {\n xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xC${n} = xTexelC${n};\n `,n+1= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n `,d+=a>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${n+1} = vec4(previous.zw, xTexelC${n+1}.xy);\n } else {\n xC${n+1} = vec4(0.0, 0.0, xTexelC${n+1}.xy);\n }\n `:`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n `):d+=1===e?`\n xC${n+1} = xTexelC${n};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n+1} = xTexelC${n+1};\n `}}else n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `,n+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(\n xTexelC${n}.xy, xTexelC${n+1}.xy);\n `,n+1=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(d+=`\n xC = xCCorner + ${n*a};\n `,1===o){if(n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n `,d+=1===a&&n>0?`\n xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n } else {\n xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xC${n} = xTexelC${n};\n `,n+1= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n `,d+=a>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${n+1} = vec4(previous.zw, xTexelC${n+1}.xy);\n } else {\n xC${n+1} = vec4(0.0, 0.0, xTexelC${n+1}.xy);\n }\n `:`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n `):d+=1===e?`\n xC${n+1} = xTexelC${n};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n+1} = xTexelC${n+1};\n `}}else n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `,n+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(\n xTexelC${n}.xy, xTexelC${n+1}.xy);\n `,n+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${o}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${r}) {\n innerDims = vec2(d1, ch);\n result[${2*e+t}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${i.output} = result;\n }\n `}} +class Hve{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec4"},{name:"pad",type:"ivec2"},{name:"stride",type:"ivec2"},{name:"dilation",type:"ivec2"},{name:"inChannels",type:"int"},{name:"itemsPerBlockRow",type:"int"},{name:"outWidth",type:"int"}],this.outputShape=e,this.enableShapeUniforms=jme(this.outputShape.length);const{dataFormat:n}=t,i=bme(),r="channelsLast"===n,s=r?1:2,o=r?2:3,a=this.enableShapeUniforms?"if(blockIndex < outShape[2] && pos < outShape[1]) {":`if(blockIndex < ${e[2]} && pos < ${e[1]}) {`;let l="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)l+=`\n blockIndex = rc.z + ${t};\n pos = rc.y + ${e};\n\n ${a}\n offsetY = int(blockIndex / outWidth) * stride[0] - pad[0];\n d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow);\n\n if(d0 < inputShape[${s}] && d0 >= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${o}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${r}) {\n innerDims = vec2(d1, ch);\n result[${2*e+t}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${i.output} = result;\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16257,7 +16257,7 @@ class zve{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.pa * limitations under the License. * ============================================================================= */ -function jve(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2],e[n-1]]:[...e.slice(0,-3),e[n-3],e[n-2]*e[n-1]]:!t&&1===n&&e[0]>1?[e[0],1]:null}function Yve({x:e,filter:t,convInfo:n,backend:i,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:o=0,activation:a=null}){const l=e.shape,u=i.texData.get(e.dataId),c=n.inChannels,d=l[0]*l[1]*l[2],h=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=s){const e=jve(s.shape,p);null!=e&&(s=sye({inputs:{x:s},backend:i,attrs:{shape:e}}),g.push(s))}if(null!=r){const e=jve(r.shape,p);null!=e&&(r=sye({inputs:{x:r},backend:i,attrs:{shape:e}}),g.push(r))}if(!((1===d||1===h)&&c>1e3)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&u3.util.arraysEqual(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),d={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},h=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,u3.util.assert(eme(u.shape,d.shape),()=>`packed reshape ${u.shape} to ${d.shape} isn't free`);const p=sye({inputs:{x:t},backend:i,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const _=_ye({a:d,b:p,backend:i,transposeA:false,transposeB:f,bias:r,activation:a,preluActivationWeights:s,leakyreluAlpha:o}),y=i.texData.get(_.dataId);u3.util.assert(y.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=h,y.shape=n.outShape,m=B_e({inputs:{x:_},backend:i}),m.shape=n.outShape,g.push(_)}else{const l=n.outHeight*n.outWidth,u=sye({inputs:{x:e},backend:i,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=sye({inputs:{x:t},backend:i,attrs:{shape:[1,n.inChannels,n.outChannels]}}),d=_ye({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:i,bias:r,activation:a,preluActivationWeights:s,leakyreluAlpha:o});m=sye({inputs:{x:d},backend:i,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(d)}for(const e of g)i.disposeIntermediateTensorInfo(e);return m}function Gve({x:e,filter:t,convInfo:n,backend:i,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:o=0,activation:a=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:d,outHeight:h,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=h*d,_=[n.batchSize,m,g],y=[];if(null!=s){const e=jve(s.shape,f);null!=e&&(s=sye({inputs:{x:s},backend:i,attrs:{shape:e}}),y.push(s))}if(null!=r){const e=jve(r.shape,f);null!=e&&(r=sye({inputs:{x:r},backend:i,attrs:{shape:e}}),y.push(r))}const v=sye({inputs:{x:t},backend:i,attrs:{shape:[1,m,u3.util.sizeFromShape(t.shape)/m]}});y.push(v);const b=new zve(_,n),T=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],x=i.runWebGLProgram(b,[e],"float32",T),E=sye({inputs:{x},backend:i,attrs:{shape:_}});y.push(x),y.push(E);const w=null!=r,I=null!=s,A="leakyrelu"===a,S=a?Z_e(a,!0):null,C=new Q_e(f?E.shape:v.shape,f?v.shape:E.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,w,S,I,A),O=f?[E,v]:[v,E];if(r&&O.push(r),I&&O.push(s),A){const e=i.makeTensorInfo([],"float32",u3.util.createScalarValue(o,"float32"));O.push(e),y.push(e)}const M=i.runWebGLProgram(C,O,"float32"),k=sye({inputs:{x:M},backend:i,attrs:{shape:n.outShape}});y.push(M);for(const e of y)i.disposeIntermediateTensorInfo(e);return k}const Hve={kernelName:u3.Conv2D,backendName:"webgl",kernelFunc: +function Wve(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2],e[n-1]]:[...e.slice(0,-3),e[n-3],e[n-2]*e[n-1]]:!t&&1===n&&e[0]>1?[e[0],1]:null}function Xve({x:e,filter:t,convInfo:n,backend:i,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:o=0,activation:a=null}){const l=e.shape,u=i.texData.get(e.dataId),c=n.inChannels,d=l[0]*l[1]*l[2],h=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=s){const e=Wve(s.shape,p);null!=e&&(s=uye({inputs:{x:s},backend:i,attrs:{shape:e}}),g.push(s))}if(null!=r){const e=Wve(r.shape,p);null!=e&&(r=uye({inputs:{x:r},backend:i,attrs:{shape:e}}),g.push(r))}if(!((1===d||1===h)&&c>1e3)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&p3.util.arraysEqual(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),d={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},h=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,p3.util.assert(rme(u.shape,d.shape),()=>`packed reshape ${u.shape} to ${d.shape} isn't free`);const p=uye({inputs:{x:t},backend:i,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const _=Tye({a:d,b:p,backend:i,transposeA:false,transposeB:f,bias:r,activation:a,preluActivationWeights:s,leakyreluAlpha:o}),y=i.texData.get(_.dataId);p3.util.assert(y.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=h,y.shape=n.outShape,m=z_e({inputs:{x:_},backend:i}),m.shape=n.outShape,g.push(_)}else{const l=n.outHeight*n.outWidth,u=uye({inputs:{x:e},backend:i,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=uye({inputs:{x:t},backend:i,attrs:{shape:[1,n.inChannels,n.outChannels]}}),d=Tye({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:i,bias:r,activation:a,preluActivationWeights:s,leakyreluAlpha:o});m=uye({inputs:{x:d},backend:i,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(d)}for(const e of g)i.disposeIntermediateTensorInfo(e);return m}function qve({x:e,filter:t,convInfo:n,backend:i,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:o=0,activation:a=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:d,outHeight:h,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=h*d,_=[n.batchSize,m,g],y=[];if(null!=s){const e=Wve(s.shape,f);null!=e&&(s=uye({inputs:{x:s},backend:i,attrs:{shape:e}}),y.push(s))}if(null!=r){const e=Wve(r.shape,f);null!=e&&(r=uye({inputs:{x:r},backend:i,attrs:{shape:e}}),y.push(r))}const v=uye({inputs:{x:t},backend:i,attrs:{shape:[1,m,p3.util.sizeFromShape(t.shape)/m]}});y.push(v);const b=new Hve(_,n),T=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],x=i.runWebGLProgram(b,[e],"float32",T),E=uye({inputs:{x},backend:i,attrs:{shape:_}});y.push(x),y.push(E);const w=null!=r,I=null!=s,A="leakyrelu"===a,S=a?tye(a,!0):null,C=new nye(f?E.shape:v.shape,f?v.shape:E.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,w,S,I,A),O=f?[E,v]:[v,E];if(r&&O.push(r),I&&O.push(s),A){const e=i.makeTensorInfo([],"float32",p3.util.createScalarValue(o,"float32"));O.push(e),y.push(e)}const M=i.runWebGLProgram(C,O,"float32"),k=uye({inputs:{x:M},backend:i,attrs:{shape:n.outShape}});y.push(M);for(const e of y)i.disposeIntermediateTensorInfo(e);return k}const Kve={kernelName:p3.Conv2D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16274,7 +16274,7 @@ function jve(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2] * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dataFormat:l,dilations:u,dimRoundingMode:c}=i,d=u3.backend_util.convertConv2DDataFormat(l),h=u3.backend_util.computeConv2DInfo(r.shape,s.shape,o,u,a,c,!1,d);let p;if(1!==h.filterHeight||1!==h.filterWidth||1!==h.dilationHeight||1!==h.dilationWidth||1!==h.strideHeight||1!==h.strideWidth||"SAME"!==h.padInfo.type&&"VALID"!==h.padInfo.type)if(h.strideWidth<=2&&"channelsLast"===d&&(0,u3.env)().getBool("WEBGL_EXP_CONV")){const e=new Vve(h),t=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];p=n.runWebGLProgram(e,[r,s],"float32",t)}else if((0,u3.env)().getBool("WEBGL_CONV_IM2COL"))p=Gve({x:r,filter:s,convInfo:h,backend:n});else{const e=new $ve(h);p=n.runWebGLProgram(e,[r,s],"float32")}else p=Yve({x:r,filter:s,convInfo:h,backend:n});const f=sye({inputs:{x:p},backend:n,attrs:{shape:h.outShape}});return n.disposeIntermediateTensorInfo(p),f}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dataFormat:l,dilations:u,dimRoundingMode:c}=i,d=p3.backend_util.convertConv2DDataFormat(l),h=p3.backend_util.computeConv2DInfo(r.shape,s.shape,o,u,a,c,!1,d);let p;if(1!==h.filterHeight||1!==h.filterWidth||1!==h.dilationHeight||1!==h.dilationWidth||1!==h.strideHeight||1!==h.strideWidth||"SAME"!==h.padInfo.type&&"VALID"!==h.padInfo.type)if(h.strideWidth<=2&&"channelsLast"===d&&(0,p3.env)().getBool("WEBGL_EXP_CONV")){const e=new Gve(h),t=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];p=n.runWebGLProgram(e,[r,s],"float32",t)}else if((0,p3.env)().getBool("WEBGL_CONV_IM2COL"))p=qve({x:r,filter:s,convInfo:h,backend:n});else{const e=new jve(h);p=n.runWebGLProgram(e,[r,s],"float32")}else p=Xve({x:r,filter:s,convInfo:h,backend:n});const f=uye({inputs:{x:p},backend:n,attrs:{shape:h.outShape}});return n.disposeIntermediateTensorInfo(p),f}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16291,7 +16291,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad: * limitations under the License. * ============================================================================= */ -class Wve{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,i=e.padInfo.top,r=e.padInfo.left,s="channelsLast"===e.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${i};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${s?"float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);":"float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);"}\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Xve{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s="channelsLast"===e.dataFormat,o=t-1-e.padInfo.top,a=n-1-e.padInfo.left,l=s?1:2,u=s?2:3,c=s?3:1;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${s}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class qve{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,i=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,o=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${r};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${i} - ${o};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Kve{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,i=e.filterWidth,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=i-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${a}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${r}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${i}; wC++) {\n float dyC = float(dyCCorner + wC) / ${o}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${i} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const Zve={kernelName:u3.Conv2DBackpropFilter,backendName:"webgl",kernelFunc: +class Zve{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,i=e.padInfo.top,r=e.padInfo.left,s="channelsLast"===e.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${i};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${s?"float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);":"float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);"}\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Qve{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s="channelsLast"===e.dataFormat,o=t-1-e.padInfo.top,a=n-1-e.padInfo.left,l=s?1:2,u=s?2:3,c=s?3:1;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${s}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Jve{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,i=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,o=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${r};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${i} - ${o};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class ebe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,i=e.filterWidth,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=i-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${a}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${r}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${i}; wC++) {\n float dyC = float(dyCCorner + wC) / ${o}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${i} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const tbe={kernelName:p3.Conv2DBackpropFilter,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16308,7 +16308,7 @@ class Wve{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filter * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,dataFormat:l,dimRoundingMode:u,filterShape:c}=i,d=u3.backend_util.convertConv2DDataFormat(l),h=u3.backend_util.computeConv2DInfo(r.shape,c,o,1,a,u,!1,d),p=new Wve(h);return n.runWebGLProgram(p,[r,s],"float32")}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,dataFormat:l,dimRoundingMode:u,filterShape:c}=i,d=p3.backend_util.convertConv2DDataFormat(l),h=p3.backend_util.computeConv2DInfo(r.shape,c,o,1,a,u,!1,d),p=new Zve(h);return n.runWebGLProgram(p,[r,s],"float32")}}; /** * @license * Copyright 2023 Google LLC. @@ -16325,7 +16325,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,da * limitations under the License. * ============================================================================= */ -class Qve{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=$me(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,i=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${r});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n int wCPerm = ${n} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}}const Jve={kernelName:u3.Conv2DBackpropInput,backendName:"webgl",kernelFunc: +class nbe{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=jme(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,i=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${r});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n int wCPerm = ${n} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}}const ibe={kernelName:p3.Conv2DBackpropInput,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16342,7 +16342,7 @@ class Qve{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{inputShape:o,strides:a,pad:l,dataFormat:u,dimRoundingMode:c}=i,d=u3.backend_util.convertConv2DDataFormat(u),h=u3.backend_util.computeConv2DInfo(o,s.shape,a,1,l,c,!1,d);if((0,u3.env)().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===d){const e=[[h.strideHeight,h.strideWidth]],t=new Qve(h);return n.runWebGLProgram(t,[r,s],"float32",e)}{const e=new Xve(h);return n.runWebGLProgram(e,[r,s],"float32")}}};const ebe={kernelName:u3.Conv3D,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{inputShape:o,strides:a,pad:l,dataFormat:u,dimRoundingMode:c}=i,d=p3.backend_util.convertConv2DDataFormat(u),h=p3.backend_util.computeConv2DInfo(o,s.shape,a,1,l,c,!1,d);if((0,p3.env)().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===d){const e=[[h.strideHeight,h.strideWidth]],t=new nbe(h);return n.runWebGLProgram(t,[r,s],"float32",e)}{const e=new Qve(h);return n.runWebGLProgram(e,[r,s],"float32")}}};const rbe={kernelName:p3.Conv3D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16359,7 +16359,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{inputShape:o, * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i,u=u3.backend_util.computeConv3DInfo(r.shape,s.shape,o,l,a),c=new Uve(u);return n.runWebGLProgram(c,[r,s],"float32")}};const tbe={kernelName:u3.Conv3DBackpropFilterV2,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i,u=p3.backend_util.computeConv3DInfo(r.shape,s.shape,o,l,a),c=new Yve(u);return n.runWebGLProgram(c,[r,s],"float32")}};const sbe={kernelName:p3.Conv3DBackpropFilterV2,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16376,7 +16376,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad: * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,filterShape:l}=i,u=u3.backend_util.computeConv3DInfo(r.shape,l,o,1,a),c=new qve(u);return n.runWebGLProgram(c,[r,s],"float32")}};const nbe={kernelName:u3.Conv3DBackpropInputV2,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,filterShape:l}=i,u=p3.backend_util.computeConv3DInfo(r.shape,l,o,1,a),c=new Jve(u);return n.runWebGLProgram(c,[r,s],"float32")}};const obe={kernelName:p3.Conv3DBackpropInputV2,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16393,7 +16393,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,fi * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides:a,inputShape:l}=i,u=u3.backend_util.computeConv3DInfo(l,s.shape,a,1,o),c=new Kve(u);return n.runWebGLProgram(c,[r,s],"float32")}},ibe=q_e({opSnippet:X_e+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${L_e}\n return result;\n`}),rbe={kernelName:u3.Cos,backendName:"webgl",kernelFunc:ibe},sbe=q_e({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),obe={kernelName:u3.Cosh,backendName:"webgl",kernelFunc:sbe}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides:a,inputShape:l}=i,u=p3.backend_util.computeConv3DInfo(l,s.shape,a,1,o),c=new ebe(u);return n.runWebGLProgram(c,[r,s],"float32")}},abe=J_e({opSnippet:Q_e+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${U_e}\n return result;\n`}),lbe={kernelName:p3.Cos,backendName:"webgl",kernelFunc:abe},ube=J_e({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),cbe={kernelName:p3.Cosh,backendName:"webgl",kernelFunc:ube}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16410,7 +16410,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides * limitations under the License. * ============================================================================= */ -class abe{constructor(e,t,n,i,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[s,o,a,l]=e,[u]=t,[c,d]=n;this.outputShape=[u,c,d,l];const h="bilinear"===i?1:0,[p,f]=[o-1+".0",a-1+".0"],[m,g,_]=c>1?[""+(o-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[y,v,b]=d>1?[""+(a-1)/(d-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${m});\n const float width_ratio = float(${y});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${s}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${v};\n\n float in_y = ${_};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${b};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${r}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${h} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}} +class dbe{constructor(e,t,n,i,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[s,o,a,l]=e,[u]=t,[c,d]=n;this.outputShape=[u,c,d,l];const h="bilinear"===i?1:0,[p,f]=[o-1+".0",a-1+".0"],[m,g,_]=c>1?[""+(o-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[y,v,b]=d>1?[""+(a-1)/(d-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${m});\n const float width_ratio = float(${y});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${s}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${v};\n\n float in_y = ${_};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${b};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${r}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${h} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16427,7 +16427,7 @@ class abe{constructor(e,t,n,i,r){this.variableNames=["Image","Boxes","BoxInd"],t * limitations under the License. * ============================================================================= */ -const lbe={kernelName:u3.CropAndResize,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{image:r,boxes:s,boxInd:o}=t,{cropSize:a,method:l,extrapolationValue:u}=i,c=new abe(r.shape,s.shape,a,l,u);return n.runWebGLProgram(c,[r,s,o],"float32")}};var ube;!function(e){e.Prod="*",e.Sum="+"}(ube||(ube={}));class cbe{constructor(e,t,n,i){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,s=this.op===ube.Prod?"1.0":"0.0",o=n?s:`getX(${dbe(r,"coords",this.op)})`,a=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=i?"end != "+(a-1):"end != 0",u=i?"end + 1":"end - 1"):(l=i?`end + pow2 < ${a}`:"end >= pow2",u=i?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${Nme(r)} coords = getOutputCoords();\n int end = ${hbe(r,"coords",this.op)};\n float val = ${o};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${hbe(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${dbe(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function dbe(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function hbe(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)} +const hbe={kernelName:p3.CropAndResize,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{image:r,boxes:s,boxInd:o}=t,{cropSize:a,method:l,extrapolationValue:u}=i,c=new dbe(r.shape,s.shape,a,l,u);return n.runWebGLProgram(c,[r,s,o],"float32")}};var pbe;!function(e){e.Prod="*",e.Sum="+"}(pbe||(pbe={}));class fbe{constructor(e,t,n,i){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,s=this.op===pbe.Prod?"1.0":"0.0",o=n?s:`getX(${mbe(r,"coords",this.op)})`,a=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=i?"end != "+(a-1):"end != 0",u=i?"end + 1":"end - 1"):(l=i?`end + pow2 < ${a}`:"end >= pow2",u=i?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${Pme(r)} coords = getOutputCoords();\n int end = ${gbe(r,"coords",this.op)};\n float val = ${o};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${gbe(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${mbe(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function mbe(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function gbe(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)} /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -16444,7 +16444,7 @@ const lbe={kernelName:u3.CropAndResize,backendName:"webgl",kernelFunc:e=>{const{ * limitations under the License. * ============================================================================= */ -function pbe(e,t,n,i,r,s){const o=t.shape.length,a=u3.backend_util.getAxesPermutation([i],o);let l=t;null!=a&&(l=mye({inputs:{x:t},backend:n,attrs:{perm:a}}));const u=u3.backend_util.getInnerMostAxes(1,o)[0];if(u!==o-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${i}`);const c=l.shape[u];let d=B_e({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const i=new cbe(e,l.shape,!1,s),r=[[t]],o=d;d=n.runWebGLProgram(i,[d],d.dtype,r),n.disposeIntermediateTensorInfo(o)}if(r){const t=new cbe(e,l.shape,r,s),i=d;d=n.runWebGLProgram(t,[d],d.dtype),n.disposeIntermediateTensorInfo(i)}if(null!=a){const e=mye({inputs:{x:d},backend:n,attrs:{perm:u3.backend_util.getUndoAxesPermutation(a)}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(l),e}return d}const fbe={kernelName:u3.Cumprod,backendName:"webgl",kernelFunc: +function _be(e,t,n,i,r,s){const o=t.shape.length,a=p3.backend_util.getAxesPermutation([i],o);let l=t;null!=a&&(l=vye({inputs:{x:t},backend:n,attrs:{perm:a}}));const u=p3.backend_util.getInnerMostAxes(1,o)[0];if(u!==o-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${i}`);const c=l.shape[u];let d=z_e({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const i=new fbe(e,l.shape,!1,s),r=[[t]],o=d;d=n.runWebGLProgram(i,[d],d.dtype,r),n.disposeIntermediateTensorInfo(o)}if(r){const t=new fbe(e,l.shape,r,s),i=d;d=n.runWebGLProgram(t,[d],d.dtype),n.disposeIntermediateTensorInfo(i)}if(null!=a){const e=vye({inputs:{x:d},backend:n,attrs:{perm:p3.backend_util.getUndoAxesPermutation(a)}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(l),e}return d}const ybe={kernelName:p3.Cumprod,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -16461,7 +16461,7 @@ function pbe(e,t,n,i,r,s){const o=t.shape.length,a=u3.backend_util.getAxesPermut * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;return pbe(ube.Prod,r,n,s,o,a)}};const mbe={kernelName:u3.Cumsum,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;return _be(pbe.Prod,r,n,s,o,a)}};const vbe={kernelName:p3.Cumsum,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -16478,7 +16478,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reve * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;return pbe(ube.Sum,r,n,s,o,a)}};const gbe={kernelName:u3.DenseBincount,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;return _be(pbe.Sum,r,n,s,o,a)}};const bbe={kernelName:p3.DenseBincount,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16495,7 +16495,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reve * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o,binaryOutput:a}=i;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(s.dataId),i=_ge(e,t,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,i)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(s),i=yge(e,t,o,a);return n.makeTensorInfo(i.shape,s.dtype,i.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o,binaryOutput:a}=i;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(s.dataId),i=Tge(e,t,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,i)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(s),i=xge(e,t,o,a);return n.makeTensorInfo(i.shape,s.dtype,i.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16512,7 +16512,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o,binary * limitations under the License. * ============================================================================= */ -class _be{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const ybe={kernelName:u3.DepthToSpace,backendName:"webgl",kernelFunc: +class Tbe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const xbe={kernelName:p3.DepthToSpace,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16529,7 +16529,7 @@ class _be{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.o * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockSize:s,dataFormat:o}=i,a=r.shape[0],l=("NHWC"===o?r.shape[1]:r.shape[2])*s,u=("NHWC"===o?r.shape[2]:r.shape[3])*s,c=("NHWC"===o?r.shape[3]:r.shape[1])/(s*s),d=new _be("NHWC"===o?[a,l,u,c]:[a,c,l,u],s,o);return n.runWebGLProgram(d,[r],r.dtype)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockSize:s,dataFormat:o}=i,a=r.shape[0],l=("NHWC"===o?r.shape[1]:r.shape[2])*s,u=("NHWC"===o?r.shape[2]:r.shape[3])*s,c=("NHWC"===o?r.shape[3]:r.shape[1])/(s*s),d=new Tbe("NHWC"===o?[a,l,u,c]:[a,c,l,u],s,o);return n.runWebGLProgram(d,[r],r.dtype)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16546,7 +16546,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockSize:s,dataFormat: * limitations under the License. * ============================================================================= */ -class vbe{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=$me(this.outputShape.length);const s=e.filterHeight,o=e.filterWidth,a=e.outChannels/e.inChannels;let l="",u="";n&&(l=i?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${a};\n int q = d2 - d1 * ${a};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${s}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${o}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}} +class Ebe{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=jme(this.outputShape.length);const s=e.filterHeight,o=e.filterWidth,a=e.outChannels/e.inChannels;let l="",u="";n&&(l=i?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${a};\n int q = d2 - d1 * ${a};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${s}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${o}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16563,7 +16563,7 @@ class vbe{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this * limitations under the License. * ============================================================================= */ -class bbe{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=$me(this.outputShape.length);const s=e.outChannels/e.inChannels,o=e.padInfo.left,a=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,c=e.filterWidth,d=c;let h="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let e=0;e<(d+1)/2;e++){const t=2*e;if(h+=`\n xC = xCCorner + ${t*l};\n `,1===a){if(t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n `,h+=1===l&&t>0?`\n xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n } else {\n xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n }\n `):h+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xC${t} = xTexelC${t};\n `,t+1= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n `,h+=l>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy);\n } else {\n xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy);\n }\n `:`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n `):h+=1===e?`\n xC${t+1} = xTexelC${t};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t+1} = xTexelC${t+1};\n `}}else t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `,t+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(h+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(\n xTexelC${t}.xy, xTexelC${t+1}.xy);\n `,t+1=0 && xR < inDims[0]) {\n ";for(let e=0;e<(d+1)/2;e++){const t=2*e;if(h+=`\n xC = xCCorner + ${t*l};\n `,1===a){if(t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n `,h+=1===l&&t>0?`\n xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n } else {\n xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n }\n `):h+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xC${t} = xTexelC${t};\n `,t+1= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n `,h+=l>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy);\n } else {\n xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy);\n }\n `:`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n `):h+=1===e?`\n xC${t+1} = xTexelC${t};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t+1} = xTexelC${t+1};\n `}}else t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `,t+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(h+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(\n xTexelC${t}.xy, xTexelC${t+1}.xy);\n `,t+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${c}'`);const d=u3.backend_util.computeConv2DInfo(r.shape,s.shape,o,c,a,u,!0);let h;h=(0,u3.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&d.strideWidth<=2&&d.outChannels/d.inChannels===1?new bbe(d):new vbe(d);const p=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];return n.runWebGLProgram(h,[r,s],"float32",p)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l,dimRoundingMode:u}=i;let c=l;null==c&&(c=[1,1]),p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(o,c),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${c}'`);const d=p3.backend_util.computeConv2DInfo(r.shape,s.shape,o,c,a,u,!0);let h;h=(0,p3.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&d.strideWidth<=2&&d.outChannels/d.inChannels===1?new wbe(d):new Ebe(d);const p=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];return n.runWebGLProgram(h,[r,s],"float32",p)}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16597,7 +16597,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad: * limitations under the License. * ============================================================================= */ -class xbe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,i=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${s} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${i};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Ebe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,o=n-1-e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${a}; dm++) {\n int d2 = d1 * ${a} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const wbe={kernelName:u3.DepthwiseConv2dNativeBackpropFilter,backendName:"webgl",kernelFunc: +class Abe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,i=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${s} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${i};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Sbe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,o=n-1-e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${a}; dm++) {\n int d2 = d1 * ${a} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const Cbe={kernelName:p3.DepthwiseConv2dNativeBackpropFilter,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16614,7 +16614,7 @@ class xbe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filter * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,filterShape:c}=i,d=u3.backend_util.computeConv2DInfo(r.shape,c,o,a,l,u,!0),h=new xbe(d);return n.runWebGLProgram(h,[r,s],"float32")}};const Ibe={kernelName:u3.DepthwiseConv2dNativeBackpropInput,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,filterShape:c}=i,d=p3.backend_util.computeConv2DInfo(r.shape,c,o,a,l,u,!0),h=new Abe(d);return n.runWebGLProgram(h,[r,s],"float32")}};const Obe={kernelName:p3.DepthwiseConv2dNativeBackpropInput,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16631,7 +16631,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,dilation * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,inputShape:c}=i,d=u3.backend_util.computeConv2DInfo(c,s.shape,o,a,l,u,!0),h=new Ebe(d);return n.runWebGLProgram(h,[r,s],"float32")}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,inputShape:c}=i,d=p3.backend_util.computeConv2DInfo(c,s.shape,o,a,l,u,!0),h=new Sbe(d);return n.runWebGLProgram(h,[r,s],"float32")}}; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -16648,7 +16648,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{strides:o,dil * limitations under the License. * ============================================================================= */ -class Abe{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}const Sbe={kernelName:u3.Diag,backendName:"webgl",kernelFunc: +class Mbe{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}const kbe={kernelName:p3.Diag,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16665,7 +16665,7 @@ class Abe{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.us * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=[...i.shape,...i.shape],s=u3.util.sizeFromShape(i.shape),o=sye({inputs:{x:i},backend:n,attrs:{shape:[s]}}),a=new Abe(s),l=n.runWebGLProgram(a,[o],o.dtype),u=sye({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),u}}; +function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=[...i.shape,...i.shape],s=p3.util.sizeFromShape(i.shape),o=uye({inputs:{x:i},backend:n,attrs:{shape:[s]}}),a=new Mbe(s),l=n.runWebGLProgram(a,[o],o.dtype),u=uye({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),u}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16682,7 +16682,7 @@ function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=[...i.shape,...i.shape],s=u3.u * limitations under the License. * ============================================================================= */ -class Cbe{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:i,strideHeight:r,strideWidth:s,filterHeight:o,filterWidth:a,dilationHeight:l,dilationWidth:u}=e,{top:c,left:d}=i;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${s});\n const ivec2 pads = ivec2(${c}, ${d});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${o}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${a}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}const Obe={kernelName:u3.Dilation2D,backendName:"webgl",kernelFunc: +class Rbe{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:i,strideHeight:r,strideWidth:s,filterHeight:o,filterWidth:a,dilationHeight:l,dilationWidth:u}=e,{top:c,left:d}=i;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${s});\n const ivec2 pads = ivec2(${c}, ${d});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${o}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${a}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}const Nbe={kernelName:p3.Dilation2D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16699,7 +16699,7 @@ class Cbe{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShap * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i,u=u3.backend_util.computeDilation2DInfo(r.shape,s.shape,o,a,"NHWC",l);let c;const d=new Cbe(u);c=n.runWebGLProgram(d,[r,s],"float32");const h=sye({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),h}};const Mbe={kernelName:u3.Einsum,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i,u=p3.backend_util.computeDilation2DInfo(r.shape,s.shape,o,a,"NHWC",l);let c;const d=new Rbe(u);c=n.runWebGLProgram(d,[r,s],"float32");const h=uye({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),h}};const Dbe={kernelName:p3.Einsum,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -16716,7 +16716,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad: * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,summedDims:a,idDims:l}=u3.backend_util.decodeEinsumEquation(r,s.length);u3.backend_util.checkEinsumDimSizes(o.length,l,s);const{path:u,steps:c}=u3.backend_util.getEinsumComputePath(a,l),d=c.length;let h=null,p=o.length;const f=[];for(let e=0;e=0&&(h=pye({inputs:{x:h},backend:n,attrs:{axis:u[e]-(o.length-p),keepDims:!1}}),f.push(h)),p--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}},kbe=q_e({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),Rbe={kernelName:u3.Elu,backendName:"webgl",kernelFunc:kbe},Nbe={kernelName:u3.EluGrad,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:i,y:r}=t,s=(0,u3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new P_e("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",i.shape,r.shape):new F_e("return (b >= 0.0) ? a : a * (b + 1.0);",i.shape,r.shape);return n.runWebGLProgram(s,[i,r],i.dtype)}},Dbe=K_e({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:Ege}),Fbe={kernelName:u3.Equal,backendName:"webgl",kernelFunc:Dbe},Lbe=q_e({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${u3.backend_util.ERF_P};\n float a1 = ${u3.backend_util.ERF_A1};\n float a2 = ${u3.backend_util.ERF_A2};\n float a3 = ${u3.backend_util.ERF_A3};\n float a4 = ${u3.backend_util.ERF_A4};\n float a5 = ${u3.backend_util.ERF_A5};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),Pbe={kernelName:u3.Erf,backendName:"webgl",kernelFunc:Lbe},Bbe=q_e({opSnippet:X_e+"\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:wge,dtype:"float32"}),$be={kernelName:u3.Exp,backendName:"webgl",kernelFunc:Bbe}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,summedDims:a,idDims:l}=p3.backend_util.decodeEinsumEquation(r,s.length);p3.backend_util.checkEinsumDimSizes(o.length,l,s);const{path:u,steps:c}=p3.backend_util.getEinsumComputePath(a,l),d=c.length;let h=null,p=o.length;const f=[];for(let e=0;e=0&&(h=_ye({inputs:{x:h},backend:n,attrs:{axis:u[e]-(o.length-p),keepDims:!1}}),f.push(h)),p--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}},Fbe=J_e({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),Lbe={kernelName:p3.Elu,backendName:"webgl",kernelFunc:Fbe},Pbe={kernelName:p3.EluGrad,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:i,y:r}=t,s=(0,p3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new V_e("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",i.shape,r.shape):new $_e("return (b >= 0.0) ? a : a * (b + 1.0);",i.shape,r.shape);return n.runWebGLProgram(s,[i,r],i.dtype)}},Bbe=eye({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:Sge}),$be={kernelName:p3.Equal,backendName:"webgl",kernelFunc:Bbe},Ube=J_e({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${p3.backend_util.ERF_P};\n float a1 = ${p3.backend_util.ERF_A1};\n float a2 = ${p3.backend_util.ERF_A2};\n float a3 = ${p3.backend_util.ERF_A3};\n float a4 = ${p3.backend_util.ERF_A4};\n float a5 = ${p3.backend_util.ERF_A5};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),Vbe={kernelName:p3.Erf,backendName:"webgl",kernelFunc:Ube},zbe=J_e({opSnippet:Q_e+"\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:Cge,dtype:"float32"}),jbe={kernelName:p3.Exp,backendName:"webgl",kernelFunc:zbe}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16733,7 +16733,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,su * limitations under the License. * ============================================================================= */ -function Ube(e){const{inputs:t,attrs:n,backend:i}=e,{dim:r}=n,{input:s}=t,o=s.shape.length,a=s.shape.slice();let l=r;return r<0&&(u3.util.assert(-(o+1)<=r,()=>`Axis must be in the interval [${-(o+1)}, ${o}]`),l=o+r+1),a.splice(l,0,1),sye({inputs:{x:s},backend:i,attrs:{shape:a}})}const Vbe={kernelName:u3.ExpandDims,backendName:"webgl",kernelFunc:Ube},zbe="return exp(x) - 1.0;",jbe=q_e({opSnippet:zbe,packedOpSnippet:zbe,cpuKernelImpl:Ige}),Ybe={kernelName:u3.Expm1,backendName:"webgl",kernelFunc:jbe}; +function Ybe(e){const{inputs:t,attrs:n,backend:i}=e,{dim:r}=n,{input:s}=t,o=s.shape.length,a=s.shape.slice();let l=r;return r<0&&(p3.util.assert(-(o+1)<=r,()=>`Axis must be in the interval [${-(o+1)}, ${o}]`),l=o+r+1),a.splice(l,0,1),uye({inputs:{x:s},backend:i,attrs:{shape:a}})}const Gbe={kernelName:p3.ExpandDims,backendName:"webgl",kernelFunc:Ybe},Hbe="return exp(x) - 1.0;",Wbe=J_e({opSnippet:Hbe,packedOpSnippet:Hbe,cpuKernelImpl:Oge}),Xbe={kernelName:p3.Expm1,backendName:"webgl",kernelFunc:Wbe}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16750,7 +16750,7 @@ function Ube(e){const{inputs:t,attrs:n,backend:i}=e,{dim:r}=n,{input:s}=t,o=s.sh * limitations under the License. * ============================================================================= */ -class Gbe{constructor(e,t,n){this.variableNames=["real","imag"];const i=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${i}.0`:"1.0";let o;if("real"===e)o="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);o="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${r};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${o}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${i});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${i}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${s};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}} +class qbe{constructor(e,t,n){this.variableNames=["real","imag"];const i=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${i}.0`:"1.0";let o;if("real"===e)o="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);o="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${r};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${o}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${i});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${i}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${s};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16767,7 +16767,7 @@ class Gbe{constructor(e,t,n){this.variableNames=["real","imag"];const i=t[1];thi * limitations under the License. * ============================================================================= */ -function Hbe(e,t,n){const i=n.texData.get(e.dataId),r=u3.util.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],o=sye({inputs:{x:e},backend:n,attrs:{shape:[r/s,s]}}),a=o.shape,l=new Gbe("real",a,t),u=new Gbe("imag",a,t),c=[{dataId:i.complexTensorInfos.real.dataId,dtype:i.complexTensorInfos.real.dtype,shape:a},{dataId:i.complexTensorInfos.imag.dataId,dtype:i.complexTensorInfos.imag.dtype,shape:a}],d=n.runWebGLProgram(l,c,"float32"),h=n.runWebGLProgram(u,c,"float32"),p=U_e({inputs:{real:d,imag:h},backend:n});n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h);const f=sye({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(p),f}const Wbe={kernelName:u3.FFT,backendName:"webgl",kernelFunc: +function Kbe(e,t,n){const i=n.texData.get(e.dataId),r=p3.util.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],o=uye({inputs:{x:e},backend:n,attrs:{shape:[r/s,s]}}),a=o.shape,l=new qbe("real",a,t),u=new qbe("imag",a,t),c=[{dataId:i.complexTensorInfos.real.dataId,dtype:i.complexTensorInfos.real.dtype,shape:a},{dataId:i.complexTensorInfos.imag.dataId,dtype:i.complexTensorInfos.imag.dtype,shape:a}],d=n.runWebGLProgram(l,c,"float32"),h=n.runWebGLProgram(u,c,"float32"),p=Y_e({inputs:{real:d,imag:h},backend:n});n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h);const f=uye({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(p),f}const Zbe={kernelName:p3.FFT,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16784,7 +16784,7 @@ function Hbe(e,t,n){const i=n.texData.get(e.dataId),r=u3.util.sizeFromShape(e.sh * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{input:i}=t;return Hbe(i,!1,n)}}; +function(e){const{inputs:t,backend:n}=e,{input:i}=t;return Kbe(i,!1,n)}}; /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -16801,7 +16801,7 @@ function(e){const{inputs:t,backend:n}=e,{input:i}=t;return Hbe(i,!1,n)}}; * limitations under the License. * ============================================================================= */ -class Xbe{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}} +class Qbe{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16818,7 +16818,7 @@ class Xbe{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value * limitations under the License. * ============================================================================= */ -function qbe(e){const{backend:t,attrs:n}=e,{shape:i,value:r}=n;let{dtype:s}=n;if(s=s||u3.util.inferDtype(r),"string"===s){const e=u3.util.getArrayFromDType(s,u3.util.sizeFromShape(i));return e.fill(r),t.makeTensorInfo(i,s,e)}{const e=new Xbe(i,r),n=[[r]];return t.runWebGLProgram(e,[],s,n)}}const Kbe={kernelName:u3.Fill,backendName:"webgl",kernelFunc:qbe}; +function Jbe(e){const{backend:t,attrs:n}=e,{shape:i,value:r}=n;let{dtype:s}=n;if(s=s||p3.util.inferDtype(r),"string"===s){const e=p3.util.getArrayFromDType(s,p3.util.sizeFromShape(i));return e.fill(r),t.makeTensorInfo(i,s,e)}{const e=new Qbe(i,r),n=[[r]];return t.runWebGLProgram(e,[],s,n)}}const eTe={kernelName:p3.Fill,backendName:"webgl",kernelFunc:Jbe}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16835,7 +16835,7 @@ function qbe(e){const{backend:t,attrs:n}=e,{shape:i,value:r}=n;let{dtype:s}=n;if * limitations under the License. * ============================================================================= */ -class Zbe{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}} +class tTe{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16852,7 +16852,7 @@ class Zbe{constructor(e){this.variableNames=["Image"],this.outputShape=[];const * limitations under the License. * ============================================================================= */ -const Qbe={kernelName:u3.FlipLeftRight,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,i=t,r=new Zbe(n.shape);return i.runWebGLProgram(r,[n],n.dtype)}},Jbe="return floor(x);",eTe=q_e({opSnippet:Jbe,packedOpSnippet:Jbe,cpuKernelImpl:Age}),tTe={kernelName:u3.Floor,backendName:"webgl",kernelFunc:eTe},nTe=K_e({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),iTe={kernelName:u3.FloorDiv,backendName:"webgl",kernelFunc:nTe}; +const nTe={kernelName:p3.FlipLeftRight,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,i=t,r=new tTe(n.shape);return i.runWebGLProgram(r,[n],n.dtype)}},iTe="return floor(x);",rTe=J_e({opSnippet:iTe,packedOpSnippet:iTe,cpuKernelImpl:Mge}),sTe={kernelName:p3.Floor,backendName:"webgl",kernelFunc:rTe},oTe=eye({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),aTe={kernelName:p3.FloorDiv,backendName:"webgl",kernelFunc:oTe}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16869,7 +16869,7 @@ const Qbe={kernelName:u3.FlipLeftRight,backendName:"webgl",kernelFunc:({inputs:e * limitations under the License. * ============================================================================= */ -class rTe{constructor(e){this.variableNames=["A"];const t=gme(),[n,i]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${i}.0, ${n}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}} +class lTe{constructor(e){this.variableNames=["A"];const t=bme(),[n,i]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${i}.0, ${n}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}} /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -16886,7 +16886,7 @@ class rTe{constructor(e){this.variableNames=["A"];const t=gme(),[n,i]=e;this.out * limitations under the License. * ============================================================================= */ -class sTe{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=gme(),[n,i]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${i}.0, ${n}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}} +class uTe{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=bme(),[n,i]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${i}.0, ${n}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -16903,7 +16903,7 @@ class sTe{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.pack * limitations under the License. * ============================================================================= */ -const oTe={kernelName:u3.FromPixels,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e;let{pixels:r}=t;const{numChannels:s}=i,o="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,a="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=o?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],d=[u,l,s];if(a||o){const e=(0,u3.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=aTe&&e===lTe||(lTe=e,aTe=document.createElement("canvas").getContext("2d",{willReadFrequently:lTe})),aTe.canvas.width=l,aTe.canvas.height=u,aTe.drawImage(r,0,0,l,u),r=aTe.canvas}const h=n.makeTensorInfo(c,"int32");n.texData.get(h.dataId).usage=dfe.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(h.dataId),r);const p=(0,u3.env)().getBool("WEBGL_PACK")?new sTe(d):new rTe(d),f=n.runWebGLProgram(p,[h],"int32");return n.disposeData(h.dataId),f}};let aTe,lTe=(0,u3.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const uTe={kernelName:u3.FusedConv2D,backendName:"webgl",kernelFunc: +const cTe={kernelName:p3.FromPixels,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e;let{pixels:r}=t;const{numChannels:s}=i,o="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,a="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=o?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],d=[u,l,s];if(a||o){const e=(0,p3.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=dTe&&e===hTe||(hTe=e,dTe=document.createElement("canvas").getContext("2d",{willReadFrequently:hTe})),dTe.canvas.width=l,dTe.canvas.height=u,dTe.drawImage(r,0,0,l,u),r=dTe.canvas}const h=n.makeTensorInfo(c,"int32");n.texData.get(h.dataId).usage=mfe.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(h.dataId),r);const p=(0,p3.env)().getBool("WEBGL_PACK")?new uTe(d):new lTe(d),f=n.runWebGLProgram(p,[h],"int32");return n.disposeData(h.dataId),f}};let dTe,hTe=(0,p3.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const pTe={kernelName:p3.FusedConv2D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16920,7 +16920,7 @@ const oTe={kernelName:u3.FromPixels,backendName:"webgl",kernelFunc:function(e){c * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h,activation:p,leakyreluAlpha:f}=i,m=u3.backend_util.convertConv2DDataFormat(c),g=u3.backend_util.computeConv2DInfo(r.shape,s.shape,l,d,u,h,!1,m);let _;const y=[],v=null!=o,b=null!=a,T="leakyrelu"===p,x=()=>{const e=[r,s],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=sye({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return y.push(t),t}return e};if(v&&e.push(t(o,c)),b&&e.push(t(a,c)),T){const t=n.makeTensorInfo([],"float32",u3.util.createScalarValue(f,"float32"));e.push(t),y.push(t)}return e};if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(g.strideWidth<=2&&"channelsLast"===m&&(0,u3.env)().getBool("WEBGL_EXP_CONV")){const e=p?Z_e(p,!0):null,t=new Vve(g,v,e,b,T),i=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();_=n.runWebGLProgram(t,r,"float32",i)}else if((0,u3.env)().getBool("WEBGL_CONV_IM2COL"))_=Gve({x:r,filter:s,convInfo:g,backend:n,bias:o,activation:p,preluActivationWeights:a,leakyreluAlpha:f});else{const e=p?Z_e(p,!1):null,t=new $ve(g,v,e,b,T),i=x();_=n.runWebGLProgram(t,i,"float32")}else _=Yve({x:r,filter:s,convInfo:g,backend:n,bias:o,activation:p,preluActivationWeights:a,leakyreluAlpha:f});const E=sye({inputs:{x:_},backend:n,attrs:{shape:g.outShape}});return y.push(_),y.forEach(e=>n.disposeIntermediateTensorInfo(e)),E}};const cTe={kernelName:u3.FusedDepthwiseConv2D,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h,activation:p,leakyreluAlpha:f}=i,m=p3.backend_util.convertConv2DDataFormat(c),g=p3.backend_util.computeConv2DInfo(r.shape,s.shape,l,d,u,h,!1,m);let _;const y=[],v=null!=o,b=null!=a,T="leakyrelu"===p,x=()=>{const e=[r,s],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=uye({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return y.push(t),t}return e};if(v&&e.push(t(o,c)),b&&e.push(t(a,c)),T){const t=n.makeTensorInfo([],"float32",p3.util.createScalarValue(f,"float32"));e.push(t),y.push(t)}return e};if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(g.strideWidth<=2&&"channelsLast"===m&&(0,p3.env)().getBool("WEBGL_EXP_CONV")){const e=p?tye(p,!0):null,t=new Gve(g,v,e,b,T),i=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();_=n.runWebGLProgram(t,r,"float32",i)}else if((0,p3.env)().getBool("WEBGL_CONV_IM2COL"))_=qve({x:r,filter:s,convInfo:g,backend:n,bias:o,activation:p,preluActivationWeights:a,leakyreluAlpha:f});else{const e=p?tye(p,!1):null,t=new jve(g,v,e,b,T),i=x();_=n.runWebGLProgram(t,i,"float32")}else _=Xve({x:r,filter:s,convInfo:g,backend:n,bias:o,activation:p,preluActivationWeights:a,leakyreluAlpha:f});const E=uye({inputs:{x:_},backend:n,attrs:{shape:g.outShape}});return y.push(_),y.forEach(e=>n.disposeIntermediateTensorInfo(e)),E}};const fTe={kernelName:p3.FusedDepthwiseConv2D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16937,7 +16937,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActiva * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:p}=i,f=[];let m=c;null==m&&(m=[1,1]),u3.util.assert(u3.backend_util.eitherStridesOrDilationsAreOne(l,m),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`);const g=u3.backend_util.computeConv2DInfo(r.shape,s.shape,l,m,u,d,!0),_=(0,u3.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,y=h?Z_e(h,_):null,v=[r,s],b=null!=o,T=null!=a,x="leakyrelu"===h;if(b&&v.push(o),T&&v.push(a),x){const e=n.makeTensorInfo([],"float32",u3.util.createScalarValue(p,"float32"));v.push(e),f.push(e)}let E;E=_?new bbe(g,b,y,T,x):new vbe(g,b,y,T,x);const w=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],I=n.runWebGLProgram(E,v,"float32",w);return f.forEach(e=>n.disposeIntermediateTensorInfo(e)),I}};class dTe{constructor(e,t,n,i){this.sliceDim=e,this.strides=t,this.paramsShape=i,this.variableNames=["x","indices"],this.outputShape=n;const r=Nme(n.length);let s="\n int index;";for(let e=0;e= ${this.paramsShape[e]};\n flattenIndex += index * ${this.strides[e]};`;this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${s}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const hTe={kernelName:u3.GatherNd,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:p}=i,f=[];let m=c;null==m&&(m=[1,1]),p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(l,m),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`);const g=p3.backend_util.computeConv2DInfo(r.shape,s.shape,l,m,u,d,!0),_=(0,p3.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,y=h?tye(h,_):null,v=[r,s],b=null!=o,T=null!=a,x="leakyrelu"===h;if(b&&v.push(o),T&&v.push(a),x){const e=n.makeTensorInfo([],"float32",p3.util.createScalarValue(p,"float32"));v.push(e),f.push(e)}let E;E=_?new wbe(g,b,y,T,x):new Ebe(g,b,y,T,x);const w=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],I=n.runWebGLProgram(E,v,"float32",w);return f.forEach(e=>n.disposeIntermediateTensorInfo(e)),I}};class mTe{constructor(e,t,n,i){this.sliceDim=e,this.strides=t,this.paramsShape=i,this.variableNames=["x","indices"],this.outputShape=n;const r=Pme(n.length);let s="\n int index;";for(let e=0;e= ${this.paramsShape[e]};\n flattenIndex += index * ${this.strides[e]};`;this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${s}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const gTe={kernelName:p3.GatherNd,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16954,7 +16954,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActiva * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{params:i,indices:r}=t,s=r.shape,o=s[s.length-1],a=u3.util.sizeFromShape(i.shape),[l,u,c,d]=u3.backend_util.prepareAndValidate(i,r),h=sye({inputs:{x:r},backend:n,attrs:{shape:[u,o]}}),p=sye({inputs:{x:i},backend:n,attrs:{shape:[u3.util.sizeFromShape(i.shape)/c,c]}});if(n.shouldExecuteOnCPU([i,r])||"string"===i.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(i),s=Sge(e,t,i.dtype,u,o,c,d,i.shape,a);return n.makeTensorInfo(l,i.dtype,s.values)}const f=new dTe(o,d,[u,c],i.shape),m=n.runWebGLProgram(f,[p,h],p.dtype),g=sye({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}}; +function(e){const{inputs:t,backend:n}=e,{params:i,indices:r}=t,s=r.shape,o=s[s.length-1],a=p3.util.sizeFromShape(i.shape),[l,u,c,d]=p3.backend_util.prepareAndValidate(i,r),h=uye({inputs:{x:r},backend:n,attrs:{shape:[u,o]}}),p=uye({inputs:{x:i},backend:n,attrs:{shape:[p3.util.sizeFromShape(i.shape)/c,c]}});if(n.shouldExecuteOnCPU([i,r])||"string"===i.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(i),s=kge(e,t,i.dtype,u,o,c,d,i.shape,a);return n.makeTensorInfo(l,i.dtype,s.values)}const f=new mTe(o,d,[u,c],i.shape),m=n.runWebGLProgram(f,[p,h],p.dtype),g=uye({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -16971,7 +16971,7 @@ function(e){const{inputs:t,backend:n}=e,{params:i,indices:r}=t,s=r.shape,o=s[s.l * limitations under the License. * ============================================================================= */ -class pTe{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=Nme(this.rank),i=function(e){const t=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let i=0;i= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${i}));\n }\n `}} +class _Te{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=Pme(this.rank),i=function(e){const t=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let i=0;i= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${i}));\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -16988,7 +16988,7 @@ class pTe{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t * limitations under the License. * ============================================================================= */ -function fTe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,batchDims:a}=i,l=u3.util.parseAxisParam(o,r.shape)[0];if((0,u3.env)().get("DEBUG")){const e=n.readSync(s.dataId),t=r.shape[l];for(let n=0;n=0,()=>`GatherV2: the index value ${i} is not in [0, ${t-1}]`)}}const u=u3.backend_util.segment_util.collectGatherOpShapeInfo(r,s,l,a),c=u3.util.sizeFromShape(s.shape),d=[],h=sye({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=sye({inputs:{x:s},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});d.push(h),d.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,s])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(h),i=Cge(t,e,f);return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(u.outputShape,i.dtype,i.values)}const m=new pTe(h.shape,f),g=n.runWebGLProgram(m,[h,p],h.dtype);d.push(g);const _=sye({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),_}const mTe={kernelName:u3.GatherV2,backendName:"webgl",kernelFunc:fTe},gTe=K_e({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:Oge,dtype:"bool"}),_Te={kernelName:u3.Greater,backendName:"webgl",kernelFunc:gTe},yTe=K_e({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Mge}),vTe={kernelName:u3.GreaterEqual,backendName:"webgl",kernelFunc:yTe};const bTe={kernelName:u3.IFFT,backendName:"webgl",kernelFunc: +function yTe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,batchDims:a}=i,l=p3.util.parseAxisParam(o,r.shape)[0];if((0,p3.env)().get("DEBUG")){const e=n.readSync(s.dataId),t=r.shape[l];for(let n=0;n=0,()=>`GatherV2: the index value ${i} is not in [0, ${t-1}]`)}}const u=p3.backend_util.segment_util.collectGatherOpShapeInfo(r,s,l,a),c=p3.util.sizeFromShape(s.shape),d=[],h=uye({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=uye({inputs:{x:s},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});d.push(h),d.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,s])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(h),i=Rge(t,e,f);return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(u.outputShape,i.dtype,i.values)}const m=new _Te(h.shape,f),g=n.runWebGLProgram(m,[h,p],h.dtype);d.push(g);const _=uye({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),_}const vTe={kernelName:p3.GatherV2,backendName:"webgl",kernelFunc:yTe},bTe=eye({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:Nge,dtype:"bool"}),TTe={kernelName:p3.Greater,backendName:"webgl",kernelFunc:bTe},xTe=eye({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Dge}),ETe={kernelName:p3.GreaterEqual,backendName:"webgl",kernelFunc:xTe};const wTe={kernelName:p3.IFFT,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17005,7 +17005,7 @@ function fTe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,ba * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{input:i}=t;return Hbe(i,!0,n)}},TTe=q_e({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),xTe={kernelName:u3.IsFinite,backendName:"webgl",kernelFunc:TTe},ETe=q_e({opSnippet:"return float(isinf(x));",dtype:"bool"}),wTe={kernelName:u3.IsInf,backendName:"webgl",kernelFunc:ETe},ITe=q_e({opSnippet:"return float(isnan(x));",dtype:"bool"}),ATe={kernelName:u3.IsNan,backendName:"webgl",kernelFunc:ITe},STe=K_e({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:kge,dtype:"bool"}),CTe={kernelName:u3.Less,backendName:"webgl",kernelFunc:STe},OTe=K_e({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:Rge,dtype:"bool"}),MTe={kernelName:u3.LessEqual,backendName:"webgl",kernelFunc:OTe};const kTe={kernelName:u3.LinSpace,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{input:i}=t;return Kbe(i,!0,n)}},ITe=J_e({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),ATe={kernelName:p3.IsFinite,backendName:"webgl",kernelFunc:ITe},STe=J_e({opSnippet:"return float(isinf(x));",dtype:"bool"}),CTe={kernelName:p3.IsInf,backendName:"webgl",kernelFunc:STe},OTe=J_e({opSnippet:"return float(isnan(x));",dtype:"bool"}),MTe={kernelName:p3.IsNan,backendName:"webgl",kernelFunc:OTe},kTe=eye({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:Fge,dtype:"bool"}),RTe={kernelName:p3.Less,backendName:"webgl",kernelFunc:kTe},NTe=eye({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:Lge,dtype:"bool"}),DTe={kernelName:p3.LessEqual,backendName:"webgl",kernelFunc:NTe};const FTe={kernelName:p3.LinSpace,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17022,7 +17022,7 @@ function(e){const{inputs:t,backend:n}=e,{input:i}=t;return Hbe(i,!0,n)}},TTe=q_e * limitations under the License. * ============================================================================= */ -function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=Nge(i,r,s);return t.makeTensorInfo([o.length],"float32",o)}},RTe=q_e({opSnippet:X_e+"\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:Dge}),NTe={kernelName:u3.Log,backendName:"webgl",kernelFunc:RTe},DTe=q_e({opSnippet:X_e+"\n return log(1.0 + x);\n"}),FTe={kernelName:u3.Log1p,backendName:"webgl",kernelFunc:DTe},LTe=K_e({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),PTe={kernelName:u3.LogicalAnd,backendName:"webgl",kernelFunc:LTe},BTe=q_e({opSnippet:"return float(!(x >= 1.0));"}),$Te={kernelName:u3.LogicalNot,backendName:"webgl",kernelFunc:BTe},UTe=K_e({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),VTe={kernelName:u3.LogicalOr,backendName:"webgl",kernelFunc:UTe}; +function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=Pge(i,r,s);return t.makeTensorInfo([o.length],"float32",o)}},LTe=J_e({opSnippet:Q_e+"\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:Bge}),PTe={kernelName:p3.Log,backendName:"webgl",kernelFunc:LTe},BTe=J_e({opSnippet:Q_e+"\n return log(1.0 + x);\n"}),$Te={kernelName:p3.Log1p,backendName:"webgl",kernelFunc:BTe},UTe=eye({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),VTe={kernelName:p3.LogicalAnd,backendName:"webgl",kernelFunc:UTe},zTe=J_e({opSnippet:"return float(!(x >= 1.0));"}),jTe={kernelName:p3.LogicalNot,backendName:"webgl",kernelFunc:zTe},YTe=eye({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),GTe={kernelName:p3.LogicalOr,backendName:"webgl",kernelFunc:YTe}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17039,7 +17039,7 @@ function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=Nge(i,r,s);ret * limitations under the License. * ============================================================================= */ -class zTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[];const s=t,o=e[3]-1;let a;this.outputShape=e;const l=`float(${n}) + float(${i}) * sum`;a=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${s}; j <= ${s}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${o}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${a};\n setOutput(val);\n }\n `}} +class HTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[];const s=t,o=e[3]-1;let a;this.outputShape=e;const l=`float(${n}) + float(${i}) * sum`;a=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${s}; j <= ${s}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${o}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${a};\n setOutput(val);\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -17056,7 +17056,7 @@ class zTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[];co * limitations under the License. * ============================================================================= */ -class jTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const s=t,o=e[3]-1;let a;this.outputShape=e;const l=`float(${n}) + float(${i}) * sum`;a=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${s};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${s}; j <= ${s}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${o}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${a};\n setOutput(result);\n }\n `}} +class WTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const s=t,o=e[3]-1;let a;this.outputShape=e;const l=`float(${n}) + float(${i}) * sum`;a=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${s};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${s}; j <= ${s}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${o}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${a};\n setOutput(result);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17073,7 +17073,7 @@ class jTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[],th * limitations under the License. * ============================================================================= */ -const YTe={kernelName:u3.LRN,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{depthRadius:s,bias:o,alpha:a,beta:l}=i,u=(0,u3.env)().getBool("WEBGL_PACK_NORMALIZATION")?new jTe(r.shape,s,o,a,l):new zTe(r.shape,s,o,a,l);return n.runWebGLProgram(u,[r],r.dtype)}}; +const XTe={kernelName:p3.LRN,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{depthRadius:s,bias:o,alpha:a,beta:l}=i,u=(0,p3.env)().getBool("WEBGL_PACK_NORMALIZATION")?new WTe(r.shape,s,o,a,l):new HTe(r.shape,s,o,a,l);return n.runWebGLProgram(u,[r],r.dtype)}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -17090,7 +17090,7 @@ const YTe={kernelName:u3.LRN,backendName:"webgl",kernelFunc:e=>{const{inputs:t,b * limitations under the License. * ============================================================================= */ -class GTe{constructor(e,t,n,i,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=i,this.beta=r,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${i}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${i})\n * float(${r})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${r});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}} +class qTe{constructor(e,t,n,i,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=i,this.beta=r,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${i}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${i})\n * float(${r})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${r});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17107,7 +17107,7 @@ class GTe{constructor(e,t,n,i,r){this.variableNames=["inputImage","outputImage", * limitations under the License. * ============================================================================= */ -const HTe={kernelName:u3.LRNGrad,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r,y:s,dy:o}=t,{depthRadius:a,bias:l,alpha:u,beta:c}=i,d=new GTe(r.shape,a,l,u,c);return n.runWebGLProgram(d,[r,s,o],r.dtype)}}; +const KTe={kernelName:p3.LRNGrad,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r,y:s,dy:o}=t,{depthRadius:a,bias:l,alpha:u,beta:c}=i,d=new qTe(r.shape,a,l,u,c);return n.runWebGLProgram(d,[r,s,o],r.dtype)}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17124,7 +17124,7 @@ const HTe={kernelName:u3.LRNGrad,backendName:"webgl",kernelFunc:e=>{const{inputs * limitations under the License. * ============================================================================= */ -function WTe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reductionIndices:s,keepDims:o}=i,a=r.shape.length,l=u3.util.parseAxisParam(s,r.shape);let u=l;const c=u3.backend_util.getAxesPermutation(u,a),d=null!=c,h=n.shouldExecuteOnCPU([r]);let p=r;if(d){if(h){const e=n.texData.get(p.dataId).values,t=new Array(a);for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=u3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);if(1===u.filterWidth&&1===u.filterHeight&&u3.util.arraysEqual(u.inShape,u.outShape))return B_e({inputs:{x:r},backend:n});const c=new Kye(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const QTe={kernelName:u3.MaxPool3D,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;yme(r,"maxPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=p3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);if(1===u.filterWidth&&1===u.filterHeight&&p3.util.arraysEqual(u.inShape,u.outShape))return z_e({inputs:{x:r},backend:n});const c=new eve(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const nxe={kernelName:p3.MaxPool3D,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17175,7 +17175,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;fme(r,"maxPool");const{f * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dataFormat:l,dimRoundingMode:u}=i,c=u3.backend_util.computePool3DInfo(r.shape,s,o,[1,1,1],a,u,l),d=new Zye(c,"max",!1);return n.runWebGLProgram(d,[r],r.dtype)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dataFormat:l,dimRoundingMode:u}=i,c=p3.backend_util.computePool3DInfo(r.shape,s,o,[1,1,1],a,u,l),d=new tve(c,"max",!1);return n.runWebGLProgram(d,[r],r.dtype)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17192,7 +17192,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o, * limitations under the License. * ============================================================================= */ -class JTe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,i=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,o=r-1-e.padInfo.top,a=s-1-e.padInfo.left,l=r*s-1;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${r};\n wR += ${i}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${s}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${s} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class exe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,i=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,o=e.dilationWidth,a=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=a-1-e.padInfo.front,d=l-1-e.padInfo.top,h=u-1-e.padInfo.left,p=a*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${d}, ${h});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${a};\n wD += ${r}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${o}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const txe={kernelName:u3.MaxPool3DGrad,backendName:"webgl",kernelFunc: +class ixe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,i=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,o=r-1-e.padInfo.top,a=s-1-e.padInfo.left,l=r*s-1;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${r};\n wR += ${i}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${s}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${s} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class rxe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,i=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,o=e.dilationWidth,a=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=a-1-e.padInfo.front,d=l-1-e.padInfo.top,h=u-1-e.padInfo.left,p=a*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${d}, ${h});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${a};\n wD += ${r}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${o}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const sxe={kernelName:p3.MaxPool3DGrad,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17209,7 +17209,7 @@ class JTe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.i * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize:a,strides:l,pad:u,dimRoundingMode:c}=i,d=u3.backend_util.computePool3DInfo(o.shape,a,l,[1,1,1],u,c),h=new Zye(d,"max",!0),p=n.runWebGLProgram(h,[o],o.dtype),f=new exe(d),m=n.runWebGLProgram(f,[r,p],o.dtype);return n.disposeIntermediateTensorInfo(p),m}};const nxe={kernelName:u3.MaxPoolGrad,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize:a,strides:l,pad:u,dimRoundingMode:c}=i,d=p3.backend_util.computePool3DInfo(o.shape,a,l,[1,1,1],u,c),h=new tve(d,"max",!0),p=n.runWebGLProgram(h,[o],o.dtype),f=new rxe(d),m=n.runWebGLProgram(f,[r,p],o.dtype);return n.disposeIntermediateTensorInfo(p),m}};const oxe={kernelName:p3.MaxPoolGrad,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17226,7 +17226,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;fme([s,o],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:d}=i,h=u3.backend_util.computePool2DInfo(a.shape,l,u,1,c,d),p=new Kye(h,"max",!0),f=n.runWebGLProgram(p,[a],a.dtype),m=new JTe(h),g=n.runWebGLProgram(m,[r,f],a.dtype);return n.disposeIntermediateTensorInfo(f),g}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;yme([s,o],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:d}=i,h=p3.backend_util.computePool2DInfo(a.shape,l,u,1,c,d),p=new eve(h,"max",!0),f=n.runWebGLProgram(p,[a],a.dtype),m=new ixe(h),g=n.runWebGLProgram(m,[r,f],a.dtype);return n.disposeIntermediateTensorInfo(f),g}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17243,7 +17243,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;fm * limitations under the License. * ============================================================================= */ -const ixe={kernelName:u3.MaxPoolWithArgmax,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{filterSize:r,strides:s,pad:o,includeBatchInIndex:a}=t,l=n;u3.util.assert(4===i.shape.length,()=>`Error in maxPool: input must be rank 4 but got rank ${i.shape.length}.`);const u=[1,1];u3.util.assert(u3.backend_util.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);const c=u3.backend_util.computePool2DInfo(i.shape,r,s,u,o),[d,h]= +const axe={kernelName:p3.MaxPoolWithArgmax,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{filterSize:r,strides:s,pad:o,includeBatchInIndex:a}=t,l=n;p3.util.assert(4===i.shape.length,()=>`Error in maxPool: input must be rank 4 but got rank ${i.shape.length}.`);const u=[1,1];p3.util.assert(p3.backend_util.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);const c=p3.backend_util.computePool2DInfo(i.shape,r,s,u,o),[d,h]= /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17260,7 +17260,7 @@ const ixe={kernelName:u3.MaxPoolWithArgmax,backendName:"webgl",kernelFunc:({inpu * limitations under the License. * ============================================================================= */ -function(e,t,n,i){let r=new Kye(n,"max",!1);const s=i.runWebGLProgram(r,[e],"float32");return r=new Kye(n,"max",!0,!0,t),[s,i.runWebGLProgram(r,[e],"float32")]}(i,a,c,l);return[d,h]}}; +function(e,t,n,i){let r=new eve(n,"max",!1);const s=i.runWebGLProgram(r,[e],"float32");return r=new eve(n,"max",!0,!0,t),[s,i.runWebGLProgram(r,[e],"float32")]}(i,a,c,l);return[d,h]}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17277,7 +17277,7 @@ function(e,t,n,i){let r=new Kye(n,"max",!1);const s=i.runWebGLProgram(r,[e],"flo * limitations under the License. * ============================================================================= */ -const rxe={kernelName:u3.Mean,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{keepDims:r,axis:s}=t,o=n,a=i.shape.length,l=u3.util.parseAxisParam(s,i.shape);let u=l;const c=u3.backend_util.getAxesPermutation(u,a),d=null!=c,h=o.shouldExecuteOnCPU([i]),p=[];let f=i;if(d){if(h){const e=o.texData.get(f.dataId).values,t=new Array(a);for(let e=0;e{const{x:i}=e,{keepDims:r,axis:s}=t,o=n,a=i.shape.length,l=p3.util.parseAxisParam(s,i.shape);let u=l;const c=p3.backend_util.getAxesPermutation(u,a),d=null!=c,h=o.shouldExecuteOnCPU([i]),p=[];let f=i;if(d){if(h){const e=o.texData.get(f.dataId).values,t=new Array(a);for(let e=0;et[0]+e[n]+t[1]);const i=e.length,r=Nme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i),l="reflect"===n?0:1;this.userCode=1!==i?`\n ${r} start = ${r}(${s});\n ${r} end = ${r}(${o});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${i}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${r} coords = outC - start;\n setOutput(getX(${a}));\n }\n `:`\n int start = ${s};\n int end = ${o};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}} +class hxe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=Pme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i),l="reflect"===n?0:1;this.userCode=1!==i?`\n ${r} start = ${r}(${s});\n ${r} end = ${r}(${o});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${i}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${r} coords = outC - start;\n setOutput(getX(${a}));\n }\n `:`\n int start = ${s};\n int end = ${o};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17345,7 +17345,7 @@ class lxe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((t, * limitations under the License. * ============================================================================= */ -class uxe{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=Nme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=h_e("rc",i),l=h_e("source",i),u=`${a[i-1]} < ${this.outputShape[i-1]}`,c=1===i?"source":`vec2(${l.slice(-2).join()})`,d="reflect"===n?0:1;let h="";if(1===i){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${d};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${d};\n }\n source -= start;\n `;h=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const e=`\n ${r} source = rc;\n ${r} lt = ${r}(lessThan(source, start));\n ${r} gte = ${r}(greaterThanEqual(source, end));\n ${r} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${d}) +\n gte * ((end - 1) * 2 - source + ${d});\n source -= start;\n `;h=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${a[i-2]} += 1;\n if(${a[i-2]} < ${this.outputShape[i-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${s});\n const ${r} end = ${r}(${o});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${h}\n setOutput(result);\n }\n `}} +class pxe{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=Pme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=g_e("rc",i),l=g_e("source",i),u=`${a[i-1]} < ${this.outputShape[i-1]}`,c=1===i?"source":`vec2(${l.slice(-2).join()})`,d="reflect"===n?0:1;let h="";if(1===i){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${d};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${d};\n }\n source -= start;\n `;h=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const e=`\n ${r} source = rc;\n ${r} lt = ${r}(lessThan(source, start));\n ${r} gte = ${r}(greaterThanEqual(source, end));\n ${r} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${d}) +\n gte * ((end - 1) * 2 - source + ${d});\n source -= start;\n `;h=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${a[i-2]} += 1;\n if(${a[i-2]} < ${this.outputShape[i-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${s});\n const ${r} end = ${r}(${o});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${h}\n setOutput(result);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17362,7 +17362,7 @@ class uxe{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this. * limitations under the License. * ============================================================================= */ -const cxe={kernelName:u3.MirrorPad,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i}=e,{paddings:r,mode:s}=n,o=(0,u3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new uxe(i.shape,r,s):new lxe(i.shape,r,s);return t.runWebGLProgram(o,[i],i.dtype)}},dxe=K_e({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n "+L_e+"\n return result;\n"}),hxe={kernelName:u3.Mod,backendName:"webgl",kernelFunc:dxe}; +const fxe={kernelName:p3.MirrorPad,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i}=e,{paddings:r,mode:s}=n,o=(0,p3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new pxe(i.shape,r,s):new hxe(i.shape,r,s);return t.runWebGLProgram(o,[i],i.dtype)}},mxe=eye({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n "+U_e+"\n return result;\n"}),gxe={kernelName:p3.Mod,backendName:"webgl",kernelFunc:mxe}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17379,7 +17379,7 @@ const cxe={kernelName:u3.MirrorPad,backendName:"webgl",kernelFunc:({inputs:e,bac * limitations under the License. * ============================================================================= */ -class pxe{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}} +class _xe{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17396,7 +17396,7 @@ class pxe{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{ * limitations under the License. * ============================================================================= */ -const fxe=K_e({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),mxe={kernelName:u3.RealDiv,backendName:"webgl",kernelFunc:fxe},gxe="return a - b;",_xe=K_e({opSnippet:gxe,packedOpSnippet:gxe,supportsComplex:!0,cpuKernelImpl:o_e}),yxe={kernelName:u3.Sub,backendName:"webgl",kernelFunc:_xe}; +const yxe=eye({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),vxe={kernelName:p3.RealDiv,backendName:"webgl",kernelFunc:yxe},bxe="return a - b;",Txe=eye({opSnippet:bxe,packedOpSnippet:bxe,supportsComplex:!0,cpuKernelImpl:c_e}),xxe={kernelName:p3.Sub,backendName:"webgl",kernelFunc:Txe}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17413,7 +17413,7 @@ const fxe=K_e({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",pac * limitations under the License. * ============================================================================= */ -function vxe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=u3.util.parseAxisParam([s],r.shape),a=WTe({inputs:{x:r},backend:n,attrs:{reductionIndices:o,keepDims:!1}}),l=u3.backend_util.expandShapeToKeepDim(a.shape,o),u=sye({inputs:{x:a},backend:n,attrs:{shape:l}}),c=_xe({inputs:{a:r,b:u},backend:n}),d=Bbe({inputs:{x:c},backend:n}),h=pye({inputs:{x:d},backend:n,attrs:{axis:o,keepDims:!1}}),p=sye({inputs:{x:h},backend:n,attrs:{shape:l}}),f=fxe({inputs:{a:d,b:p},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),f}const bxe={kernelName:u3.Softmax,backendName:"webgl",kernelFunc:vxe};const Txe={kernelName:u3.Multinomial,backendName:"webgl",kernelFunc: +function Exe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=p3.util.parseAxisParam([s],r.shape),a=ZTe({inputs:{x:r},backend:n,attrs:{reductionIndices:o,keepDims:!1}}),l=p3.backend_util.expandShapeToKeepDim(a.shape,o),u=uye({inputs:{x:a},backend:n,attrs:{shape:l}}),c=Txe({inputs:{a:r,b:u},backend:n}),d=zbe({inputs:{x:c},backend:n}),h=_ye({inputs:{x:d},backend:n,attrs:{axis:o,keepDims:!1}}),p=uye({inputs:{x:h},backend:n,attrs:{shape:l}}),f=yxe({inputs:{a:d,b:p},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),f}const wxe={kernelName:p3.Softmax,backendName:"webgl",kernelFunc:Exe};const Ixe={kernelName:p3.Multinomial,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17430,7 +17430,7 @@ function vxe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=u3. * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{numSamples:s,seed:o,normalized:a}=i,l=a?r:vxe({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],d=new pxe(u,c,s),h=[[o]],p=n.runWebGLProgram(d,[l],"int32",h);return a||n.disposeIntermediateTensorInfo(l),p}},xxe=b_e+"\n return -x;\n";const Exe={kernelName:u3.Neg,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;if(n.shouldExecuteOnCPU([i])){const e=n.texData.get(i.dataId),[t,r]=$ge(e.values,i.shape,i.dtype);return n.makeTensorInfo(r,i.dtype,t)}let r;return r=(0,u3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new I_e(i.shape,"\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"):new v_e(i.shape,xxe),n.runWebGLProgram(r,[i],i.dtype)}},wxe=u3.kernel_impls.nonMaxSuppressionV3Impl;const Ixe={kernelName:u3.NonMaxSuppressionV3,backendName:"webgl",kernelFunc:function(e){u3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=i,u=n.readSync(r.dataId),c=n.readSync(s.dataId),{selectedIndices:d}=wxe(u,c,o,a,l);return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}},Axe=u3.kernel_impls.nonMaxSuppressionV4Impl;const Sxe={kernelName:u3.NonMaxSuppressionV4,backendName:"webgl",kernelFunc:function(e){u3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,padToMaxOutputSize:u}=i,c=n.readSync(r.dataId),d=n.readSync(s.dataId),{selectedIndices:h,validOutputs:p}=Axe(c,d,o,a,l,u);return[n.makeTensorInfo([h.length],"int32",new Int32Array(h)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},Cxe=u3.kernel_impls.nonMaxSuppressionV5Impl;const Oxe={kernelName:u3.NonMaxSuppressionV5,backendName:"webgl",kernelFunc:function(e){u3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=i,c=n.readSync(r.dataId),d=n.readSync(s.dataId),h=o,p=a,f=l,m=u,{selectedIndices:g,selectedScores:_}=Cxe(c,d,h,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([_.length],"float32",new Float32Array(_))]}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{numSamples:s,seed:o,normalized:a}=i,l=a?r:Exe({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],d=new _xe(u,c,s),h=[[o]],p=n.runWebGLProgram(d,[l],"int32",h);return a||n.disposeIntermediateTensorInfo(l),p}},Axe=w_e+"\n return -x;\n";const Sxe={kernelName:p3.Neg,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;if(n.shouldExecuteOnCPU([i])){const e=n.texData.get(i.dataId),[t,r]=jge(e.values,i.shape,i.dtype);return n.makeTensorInfo(r,i.dtype,t)}let r;return r=(0,p3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new O_e(i.shape,"\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"):new E_e(i.shape,Axe),n.runWebGLProgram(r,[i],i.dtype)}},Cxe=p3.kernel_impls.nonMaxSuppressionV3Impl;const Oxe={kernelName:p3.NonMaxSuppressionV3,backendName:"webgl",kernelFunc:function(e){p3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=i,u=n.readSync(r.dataId),c=n.readSync(s.dataId),{selectedIndices:d}=Cxe(u,c,o,a,l);return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}},Mxe=p3.kernel_impls.nonMaxSuppressionV4Impl;const kxe={kernelName:p3.NonMaxSuppressionV4,backendName:"webgl",kernelFunc:function(e){p3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,padToMaxOutputSize:u}=i,c=n.readSync(r.dataId),d=n.readSync(s.dataId),{selectedIndices:h,validOutputs:p}=Mxe(c,d,o,a,l,u);return[n.makeTensorInfo([h.length],"int32",new Int32Array(h)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},Rxe=p3.kernel_impls.nonMaxSuppressionV5Impl;const Nxe={kernelName:p3.NonMaxSuppressionV5,backendName:"webgl",kernelFunc:function(e){p3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=i,c=n.readSync(r.dataId),d=n.readSync(s.dataId),h=o,p=a,f=l,m=u,{selectedIndices:g,selectedScores:_}=Rxe(c,d,h,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([_.length],"float32",new Float32Array(_))]}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17447,7 +17447,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{numSamples:s,seed: * limitations under the License. * ============================================================================= */ -class Mxe{constructor(e,t,n,i){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${i}), float(${n}),\n float(index == coords.y)));\n }\n `}} +class Dxe{constructor(e,t,n,i){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${i}), float(${n}),\n float(index == coords.y)));\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17464,7 +17464,7 @@ class Mxe{constructor(e,t,n,i){this.variableNames=["indices"],this.outputShape=[ * limitations under the License. * ============================================================================= */ -const kxe={kernelName:u3.OneHot,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{indices:r}=t,{dtype:s,depth:o,onValue:a,offValue:l}=i,u=u3.util.sizeFromShape(r.shape),c=new Mxe(u,o,a,l),d=sye({inputs:{x:r},backend:n,attrs:{shape:[u]}}),h=n.runWebGLProgram(c,[d],s);n.disposeIntermediateTensorInfo(d);const p=sye({inputs:{x:h},backend:n,attrs:{shape:[...r.shape,o]}});return n.disposeIntermediateTensorInfo(h),p}}; +const Fxe={kernelName:p3.OneHot,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{indices:r}=t,{dtype:s,depth:o,onValue:a,offValue:l}=i,u=p3.util.sizeFromShape(r.shape),c=new Dxe(u,o,a,l),d=uye({inputs:{x:r},backend:n,attrs:{shape:[u]}}),h=n.runWebGLProgram(c,[d],s);n.disposeIntermediateTensorInfo(d);const p=uye({inputs:{x:h},backend:n,attrs:{shape:[...r.shape,o]}});return n.disposeIntermediateTensorInfo(h),p}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17481,7 +17481,7 @@ const kxe={kernelName:u3.OneHot,backendName:"webgl",kernelFunc:e=>{const{inputs: * limitations under the License. * ============================================================================= */ -function Rxe(e){const{inputs:t,backend:n}=e,{x:i}=t;if("complex64"===i.dtype){const e=vve({inputs:{input:i},backend:n}),t=Rxe({inputs:{x:e},backend:n}),r=Dve({inputs:{input:i},backend:n}),s=Rxe({inputs:{x:r},backend:n}),o=U_e({inputs:{real:t,imag:s},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),o}return qbe({attrs:{shape:i.shape,dtype:i.dtype,value:"string"===i.dtype?"":0},backend:n})}const Nxe={kernelName:u3.ZerosLike,backendName:"webgl",kernelFunc:Rxe};const Dxe={kernelName:u3.OnesLike,backendName:"webgl",kernelFunc: +function Lxe(e){const{inputs:t,backend:n}=e,{x:i}=t;if("complex64"===i.dtype){const e=Eve({inputs:{input:i},backend:n}),t=Lxe({inputs:{x:e},backend:n}),r=Bve({inputs:{input:i},backend:n}),s=Lxe({inputs:{x:r},backend:n}),o=Y_e({inputs:{real:t,imag:s},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),o}return Jbe({attrs:{shape:i.shape,dtype:i.dtype,value:"string"===i.dtype?"":0},backend:n})}const Pxe={kernelName:p3.ZerosLike,backendName:"webgl",kernelFunc:Lxe};const Bxe={kernelName:p3.OnesLike,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17498,7 +17498,7 @@ function Rxe(e){const{inputs:t,backend:n}=e,{x:i}=t;if("complex64"===i.dtype){co * limitations under the License. * ============================================================================= */ -function e(t){const{inputs:n,backend:i}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=vve({inputs:{input:r},backend:i}),n=e({inputs:{x:t},backend:i}),s=Dve({inputs:{input:r},backend:i}),o=Rxe({inputs:{x:s},backend:i}),a=U_e({inputs:{real:n,imag:o},backend:i});return i.disposeIntermediateTensorInfo(t),i.disposeIntermediateTensorInfo(n),i.disposeIntermediateTensorInfo(s),i.disposeIntermediateTensorInfo(o),a}return qbe({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:i})}};const Fxe={kernelName:u3.Pack,backendName:"webgl",kernelFunc: +function e(t){const{inputs:n,backend:i}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=Eve({inputs:{input:r},backend:i}),n=e({inputs:{x:t},backend:i}),s=Bve({inputs:{input:r},backend:i}),o=Lxe({inputs:{x:s},backend:i}),a=Y_e({inputs:{real:n,imag:o},backend:i});return i.disposeIntermediateTensorInfo(t),i.disposeIntermediateTensorInfo(n),i.disposeIntermediateTensorInfo(s),i.disposeIntermediateTensorInfo(o),a}return Jbe({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:i})}};const $xe={kernelName:p3.Pack,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17515,7 +17515,7 @@ function e(t){const{inputs:n,backend:i}=t,{x:r}=n;if("string"===r.dtype)throw ne * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)return Ube({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const s=t[0].shape,o=t[0].dtype;t.forEach(e=>{u3.util.assertShapesMatch(s,e.shape,"All tensors passed to stack must have matching shapes"),u3.util.assert(o===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const a=[],l=Pve({inputs:t.map(e=>{const t=Ube({inputs:{input:e},backend:n,attrs:{dim:r}});return a.push(t),t}),backend:n,attrs:{axis:r}});return a.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)return Ybe({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const s=t[0].shape,o=t[0].dtype;t.forEach(e=>{p3.util.assertShapesMatch(s,e.shape,"All tensors passed to stack must have matching shapes"),p3.util.assert(o===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const a=[],l=Vve({inputs:t.map(e=>{const t=Ybe({inputs:{input:e},backend:n,attrs:{dim:r}});return a.push(t),t}),backend:n,attrs:{axis:r}});return a.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17532,7 +17532,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)retur * limitations under the License. * ============================================================================= */ -class Lxe{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=Nme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i);this.userCode=1!==i?`\n ${r} start = ${r}(${s});\n ${r} end = ${r}(${o});\n\n void main() {\n ${r} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${r} coords = outC - start;\n setOutput(getX(${a}));\n }\n }\n `:`\n int start = ${s};\n int end = ${o};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}} +class Uxe{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=Pme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i);this.userCode=1!==i?`\n ${r} start = ${r}(${s});\n ${r} end = ${r}(${o});\n\n void main() {\n ${r} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${r} coords = outC - start;\n setOutput(getX(${a}));\n }\n }\n `:`\n int start = ${s};\n int end = ${o};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -17549,7 +17549,7 @@ class Lxe{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name * limitations under the License. * ============================================================================= */ -class Pxe{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=Nme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=h_e("rc",i),l=h_e("source",i),u=`${a[i-1]} < ${this.outputShape[i-1]}`,c=1===i?"source":`vec2(${l.slice(-2).join()})`,d=[`${r} rc = outputLoc;`,`${a[i-1]} += 1;\n if(${u}) {\n `,1===i?"":`}\n rc = outputLoc;\n ${a[i-2]} += 1;\n if(${a[i-2]} < ${this.outputShape[i-2]}) {`,1===i?"":` ${a[i-1]} += 1;\n if(${u}) {`],h=1===i?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===i?2:4;et[0]+e[n]+t[1]);const i=e.length,r=Pme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=g_e("rc",i),l=g_e("source",i),u=`${a[i-1]} < ${this.outputShape[i-1]}`,c=1===i?"source":`vec2(${l.slice(-2).join()})`,d=[`${r} rc = outputLoc;`,`${a[i-1]} += 1;\n if(${u}) {\n `,1===i?"":`}\n rc = outputLoc;\n ${a[i-2]} += 1;\n if(${a[i-2]} < ${this.outputShape[i-2]}) {`,1===i?"":` ${a[i-1]} += 1;\n if(${u}) {`],h=1===i?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===i?2:4;e{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValue:o}=i;if(0===u3.util.sizeFromShape(r.shape)){const e=s.map((e,t)=>e[0]+r.shape[t]+e[1]);return qbe({backend:n,attrs:{shape:e,value:o,dtype:r.dtype}})}const a=(0,u3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Pxe(r.shape,s,o):new Lxe(r.shape,s,o),l=[[o]];return n.runWebGLProgram(a,[r],r.dtype,l)},$xe={kernelName:u3.PadV2,backendName:"webgl",kernelFunc:Bxe},Uxe=K_e({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n "+L_e+"\n return result;\n"}),Vxe={kernelName:u3.Pow,backendName:"webgl",kernelFunc:Uxe};const zxe={kernelName:u3.Prod,backendName:"webgl",kernelFunc: +const zxe=e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValue:o}=i;if(0===p3.util.sizeFromShape(r.shape)){const e=s.map((e,t)=>e[0]+r.shape[t]+e[1]);return Jbe({backend:n,attrs:{shape:e,value:o,dtype:r.dtype}})}const a=(0,p3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Vxe(r.shape,s,o):new Uxe(r.shape,s,o),l=[[o]];return n.runWebGLProgram(a,[r],r.dtype,l)},jxe={kernelName:p3.PadV2,backendName:"webgl",kernelFunc:zxe},Yxe=eye({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n "+U_e+"\n return result;\n"}),Gxe={kernelName:p3.Pow,backendName:"webgl",kernelFunc:Yxe};const Hxe={kernelName:p3.Prod,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17583,7 +17583,7 @@ const Bxe=e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantVa * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=[],u=u3.util.parseAxisParam(s,r.shape);let c=u;const d=u3.backend_util.getAxesPermutation(c,a);let h,p=r;if(null!=d&&(p=mye({inputs:{x:r},backend:n,attrs:{perm:d}}),c=u3.backend_util.getInnerMostAxes(c.length,a),l.push(p)),u3.backend_util.assertAxesAreInnerMostDims("prod",c,a),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:i,outDtype:r}=Vge(p.shape,p.dtype,e,c);h=n.makeTensorInfo(i,r,t)}else{const[e,t]=u3.backend_util.computeOutAndReduceShapes(p.shape,c),i=u3.util.sizeFromShape(t),s=sye({inputs:{x:p},backend:n,attrs:{shape:[-1,i]}}),o=uye(s,(0,u3.sumOutType)(r.dtype),"prod",n);h=sye({inputs:{x:o},backend:n,attrs:{shape:e}}),l.push(s),l.push(o)}if(o){l.push(h);const e=u3.backend_util.expandShapeToKeepDim(h.shape,u);h=sye({inputs:{x:h},backend:n,attrs:{shape:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),h}};const jxe={kernelName:u3.RaggedGather,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=[],u=p3.util.parseAxisParam(s,r.shape);let c=u;const d=p3.backend_util.getAxesPermutation(c,a);let h,p=r;if(null!=d&&(p=vye({inputs:{x:r},backend:n,attrs:{perm:d}}),c=p3.backend_util.getInnerMostAxes(c.length,a),l.push(p)),p3.backend_util.assertAxesAreInnerMostDims("prod",c,a),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:i,outDtype:r}=Gge(p.shape,p.dtype,e,c);h=n.makeTensorInfo(i,r,t)}else{const[e,t]=p3.backend_util.computeOutAndReduceShapes(p.shape,c),i=p3.util.sizeFromShape(t),s=uye({inputs:{x:p},backend:n,attrs:{shape:[-1,i]}}),o=pye(s,(0,p3.sumOutType)(r.dtype),"prod",n);h=uye({inputs:{x:o},backend:n,attrs:{shape:e}}),l.push(s),l.push(o)}if(o){l.push(h);const e=p3.backend_util.expandShapeToKeepDim(h.shape,u);h=uye({inputs:{x:h},backend:n,attrs:{shape:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),h}};const Wxe={kernelName:p3.RaggedGather,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -17600,7 +17600,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a= * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:o}=t,{outputRaggedRank:a}=i,l=r.map(e=>n.readSync(e.dataId)),u=r.map(e=>e.shape),c=n.readSync(s.dataId),d=n.readSync(o.dataId),[h,p,f]=zge(l,u,c,s.shape,s.dtype,d,o.shape,a),m=h.map(e=>n.makeTensorInfo([e.length],"int32",e)),g=n.makeTensorInfo(f,s.dtype,p);return m.concat([g])}};const Yxe={kernelName:u3.RaggedRange,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:o}=t,{outputRaggedRank:a}=i,l=r.map(e=>n.readSync(e.dataId)),u=r.map(e=>e.shape),c=n.readSync(s.dataId),d=n.readSync(o.dataId),[h,p,f]=Hge(l,u,c,s.shape,s.dtype,d,o.shape,a),m=h.map(e=>n.makeTensorInfo([e.length],"int32",e)),g=n.makeTensorInfo(f,s.dtype,p);return m.concat([g])}};const Xxe={kernelName:p3.RaggedRange,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. @@ -17617,7 +17617,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDens * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=jge(o,i.shape,i.dtype,a,r.shape,l,s.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],i.dtype,c)]}};const Gxe={kernelName:u3.RaggedTensorToTensor,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=Wge(o,i.shape,i.dtype,a,r.shape,l,s.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],i.dtype,c)]}};const qxe={kernelName:p3.RaggedTensorToTensor,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -17634,7 +17634,7 @@ function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.readS * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o,rowPartitionTensors:a}=t,{rowPartitionTypes:l}=i,u=n.readSync(r.dataId),c=n.readSync(s.dataId),d=n.readSync(o.dataId),h=a.map(e=>n.readSync(e.dataId)),p=a.map(e=>e.shape),[f,m]=Yge(u,r.shape,c,s.shape,s.dtype,d,o.shape,h,p,l);return n.makeTensorInfo(f,s.dtype,m)}},Hxe=e=>{const{backend:t,attrs:n}=e,{start:i,stop:r,step:s,dtype:o}=n,a=Gge(i,r,s,o);return t.makeTensorInfo([a.length],o,a)},Wxe={kernelName:u3.Range,backendName:"webgl",kernelFunc:Hxe},Xxe=q_e({opSnippet:"return 1.0 / x;"}),qxe={kernelName:u3.Reciprocal,backendName:"webgl",kernelFunc:Xxe},Kxe=q_e({opSnippet:b_e+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),Zxe={kernelName:u3.Relu,backendName:"webgl",kernelFunc:Kxe},Qxe=q_e({opSnippet:b_e+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),Jxe={kernelName:u3.Relu6,backendName:"webgl",kernelFunc:Qxe}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o,rowPartitionTensors:a}=t,{rowPartitionTypes:l}=i,u=n.readSync(r.dataId),c=n.readSync(s.dataId),d=n.readSync(o.dataId),h=a.map(e=>n.readSync(e.dataId)),p=a.map(e=>e.shape),[f,m]=Xge(u,r.shape,c,s.shape,s.dtype,d,o.shape,h,p,l);return n.makeTensorInfo(f,s.dtype,m)}},Kxe=e=>{const{backend:t,attrs:n}=e,{start:i,stop:r,step:s,dtype:o}=n,a=qge(i,r,s,o);return t.makeTensorInfo([a.length],o,a)},Zxe={kernelName:p3.Range,backendName:"webgl",kernelFunc:Kxe},Qxe=J_e({opSnippet:"return 1.0 / x;"}),Jxe={kernelName:p3.Reciprocal,backendName:"webgl",kernelFunc:Qxe},eEe=J_e({opSnippet:w_e+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),tEe={kernelName:p3.Relu,backendName:"webgl",kernelFunc:eEe},nEe=J_e({opSnippet:w_e+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),iEe={kernelName:p3.Relu6,backendName:"webgl",kernelFunc:nEe}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17651,7 +17651,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o * limitations under the License. * ============================================================================= */ -class eEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n];let d;d=r?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${o}.0, ${a}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}} +class rEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n];let d;d=r?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${o}.0, ${a}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -17668,7 +17668,7 @@ class eEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];co * limitations under the License. * ============================================================================= */ -class tEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n];let d;d=r?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${o}.0, ${a}.0,\n ${a}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}const nEe={kernelName:u3.ResizeBilinear,backendName:"webgl",kernelFunc: +class sEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n];let d;d=r?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${o}.0, ${a}.0,\n ${a}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}const oEe={kernelName:p3.ResizeBilinear,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17685,7 +17685,7 @@ class tEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,t * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i,[l,u]=a,c=(0,u3.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new tEe(r.shape,l,u,s,o):new eEe(r.shape,l,u,s,o);return n.runWebGLProgram(c,[r],"float32")}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i,[l,u]=a,c=(0,p3.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new sEe(r.shape,l,u,s,o):new rEe(r.shape,l,u,s,o);return n.runWebGLProgram(c,[r],"float32")}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -17702,7 +17702,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,hal * limitations under the License. * ============================================================================= */ -class iEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,r]=t,[,s,o]=e,a=[n&&s>1?i-1:i,n&&o>1?r-1:r],l=[n&&s>1?s-1:s,n&&o>1?o-1:o],u=a[0]/l[0],c=a[1]/l[1],d=1/u,h=1/c,p=2*Math.ceil(d)+2,f=2*Math.ceil(h)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${d});\n const float invWidthScale = float(${h});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${s}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${o}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${i-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const rEe={kernelName:u3.ResizeBilinearGrad,backendName:"webgl",kernelFunc: +class aEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,r]=t,[,s,o]=e,a=[n&&s>1?i-1:i,n&&o>1?r-1:r],l=[n&&s>1?s-1:s,n&&o>1?o-1:o],u=a[0]/l[0],c=a[1]/l[1],d=1/u,h=1/c,p=2*Math.ceil(d)+2,f=2*Math.ceil(h)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${d});\n const float invWidthScale = float(${h});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${s}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${o}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${i-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const lEe={kernelName:p3.ResizeBilinearGrad,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17719,7 +17719,7 @@ class iEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this. * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i,a=new iEe(s.shape,r.shape,o);return n.runWebGLProgram(a,[s],s.dtype)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i,a=new aEe(s.shape,r.shape,o);return n.runWebGLProgram(a,[s],s.dtype)}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -17736,7 +17736,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners: * limitations under the License. * ============================================================================= */ -class sEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n],d=i?"0.5":"0.0";let h;h=r?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${o}.0, ${a}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${d})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}} +class uEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n],d=i?"0.5":"0.0";let h;h=r?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${o}.0, ${a}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${d})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -17753,7 +17753,7 @@ class sEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];co * limitations under the License. * ============================================================================= */ -class oEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n],d=i?"0.5":"0.0";let h;h=r?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${o}.0, ${a}.0,\n ${a}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${d})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}const aEe={kernelName:u3.ResizeNearestNeighbor,backendName:"webgl",kernelFunc: +class cEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n],d=i?"0.5":"0.0";let h;h=r?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${o}.0, ${a}.0,\n ${a}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${d})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}const dEe={kernelName:p3.ResizeNearestNeighbor,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17770,7 +17770,7 @@ class oEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,t * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i,[l,u]=a,c=(0,u3.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new oEe(r.shape,l,u,s,o):new sEe(r.shape,l,u,s,o);return n.runWebGLProgram(c,[r],r.dtype)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i,[l,u]=a,c=(0,p3.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new cEe(r.shape,l,u,s,o):new uEe(r.shape,l,u,s,o);return n.runWebGLProgram(c,[r],r.dtype)}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -17787,7 +17787,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,hal * limitations under the License. * ============================================================================= */ -class lEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,r]=t,[,s,o]=e,a=[n&&s>1?i-1:i,n&&o>1?r-1:r],l=[n&&s>1?s-1:s,n&&o>1?o-1:o],u=a[0]/l[0],c=a[1]/l[1],d=1/u,h=1/c,p=2*Math.ceil(d)+2,f=2*Math.ceil(h)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${d});\n const float invWidthScale = float(${h});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${s}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${o}) {\n continue;\n }\n\n float sourceFracRow =\n float(${a[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${a[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${i}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const uEe={kernelName:u3.ResizeNearestNeighborGrad,backendName:"webgl",kernelFunc: +class hEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,r]=t,[,s,o]=e,a=[n&&s>1?i-1:i,n&&o>1?r-1:r],l=[n&&s>1?s-1:s,n&&o>1?o-1:o],u=a[0]/l[0],c=a[1]/l[1],d=1/u,h=1/c,p=2*Math.ceil(d)+2,f=2*Math.ceil(h)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${d});\n const float invWidthScale = float(${h});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${s}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${o}) {\n continue;\n }\n\n float sourceFracRow =\n float(${a[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${a[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${i}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const pEe={kernelName:p3.ResizeNearestNeighborGrad,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17804,7 +17804,7 @@ class lEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this. * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i,a=new lEe(s.shape,r.shape,o);return n.runWebGLProgram(a,[s],s.dtype)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i,a=new hEe(s.shape,r.shape,o);return n.runWebGLProgram(a,[s],s.dtype)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17821,7 +17821,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners: * limitations under the License. * ============================================================================= */ -class cEe{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `);const i=e.map((n,i)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(i)).join(","),r=Nme(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}} +class fEe{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `);const i=e.map((n,i)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(i)).join(","),r=Pme(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}} /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -17838,7 +17838,7 @@ class cEe{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)thro * limitations under the License. * ============================================================================= */ -class dEe{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const i=h_e("rc",n),r=`${i[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${i[n-2]} + 1 < ${this.outputShape[n-2]}`,o=Nme(n);function a(n){const i=e.map((i,r)=>function(n,i){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${i[n]} - 1`:`${i[n]}`}(r,n));return`getChannel(getX(${i.join(",")}), vec2(${i.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${r}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${o} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return a(e)}(i.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",a(e)}(i.slice())};\n }\n if(${s}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",a(e)}(i.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",a(e)}(i.slice())};\n }\n }\n setOutput(result);\n }\n `}}const hEe={kernelName:u3.Reverse,backendName:"webgl",kernelFunc: +class mEe{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const i=g_e("rc",n),r=`${i[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${i[n-2]} + 1 < ${this.outputShape[n-2]}`,o=Pme(n);function a(n){const i=e.map((i,r)=>function(n,i){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${i[n]} - 1`:`${i[n]}`}(r,n));return`getChannel(getX(${i.join(",")}), vec2(${i.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${r}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${o} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return a(e)}(i.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",a(e)}(i.slice())};\n }\n if(${s}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",a(e)}(i.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",a(e)}(i.slice())};\n }\n }\n setOutput(result);\n }\n `}}const gEe={kernelName:p3.Reverse,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17855,7 +17855,7 @@ class dEe{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.pa * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i,o=r.shape.length,a=u3.util.parseAxisParam(s,r.shape);if(0===o)return B_e({inputs:{x:r},backend:n});const l=(0,u3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new dEe(r.shape,a):new cEe(r.shape,a);return n.runWebGLProgram(l,[r],r.dtype)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i,o=r.shape.length,a=p3.util.parseAxisParam(s,r.shape);if(0===o)return z_e({inputs:{x:r},backend:n});const l=(0,p3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new mEe(r.shape,a):new fEe(r.shape,a);return n.runWebGLProgram(l,[r],r.dtype)}}; /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17872,7 +17872,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i,o=r.shape.len * limitations under the License. * ============================================================================= */ -class pEe{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],i=e[2];this.outputShape=e;let r="";r="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n vec3 fill = vec3(${t.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${r}\n if(coordX >= 0 && coordX < ${i} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}} +class _Ee{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],i=e[2];this.outputShape=e;let r="";r="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n vec3 fill = vec3(${t.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${r}\n if(coordX >= 0 && coordX < ${i} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17889,7 +17889,7 @@ class pEe{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this * limitations under the License. * ============================================================================= */ -const fEe={kernelName:u3.RotateWithOffset,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,{radians:r,fillValue:s,center:o}=t,a=n,l=new pEe(i.shape,s),[u,c]=u3.backend_util.getImageCenter(o,i.shape[1],i.shape[2]),d=[[u,c,Math.sin(r),Math.cos(r)]];return a.runWebGLProgram(l,[i],i.dtype,d)}},mEe=q_e({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),gEe={kernelName:u3.Round,backendName:"webgl",kernelFunc:mEe},_Ee=q_e({opSnippet:"return inversesqrt(x);",cpuKernelImpl:Hge}),yEe={kernelName:u3.Rsqrt,backendName:"webgl",kernelFunc:_Ee}; +const yEe={kernelName:p3.RotateWithOffset,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,{radians:r,fillValue:s,center:o}=t,a=n,l=new _Ee(i.shape,s),[u,c]=p3.backend_util.getImageCenter(o,i.shape[1],i.shape[2]),d=[[u,c,Math.sin(r),Math.cos(r)]];return a.runWebGLProgram(l,[i],i.dtype,d)}},vEe=J_e({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),bEe={kernelName:p3.Round,backendName:"webgl",kernelFunc:vEe},TEe=J_e({opSnippet:"return inversesqrt(x);",cpuKernelImpl:Kge}),xEe={kernelName:p3.Rsqrt,backendName:"webgl",kernelFunc:TEe}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -17906,7 +17906,7 @@ const fEe={kernelName:u3.RotateWithOffset,backendName:"webgl",kernelFunc:({input * limitations under the License. * ============================================================================= */ -class vEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;const l=Nme(r.length),u=Nme(s.length);let c="";1===n?c="i":2===n&&(c="i, j");const d=`getIndices(${c})`;let h="";1===i?h="i":2===i&&(h="i, coords[1]");const p=`getUpdates(${h})`;let f="";a&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${d});\n flattenedIndex += index * ${g};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${p};\n found = true;\n }\n }\n setOutput(mix(${m}, sum, float(found)));\n }\n `}} +class EEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;const l=Pme(r.length),u=Pme(s.length);let c="";1===n?c="i":2===n&&(c="i, j");const d=`getIndices(${c})`;let h="";1===i?h="i":2===i&&(h="i, coords[1]");const p=`getUpdates(${h})`;let f="";a&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${d});\n flattenedIndex += index * ${g};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${p};\n found = true;\n }\n }\n setOutput(mix(${m}, sum, float(found)));\n }\n `}} /** * @license * Copyright 2023 Google LLC. @@ -17923,7 +17923,7 @@ class vEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indi * limitations under the License. * ============================================================================= */ -class bEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=s;const l=Nme(r.length),u=Nme(s.length);let c="";1===n?c="i":2===n&&(c="i, j");const d=`getIndices(${c})`;let h="";1===i?h="i":2===i&&(h="i, coords[1]");const p=`getUpdates(${h})`;let f="";a&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",_=t>1?"strides[j + 1]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${d});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${_};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${p};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${m}, sum, found));\n }\n `}}const TEe={kernelName:u3.ScatterNd,backendName:"webgl",kernelFunc: +class wEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=s;const l=Pme(r.length),u=Pme(s.length);let c="";1===n?c="i":2===n&&(c="i, j");const d=`getIndices(${c})`;let h="";1===i?h="i":2===i&&(h="i, coords[1]");const p=`getUpdates(${h})`;let f="";a&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",_=t>1?"strides[j + 1]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${d});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${_};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${p};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${m}, sum, found));\n }\n `}}const IEe={kernelName:p3.ScatterNd,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -17940,7 +17940,7 @@ class bEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indi * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=u3.backend_util.calculateShapes(s,r,o),h=[d/u,u];if(0===d)return n.makeTensorInfo(o,r.dtype);const p=sye({inputs:{x:r},backend:n,attrs:{shape:[l,a]}}),f=sye({inputs:{x:s},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=(0,u3.env)().getBool("WEBGL_PACK")?new bEe(l,a,p.shape.length,f.shape.length,c,h):new vEe(l,a,p.shape.length,f.shape.length,c,h);const _=n.runWebGLProgram(g,[f,p,m],f.dtype),y=sye({inputs:{x:_},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(_),n.disposeIntermediateTensorInfo(m),y}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=p3.backend_util.calculateShapes(s,r,o),h=[d/u,u];if(0===d)return n.makeTensorInfo(o,r.dtype);const p=uye({inputs:{x:r},backend:n,attrs:{shape:[l,a]}}),f=uye({inputs:{x:s},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=(0,p3.env)().getBool("WEBGL_PACK")?new wEe(l,a,p.shape.length,f.shape.length,c,h):new EEe(l,a,p.shape.length,f.shape.length,c,h);const _=n.runWebGLProgram(g,[f,p,m],f.dtype),y=uye({inputs:{x:_},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(_),n.disposeIntermediateTensorInfo(m),y}}; /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -17957,7 +17957,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o * limitations under the License. * ============================================================================= */ -class xEe{constructor(e,t,n,i){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,n];const r=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,s=2===(0,u3.env)().getNumber("WEBGL_VERSION")?"while (left < right) {":r,o="left"===i?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${s}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${o} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}}const EEe={kernelName:u3.SearchSorted,backendName:"webgl",kernelFunc: +class AEe{constructor(e,t,n,i){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,n];const r=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,s=2===(0,p3.env)().getNumber("WEBGL_VERSION")?"while (left < right) {":r,o="left"===i?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${s}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${o} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}}const SEe={kernelName:p3.SearchSorted,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -17974,7 +17974,7 @@ class xEe{constructor(e,t,n,i){this.variableNames=["sortedSequence","values"],th * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{sortedSequence:r,values:s}=t,{side:o}=i,a=new xEe(r.shape[0],r.shape[1],s.shape[1],o),l=[[r.shape[1]]];return n.runWebGLProgram(a,[r,s],"int32",l)}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{sortedSequence:r,values:s}=t,{side:o}=i,a=new AEe(r.shape[0],r.shape[1],s.shape[1],o),l=[[r.shape[1]]];return n.runWebGLProgram(a,[r,s],"int32",l)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -17991,7 +17991,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{sortedSequence:r,values:s}=t,{s * limitations under the License. * ============================================================================= */ -class wEe{constructor(e,t,n){let i,r;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)r="resRC",i="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],o=[];for(let i=0;i= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const IEe={kernelName:u3.Select,backendName:"webgl",kernelFunc: +class CEe{constructor(e,t,n){let i,r;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)r="resRC",i="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],o=[];for(let i=0;i= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const OEe={kernelName:p3.Select,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18008,7 +18008,7 @@ class wEe{constructor(e,t,n){let i,r;if(this.variableNames=["c","a","b"],this.ou * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{condition:i,t:r,e:s}=t,o=new wEe(i.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(o,[i,r,s],(0,u3.upcastType)(r.dtype,s.dtype))}},AEe=q_e({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${u3.backend_util.SELU_SCALEALPHA};\n float scale = ${u3.backend_util.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),SEe={kernelName:u3.Selu,backendName:"webgl",kernelFunc:AEe},CEe=q_e({opSnippet:X_e+"\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:Xge}),OEe={kernelName:u3.Sigmoid,backendName:"webgl",kernelFunc:CEe},MEe=q_e({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),kEe={kernelName:u3.Sign,backendName:"webgl",kernelFunc:MEe},REe=q_e({opSnippet:X_e+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${L_e}\n return result;\n`}),NEe={kernelName:u3.Sin,backendName:"webgl",kernelFunc:REe},DEe=q_e({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),FEe={kernelName:u3.Sinh,backendName:"webgl",kernelFunc:DEe},LEe=q_e({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),PEe={kernelName:u3.Softplus,backendName:"webgl",kernelFunc:LEe},BEe={kernelName:u3.SpaceToBatchND,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,paddings:o}=i;u3.util.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const a=s.reduce((e,t)=>e*t),l=[[0,0]];l.push(...o);for(let e=1+s.length;en.disposeIntermediateTensorInfo(e)),g}};const $Ee={kernelName:u3.SparseFillEmptyRows,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{condition:i,t:r,e:s}=t,o=new CEe(i.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(o,[i,r,s],(0,p3.upcastType)(r.dtype,s.dtype))}},MEe=J_e({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${p3.backend_util.SELU_SCALEALPHA};\n float scale = ${p3.backend_util.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),kEe={kernelName:p3.Selu,backendName:"webgl",kernelFunc:MEe},REe=J_e({opSnippet:Q_e+"\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:Qge}),NEe={kernelName:p3.Sigmoid,backendName:"webgl",kernelFunc:REe},DEe=J_e({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),FEe={kernelName:p3.Sign,backendName:"webgl",kernelFunc:DEe},LEe=J_e({opSnippet:Q_e+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${U_e}\n return result;\n`}),PEe={kernelName:p3.Sin,backendName:"webgl",kernelFunc:LEe},BEe=J_e({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),$Ee={kernelName:p3.Sinh,backendName:"webgl",kernelFunc:BEe},UEe=J_e({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),VEe={kernelName:p3.Softplus,backendName:"webgl",kernelFunc:UEe},zEe={kernelName:p3.SpaceToBatchND,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,paddings:o}=i;p3.util.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const a=s.reduce((e,t)=>e*t),l=[[0,0]];l.push(...o);for(let e=1+s.length;en.disposeIntermediateTensorInfo(e)),g}};const jEe={kernelName:p3.SparseFillEmptyRows,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18025,7 +18025,7 @@ function(e){const{inputs:t,backend:n}=e,{condition:i,t:r,e:s}=t,o=new wEe(i.shap * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,defaultValue:o}=t;if(1!==s.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(2!==i.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${o.shape}`);const a=n.readSync(i.dataId),l=n.readSync(r.dataId),u=n.readSync(s.dataId),c=n.readSync(o.dataId)[0],[d,h,p,f,m]=Zge(a,i.shape,i.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(h,i.dtype,d),n.makeTensorInfo([h[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([m.length],i.dtype,new Int32Array(m))]}};const UEe={kernelName:u3.SparseReshape,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,defaultValue:o}=t;if(1!==s.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(2!==i.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${o.shape}`);const a=n.readSync(i.dataId),l=n.readSync(r.dataId),u=n.readSync(s.dataId),c=n.readSync(o.dataId)[0],[d,h,p,f,m]=t_e(a,i.shape,i.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(h,i.dtype,d),n.makeTensorInfo([h[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([m.length],i.dtype,new Int32Array(m))]}};const YEe={kernelName:p3.SparseReshape,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18042,7 +18042,7 @@ function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,default * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s}=t;if(2!==i.shape.length)throw new Error(`Input indices should be a matrix but received shape ${i.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.readSync(r.dataId)),a=n.readSync(i.dataId),l=Array.from(n.readSync(s.dataId)),[u,c,d]=Qge(a,i.shape,i.dtype,o,l);return[n.makeTensorInfo(c,i.dtype,u),n.makeTensorInfo([d.length],s.dtype,new Int32Array(d))]}};const VEe={kernelName:u3.SparseSegmentMean,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s}=t;if(2!==i.shape.length)throw new Error(`Input indices should be a matrix but received shape ${i.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.readSync(r.dataId)),a=n.readSync(i.dataId),l=Array.from(n.readSync(s.dataId)),[u,c,d]=n_e(a,i.shape,i.dtype,o,l);return[n.makeTensorInfo(c,i.dtype,u),n.makeTensorInfo([d.length],s.dtype,new Int32Array(d))]}};const GEe={kernelName:p3.SparseSegmentMean,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18059,7 +18059,7 @@ function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s} * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=Jge(o,i.shape,i.dtype,a,l,!0);return n.makeTensorInfo(c,i.dtype,u)}};const zEe={kernelName:u3.SparseSegmentSum,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=i_e(o,i.shape,i.dtype,a,l,!0);return n.makeTensorInfo(c,i.dtype,u)}};const HEe={kernelName:p3.SparseSegmentSum,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18076,7 +18076,7 @@ function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=Jge(o,i.shape,i.dtype,a,l);return n.makeTensorInfo(c,i.dtype,u)}};const jEe={kernelName:u3.SparseToDense,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=i_e(o,i.shape,i.dtype,a,l);return n.makeTensorInfo(c,i.dtype,u)}};const WEe={kernelName:p3.SparseToDense,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18093,7 +18093,7 @@ function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.s * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s,defaultValue:o}=t,{outputShape:a}=i,{sliceRank:l,numUpdates:u,sliceSize:c,strides:d,outputSize:h}=u3.backend_util.calculateShapes(s,r,a),p=!1;if("string"===s.dtype){const e=n.bufferSync(r),t=n.bufferSync(s),i=u3.util.decodeString(n.readSync(o.dataId)[0]),f=Wge(e,t,a,h,c,u,l,d,i,p);return n.makeTensorInfo(a,f.dtype,f.values)}const f=new vEe(u,l,r.shape.length,s.shape.length,d,[h,1],p),m=n.runWebGLProgram(f,[s,r,o],s.dtype),g=sye({inputs:{x:m},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(m),g}};const YEe={kernelName:u3.SplitV,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s,defaultValue:o}=t,{outputShape:a}=i,{sliceRank:l,numUpdates:u,sliceSize:c,strides:d,outputSize:h}=p3.backend_util.calculateShapes(s,r,a),p=!1;if("string"===s.dtype){const e=n.bufferSync(r),t=n.bufferSync(s),i=p3.util.decodeString(n.readSync(o.dataId)[0]),f=Zge(e,t,a,h,c,u,l,d,i,p);return n.makeTensorInfo(a,f.dtype,f.values)}const f=new EEe(u,l,r.shape.length,s.shape.length,d,[h,1],p),m=n.runWebGLProgram(f,[s,r,o],s.dtype),g=uye({inputs:{x:m},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(m),g}};const XEe={kernelName:p3.SplitV,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18110,7 +18110,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s, * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis:o}=i,a=u3.util.parseAxisParam(o,r.shape)[0],l=u3.backend_util.prepareSplitSize(r,s,a),u=r.shape.length,c=new Array(u).fill(0),d=r.shape.slice();return l.map(e=>{const t=[...d];t[a]=e;const i=dve({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[a]+=e,i})}},GEe="return sqrt(x);",HEe=q_e({opSnippet:GEe,packedOpSnippet:GEe,cpuKernelImpl:e_e}),WEe={kernelName:u3.Sqrt,backendName:"webgl",kernelFunc:HEe},XEe=q_e({opSnippet:"return x * x;"}),qEe={kernelName:u3.Square,backendName:"webgl",kernelFunc:XEe},KEe="return (a - b) * (a - b);",ZEe=K_e({opSnippet:KEe,packedOpSnippet:KEe}),QEe={kernelName:u3.SquaredDifference,backendName:"webgl",kernelFunc:ZEe};const JEe={kernelName:u3.StaticRegexReplace,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis:o}=i,a=p3.util.parseAxisParam(o,r.shape)[0],l=p3.backend_util.prepareSplitSize(r,s,a),u=r.shape.length,c=new Array(u).fill(0),d=r.shape.slice();return l.map(e=>{const t=[...d];t[a]=e;const i=mve({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[a]+=e,i})}},qEe="return sqrt(x);",KEe=J_e({opSnippet:qEe,packedOpSnippet:qEe,cpuKernelImpl:r_e}),ZEe={kernelName:p3.Sqrt,backendName:"webgl",kernelFunc:KEe},QEe=J_e({opSnippet:"return x * x;"}),JEe={kernelName:p3.Square,backendName:"webgl",kernelFunc:QEe},ewe="return (a - b) * (a - b);",twe=eye({opSnippet:ewe,packedOpSnippet:ewe}),nwe={kernelName:p3.SquaredDifference,backendName:"webgl",kernelFunc:twe};const iwe={kernelName:p3.StaticRegexReplace,backendName:"webgl",kernelFunc: /** * @license * Copyright 2023 Google LLC. @@ -18127,7 +18127,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis: * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const s=n.readSync(r.dataId),o=u3.backend_util.fromUint8ToStringArray(s),a=t_e(o,"string",i);return n.makeTensorInfo(r.shape,"string",a)}};const ewe={kernelName:u3.Step,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const s=n.readSync(r.dataId),o=p3.backend_util.fromUint8ToStringArray(s),a=s_e(o,"string",i);return n.makeTensorInfo(r.shape,"string",a)}};const rwe={kernelName:p3.Step,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18144,7 +18144,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;if("string"!==r.dtype)th * limitations under the License. * ============================================================================= */ -function({inputs:e,attrs:t,backend:n}){const{x:i}=e,r=b_e+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,s=new v_e(i.shape,r);return n.runWebGLProgram(s,[i],i.dtype)}}; +function({inputs:e,attrs:t,backend:n}){const{x:i}=e,r=w_e+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,s=new E_e(i.shape,r);return n.runWebGLProgram(s,[i],i.dtype)}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -18161,7 +18161,7 @@ function({inputs:e,attrs:t,backend:n}){const{x:i}=e,r=b_e+`\n return x > 0.0 * limitations under the License. * ============================================================================= */ -class twe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const i=n.length,r=Nme(n.length),s=Nme(n.length);let o="";if(1===i)o="coords * strides + begin";else{let e=0;o=n.map((t,i)=>(e++,1===n.length?`coords * strides[${i}] + begin[${i}]`:`coords[${e-1}] * strides[${i}] + begin[${i}]`)).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${s} coords = getOutputCoords();\n setOutput(getX(${o}));\n }\n `}}const nwe={kernelName:u3.StridedSlice,backendName:"webgl",kernelFunc: +class swe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const i=n.length,r=Pme(n.length),s=Pme(n.length);let o="";if(1===i)o="coords * strides + begin";else{let e=0;o=n.map((t,i)=>(e++,1===n.length?`coords * strides[${i}] + begin[${i}]`:`coords[${e-1}] * strides[${i}] + begin[${i}]`)).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${s} coords = getOutputCoords();\n setOutput(getX(${o}));\n }\n `}}const owe={kernelName:p3.StridedSlice,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18178,7 +18178,7 @@ class twe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const i * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:d,shrinkAxisMask:h}=i,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:y,end:v,strides:b}=u3.slice_util.sliceInfo(r.shape,s,o,a,l,u,c,d,h);let T;if(m)T=sye({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||_){u3.util.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);const e=u3.slice_util.computeOutShape(y,v,b),t=dve({inputs:{x:r},backend:n,attrs:{begin:y,size:e}});T=sye({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=(0,u3.buffer)(r.shape,r.dtype,e),i=n_e(p,t,b,y);T=n.makeTensorInfo(f,r.dtype,i.values)}else{const e=new twe(y,b,p);T=n.runWebGLProgram(e,[r],r.dtype)}}const x=sye({inputs:{x:T},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(T),x}};const iwe={kernelName:u3.StringNGrams,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:d,shrinkAxisMask:h}=i,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:y,end:v,strides:b}=p3.slice_util.sliceInfo(r.shape,s,o,a,l,u,c,d,h);let T;if(m)T=uye({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||_){p3.util.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);const e=p3.slice_util.computeOutShape(y,v,b),t=mve({inputs:{x:r},backend:n,attrs:{begin:y,size:e}});T=uye({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=(0,p3.buffer)(r.shape,r.dtype,e),i=o_e(p,t,b,y);T=n.makeTensorInfo(f,r.dtype,i.values)}else{const e=new swe(y,b,p);T=n.runWebGLProgram(e,[r],r.dtype)}}const x=uye({inputs:{x:T},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(T),x}};const awe={kernelName:p3.StringNGrams,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18195,7 +18195,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftPad:o,rightPad:a,padWidth:l,preserveShortSequences:u}=i,{data:c,dataSplits:d}=t,h=n.readSync(c.dataId),p=n.readSync(d.dataId),[f,m]=i_e(h,p,r,s,o,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(d.shape,"int32",m)]}};const rwe={kernelName:u3.StringSplit,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftPad:o,rightPad:a,padWidth:l,preserveShortSequences:u}=i,{data:c,dataSplits:d}=t,h=n.readSync(c.dataId),p=n.readSync(d.dataId),[f,m]=a_e(h,p,r,s,o,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(d.shape,"int32",m)]}};const lwe={kernelName:p3.StringSplit,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18212,7 +18212,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftP * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const a=n.readSync(s.dataId),l=n.readSync(o.dataId)[0],[u,c,d]=r_e(a,l,r),h=c.length;return[n.makeTensorInfo([h,2],"int32",u),n.makeTensorInfo([h],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};const swe={kernelName:u3.StringToHashBucketFast,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const a=n.readSync(s.dataId),l=n.readSync(o.dataId)[0],[u,c,d]=l_e(a,l,r),h=c.length;return[n.makeTensorInfo([h,2],"int32",u),n.makeTensorInfo([h],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};const uwe={kernelName:p3.StringToHashBucketFast,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18229,7 +18229,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimit * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const o=n.readSync(s.dataId),a=s_e(o,r);return n.makeTensorInfo(s.shape,"int32",a)}},owe=q_e({opSnippet:"return tan(x);"}),awe={kernelName:u3.Tan,backendName:"webgl",kernelFunc:owe},lwe=q_e({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),uwe={kernelName:u3.Tanh,backendName:"webgl",kernelFunc:lwe};const cwe={kernelName:u3.TensorScatterUpdate,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const o=n.readSync(s.dataId),a=u_e(o,r);return n.makeTensorInfo(s.shape,"int32",a)}},cwe=J_e({opSnippet:"return tan(x);"}),dwe={kernelName:p3.Tan,backendName:"webgl",kernelFunc:cwe},hwe=J_e({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),pwe={kernelName:p3.Tanh,backendName:"webgl",kernelFunc:hwe};const fwe={kernelName:p3.TensorScatterUpdate,backendName:"webgl",kernelFunc: /** * @license * Copyright 2022 Google LLC. All Rights Reserved. @@ -18246,7 +18246,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if( * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{tensor:r,indices:s,updates:o}=t,{}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=u3.backend_util.calculateShapes(o,s,r.shape),h=[d/u,u];if(0===d)return n.makeTensorInfo(r.shape,s.dtype);const p=sye({inputs:{x:s},backend:n,attrs:{shape:[l,a]}}),f=sye({inputs:{x:o},backend:n,attrs:{shape:[l,u]}}),m=sye({inputs:{x:r},backend:n,attrs:{shape:h}}),g=new vEe(l,a,p.shape.length,f.shape.length,c,h,!1,!0),_=n.runWebGLProgram(g,[f,p,m],m.dtype),y=sye({inputs:{x:_},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(_),y}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{tensor:r,indices:s,updates:o}=t,{}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=p3.backend_util.calculateShapes(o,s,r.shape),h=[d/u,u];if(0===d)return n.makeTensorInfo(r.shape,s.dtype);const p=uye({inputs:{x:s},backend:n,attrs:{shape:[l,a]}}),f=uye({inputs:{x:o},backend:n,attrs:{shape:[l,u]}}),m=uye({inputs:{x:r},backend:n,attrs:{shape:h}}),g=new EEe(l,a,p.shape.length,f.shape.length,c,h,!1,!0),_=n.runWebGLProgram(g,[f,p,m],m.dtype),y=uye({inputs:{x:_},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(_),y}}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. @@ -18263,7 +18263,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{tensor:r,indices:s,updates:o}=t * limitations under the License. * ============================================================================= */ -class dwe{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let i=0;i5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],i=[];for(let t=0;t5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],i=[];for(let t=0;t5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map(e=>u3.util.decodeString(e)):e,i=(0,u3.buffer)(r.shape,r.dtype,t),o=a_e(i,s);return n.makeTensorInfo(o.shape,o.dtype,o.values)}const o=new dwe(r.shape,s);return n.runWebGLProgram(o,[r],r.dtype)}const pwe={kernelName:u3.Tile,backendName:"webgl",kernelFunc:hwe};class fwe{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class mwe{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}} +function gwe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;if("string"===r.dtype||r.shape.length>5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map(e=>p3.util.decodeString(e)):e,i=(0,p3.buffer)(r.shape,r.dtype,t),o=d_e(i,s);return n.makeTensorInfo(o.shape,o.dtype,o.values)}const o=new mwe(r.shape,s);return n.runWebGLProgram(o,[r],r.dtype)}const _we={kernelName:p3.Tile,backendName:"webgl",kernelFunc:gwe};class ywe{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class vwe{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}} /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18297,7 +18297,7 @@ function hwe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;if("strin * limitations under the License. * ============================================================================= */ -function gwe(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function _we(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,i]=l_e(e,u,r.dtype,s,o);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(i.shape,i.dtype,i.values)]}if(0===s)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,qbe({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const d=n.texData.get(r.dataId),h=null!==d&&d.isPacked,p=h?n.unpackTensor(r):r,f=u3.util.sizeFromShape(u)/c,m=sye({inputs:{x:p},attrs:{shape:[f,c]},backend:n});h&&gwe(n,p);const g=_we(s),_=_we(c);let y=null;const v=()=>null===y?[m,m]:[m,y],b=(e,t,i)=>{const r=v(),s=new fwe(i),o=[[c],[null===y?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],a=y;y=n.runWebGLProgram(s,r,"int32",o),gwe(n,a)};for(let e=1;e=1;n/=2)b(t,n,[f,_])}for(let e=_;e>g;e/=2){const t=v(),i=new mwe([f,e/2]),r=[[c],[null===y?1:0],[g]],s=y;y=n.runWebGLProgram(i,t,"int32",r),gwe(n,s);const o=g/2,a=2*o;for(let e=o;e>=1;e/=2)b(a,e,y.shape)}let T=y;y=dve({inputs:{x:y},backend:n,attrs:{begin:0,size:[f,s]}}),gwe(n,T);let x=fTe({inputs:{x:m,indices:y},backend:n,attrs:{axis:1,batchDims:1}});gwe(n,m);const E=u.slice(0,-1);E.push(s),T=y,y=sye({inputs:{x:y},attrs:{shape:E},backend:n}),gwe(n,T);const w=x;return x=sye({inputs:{x},attrs:{shape:E},backend:n}),gwe(n,w),[x,y]}}; +function bwe(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function Twe(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,i]=h_e(e,u,r.dtype,s,o);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(i.shape,i.dtype,i.values)]}if(0===s)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,Jbe({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const d=n.texData.get(r.dataId),h=null!==d&&d.isPacked,p=h?n.unpackTensor(r):r,f=p3.util.sizeFromShape(u)/c,m=uye({inputs:{x:p},attrs:{shape:[f,c]},backend:n});h&&bwe(n,p);const g=Twe(s),_=Twe(c);let y=null;const v=()=>null===y?[m,m]:[m,y],b=(e,t,i)=>{const r=v(),s=new ywe(i),o=[[c],[null===y?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],a=y;y=n.runWebGLProgram(s,r,"int32",o),bwe(n,a)};for(let e=1;e=1;n/=2)b(t,n,[f,_])}for(let e=_;e>g;e/=2){const t=v(),i=new vwe([f,e/2]),r=[[c],[null===y?1:0],[g]],s=y;y=n.runWebGLProgram(i,t,"int32",r),bwe(n,s);const o=g/2,a=2*o;for(let e=o;e>=1;e/=2)b(a,e,y.shape)}let T=y;y=mve({inputs:{x:y},backend:n,attrs:{begin:0,size:[f,s]}}),bwe(n,T);let x=yTe({inputs:{x:m,indices:y},backend:n,attrs:{axis:1,batchDims:1}});bwe(n,m);const E=u.slice(0,-1);E.push(s),T=y,y=uye({inputs:{x:y},attrs:{shape:E},backend:n}),bwe(n,T);const w=x;return x=uye({inputs:{x},attrs:{shape:E},backend:n}),bwe(n,w),[x,y]}}; /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18314,7 +18314,7 @@ function gwe(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function _we(e){l * limitations under the License. * ============================================================================= */ -class vwe{constructor(e,t,n,i,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;const o="nearest"===n?1:2;let a;switch(i){case"constant":default:a=1;break;case"reflect":a=2;break;case"wrap":a=3;break;case"nearest":a=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${a} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${a} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${a} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${r});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${r});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${o} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}const bwe={kernelName:u3.Transform,backendName:"webgl",kernelFunc: +class Ewe{constructor(e,t,n,i,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;const o="nearest"===n?1:2;let a;switch(i){case"constant":default:a=1;break;case"reflect":a=2;break;case"wrap":a=3;break;case"nearest":a=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${a} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${a} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${a} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${r});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${r});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${o} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}const wwe={kernelName:p3.Transform,backendName:"webgl",kernelFunc: /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -18331,7 +18331,7 @@ class vwe{constructor(e,t,n,i,r,s){this.variableNames=["Image","Transforms"],thi * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r,transforms:s}=t,{interpolation:o,fillMode:a,fillValue:l,outputShape:u}=i,[c,d,h,p]=r.shape,[f,m]=null!=u?u:[d,h],g=new vwe(d,h,o,a,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,s],"float32")}};const Twe={kernelName:u3.Unique,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r,transforms:s}=t,{interpolation:o,fillMode:a,fillValue:l,outputShape:u}=i,[c,d,h,p]=r.shape,[f,m]=null!=u?u:[d,h],g=new Ewe(d,h,o,a,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,s],"float32")}};const Iwe={kernelName:p3.Unique,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18348,7 +18348,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r,transforms:s}=t,{interp * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,attrs:n,backend:i}=e,{axis:r}=n,{x:s}=t;fme(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const o=i.readSync(s.dataId),{outputValues:a,outputShape:l,indices:u}=c_e(o,r,s.shape,s.dtype);return[i.makeTensorInfo(l,s.dtype,a),i.makeTensorInfo([u.length],"int32",u)]}};const xwe={kernelName:u3.Unpack,backendName:"webgl",kernelFunc: +function(e){const{inputs:t,attrs:n,backend:i}=e,{axis:r}=n,{x:s}=t;yme(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const o=i.readSync(s.dataId),{outputValues:a,outputShape:l,indices:u}=f_e(o,r,s.shape,s.dtype);return[i.makeTensorInfo(l,s.dtype,a),i.makeTensorInfo([u.length],"int32",u)]}};const Awe={kernelName:p3.Unpack,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18365,7 +18365,7 @@ function(e){const{inputs:t,attrs:n,backend:i}=e,{axis:r}=n,{x:s}=t;fme(s,"unique * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{value:r}=t;let{axis:s}=i;s<0&&(s+=r.shape.length);const o=r,a=o.shape.length,l=r.shape[s],u=new Array(a-1);let c=0;for(let e=0;en.disposeIntermediateTensorInfo(e)),f}}; +function(e){const{inputs:t,backend:n,attrs:i}=e,{value:r}=t;let{axis:s}=i;s<0&&(s+=r.shape.length);const o=r,a=o.shape.length,l=r.shape[s],u=new Array(a-1);let c=0;for(let e=0;en.disposeIntermediateTensorInfo(e)),f}}; /** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -18382,7 +18382,7 @@ function(e){const{inputs:t,backend:n,attrs:i}=e,{value:r}=t;let{axis:s}=i;s<0&&( * limitations under the License. * ============================================================================= */ -class Ewe{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,i=e.batchSize,r=e.inSize,s=e.numSegments,o=s*Math.ceil(r/n);this.outputShape=[i,o];const a=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";r%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `);let d="";r%n>0&&(d=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${d}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${s})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${s})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${a}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${a};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}const wwe={kernelName:u3.UnsortedSegmentSum,backendName:"webgl",kernelFunc: +class Swe{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,i=e.batchSize,r=e.inSize,s=e.numSegments,o=s*Math.ceil(r/n);this.outputShape=[i,o];const a=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";r%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `);let d="";r%n>0&&(d=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${d}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${s})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${s})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${a}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${a};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}const Cwe={kernelName:p3.UnsortedSegmentSum,backendName:"webgl",kernelFunc: /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -18399,6 +18399,6 @@ class Ewe{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windo * limitations under the License. * ============================================================================= */ -function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,segmentIds:s}=t,{numSegments:o}=i,a=r.shape.length,l=[];let u=0;const c=u3.backend_util.getAxesPermutation([u],a);let d=r;null!=c&&(d=mye({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(d),u=u3.backend_util.getInnerMostAxes(1,a)[0]);const h=u3.backend_util.segment_util.computeOutShape(d.shape,u,o),p=u3.util.sizeFromShape([d.shape[u]]),f=sye({inputs:{x:d},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=(0,u3.sumOutType)(r.dtype),g=(e,t,i,r,s)=>{const o=e.shape[0],a=e.shape[1],u=u3.backend_util.segment_util.segOpComputeOptimalWindowSize(a,s),c=new Ewe({windowSize:u,inSize:a,batchSize:o,numSegments:s},t),d=n.compileAndRun(c,[e,i],r);if(l.push(d),d.shape[1]===s)return d;const h=Hxe({backend:n,attrs:{start:0,stop:s,step:1,dtype:"float32"}}),p=hwe({inputs:{x:h},backend:n,attrs:{reps:[a/u]}});l.push(h),l.push(p);return g(d,t,p,r,s)},_=sye({inputs:{x:g(f,"unsortedSegmentSum",s,m,o)},backend:n,attrs:{shape:h}});let y=_;if(null!=c){l.push(_);const e=u3.backend_util.getUndoAxesPermutation(c);y=mye({inputs:{x:y},backend:n,attrs:{perm:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),y}},Iwe=[yye,bye,xye,wye,Sye,Mye,kye,Rye,Bye,$ye,Vye,jye,Gye,Wye,qye,Qye,Jye,nve,ive,rve,ave,pve,fve,mve,gve,Tve,wve,Sve,V_e,Mve,Bve,Hve,Zve,Jve,ebe,tbe,nbe,rbe,obe,lbe,fbe,mbe,gbe,ybe,Tbe,wbe,Ibe,Sbe,Obe,Mbe,Rbe,Nbe,Fbe,Pbe,$be,Vbe,Ybe,Wbe,Kbe,Qbe,tTe,iTe,oTe,uTe,cTe,hTe,mTe,_Te,vTe,$_e,bTe,Fve,xTe,wTe,ATe,Y_e,CTe,MTe,kTe,NTe,FTe,PTe,$Te,VTe,YTe,HTe,XTe,KTe,ZTe,QTe,txe,nxe,ixe,rxe,sxe,axe,cxe,hxe,Txe,rye,Exe,Ixe,Sxe,Oxe,yve,kxe,Dxe,Fxe,$xe,Vxe,W_e,zxe,jxe,Yxe,Gxe,Wxe,bve,mxe,qxe,Zxe,Jxe,oye,nEe,rEe,aEe,uEe,hEe,fEe,gEe,yEe,TEe,EEe,IEe,SEe,OEe,kEe,NEe,FEe,hve,bxe,PEe,BEe,$Ee,UEe,VEe,zEe,jEe,YEe,WEe,qEe,QEe,JEe,ewe,nwe,iwe,rwe,swe,yxe,fye,awe,uwe,cwe,pwe,ywe,bwe,gye,Twe,xwe,wwe,Nxe];for(const e of Iwe)(0,u3.registerKernel)(e); +function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,segmentIds:s}=t,{numSegments:o}=i,a=r.shape.length,l=[];let u=0;const c=p3.backend_util.getAxesPermutation([u],a);let d=r;null!=c&&(d=vye({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(d),u=p3.backend_util.getInnerMostAxes(1,a)[0]);const h=p3.backend_util.segment_util.computeOutShape(d.shape,u,o),p=p3.util.sizeFromShape([d.shape[u]]),f=uye({inputs:{x:d},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=(0,p3.sumOutType)(r.dtype),g=(e,t,i,r,s)=>{const o=e.shape[0],a=e.shape[1],u=p3.backend_util.segment_util.segOpComputeOptimalWindowSize(a,s),c=new Swe({windowSize:u,inSize:a,batchSize:o,numSegments:s},t),d=n.compileAndRun(c,[e,i],r);if(l.push(d),d.shape[1]===s)return d;const h=Kxe({backend:n,attrs:{start:0,stop:s,step:1,dtype:"float32"}}),p=gwe({inputs:{x:h},backend:n,attrs:{reps:[a/u]}});l.push(h),l.push(p);return g(d,t,p,r,s)},_=uye({inputs:{x:g(f,"unsortedSegmentSum",s,m,o)},backend:n,attrs:{shape:h}});let y=_;if(null!=c){l.push(_);const e=p3.backend_util.getUndoAxesPermutation(c);y=vye({inputs:{x:y},backend:n,attrs:{perm:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),y}},Owe=[xye,wye,Aye,Cye,kye,Dye,Fye,Lye,zye,jye,Gye,Wye,qye,Zye,Jye,nve,ive,ove,ave,lve,dve,_ve,yve,vve,bve,Ive,Cve,kve,G_e,Dve,zve,Kve,tbe,ibe,rbe,sbe,obe,lbe,cbe,hbe,ybe,vbe,bbe,xbe,Ibe,Cbe,Obe,kbe,Nbe,Dbe,Lbe,Pbe,$be,Vbe,jbe,Gbe,Xbe,Zbe,eTe,nTe,sTe,aTe,cTe,pTe,fTe,gTe,vTe,TTe,ETe,j_e,wTe,$ve,ATe,CTe,MTe,X_e,RTe,DTe,FTe,PTe,$Te,VTe,jTe,GTe,XTe,KTe,QTe,exe,txe,nxe,sxe,oxe,axe,lxe,uxe,dxe,fxe,gxe,Ixe,lye,Sxe,Oxe,kxe,Nxe,xve,Fxe,Bxe,$xe,jxe,Gxe,Z_e,Hxe,Wxe,Xxe,qxe,Zxe,wve,vxe,Jxe,tEe,iEe,cye,oEe,lEe,dEe,pEe,gEe,yEe,bEe,xEe,IEe,SEe,OEe,kEe,NEe,FEe,PEe,$Ee,gve,wxe,VEe,zEe,jEe,YEe,GEe,HEe,WEe,XEe,ZEe,JEe,nwe,iwe,rwe,owe,awe,lwe,uwe,xxe,yye,dwe,pwe,fwe,_we,xwe,wwe,bye,Iwe,Awe,Cwe,Pxe];for(const e of Owe)(0,p3.registerKernel)(e); /** @license See the LICENSE file. */ -const Awe={"tfjs-core":u3.version_core,"tfjs-backend-cpu":Jue,"tfjs-backend-webgl":k_e,"tfjs-data":Eae,"tfjs-layers":tee,"tfjs-converter":hoe,tfjs:"4.22.0"};var Swe=__webpack_require__(99778);const Cwe=Symbol("rowContextKey"),Owe=nG({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Mwe=tS({name:"ElRow"});const kwe=gG(LH(tS({...Mwe,props:Owe,setup(e){const t=e,n=Wz("row"),i=ZM(()=>t.gutter);YC(Cwe,{gutter:i});const r=ZM(()=>{const e={};return t.gutter?(e.marginRight=e.marginLeft=`-${t.gutter/2}px`,e):e}),s=ZM(()=>[n.b(),n.is(`justify-${t.justify}`,"start"!==t.justify),n.is(`align-${t.align}`,!!t.align)]);return(e,t)=>(JO(),oM(JS(e.tag),{class:yE(yI(s)),style:pE(yI(r))},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["class","style"]))}}),[["__file","row.vue"]])),Rwe=nG({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:[Number,Object],default:()=>({})},sm:{type:[Number,Object],default:()=>({})},md:{type:[Number,Object],default:()=>({})},lg:{type:[Number,Object],default:()=>({})},xl:{type:[Number,Object],default:()=>({})}}),Nwe=tS({name:"ElCol"});const Dwe=gG(LH(tS({...Nwe,props:Rwe,setup(e){const t=e,{gutter:n}=GC(Cwe,{gutter:ZM(()=>0)}),i=Wz("col"),r=ZM(()=>{const e={};return n.value&&(e.paddingLeft=e.paddingRight=n.value/2+"px"),e}),s=ZM(()=>{const e=[];["span","offset","pull","push"].forEach(n=>{const r=t[n];Kz(r)&&("span"===n?e.push(i.b(`${t[n]}`)):r>0&&e.push(i.b(`${n}-${t[n]}`)))});return["xs","sm","md","lg","xl"].forEach(n=>{Kz(t[n])?e.push(i.b(`${n}-${t[n]}`)):jx(t[n])&&Object.entries(t[n]).forEach(([t,r])=>{e.push("span"!==t?i.b(`${n}-${t}-${r}`):i.b(`${n}-${r}`))})}),n.value&&e.push(i.is("guttered")),[i.b(),e]});return(e,t)=>(JO(),oM(JS(e.tag),{class:yE(yI(s)),style:pE(yI(r))},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["class","style"]))}}),[["__file","col.vue"]])),Fwe={class:"vis-left-panel-inner-wrapper"},Lwe={class:"card-header"},Pwe={key:0,style:{margin:"auto"}},Bwe={key:1,style:{margin:"auto"}},$we=["src"],Uwe={__name:"ModelArea",emits:["shot"],setup(e,{expose:t,emit:n}){const i=n,r=GC("picList"),s=GC("shotList"),o=GC("states"),a=pI(r.value.map((e,t)=>({name:e.title,progress:0}))),l=["#FF6F61","#42A5F5","#66BB6A","#FFA726","#AB47BC"];let u,c,d=[];setInterval(async()=>{if(2!==o.value.isTraining)return;if(""!==p.value)return;i("shot");const e=s.value[s.value.length-1];if(!e||"data:,"===e)return void dW.error("未获取到有效样本");const t=new Image;t.src=e,await new Promise(e=>{t.onload=e});const n=u3.browser.fromPixels(t);let r=u3.image.resizeBilinear(n,[224,224]).expandDims(0).div(255),l=u.predict(r);const d=c.predict(l),h=await d.data();a.value=[...a.value.map((e,t)=>({...e,progress:Number((100*h[t]).toFixed(2))}))],n.dispose(),l.dispose(),d.dispose()},200);const h=pI(!1),p=pI(""),f=pI(""),m=pI("20%"),g=pI("20%");async function _(){if(c)try{await c.save(`downloads://${""==S.value?"my-model":S.value}`),dW.success("模型导出成功")}catch(e){dW.error(`模型导出失败: ${e.message}`)}else dW.error("模型尚未训练完成")}async function y(e){const t=new FileReader;return t.onload=async e=>{if(p.value=e.target.result,!u||!c)return dW.error("请先完成模型训练"),!1;const t=new window.Image;t.src=p.value,await new Promise(e=>t.onload=e);const n=u3.browser.fromPixels(t);let i=u3.image.resizeBilinear(n,[224,224]).expandDims(0).div(255),r=u.predict(i);const s=c.predict(r),o=await s.data();a.value=[...a.value.map((e,t)=>({...e,progress:Number((100*o[t]).toFixed(2))}))];const l=o.indexOf(Math.max(...o));f.value=a.value[l]?.name||"未知",n.dispose(),r.dispose(),s.dispose()},t.readAsDataURL(e),!1}function v(){p.value=""}let b=0,T=0,x=0,E=0;function w(e){if(0!==e.button)return;b=e.clientX,T=e.clientY;const t=document.getElementById("vis-left-panel-wrapper").style.top,n=document.getElementById("vis-left-panel-wrapper").style.right;x=t.endsWith("%")?window.innerHeight*Number.parseFloat(t)/100:Number.parseFloat(t),E=n.endsWith("%")?window.innerWidth*Number.parseFloat(n)/100:Number.parseFloat(n),document.addEventListener("mousemove",I),document.addEventListener("mouseup",A)}function I(e){const t=e.clientX-b,n=e.clientY-T;let i=x+n,r=E-t;i=Math.max(0,Math.min(window.innerHeight-100,i)),r=Math.max(0,Math.min(window.innerWidth-200,r)),m.value=`${i}px`,g.value=`${r}px`}function A(){document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",A)}t({train:async function(){const e=document.getElementById("vis-left-panel");e&&(e.innerHTML="训练准备中……"),h.value=!0,console.log("正在加载Mobilenet……"),u=await coe(xx.join(ze.Env.boardDirPath,"teachableModel/model.json")),console.log("Mobilenet加载完成。"),e&&(e.innerHTML="");const t=r.value.length;let n=null,i=null;c=See(),c.add(hie({inputShape:[1280],units:128,activation:"relu"})),c.add(hie({units:t,activation:"softmax"})),c.compile({optimizer:u3.train.adam(.001),loss:"categoricalCrossentropy",metrics:["accuracy"]});for(let e=0;e{o.onload=e});const a=u3.browser.fromPixels(o),l=a.resizeBilinear([224,224]).toFloat().div(u3.scalar(127.5)).sub(u3.scalar(1)).expandDims(0);let c=u.predict(l);const d=u3.oneHot(u3.tensor1d([e]).toInt(),t);if(null==n)n=c.clone(),i=d.clone();else{const e=n;n=e.concat(c,0),e.dispose();const t=i;i=t.concat(d,0),t.dispose()}d.dispose(),a.dispose()}}d=[];const s=document.getElementById("vis-left-panel")||{name:"训练过程",tab:"训练"};await c.fit(n,i,{epochs:20,batchSize:16,shuffle:!0,validationSplit:.2,callbacks:Swe.show.fitCallbacks(s,["loss","acc","val_loss","val_acc","accuracy","val_accuracy"],{callbacks:["onEpochEnd"]})}),console.log("训练完成"),a.value=r.value.filter(e=>!0!==e.disabled).map((e,t)=>({name:e.title,progress:0})),console.log(a.value),o.value.isTraining=2}});const S=pI("");async function C(){if(c)try{await c.save(`indexeddb://${""==S.value?"my-model":S.value}`),dW.success("模型保存成功")}catch(e){dW.error(`模型保存失败: ${e.message}`)}else dW.error("模型尚未训练完成")}return(e,t)=>(JO(),sM("div",null,[SA(hM("div",{id:"vis-left-panel-wrapper",class:"vis-left-panel-wrapper",style:pE(`right: ${g.value}; top: ${m.value};`)},[hM("div",Fwe,[hM("div",{class:"vis-left-panel-title",style:{},onMousedown:w},[t[4]||(t[4]=hM("span",null," 训练过程可视化 ",-1)),pM(yI(EX),{size:"small",plain:"",onClick:t[0]||(t[0]=e=>h.value=!1)},{default:AA(()=>t[3]||(t[3]=[_M(" 隐藏 ")])),_:1})],32),t[5]||(t[5]=hM("div",{id:"vis-left-panel",class:"vis-left-panel"},"训练准备中……",-1))])],4),[[Bk,h.value]]),2===yI(o).isTraining?(JO(),oM(yI(SX),{key:0,class:"model-area"},{header:AA(()=>[hM("div",Lwe,[t[8]||(t[8]=_M(" 模型 ")),h.value?vM("v-if",!0):(JO(),oM(yI(EX),{key:0,size:"small",style:{"margin-left":"10px"},type:"primary",plain:"",onClick:t[1]||(t[1]=e=>h.value=!0)},{default:AA(()=>t[6]||(t[6]=[_M(" 显示训练过程 ")])),_:1})),2===yI(o).isTraining?(JO(),oM(yI(EX),{key:1,size:"small",style:{"margin-left":"10px"},type:"success",plain:"",onClick:_},{default:AA(()=>t[7]||(t[7]=[_M(" 模型导出至本地 ")])),_:1})):vM("v-if",!0)])]),default:AA(()=>[pM(yI(kwe),{class:"model-item",style:{"flex-direction":"column","align-items":"flex-center"}},{default:AA(()=>[pM(yI(kwe),null,{default:AA(()=>[pM(yI(Dwe),{span:6,style:{display:"flex","align-items":"center","text-align":"right"}},{default:AA(()=>t[9]||(t[9]=[_M(" 名称: ")])),_:1}),pM(yI(Dwe),{span:12},{default:AA(()=>[pM(yI(Nq),{modelValue:S.value,"onUpdate:modelValue":t[2]||(t[2]=e=>S.value=e),placeholder:"请输入模型名称"},null,8,["modelValue"])]),_:1}),pM(yI(Dwe),{span:4,style:{display:"flex","align-items":"center"}},{default:AA(()=>[pM(yI(EX),{style:{margin:"auto 5px"},type:"primary",plain:"",size:"small",onClick:C},{default:AA(()=>t[10]||(t[10]=[_M(" 保存 ")])),_:1})]),_:1})]),_:1})]),_:1}),pM(yI(kwe),{class:"model-item"},{default:AA(()=>t[11]||(t[11]=[hM("b",null,"输入",-1)])),_:1}),pM(yI(kwe),{class:"model-item"},{default:AA(()=>[p.value?(JO(),sM("div",Bwe,[t[16]||(t[16]=_M(" 下方上传图片 ")),t[17]||(t[17]=hM("br",null,null,-1)),pM(yI(EX),{size:"small",type:"success",plain:"",onClick:v},{default:AA(()=>t[14]||(t[14]=[_M(" 切换为上方拍摄内容 ")])),_:1}),pM(yI(I2),{"show-file-list":!1,accept:"image/*","before-upload":y},{default:AA(()=>[pM(yI(EX),{size:"small",type:"success"},{default:AA(()=>t[15]||(t[15]=[_M(" 重新上传一张 ")])),_:1})]),_:1}),hM("img",{src:p.value,alt:"用户上传图片",style:{"max-width":"100%","max-height":"150px","border-radius":"10px"}},null,8,$we)])):(JO(),sM("div",Pwe,[t[13]||(t[13]=_M(" 上方拍摄内容 ")),pM(yI(I2),{"show-file-list":!1,accept:"image/*","before-upload":y},{default:AA(()=>[pM(yI(EX),{size:"small",type:"success"},{default:AA(()=>t[12]||(t[12]=[_M(" 切换为上传图片 ")])),_:1})]),_:1})]))]),_:1}),pM(yI(kwe),{class:"model-item"},{default:AA(()=>t[18]||(t[18]=[hM("b",null,"输出",-1)])),_:1}),(JO(!0),sM(WO,null,iC(a.value,(e,t)=>(JO(),oM(yI(kwe),{key:`${e.name}-${t}`,class:"model-item"},{default:AA(()=>[pM(yI(Dwe),{span:6},{default:AA(()=>[_M(FE(e.name),1)]),_:2},1024),pM(yI(Dwe),{span:18},{default:AA(()=>[pM(yI(PJ),{class:"progress","text-inside":!0,"stroke-width":20,percentage:e.progress,color:l[t%l.length],striped:"",format:e=>`${e}%`},null,8,["percentage","color","format"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):vM("v-if",!0)]))}},Vwe=(0,a3.A)(Uwe,[["__scopeId","data-v-5abb0202"]]),zwe=nG({trigger:pZ.trigger,triggerKeys:pZ.triggerKeys,placement:sJ.placement,disabled:pZ.disabled,visible:dZ.visible,transition:dZ.transition,popperOptions:sJ.popperOptions,tabindex:sJ.tabindex,content:dZ.content,popperStyle:dZ.popperStyle,popperClass:dZ.popperClass,enterable:{...dZ.enterable,default:!0},effect:{...dZ.effect,default:"light"},teleported:dZ.teleported,appendTo:dZ.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),jwe={"update:visible":e=>qz(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Ywe=tS({name:"ElPopover"}),Gwe=tS({...Ywe,props:zwe,emits:jwe,setup(e,{expose:t,emit:n}){const i=e,r=ZM(()=>i["onUpdate:visible"]),s=Wz("popover"),o=pI(),a=ZM(()=>{var e;return null==(e=yI(o))?void 0:e.popperRef}),l=ZM(()=>[{width:PH(i.width)},i.popperStyle]),u=ZM(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),c=ZM(()=>i.transition===`${s.namespace.value}-fade-in-linear`),d=()=>{n("before-enter")},h=()=>{n("before-leave")},p=()=>{n("after-enter")},f=()=>{n("update:visible",!1),n("after-leave")};return t({popperRef:a,hide:()=>{var e;null==(e=o.value)||e.hide()}}),(e,t)=>(JO(),oM(yI(SQ),EM({ref_key:"tooltipRef",ref:o},e.$attrs,{trigger:e.trigger,"trigger-keys":e.triggerKeys,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":yI(u),"popper-style":yI(l),teleported:e.teleported,"append-to":e.appendTo,persistent:e.persistent,"gpu-acceleration":yI(c),"onUpdate:visible":yI(r),onBeforeShow:d,onBeforeHide:h,onShow:p,onHide:f}),{content:AA(()=>[e.title?(JO(),sM("div",{key:0,class:yE(yI(s).e("title")),role:"title"},FE(e.title),3)):vM("v-if",!0),sC(e.$slots,"default",{},()=>[_M(FE(e.content),1)])]),default:AA(()=>[e.$slots.reference?sC(e.$slots,"reference",{key:0}):vM("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});const Hwe=(e,t)=>{const n=t.arg||t.value,i=null==n?void 0:n.popperRef;i&&(i.triggerRef=e)};var Wwe,Xwe;const qwe=gG(LH(Gwe,[["__file","popover.vue"]]),{directive:(Xwe="popover",(Wwe={mounted(e,t){Hwe(e,t)},updated(e,t){Hwe(e,t)}}).install=e=>{e.directive(Xwe,Wwe)},Wwe)}),Kwe=nG({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:iG,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),Zwe=tS({name:"ElText"}),Qwe=tS({...Zwe,props:Kwe,setup(e){const t=e,n=pI(),i=GW(),r=Wz("text"),s=ZM(()=>[r.b(),r.m(t.type),r.m(i.value),r.is("truncated",t.truncated),r.is("line-clamp",!Xz(t.lineClamp))]),o=()=>{var e,i,r,s,o,a,l;if(TC().title)return;let u=!1;const c=(null==(e=n.value)?void 0:e.textContent)||"";if(t.truncated){const e=null==(i=n.value)?void 0:i.offsetWidth,t=null==(r=n.value)?void 0:r.scrollWidth;e&&t&&t>e&&(u=!0)}else if(!Xz(t.lineClamp)){const e=null==(s=n.value)?void 0:s.offsetHeight,t=null==(o=n.value)?void 0:o.scrollHeight;e&&t&&t>e&&(u=!0)}u?null==(a=n.value)||a.setAttribute("title",c):null==(l=n.value)||l.removeAttribute("title")};return US(o),zS(o),(e,t)=>(JO(),oM(JS(e.tag),{ref_key:"textRef",ref:n,class:yE(yI(s)),style:pE({"-webkit-line-clamp":e.lineClamp})},{default:AA(()=>[sC(e.$slots,"default")]),_:3},8,["class","style"]))}});const Jwe=gG(LH(Qwe,[["__file","text.vue"]])),eIe={__name:"TrainArea",emits:["train"],setup(e,{emit:t}){const n=t,i=GC("picList"),r=GC("states"),s=pI(!1),o=pI("待训练……");function a(){s.value&&(n("train"),r.value.isTraining=1)}return wO([i.value,()=>r.value.isTraining],()=>{s.value=function(){const e=Array.isArray(i.value)?i.value.filter(e=>!1===e.disabled):[];return 1!==r.value.isTraining&&e.length>1&&e.every(e=>Array.isArray(e.list)&&e.list.length>0)}(),0===r.value.isTraining?o.value="待训练……":1===r.value.isTraining?o.value="训练中……":2===r.value.isTraining&&(o.value="训练完成")},{immediate:!0}),(e,t)=>(JO(),oM(yI(SX),{class:"train-area"},{header:AA(()=>t[0]||(t[0]=[hM("div",{class:"card-header"}," 训练 ",-1)])),default:AA(()=>[pM(yI(qwe),{class:"box-item",placement:"bottom",disabled:s.value},{reference:AA(()=>[pM(yI(EX),{disabled:!s.value,type:"primary",style:{"max-width":"100%"},onClick:a},{default:AA(()=>t[1]||(t[1]=[_M(" 训练模型 ")])),_:1},8,["disabled"])]),default:AA(()=>[pM(yI(jH),null,{default:AA(()=>[pM(yI(dH))]),_:1}),t[2]||(t[2]=_M(" 至少有两个类别,且每个类别都需有图像样本。 "))]),_:1},8,["disabled"]),t[3]||(t[3]=hM("br",null,null,-1)),pM(yI(Jwe),null,{default:AA(()=>[_M(FE(o.value),1)]),_:1})]),_:1}))}},tIe=(0,a3.A)(eIe,[["__scopeId","data-v-1deba862"]]),nIe={class:"main-splitter"},iIe={class:"class-area"},rIe={class:"add-class-content"},sIe={__name:"teachableModel",setup(e){const t=pI([]);YC("shotList",t);const n=pI([{title:"类别 1",list:[],disabled:!1},{title:"类别 2",list:[],disabled:!1}]);YC("picList",n);async function i(e,i){n.value[e].disabled?dW.error("该类别已被禁用"):i?n.value[e].list.push(i):(await a(),t.value[t.value.length-1]&&"data:,"!==t.value[t.value.length-1]?n.value[e].list.push(t.value[t.value.length-1]):dW.error("未获取到有效样本"))}function r(){n.value.push({title:`类别 ${n.value.length+1}`,list:[],disabled:!1})}YC("states",pI({isTraining:0}));const s=pI(!0),o=pI(null);async function a(){await(o.value?.captureShot())}const l=pI(null);async function u(){await l.value.train()}return(e,t)=>(JO(),sM("div",nIe,[pM(yI(NW),null,{default:AA(()=>[pM(yI(DW),{size:"70%",min:200},{default:AA(()=>[hM("div",iIe,[(JO(!0),sM(WO,null,iC(n.value,(e,r)=>(JO(),oM(r3,{key:r,title:e.title,"pic-list":e.list,disabled:e.disabled,onAddSample:e=>i(r,e),onDeleteSample:e=>n.value[r].list=n.value[r].list.filter(t=>t!==e),onDeleteClass:e=>function(e){n.value.splice(e,1)}(r),onDisableClass:e=>function(e){n.value[e].disabled=!n.value[e].disabled}(r),onRenameClass:e=>function(e,t){n.value[e].title=t}(r,e),onClearSamples:e=>function(e){n.value[e].list=[]}(r)},{default:AA(()=>[pM(yI(EX),{type:"primary",size:"mini",onClick:e=>i(r)},{default:AA(()=>t[0]||(t[0]=[_M(" 添加样本 ")])),_:2},1032,["onClick"])]),_:2},1032,["title","pic-list","disabled","onAddSample","onDeleteSample","onDeleteClass","onDisableClass","onRenameClass","onClearSamples"]))),128)),pM(yI(SX),{class:"add-class-card",onClick:r},{default:AA(()=>[hM("div",rIe,[t[1]||(t[1]=_M(" 添加一个类别 ")),pM(yI(jH),null,{default:AA(()=>[pM(yI(BG))]),_:1})])]),_:1})])]),_:1}),pM(yI(DW),{min:200},{default:AA(()=>[pM(l3,{ref_key:"cameraBoxRef",ref:o},null,512),pM(xk,{name:"fade-scale"},{default:AA(()=>[s.value?(JO(),oM(Vwe,{key:0,ref_key:"modelAreaRef",ref:l,onShot:a},null,512)):vM("v-if",!0)]),_:1}),pM(tIe,{onTrain:u})]),_:1})]),_:1})]))}},oIe=(0,a3.A)(sIe,[["__scopeId","data-v-02bafc86"]]),aIe={__name:"App",setup:e=>(e,t)=>(JO(),oM(yI(yG),null,{default:AA(()=>[pM(oIe)]),_:1}))};class lIe{static{ze.HTMLTemplate.add("html/statusbar/loader.html",new ze.HTMLTemplate('\r\n
\r\n
\r\n

{{d.msg.loading}}

\r\n
')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=wx()(ze.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:Ve.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){ze.app.getFooterBar().getContent().after(this.$loader);const e=xx.relative(ze.Env.indexDirPath,ze.Env.boardDirPath),t=new tP({rootPath:xx.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();if(!n)return;await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.statusBarImage=nP.init(),this.statusBarFileSystem=$z.init(),this.statusBarTool=Uz.init();KR(aIe).mount(this.statusBarTool.getContent()[0]),this.statusBarGame=Vz.init(),this.pythonShell=new lIe,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader&&this.$loader.remove&&this.$loader.remove(),this.$loader=null},this.run=async function(){if(!this.kernelLoaded)return;const e=ze.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#C=null;#O=null;#M=null;#k={row:0,column:0};#R="";#N=null;#D=null;#F=!1;#L=!1;#P=null;#B=()=>this.#$();#U=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#k.row){const e=this.#C.getEndPos();let t=this.#C.getValueRange(this.#k,e);t=t.replace(this.#R,""),this.#N?.(t),this.#N=null,this.#D=null,this.#C.addValue("\n"),this.#V()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row{this.#L=!1,this.#C.addValue(`\n==${ze.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(ze.Debug.error)}),this.#P.addEventListener("eval.output",e=>{this.#C.addValue(e.content)}),this.#P.addEventListener("eval.error",()=>{this.#L=!1,this.#C.addValue(`\n==${ze.Msg.Lang["shell.finish"]}==`)}),this.#P.addEventListener("eval.input",e=>{const t=String(e?.content?.prompt);this.#C.addValue(t),this.#R=t,this.#N=e.resolve,this.#D=e.reject,this.#z()}),this.#P.addEventListener("eval.display",e=>{this.#M.changeTo("images"),this.#O.display(e)})}#$(){const e=this.#C.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row{window.pyodide.FS.syncfs(e,t)})}sleep(e){return new Promise(t=>setTimeout(t,e))}}const uIe={init:async function(){const e=ze.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Ve.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{lIe.run().catch(ze.Debug.error)},scopeType:ze.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Ve.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{lIe.stop().catch(ze.Debug.error)},scopeType:ze.Nav.Scope.LEFT,weight:5}),await lIe.init()}},cIe=uIe,dIe=new ze.Registry,hIe=function(e){let t={ok:!1,buffer:null,json:function(){const e=new TextDecoder("utf-8").decode(this.buffer);return JSON.parse(e)},arrayBuffer:function(){return this.buffer}};return dIe.hasKey(e)?(t.ok=!0,t.buffer=dIe.getItem(e),t):t},pIe={modelsValue:{},loadGraphModel:async function(e){return await coe(e,{fromTFHub:!1,fetchFunc:(...e)=>hIe(e[0])})},loadLayersModel:async function(e){return await wee(e,{fromTFHub:!1,fetchFunc:(...e)=>hIe(e[0])})},setModelsValue:function(e,t){dIe.hasKey(e)&&dIe.unregister(e),dIe.register(e,t),pIe.modelsValue[e]=t}};window.tensorflow=pIe,window.addEventListener("error",e=>e.error&&e.error.message&&e.error.message.includes("openOrClosedShadowRoot")?(console.warn("捕获到Blockly DOM操作错误,这通常是无害的:",e.error.message),e.preventDefault(),!1):e.error&&e.error.message&&(e.error.message.includes("DOM")||e.error.message.includes("Element")||e.error.message.includes("Node"))?(console.warn("捕获到DOM操作错误:",e.error.message),e.preventDefault(),!1):void 0),window.addEventListener("unhandledrejection",e=>{if(e.reason&&e.reason.message&&e.reason.message.includes("openOrClosedShadowRoot"))return console.warn("捕获到未处理的Promise拒绝(Blockly DOM错误):",e.reason.message),e.preventDefault(),!1});const fIe=console.error;console.error=function(...e){const t=e.join(" ");t.includes("openOrClosedShadowRoot")||t.includes("DOM")||t.includes("Element")||t.includes("Node")?console.warn("过滤的DOM错误:",...e):fIe.apply(console,e)};const mIe=(e,t)=>{try{if(e&&t&&e.appendChild)return e.appendChild(t)}catch(e){console.warn("安全DOM添加失败:",e.message)}return null},gIe=(e,t)=>{try{if(e&&t&&e.removeChild&&t.parentNode===e)return e.removeChild(t)}catch(e){console.warn("安全DOM移除失败:",e.message)}return null},_Ie=(e,t)=>{try{if(e&&e.querySelector)return e.querySelector(t)}catch(e){console.warn("安全DOM查询失败:",e.message)}return null},yIe=e=>e&&e.parentNode&&document.contains(e),vIe={volume:100,effects:{pitch:0,pan:0},builtin:{Meow:"meow"},isRecording:!1,mediaRecorder:null,recordedChunks:[],recordedAudio:null,activeAudios:[],isStopped:!1,abortController:null,blockAllAudio:!1,audioHistory:[],soundQueue:[],isProcessingQueue:!1,currentlyPlaying:null,initAudioContext:()=>{if(!vIe.audioContext)try{vIe.audioContext=new(window.AudioContext||window.webkitAudioContext)}catch(e){console.error("Error initializing audio context:",e)}},createAudio:e=>{if(vIe.blockAllAudio||vIe.isStopped||vIe.abortController&&vIe.abortController.signal.aborted){return{play:()=>Promise.reject(new Error("Audio playback blocked")),pause:()=>{},currentTime:0,src:"",volume:1,playbackRate:1,onended:null,onerror:null,onloadstart:null,oncanplay:null,onplay:null,onpause:null,tagName:"AUDIO",addEventListener:()=>{},removeEventListener:()=>{},load:()=>{},duration:0,ended:!1,paused:!0,muted:!1,readyState:0,networkState:0,preload:"none"}}return new Audio(e)},play:async e=>{try{if(vIe.isStopped)return;if(vIe.abortController&&vIe.abortController.signal.aborted)return;if(vIe.blockAllAudio)return;if(vIe.soundQueue.length>0||vIe.isProcessingQueue)return vIe.soundQueue.push({name:e,resolve:()=>{},reject:()=>{}}),void vIe.processQueue();if(vIe.activeAudios.length>0&&(vIe.activeAudios.forEach(e=>{try{e&&"AUDIO"===e.tagName&&(e.pause(),e.currentTime=0,e.src="")}catch(e){console.warn("停止现有音频时出错:",e)}}),vIe.activeAudios=[]),e.startsWith("recording")&&vIe.builtin[e]){if(vIe.blockAllAudio||vIe.isStopped)return;const t=vIe.createAudio(vIe.builtin[e]);t.volume=vIe.volume/100;const n=vIe.effects.pitch,i=vIe.effects.pan;if(0===n&&0===i)return void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)});if(vIe.initAudioContext(),!vIe.audioContext)return console.warn("音频上下文初始化失败,无法应用增强音效"),void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)});try{const e=vIe.audioContext.createMediaElementSource(t),r=vIe.audioContext.createGain();if(0!==n){const t=vIe.audioContext.createBiquadFilter();t.type="peaking",t.frequency.setValueAtTime(1e3,vIe.audioContext.currentTime),t.Q.setValueAtTime(1,vIe.audioContext.currentTime);const i=Math.max(-20,Math.min(20,.8*n));t.gain.setValueAtTime(i,vIe.audioContext.currentTime),e.connect(t),t.connect(r)}else e.connect(r);if(0!==i){const e=vIe.audioContext.createStereoPanner(),t=Math.max(-1,Math.min(1,i/100*1.5));e.pan.setValueAtTime(t,vIe.audioContext.currentTime),r.connect(e),e.connect(vIe.audioContext.destination)}else r.connect(vIe.audioContext.destination);r.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime)}catch(e){return console.warn("应用增强音效失败,使用默认播放:",e),void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)})}return vIe.activeAudios.push(t),t.onended=()=>{const e=vIe.activeAudios.indexOf(t);e>-1&&vIe.activeAudios.splice(e,1)},void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e);const n=vIe.activeAudios.indexOf(t);n>-1&&vIe.activeAudios.splice(n,1)})}if("Meow"===e&&(vIe.initAudioContext(),vIe.audioContext)){const e=vIe.audioContext.createOscillator(),t=vIe.audioContext.createGain();let n=440;if(0!==vIe.effects.pitch&&(n*=Math.pow(2,vIe.effects.pitch/12)),e.frequency.setValueAtTime(n,vIe.audioContext.currentTime),e.type="sine",t.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime),0!==vIe.effects.pan){const n=vIe.audioContext.createStereoPanner(),i=vIe.effects.pan/100;n.pan.setValueAtTime(i,vIe.audioContext.currentTime),e.connect(n),n.connect(t)}else e.connect(t);t.connect(vIe.audioContext.destination),e.start(),e.stop(vIe.audioContext.currentTime+.5)}}catch(e){console.error("Error in sound.play:",e)}},_playAudioInternal:async e=>new Promise((t,n)=>{try{if(vIe.isStopped||vIe.blockAllAudio)return void n(new Error("Playback blocked"));if(e.startsWith("recording")&&vIe.builtin[e]){const i=vIe.createAudio(vIe.builtin[e]);i.volume=vIe.volume/100;const r=vIe.effects.pitch,s=vIe.effects.pan;if((0!==r||0!==s)&&(vIe.initAudioContext(),vIe.audioContext))try{const e=vIe.audioContext.createMediaElementSource(i),t=vIe.audioContext.createGain();if(0!==r){const n=vIe.audioContext.createBiquadFilter();n.type="peaking",n.frequency.setValueAtTime(1e3,vIe.audioContext.currentTime),n.Q.setValueAtTime(1,vIe.audioContext.currentTime);const i=Math.max(-20,Math.min(20,.8*r));n.gain.setValueAtTime(i,vIe.audioContext.currentTime),e.connect(n),n.connect(t)}else e.connect(t);if(0!==s){const e=vIe.audioContext.createStereoPanner(),n=Math.max(-1,Math.min(1,s/100*1.5));e.pan.setValueAtTime(n,vIe.audioContext.currentTime),t.connect(e),e.connect(vIe.audioContext.destination)}else t.connect(vIe.audioContext.destination);t.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime)}catch(e){console.warn("应用音效失败:",e)}i.onended=()=>{const e=vIe.activeAudios.indexOf(i);e>-1&&vIe.activeAudios.splice(e,1),t()},i.onerror=t=>{console.error(`音频播放失败: ${e}`,t);const r=vIe.activeAudios.indexOf(i);r>-1&&vIe.activeAudios.splice(r,1),n(t)},vIe.activeAudios.push(i),i.play().catch(e=>{"AbortError"===e.name?t():(console.error("播放音频失败:",e),n(e))})}else if("Meow"===e)if(vIe.initAudioContext(),vIe.audioContext){const e=vIe.audioContext.createOscillator(),n=vIe.audioContext.createGain();let i=440;if(0!==vIe.effects.pitch&&(i*=Math.pow(2,vIe.effects.pitch/12)),e.frequency.setValueAtTime(i,vIe.audioContext.currentTime),e.type="sine",n.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime),0!==vIe.effects.pan){const t=vIe.audioContext.createStereoPanner(),i=vIe.effects.pan/100;t.pan.setValueAtTime(i,vIe.audioContext.currentTime),e.connect(t),t.connect(n)}else e.connect(n);n.connect(vIe.audioContext.destination),e.start(),e.stop(vIe.audioContext.currentTime+.5),setTimeout(()=>{t()},500)}else n(new Error("AudioContext not available"));else n(new Error(`Unknown sound: ${e}`))}catch(e){console.error("内部播放错误:",e),n(e)}}),processQueue:async()=>{if(!vIe.isProcessingQueue&&0!==vIe.soundQueue.length){for(vIe.isProcessingQueue=!0;vIe.soundQueue.length>0;){const e=vIe.soundQueue.shift();try{if("frequency"===e.type){const{frequency:t,duration:n,resolve:i}=e;vIe.currentlyPlaying={type:"frequency",frequency:t,startTime:Date.now()},await new Promise(e=>{if(vIe.initAudioContext(),vIe.audioContext){const i=vIe.audioContext.createOscillator(),r=vIe.audioContext.createGain();i.frequency.setValueAtTime(t,vIe.audioContext.currentTime),i.type="sine";const s=vIe.effects.pitch;0!==s&&i.frequency.setValueAtTime(t*Math.pow(2,s/12),vIe.audioContext.currentTime),r.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime),i.connect(r),r.connect(vIe.audioContext.destination),i.onended=()=>{vIe.currentlyPlaying=null,e()},i.start(),i.stop(vIe.audioContext.currentTime+n/1e3)}else e()}),vIe.currentlyPlaying=null,i()}else{const{name:t,resolve:n}=e;vIe.currentlyPlaying={name:t,startTime:Date.now()},await vIe._playAudioInternal(t),vIe.currentlyPlaying=null,n()}}catch(t){console.error("队列播放失败:",t),vIe.currentlyPlaying=null,e.reject&&e.reject(t)}}vIe.isProcessingQueue=!1}},play_blocking:e=>new Promise((t,n)=>{vIe.soundQueue.push({name:e,resolve:t,reject:n}),vIe.processQueue()}),stop_all:()=>{try{if(vIe.isStopped=!0,vIe.blockAllAudio=!0,vIe.soundQueue.length>0&&(vIe.soundQueue.forEach(({reject:e})=>{e(new Error("Playback stopped"))}),vIe.soundQueue=[]),vIe.isProcessingQueue=!1,vIe.currentlyPlaying=null,vIe.abortController&&vIe.abortController.abort(),vIe.abortController=new AbortController,vIe.activeAudios.length>0&&(vIe.activeAudios.forEach(e=>{try{e&&"AUDIO"===e.tagName&&(e.pause(),e.currentTime=0,e.src="",e.load(),e.onended=null,e.onerror=null,e.onloadstart=null,e.oncanplay=null,e.onplay=null,e.onpause=null)}catch(e){console.warn("停止音频时出错:",e)}}),vIe.activeAudios=[]),vIe.audioContext)try{vIe.audioContext.close(),vIe.audioContext=null}catch(e){console.warn("关闭音频上下文时出错:",e)}vIe.effects.pitch=0,vIe.effects.pan=0;const e=document.querySelectorAll("audio");e.length>0&&e.forEach(e=>{try{e.pause(),e.currentTime=0,e.src=""}catch(e){console.warn("停止页面音频元素时出错:",e)}}),setTimeout(()=>{vIe.isStopped=!1,vIe.blockAllAudio=!1},100)}catch(e){console.error("Error in sound.stop_all:",e)}},adjust_volume:e=>{const t=Math.max(0,Math.min(100,vIe.volume+e));vIe.volume=t},set_volume:e=>{vIe.volume=Math.max(0,Math.min(100,e))},get_volume:()=>vIe.volume,noteFrequencies:{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},play_frequency:(e,t=1e3)=>{try{if(vIe.initAudioContext(),vIe.audioContext){const n=vIe.audioContext.createOscillator(),i=vIe.audioContext.createGain();n.frequency.setValueAtTime(e,vIe.audioContext.currentTime),n.type="sine";const r=vIe.effects.pitch;0!==r&&n.frequency.setValueAtTime(e*Math.pow(2,r/12),vIe.audioContext.currentTime),i.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime),n.connect(i),i.connect(vIe.audioContext.destination),n.start(),n.stop(vIe.audioContext.currentTime+t/1e3),console.log(`播放频率: ${e}Hz, 持续时间: ${t}ms, 音量: ${vIe.volume}%`)}}catch(e){console.error("播放频率声音失败:",e)}},play_frequency_continuous:e=>{try{if(vIe.initAudioContext(),vIe.audioContext){const t=vIe.audioContext.createOscillator(),n=vIe.audioContext.createGain();t.frequency.setValueAtTime(e,vIe.audioContext.currentTime),t.type="sine";const i=vIe.effects.pitch;0!==i&&t.frequency.setValueAtTime(e*Math.pow(2,i/12),vIe.audioContext.currentTime),n.gain.setValueAtTime(vIe.volume/100,vIe.audioContext.currentTime),t.connect(n),n.connect(vIe.audioContext.destination),t.start(),t.stop(vIe.audioContext.currentTime+2),console.log(`播放频率(持续): ${e}Hz, 无持续时间限制, 音量: ${vIe.volume}%`)}}catch(e){console.error("播放频率声音失败:",e)}},play_frequency_blocking:(e,t=1e3)=>(console.log(`=== 🔒 阻塞播放频率(加入队列): ${e}Hz, ${t}ms ===`),new Promise((n,i)=>{const r={type:"frequency",frequency:e,duration:t,resolve:n,reject:i};vIe.soundQueue.push(r),console.log(`✅ 频率已加入声音队列,当前队列长度: ${vIe.soundQueue.length}`),vIe.processQueue()})),play_frequency_continuous_blocking:e=>(console.log(`=== 🔒 阻塞播放频率(持续,加入队列): ${e}Hz ===`),new Promise((t,n)=>{const i={type:"frequency",frequency:e,duration:2e3,resolve:t,reject:n};vIe.soundQueue.push(i),console.log(`✅ 频率(持续)已加入声音队列,当前队列长度: ${vIe.soundQueue.length}`),vIe.processQueue()})),play_note_list:e=>{try{const t={DADADADUM:[{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500}],BIRTHDAY:[{note:"NOTE_C4",duration:400},{note:"NOTE_C4",duration:400},{note:"NOTE_D4",duration:800},{note:"NOTE_C4",duration:800},{note:"NOTE_F4",duration:800},{note:"NOTE_E4",duration:1600}],BA_DING:[{note:"NOTE_C5",duration:200},{note:"NOTE_E5",duration:200},{note:"NOTE_G5",duration:400}],JUMP_UP:[{note:"NOTE_C5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_G5",duration:100}],JUMP_DOWN:[{note:"NOTE_G5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_C5",duration:100}],POWER_UP:[{note:"NOTE_C4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_C5",duration:300}],POWER_DOWN:[{note:"NOTE_C5",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_C4",duration:300}]}[e];if(t){let e=0;t.forEach(t=>{const n=vIe.noteFrequencies[t.note]||440,i=t.duration;setTimeout(()=>{vIe.play_frequency(n,i)},e),e+=i})}else console.warn(`未知的音符列表: ${e}`)}catch(e){console.error("播放音符列表失败:",e)}},play_note_list_blocking:e=>new Promise((t,n)=>{(async()=>{try{const i={DADADADUM:[{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500}],BIRTHDAY:[{note:"NOTE_C4",duration:400},{note:"NOTE_C4",duration:400},{note:"NOTE_D4",duration:800},{note:"NOTE_C4",duration:800},{note:"NOTE_F4",duration:800},{note:"NOTE_E4",duration:1600}],BA_DING:[{note:"NOTE_C5",duration:200},{note:"NOTE_E5",duration:200},{note:"NOTE_G5",duration:400}],JUMP_UP:[{note:"NOTE_C5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_G5",duration:100}],JUMP_DOWN:[{note:"NOTE_G5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_C5",duration:100}],POWER_UP:[{note:"NOTE_C4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_C5",duration:300}],POWER_DOWN:[{note:"NOTE_C5",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_C4",duration:300}]}[e];if(i){for(const e of i){const t=vIe.noteFrequencies[e.note]||440;await vIe.play_frequency_blocking(t,e.duration)}t()}else console.warn(`未知的音符列表: ${e}`),n(new Error(`未知的音符列表: ${e}`))}catch(e){console.error("播放音符列表失败:",e),n(e)}})()}),adjust_effect:(e,t)=>{"pitch"===e?vIe.effects.pitch=Math.max(-24,Math.min(24,vIe.effects.pitch+t)):"pan"===e&&(vIe.effects.pan=Math.max(-100,Math.min(100,vIe.effects.pan+t)))},set_effect:(e,t)=>{"pitch"===e?vIe.effects.pitch=Math.max(-24,Math.min(24,t)):"pan"===e&&(vIe.effects.pan=Math.max(-100,Math.min(100,t)))},clear_effects:()=>{vIe.effects.pitch=0,vIe.effects.pan=0},record:()=>{if(!vIe.isRecording)try{navigator.mediaDevices.getUserMedia({audio:!0}).then(e=>{vIe.mediaRecorder=new MediaRecorder(e),vIe.recordedChunks=[],vIe.mediaRecorder.ondataavailable=e=>{e.data.size>0&&vIe.recordedChunks.push(e.data)},vIe.mediaRecorder.onstart=()=>{vIe.isRecording=!0},vIe.mediaRecorder.onstop=()=>{vIe.isRecording=!1;const t=new Blob(vIe.recordedChunks,{type:"audio/wav"});vIe.recordedAudio=URL.createObjectURL(t),e.getTracks().forEach(e=>{e.stop()}),vIe.showPlaybackInterface(t)},vIe.mediaRecorder.onerror=e=>{console.error("MediaRecorder 错误:",e.error),vIe.isRecording=!1},vIe.mediaRecorder.start(100),vIe.showRecordInterface()}).catch(e=>{console.error("获取麦克风权限失败:",e),alert("无法访问麦克风,请检查权限设置。错误: "+e.message)})}catch(e){console.error("录制功能初始化失败:",e),alert("录制功能初始化失败: "+e.message)}},showRecordInterface:()=>{const e=document.createElement("div");e.id="recordModal",e.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10000;\n ";const t=document.createElement("div");t.style.cssText="\n background: white;\n border-radius: 10px;\n padding: 20px;\n text-align: center;\n min-width: 300px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n ",t.innerHTML='\n

录制声音

\n
\n
\n
\n
\n
\n \n
\n
正在录制...
\n ',e.appendChild(t);try{mIe(document.body,e)}catch(e){return void console.error("添加录制界面到DOM失败:",e)}e.addEventListener("click",e=>{if("stopRecord"===e.target.id)try{vIe.mediaRecorder&&vIe.isRecording?vIe.mediaRecorder.stop():console.warn("MediaRecorder 不存在或未在录制状态")}catch(e){console.error("停止录制时出错:",e),alert("停止录制时出错: "+e.message)}});const n=e.querySelector("#waveformBars");if(n){for(let e=0;e<20;e++){const t=document.createElement("div");t.style.cssText=`\n position: absolute;\n left: ${10*e}px;\n bottom: 0;\n width: 8px;\n height: 20px;\n background: #4a90e2;\n border-radius: 2px;\n transition: height 0.1s ease;\n `,n.appendChild(t)}const t=setInterval(()=>{if(vIe.isRecording&&e.parentNode){const e=n.children;for(let t=0;t{vIe.isRecording&&e.parentNode?(i=60*Math.random()+40,r.style.height=i+"%",s.textContent=`正在录制... 音量: ${Math.round(i)}%`,r.style.opacity=.8+i/100*.2):(clearInterval(t),s&&e.parentNode&&(s.textContent="录制完成",s.style.color="#4CAF50"),r&&e.parentNode&&(r.style.height="100%",r.style.background="linear-gradient(to top, #4CAF50, #4CAF50)"))},200);e.volumeInterval=t}else console.error("找不到音量计或状态显示元素");const o=e=>{"Space"===e.code&&vIe.isRecording&&(e.preventDefault(),vIe.mediaRecorder&&vIe.mediaRecorder.stop())};document.addEventListener("keydown",o),e.keyHandler=o},showPlaybackInterface:e=>{const t=document.getElementById("recordModal");if(t){t.volumeInterval&&clearInterval(t.volumeInterval),t.waveformInterval&&clearInterval(t.waveformInterval),t.keyHandler&&document.removeEventListener("keydown",t.keyHandler);try{yIe(t)&&gIe(document.body,t)}catch(e){console.warn("移除录制界面时出错:",e)}}const n=document.createElement("div");n.id="playbackModal",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10000;\n ";const i=document.createElement("div");i.style.cssText="\n background: white;\n border-radius: 10px;\n padding: 20px;\n text-align: center;\n min-width: 350px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n ",i.innerHTML='\n

录音完成

\n
\n
\n
\n
\n \n
\n
\n \n \n
\n ',n.appendChild(i);try{mIe(document.body,n)}catch(e){return void console.error("添加播放界面到DOM失败:",e)}const r=n.querySelector("#playRecording");r&&(r.onclick=()=>{try{vIe.createAudio(vIe.recordedAudio).play().catch(e=>{console.error("播放录音失败:",e),alert("播放录音失败: "+e.message)});const e=n.querySelector("#waveformLine");e&&(e.style.background="#FF5722",setTimeout(()=>{e.parentNode&&(e.style.background="#4a90e2")},1e3))}catch(e){console.error("播放录音时出错:",e),alert("播放录音时出错: "+e.message)}});const s=n.querySelector("#reRecord");s&&(s.onclick=()=>{try{yIe(n)&&gIe(document.body,n),vIe.record()}catch(e){console.error("重新录制时出错:",e),alert("重新录制时出错: "+e.message)}});const o=n.querySelector("#saveRecording");o&&(o.onclick=()=>{try{vIe.saveRecording(e),yIe(n)&&gIe(document.body,n)}catch(e){console.error("添加到列表时出错:",e),alert("添加到列表时出错: "+e.message)}}),vIe.createWaveformDisplay(e,n)},createWaveformDisplay:async(e,t)=>{try{if(!t||!t.parentNode)return void console.warn("波形显示容器不存在或已被移除");const n=await e.arrayBuffer(),i=new(window.AudioContext||window.webkitAudioContext),r=(await i.decodeAudioData(n)).getChannelData(0),s=t.querySelector("#playbackWaveform");if(s&&s.parentNode){s.innerHTML="";const e=100,t=Math.floor(r.length/e);for(let n=0;n{try{const t=`recording${Object.keys(vIe.builtin).filter(e=>e.startsWith("recording")).length+1}`,n=e?URL.createObjectURL(e):vIe.recordedAudio;if(!n)throw new Error("录音数据不存在");vIe.builtin[t]=n,alert(`录音已保存为: ${t}`);const i=document.getElementById("playbackModal");if(yIe(i)){const e=_Ie(i,"#playRecording");e&&(e.innerHTML=` 播放 ${t}`)}}catch(e){console.error("保存录音失败:",e),alert("保存录音失败: "+e.message)}}},bIe=vIe,TIe=window.Audio;if(window.Audio=function(e){if(vIe.blockAllAudio||vIe.isStopped||vIe.abortController&&vIe.abortController.signal.aborted){return{play:()=>Promise.reject(new Error("Audio playback blocked globally")),pause:()=>{},currentTime:0,src:"",volume:1,playbackRate:1,onended:null,onerror:null,onloadstart:null,oncanplay:null,onplay:null,onpause:null,tagName:"AUDIO",addEventListener:()=>{},removeEventListener:()=>{},load:()=>{},duration:0,ended:!1,paused:!0,muted:!1,readyState:0,networkState:0,preload:"none"}}return new TIe(e)},window.Audio.original=TIe,"undefined"!=typeof window){const e=console.error;console.error=function(...t){const n=t.join(" ");n.includes("sound")&&(n.includes("no-unused-vars")||n.includes("no-trailing-spaces")||n.includes("new-cap"))?console.warn("过滤的sound模块ESLint错误:",...t):e.apply(console,t)}}let xIe=!1;function EIe(e){if(!e)return!1;if("PythonError"===e.name||"KeyboardInterrupt"===e.name){const t=e.message||String(e);return t.includes("KeyboardInterrupt")||t.includes("interrupted")}return!1}function wIe(){if(xIe)return!1;if(window.pyodide&&window.pyodide.globals)try{xIe=!0;const e={play:e=>vIe.play(e),play_blocking:e=>vIe.play_blocking(e),stop_all:()=>vIe.stop_all(),adjust_volume:e=>vIe.adjust_volume(e),set_volume:e=>vIe.set_volume(e),get_volume:()=>vIe.get_volume(),adjust_effect:(e,t)=>vIe.adjust_effect(e,t),set_effect:(e,t)=>vIe.set_effect(e,t),clear_effects:()=>vIe.clear_effects(),play_frequency:(e,t)=>(console.log(`Python调用: sound.play_frequency(${e}, ${t})`),vIe.soundQueue.length>0||vIe.isProcessingQueue?vIe.play_frequency_blocking(e,t):vIe.play_frequency(e,t)),play_frequency_no_duration:e=>(console.log(`Python调用: sound.play_frequency_no_duration(${e})`),vIe.soundQueue.length>0||vIe.isProcessingQueue?vIe.play_frequency_continuous_blocking(e):vIe.play_frequency_continuous(e)),play_frequency_blocking:(e,t)=>(console.log(`Python调用: sound.play_frequency_blocking(${e}, ${t})`),vIe.play_frequency_blocking(e,t)),play_frequency_continuous:e=>(console.log(`Python调用: sound.play_frequency_continuous(${e})`),vIe.play_frequency_continuous(e)),play_frequency_continuous_blocking:e=>(console.log(`Python调用: sound.play_frequency_continuous_blocking(${e})`),vIe.play_frequency_continuous_blocking(e)),play_note_list:e=>vIe.play_note_list(e),play_note_list_blocking:e=>vIe.play_note_list_blocking(e),record:()=>vIe.record(),volume:vIe.volume,effects:vIe.effects};window.pyodide.globals.set("sound",e);const t=new(0,window.pyodide.pyimport("types").ModuleType)("sound");Object.keys(e).forEach(n=>{e[n],t[n]=e[n]});try{window.pyodide.runPython('\nimport sys\nsys.modules[\'sound\'] = sound\n\n# 创建同步版本的play_blocking包装函数\nimport asyncio\nfrom js import Promise\n\n# 保存原始的play_blocking(返回Promise的版本)\n_original_play_blocking = sound.play_blocking\n\ndef _sync_play_blocking(name):\n """同步版本的play_blocking,会等待声音播放完成"""\n promise = _original_play_blocking(name)\n # 使用Pyodide的Promise支持\n # 在Pyodide中,可以直接等待JS Promise\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n # Pyodide 0.21+\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n # 降级方案:使用asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n # 将JS Promise转换为Python awaitable\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n \n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换sound.play_blocking为同步版本\nsound.play_blocking = _sync_play_blocking\n\n# 创建同步版本的play_frequency包装函数\n_original_play_frequency = sound.play_frequency\n\ndef _sync_play_frequency(frequency, duration):\n """同步版本的play_frequency,会自动判断是否需要阻塞"""\n promise = _original_play_frequency(frequency, duration)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 创建同步版本的play_frequency_no_duration包装函数\n_original_play_frequency_no_duration = sound.play_frequency_no_duration\n\ndef _sync_play_frequency_no_duration(frequency):\n """同步版本的play_frequency_no_duration,会自动判断是否需要阻塞"""\n promise = _original_play_frequency_no_duration(frequency)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换为同步版本\nsound.play_frequency = _sync_play_frequency\nsound.play_frequency_no_duration = _sync_play_frequency_no_duration\n\n# 创建同步版本的play_frequency_continuous_blocking包装函数\n_original_play_frequency_continuous_blocking = sound.play_frequency_continuous_blocking\n\ndef _sync_play_frequency_continuous_blocking(frequency):\n """同步版本的play_frequency_continuous_blocking,会等待频率播放完成"""\n promise = _original_play_frequency_continuous_blocking(frequency)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n return pyodide.ffi.run_sync(promise)\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n return await promise\n\n return loop.run_until_complete(wait_promise())\n\n# 替换为同步版本\nsound.play_frequency_continuous_blocking = _sync_play_frequency_continuous_blocking\n\n# 创建同步版本的play_frequency_blocking包装函数\n_original_play_frequency_blocking = sound.play_frequency_blocking\n\ndef _sync_play_frequency_blocking(frequency, duration):\n """同步版本的play_frequency_blocking,会等待频率播放完成"""\n promise = _original_play_frequency_blocking(frequency, duration)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 创建同步版本的play_note_list_blocking包装函数\n_original_play_note_list_blocking = sound.play_note_list_blocking\n\ndef _sync_play_note_list_blocking(note_list):\n """同步版本的play_note_list_blocking,会等待音符列表播放完成"""\n promise = _original_play_note_list_blocking(note_list)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换为同步版本\nsound.play_frequency_blocking = _sync_play_frequency_blocking\nsound.play_note_list_blocking = _sync_play_note_list_blocking\n ')}catch(e){if(EIe(e))return xIe=!1,!1;throw e}return window.pyodide.globals.get("sound")?(xIe=!1,!0):(xIe=!1,console.error("Sound对象注入失败:验证时未找到对象"),!1)}catch(e){return xIe=!1,EIe(e)?!1:(console.error("注入sound对象到Python环境失败:",e),!1)}return!1}function IIe(){!function(){const e=Element.prototype.remove;if(Element.prototype.remove=function(){if(this)if("function"==typeof this.remove)try{return e.call(this)}catch(e){console.warn("remove()调用失败,已安全处理:",e)}else console.warn("对象没有remove方法,已安全忽略");else console.warn("尝试在null对象上调用remove(),已安全忽略")},window.$&&window.$.fn&&window.$.fn.remove){const e=window.$.fn.remove;window.$.fn.remove=function(){if(!this||0===this.length)return console.warn("尝试在空的jQuery对象上调用remove(),已安全忽略"),this;try{return e.call(this)}catch(e){return console.warn("jQuery remove()调用失败,已安全处理:",e),this}}}}(),function(){if(wIe())return;const e=setInterval(()=>{wIe()&&clearInterval(e)},100);setTimeout(()=>{clearInterval(e)},1e4)}()}function AIe(){if(window.pyodide&&window.pyodide.globals)try{window.pyodide.globals.get("sound")||wIe()}catch(e){if(EIe(e))return;console.warn("强制注入检查失败:",e)}}function SIe(){const e=window.eval;if(window.eval=function(t){if("string"==typeof t&&t.includes("sound."))try{AIe()}catch(e){EIe(e)||console.warn("执行拦截时出错:",e)}return e.call(this,t)},window.pyodide&&window.pyodide.runPython){const e=window.pyodide.runPython;window.pyodide.runPython=function(t){if("string"==typeof t&&t.includes("sound."))try{AIe()}catch(e){EIe(e)||console.warn("执行拦截时出错:",e)}return e.call(this,t)}}}function CIe(){document.getElementById("modalOverlay").style.display="none"}function OIe(e){const t=document.getElementById("imported-models");if([...t.children].some(t=>t.dataset.modelName===e))return;const n=document.createElement("div");n.className="model-item",n.dataset.modelName=e,n.innerHTML=`\n
\n ${e}\n \n
\n `,n.querySelector(".delete-model").addEventListener("click",()=>{!async function(e){try{await u3.io.removeModel(`indexeddb://${e}`);const t=document.querySelector(`.model-item[data-model-name="${e}"]`);t&&t.remove()}catch(e){console.error("删除模型失败:",e),alert("删除模型失败: "+e.message)}}(e)}),t.appendChild(n)}async function MIe(){try{const e=await u3.io.listModels();document.getElementById("imported-models").innerHTML="";for(const[t]of Object.entries(e)){OIe(t.replace("indexeddb://",""))}}catch(e){console.error("加载模型列表失败:",e)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{IIe(),SIe()}):(IIe(),SIe()),window.addEventListener("pyodideLoaded",()=>{IIe(),SIe()}),setTimeout(()=>{IIe(),SIe()},1e3),window.addEventListener("load",()=>{IIe(),SIe()}),setInterval(AIe,5e3),cIe.init(),window.tf=Ue,async function(){const e=document.createElement("div");e.id="modalOverlay",Object.assign(e.style,{display:"none",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",zIndex:"20011216",pointerEvents:"auto"});const t=document.createElement("div");Object.assign(t.style,{backgroundColor:"white",width:"60%",maxHeight:"80%",margin:"12vh auto",padding:"20px 30px",borderRadius:"12px"}),t.innerHTML='\n

选择本地模型

\n
\x3c!-- 新增 min-height 和 position --\x3e\n \n \n
\n 导入模型名称:\n \n \n
\n
\n
\n ❌ 模型结构描述文件(model.json)\n\n
未选择
\n
\n
\n ❌ 权重文件(model.weights.bin)\n
0 个已选择
\n
\n
\n
\n
\n
\n

已导入模型

\n
\n \n \n
\n
\n
\n
加载中...
\n
\n
\n
\n \n
\n
\n ',e.appendChild(t),document.body.appendChild(e),t.querySelector(".close-btn").addEventListener("click",CIe),e.addEventListener("click",t=>{t.target===e&&CIe()});const n=document.getElementById("model-upload"),i=document.getElementById("model-handle"),r=document.getElementById("output");let s=null,o=[];n.addEventListener("change",async e=>{const t=e.target.files,n=document.getElementById("json-status"),i=document.getElementById("weights-status");n.querySelector("span").textContent="❌ 模型结构描述文件(model.json)",n.querySelector("div").textContent="未选择",i.querySelector("span").textContent="❌ 权重文件(model.weights.bin)",i.querySelector("div").textContent="0 个已选择",o=[];for(let e=0;e0&&(i.querySelector("span").textContent="✅ 权重文件(model.weights.bin)",i.querySelector("div").textContent=`${o.length} 个已选择`)}else alert("未找到 model.json 文件")}),i.addEventListener("click",async()=>{try{const e=document.getElementById("model-name").value||"mixly-model",t=await wee(u3.io.browserFiles([s,...o]));await t.save(`indexeddb://${e}`),MIe(),r.innerHTML=`模型已成功保存为 ${e}!`}catch(e){r.innerHTML=`保存模型出错: ${e.message}`,console.error(e)}}),t.querySelector("#refresh-models").addEventListener("click",MIe),t.querySelector("#clear-models").addEventListener("click",async()=>{confirm("确定要删除所有模型吗?此操作不可恢复!")&&await async function(){try{const e=await u3.io.listModels(),t=Object.keys(e).map(e=>e.replace("indexeddb://","")).map(e=>u3.io.removeModel(`indexeddb://${e}`));await Promise.all(t),document.getElementById("imported-models").innerHTML=""}catch(e){console.error("清空模型失败:",e),alert("清空模型失败: "+e.message)}}()})}(),(async()=>{await MIe()})();Ve.getMainWorkspace().registerButtonCallback("handleModels",function(){MIe(),document.getElementById("modalOverlay").style.display="block"}),window.prepare_qmyixtxi=async function(e){let t=null;window.featureExtractor?t=window.featureExtractor:(t=await coe("../common/media/tfmodel/model.json"),window.featureExtractor=t);const n=e.resizeBilinear([224,224]).toFloat().div(u3.scalar(127.5)).sub(u3.scalar(1)).expandDims(0);return window.featureExtractor.predict(n)};const kIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(new Ve.FieldDropdown(this.getSoundOptions),"SOUND"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_TOOLTIP)},getSoundOptions:function(){const e=[["Meow","Meow"],[Ve.Msg.MIXLY_SOUND_RECORD_OPTION,"record"]];if(window.sound&&window.sound.builtin){Object.keys(window.sound.builtin).filter(e=>e.startsWith("recording")).forEach(t=>{e.push([t,t])})}return e}},RIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(new Ve.FieldDropdown(this.getSoundOptions),"SOUND").appendField(Ve.Msg.MIXLY_SOUND_WAIT_FINISH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_WAIT_TOOLTIP)},getSoundOptions:function(){const e=[["Meow","Meow"],[Ve.Msg.MIXLY_SOUND_RECORD_OPTION,"record"]];if(window.sound&&window.sound.builtin){Object.keys(window.sound.builtin).filter(e=>e.startsWith("recording")).forEach(t=>{e.push([t,t])})}return e}},NIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_STOP_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_STOP_ALL_TOOLTIP)}},DIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_SET_TO).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SOUND_EFFECT_PITCH,"pitch"],[Ve.Msg.MIXLY_SOUND_EFFECT_PAN,"pan"]]),"EFFECT").appendField(Ve.Msg.MIXLY_SOUND_EFFECT_ADD_BY),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_ADD_TOOLTIP)}},FIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_SET_TO).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SOUND_EFFECT_PITCH,"pitch"],[Ve.Msg.MIXLY_SOUND_EFFECT_PAN,"pan"]]),"EFFECT").appendField(Ve.Msg.MIXLY_SOUND_EFFECT_SET_TO),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_SET_TOOLTIP)}},LIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_CLEAR_EFFECTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_CLEAR_TOOLTIP)}},PIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_INCREASE),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_ADD_TOOLTIP)}},BIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_SET),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_SET_TOOLTIP)}},$Ie={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_GET),this.setOutput(!0,"Volume"),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_GET_TOOLTIP)}},UIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_RECORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_RECORD_TOOLTIP)}},VIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(Ve.Msg.MIXLY_SOUND_FREQUENCY),this.appendValueInput("FREQUENCY").setCheck(Number).setAlign(Ve.ALIGN_RIGHT),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_DURATION),this.appendValueInput("DURATION").setCheck(Number).setAlign(Ve.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_TOOLTIP)}},zIe={init:function(){this.setColour("#acc159"),this.appendValueInput("FREQUENCY").setCheck(Number).appendField(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION_TOOLTIP)}},jIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY_NOTE_LIST).appendField(new Ve.FieldDropdown([["DADADADUM","DADADADUM"],["BIRTHDAY","BIRTHDAY"],["BA_DING","BA_DING"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]]),"NOTE_LIST"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_NOTE_LIST_TOOLTIP)}},YIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(new Ve.FieldDropdown([["NOTE_A4","440"],["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"),this.setOutput(!0,null),this.setOutputShape(Ve.OUTPUT_SHAPE_ROUND),this.setTooltip(Ve.Msg.MIXLY_SOUND_NOTE_TOOLTIP)}};Object.assign(Ve.Variables,Ye),Object.assign(Ve.Procedures,oc),Ve.Python=ac,Ve.generator=ac,ze.Profile.default={},Object.assign(Ve.Blocks,e,t,n,i,r,s,o,a,l,u,c,d,h,A,S,C,O,M,k,R,N,D,F,L,P,B,U,V,ne,re),Object.assign(Ve.Python.forBlock,p,f,m,g,_,y,v,b,T,x,E,w,I,z,j,Y,uy,G,H,W,X,q,K,Z,Q,J,ee,te,ie,se);const GIe={sound_play:kIe,sound_play_wait:RIe,sound_stop_all:NIe,sound_effect_add:DIe,sound_effect_set:FIe,sound_effect_clear:LIe,sound_volume_add:PIe,sound_volume_set:BIe,sound_volume_get:$Ie,sound_record:UIe,sound_play_frequency:VIe,sound_play_frequency_no_duration:zIe,sound_play_note_list:jIe,sound_note:YIe},HIe={sound_play:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("SOUND");return"record"===n?"sound.record()\n":`sound.play("${n}")\n`},sound_play_wait:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("SOUND");return"record"===n?"sound.record()\n":`sound.play_blocking("${n}")\n`},sound_stop_all:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.stop_all()\n"},sound_effect_add:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("EFFECT"),i=e.getInputTargetBlock("VALUE");let r;return r=i?"math_number"===i.type?i.getFieldValue("NUM")||"10":t.valueToCode(i,"VALUE",t.ORDER_NONE)||"10":"10",`sound.adjust_effect("${n}", ${r})\n`},sound_effect_set:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("EFFECT"),i=e.getInputTargetBlock("VALUE");let r;return r=i?"math_number"===i.type?i.getFieldValue("NUM")||"100":t.valueToCode(i,"VALUE",t.ORDER_NONE)||"100":"100",`sound.set_effect("${n}", ${r})\n`},sound_effect_clear:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.clear_effects()\n"},sound_volume_add:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.adjust_volume(${t.valueToCode(e,"VALUE",t.ORDER_NONE)||"0"})\n`},sound_volume_set:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.set_volume(${t.valueToCode(e,"VALUE",t.ORDER_NONE)||"100"})\n`},sound_volume_get:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),["sound.get_volume()",t.ORDER_ATOMIC]},sound_record:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.record()\n"},sound_play_frequency:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_frequency(${t.valueToCode(this,"FREQUENCY",t.ORDER_ATOMIC)}, ${t.valueToCode(this,"DURATION",t.ORDER_ATOMIC)})\n`},sound_play_frequency_no_duration:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_frequency_no_duration(${t.valueToCode(this,"FREQUENCY",t.ORDER_ATOMIC)})\n`},sound_play_note_list:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_note_list("${this.getFieldValue("NOTE_LIST")}")\n`},sound_note:function(e,t){return[this.getFieldValue("NOTE"),t.ORDER_ATOMIC]}};Object.assign(Ve.Blocks,GIe),Object.assign(Ve.Python.forBlock,HIe),window.sound=bIe})()})(); \ No newline at end of file +const Mwe={"tfjs-core":p3.version_core,"tfjs-backend-cpu":ice,"tfjs-backend-webgl":F_e,"tfjs-data":Sae,"tfjs-layers":see,"tfjs-converter":goe,tfjs:"4.22.0"};var kwe=__webpack_require__(99778);const Rwe=Symbol("rowContextKey"),Nwe=oG({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Dwe=sS({name:"ElRow"});const Fwe=bG(UH(sS({...Dwe,props:Nwe,setup(e){const t=e,n=Zz("row"),i=tk(()=>t.gutter);XC(Rwe,{gutter:i});const r=tk(()=>{const e={};return t.gutter?(e.marginRight=e.marginLeft=`-${t.gutter/2}px`,e):e}),s=tk(()=>[n.b(),n.is(`justify-${t.justify}`,"start"!==t.justify),n.is(`align-${t.align}`,!!t.align)]);return(e,t)=>(iM(),cM(iC(e.tag),{class:xE(xI(s)),style:_E(xI(r))},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["class","style"]))}}),[["__file","row.vue"]])),Lwe=oG({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:[Number,Object],default:()=>({})},sm:{type:[Number,Object],default:()=>({})},md:{type:[Number,Object],default:()=>({})},lg:{type:[Number,Object],default:()=>({})},xl:{type:[Number,Object],default:()=>({})}}),Pwe=sS({name:"ElCol"});const Bwe=bG(UH(sS({...Pwe,props:Lwe,setup(e){const t=e,{gutter:n}=qC(Rwe,{gutter:tk(()=>0)}),i=Zz("col"),r=tk(()=>{const e={};return n.value&&(e.paddingLeft=e.paddingRight=n.value/2+"px"),e}),s=tk(()=>{const e=[];["span","offset","pull","push"].forEach(n=>{const r=t[n];ej(r)&&("span"===n?e.push(i.b(`${t[n]}`)):r>0&&e.push(i.b(`${n}-${t[n]}`)))});return["xs","sm","md","lg","xl"].forEach(n=>{ej(t[n])?e.push(i.b(`${n}-${t[n]}`)):Wx(t[n])&&Object.entries(t[n]).forEach(([t,r])=>{e.push("span"!==t?i.b(`${n}-${t}-${r}`):i.b(`${n}-${r}`))})}),n.value&&e.push(i.is("guttered")),[i.b(),e]});return(e,t)=>(iM(),cM(iC(e.tag),{class:xE(xI(s)),style:_E(xI(r))},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["class","style"]))}}),[["__file","col.vue"]])),$we={class:"vis-left-panel-inner-wrapper"},Uwe={class:"card-header"},Vwe={key:0,style:{margin:"auto"}},zwe={key:1,style:{margin:"auto"}},jwe=["src"],Ywe={__name:"ModelArea",emits:["shot"],setup(e,{expose:t,emit:n}){const i=n,r=qC("picList"),s=qC("shotList"),o=qC("states"),a=_I(r.value.map((e,t)=>({name:e.title,progress:0}))),l=["#FF6F61","#42A5F5","#66BB6A","#FFA726","#AB47BC"];let u,c,d=[];setInterval(async()=>{if(2!==o.value.isTraining)return;if(""!==p.value)return;i("shot");const e=s.value[s.value.length-1];if(!e||"data:,"===e)return void mW.error("未获取到有效样本");const t=new Image;t.src=e,await new Promise(e=>{t.onload=e});const n=p3.browser.fromPixels(t);let r=p3.image.resizeBilinear(n,[224,224]).expandDims(0).div(255),l=u.predict(r);const d=c.predict(l),h=await d.data();a.value=[...a.value.map((e,t)=>({...e,progress:Number((100*h[t]).toFixed(2))}))],n.dispose(),l.dispose(),d.dispose()},200);const h=_I(!1),p=_I(""),f=_I(""),m=_I("20%"),g=_I("20%");async function _(){if(c)try{await c.save(`downloads://${""==S.value?"my-model":S.value}`),mW.success("模型导出成功")}catch(e){mW.error(`模型导出失败: ${e.message}`)}else mW.error("模型尚未训练完成")}async function y(e){const t=new FileReader;return t.onload=async e=>{if(p.value=e.target.result,!u||!c)return mW.error("请先完成模型训练"),!1;const t=new window.Image;t.src=p.value,await new Promise(e=>t.onload=e);const n=p3.browser.fromPixels(t);let i=p3.image.resizeBilinear(n,[224,224]).expandDims(0).div(255),r=u.predict(i);const s=c.predict(r),o=await s.data();a.value=[...a.value.map((e,t)=>({...e,progress:Number((100*o[t]).toFixed(2))}))];const l=o.indexOf(Math.max(...o));f.value=a.value[l]?.name||"未知",n.dispose(),r.dispose(),s.dispose()},t.readAsDataURL(e),!1}function v(){p.value=""}let b=0,T=0,x=0,E=0;function w(e){if(0!==e.button)return;b=e.clientX,T=e.clientY;const t=document.getElementById("vis-left-panel-wrapper").style.top,n=document.getElementById("vis-left-panel-wrapper").style.right;x=t.endsWith("%")?window.innerHeight*Number.parseFloat(t)/100:Number.parseFloat(t),E=n.endsWith("%")?window.innerWidth*Number.parseFloat(n)/100:Number.parseFloat(n),document.addEventListener("mousemove",I),document.addEventListener("mouseup",A)}function I(e){const t=e.clientX-b,n=e.clientY-T;let i=x+n,r=E-t;i=Math.max(0,Math.min(window.innerHeight-100,i)),r=Math.max(0,Math.min(window.innerWidth-200,r)),m.value=`${i}px`,g.value=`${r}px`}function A(){document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",A)}t({train:async function(){const e=document.getElementById("vis-left-panel");e&&(e.innerHTML="训练准备中……"),h.value=!0,console.log("正在加载Mobilenet……"),u=await foe(Ax.join(ze.Env.boardDirPath,"teachableModel/model.json")),console.log("Mobilenet加载完成。"),e&&(e.innerHTML="");const t=r.value.length;let n=null,i=null;c=kee(),c.add(gie({inputShape:[1280],units:128,activation:"relu"})),c.add(gie({units:t,activation:"softmax"})),c.compile({optimizer:p3.train.adam(.001),loss:"categoricalCrossentropy",metrics:["accuracy"]});for(let e=0;e{o.onload=e});const a=p3.browser.fromPixels(o),l=a.resizeBilinear([224,224]).toFloat().div(p3.scalar(127.5)).sub(p3.scalar(1)).expandDims(0);let c=u.predict(l);const d=p3.oneHot(p3.tensor1d([e]).toInt(),t);if(null==n)n=c.clone(),i=d.clone();else{const e=n;n=e.concat(c,0),e.dispose();const t=i;i=t.concat(d,0),t.dispose()}d.dispose(),a.dispose()}}d=[];const s=document.getElementById("vis-left-panel")||{name:"训练过程",tab:"训练"};await c.fit(n,i,{epochs:20,batchSize:16,shuffle:!0,validationSplit:.2,callbacks:kwe.show.fitCallbacks(s,["loss","acc","val_loss","val_acc","accuracy","val_accuracy"],{callbacks:["onEpochEnd"]})}),console.log("训练完成"),a.value=r.value.filter(e=>!0!==e.disabled).map((e,t)=>({name:e.title,progress:0})),console.log(a.value),o.value.isTraining=2}});const S=_I("");async function C(){if(c)try{await c.save(`indexeddb://${""==S.value?"my-model":S.value}`),mW.success("模型保存成功")}catch(e){mW.error(`模型保存失败: ${e.message}`)}else mW.error("模型尚未训练完成")}return(e,t)=>(iM(),uM("div",null,[kA(gM("div",{id:"vis-left-panel-wrapper",class:"vis-left-panel-wrapper",style:_E(`right: ${g.value}; top: ${m.value};`)},[gM("div",$we,[gM("div",{class:"vis-left-panel-title",style:{},onMousedown:w},[t[4]||(t[4]=gM("span",null," 训练过程可视化 ",-1)),_M(xI(SX),{size:"small",plain:"",onClick:t[0]||(t[0]=e=>h.value=!1)},{default:MA(()=>t[3]||(t[3]=[TM(" 隐藏 ")])),_:1})],32),t[5]||(t[5]=gM("div",{id:"vis-left-panel",class:"vis-left-panel"},"训练准备中……",-1))])],4),[[zk,h.value]]),2===xI(o).isTraining?(iM(),cM(xI(kX),{key:0,class:"model-area"},{header:MA(()=>[gM("div",Uwe,[t[8]||(t[8]=TM(" 模型 ")),h.value?EM("v-if",!0):(iM(),cM(xI(SX),{key:0,size:"small",style:{"margin-left":"10px"},type:"primary",plain:"",onClick:t[1]||(t[1]=e=>h.value=!0)},{default:MA(()=>t[6]||(t[6]=[TM(" 显示训练过程 ")])),_:1})),2===xI(o).isTraining?(iM(),cM(xI(SX),{key:1,size:"small",style:{"margin-left":"10px"},type:"success",plain:"",onClick:_},{default:MA(()=>t[7]||(t[7]=[TM(" 模型导出至本地 ")])),_:1})):EM("v-if",!0)])]),default:MA(()=>[_M(xI(Fwe),{class:"model-item",style:{"flex-direction":"column","align-items":"flex-center"}},{default:MA(()=>[_M(xI(Fwe),null,{default:MA(()=>[_M(xI(Bwe),{span:6,style:{display:"flex","align-items":"center","text-align":"right"}},{default:MA(()=>t[9]||(t[9]=[TM(" 名称: ")])),_:1}),_M(xI(Bwe),{span:12},{default:MA(()=>[_M(xI(Pq),{modelValue:S.value,"onUpdate:modelValue":t[2]||(t[2]=e=>S.value=e),placeholder:"请输入模型名称"},null,8,["modelValue"])]),_:1}),_M(xI(Bwe),{span:4,style:{display:"flex","align-items":"center"}},{default:MA(()=>[_M(xI(SX),{style:{margin:"auto 5px"},type:"primary",plain:"",size:"small",onClick:C},{default:MA(()=>t[10]||(t[10]=[TM(" 保存 ")])),_:1})]),_:1})]),_:1})]),_:1}),_M(xI(Fwe),{class:"model-item"},{default:MA(()=>t[11]||(t[11]=[gM("b",null,"输入",-1)])),_:1}),_M(xI(Fwe),{class:"model-item"},{default:MA(()=>[p.value?(iM(),uM("div",zwe,[t[16]||(t[16]=TM(" 下方上传图片 ")),t[17]||(t[17]=gM("br",null,null,-1)),_M(xI(SX),{size:"small",type:"success",plain:"",onClick:v},{default:MA(()=>t[14]||(t[14]=[TM(" 切换为上方拍摄内容 ")])),_:1}),_M(xI(O2),{"show-file-list":!1,accept:"image/*","before-upload":y},{default:MA(()=>[_M(xI(SX),{size:"small",type:"success"},{default:MA(()=>t[15]||(t[15]=[TM(" 重新上传一张 ")])),_:1})]),_:1}),gM("img",{src:p.value,alt:"用户上传图片",style:{"max-width":"100%","max-height":"150px","border-radius":"10px"}},null,8,jwe)])):(iM(),uM("div",Vwe,[t[13]||(t[13]=TM(" 上方拍摄内容 ")),_M(xI(O2),{"show-file-list":!1,accept:"image/*","before-upload":y},{default:MA(()=>[_M(xI(SX),{size:"small",type:"success"},{default:MA(()=>t[12]||(t[12]=[TM(" 切换为上传图片 ")])),_:1})]),_:1})]))]),_:1}),_M(xI(Fwe),{class:"model-item"},{default:MA(()=>t[18]||(t[18]=[gM("b",null,"输出",-1)])),_:1}),(iM(!0),uM(ZO,null,aC(a.value,(e,t)=>(iM(),cM(xI(Fwe),{key:`${e.name}-${t}`,class:"model-item"},{default:MA(()=>[_M(xI(Bwe),{span:6},{default:MA(()=>[TM($E(e.name),1)]),_:2},1024),_M(xI(Bwe),{span:18},{default:MA(()=>[_M(xI(VJ),{class:"progress","text-inside":!0,"stroke-width":20,percentage:e.progress,color:l[t%l.length],striped:"",format:e=>`${e}%`},null,8,["percentage","color","format"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):EM("v-if",!0)]))}},Gwe=(0,d3.A)(Ywe,[["__scopeId","data-v-5abb0202"]]),Hwe=oG({trigger:_Z.trigger,triggerKeys:_Z.triggerKeys,placement:uJ.placement,disabled:_Z.disabled,visible:mZ.visible,transition:mZ.transition,popperOptions:uJ.popperOptions,tabindex:uJ.tabindex,content:mZ.content,popperStyle:mZ.popperStyle,popperClass:mZ.popperClass,enterable:{...mZ.enterable,default:!0},effect:{...mZ.effect,default:"light"},teleported:mZ.teleported,appendTo:mZ.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Wwe={"update:visible":e=>Jz(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Xwe=sS({name:"ElPopover"}),qwe=sS({...Xwe,props:Hwe,emits:Wwe,setup(e,{expose:t,emit:n}){const i=e,r=tk(()=>i["onUpdate:visible"]),s=Zz("popover"),o=_I(),a=tk(()=>{var e;return null==(e=xI(o))?void 0:e.popperRef}),l=tk(()=>[{width:VH(i.width)},i.popperStyle]),u=tk(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),c=tk(()=>i.transition===`${s.namespace.value}-fade-in-linear`),d=()=>{n("before-enter")},h=()=>{n("before-leave")},p=()=>{n("after-enter")},f=()=>{n("update:visible",!1),n("after-leave")};return t({popperRef:a,hide:()=>{var e;null==(e=o.value)||e.hide()}}),(e,t)=>(iM(),cM(xI(kQ),SM({ref_key:"tooltipRef",ref:o},e.$attrs,{trigger:e.trigger,"trigger-keys":e.triggerKeys,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":xI(u),"popper-style":xI(l),teleported:e.teleported,"append-to":e.appendTo,persistent:e.persistent,"gpu-acceleration":xI(c),"onUpdate:visible":xI(r),onBeforeShow:d,onBeforeHide:h,onShow:p,onHide:f}),{content:MA(()=>[e.title?(iM(),uM("div",{key:0,class:xE(xI(s).e("title")),role:"title"},$E(e.title),3)):EM("v-if",!0),uC(e.$slots,"default",{},()=>[TM($E(e.content),1)])]),default:MA(()=>[e.$slots.reference?uC(e.$slots,"reference",{key:0}):EM("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});const Kwe=(e,t)=>{const n=t.arg||t.value,i=null==n?void 0:n.popperRef;i&&(i.triggerRef=e)};var Zwe,Qwe;const Jwe=bG(UH(qwe,[["__file","popover.vue"]]),{directive:(Qwe="popover",(Zwe={mounted(e,t){Kwe(e,t)},updated(e,t){Kwe(e,t)}}).install=e=>{e.directive(Qwe,Zwe)},Zwe)}),eIe=oG({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:aG,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),tIe=sS({name:"ElText"}),nIe=sS({...tIe,props:eIe,setup(e){const t=e,n=_I(),i=qW(),r=Zz("text"),s=tk(()=>[r.b(),r.m(t.type),r.m(i.value),r.is("truncated",t.truncated),r.is("line-clamp",!Qz(t.lineClamp))]),o=()=>{var e,i,r,s,o,a,l;if(IC().title)return;let u=!1;const c=(null==(e=n.value)?void 0:e.textContent)||"";if(t.truncated){const e=null==(i=n.value)?void 0:i.offsetWidth,t=null==(r=n.value)?void 0:r.scrollWidth;e&&t&&t>e&&(u=!0)}else if(!Qz(t.lineClamp)){const e=null==(s=n.value)?void 0:s.offsetHeight,t=null==(o=n.value)?void 0:o.scrollHeight;e&&t&&t>e&&(u=!0)}u?null==(a=n.value)||a.setAttribute("title",c):null==(l=n.value)||l.removeAttribute("title")};return YS(o),HS(o),(e,t)=>(iM(),cM(iC(e.tag),{ref_key:"textRef",ref:n,class:xE(xI(s)),style:_E({"-webkit-line-clamp":e.lineClamp})},{default:MA(()=>[uC(e.$slots,"default")]),_:3},8,["class","style"]))}});const iIe=bG(UH(nIe,[["__file","text.vue"]])),rIe={__name:"TrainArea",emits:["train"],setup(e,{emit:t}){const n=t,i=qC("picList"),r=qC("states"),s=_I(!1),o=_I("待训练……");function a(){s.value&&(n("train"),r.value.isTraining=1)}return CO([i.value,()=>r.value.isTraining],()=>{s.value=function(){const e=Array.isArray(i.value)?i.value.filter(e=>!1===e.disabled):[];return 1!==r.value.isTraining&&e.length>1&&e.every(e=>Array.isArray(e.list)&&e.list.length>0)}(),0===r.value.isTraining?o.value="待训练……":1===r.value.isTraining?o.value="训练中……":2===r.value.isTraining&&(o.value="训练完成")},{immediate:!0}),(e,t)=>(iM(),cM(xI(kX),{class:"train-area"},{header:MA(()=>t[0]||(t[0]=[gM("div",{class:"card-header"}," 训练 ",-1)])),default:MA(()=>[_M(xI(Jwe),{class:"box-item",placement:"bottom",disabled:s.value},{reference:MA(()=>[_M(xI(SX),{disabled:!s.value,type:"primary",style:{"max-width":"100%"},onClick:a},{default:MA(()=>t[1]||(t[1]=[TM(" 训练模型 ")])),_:1},8,["disabled"])]),default:MA(()=>[_M(xI(WH),null,{default:MA(()=>[_M(xI(mH))]),_:1}),t[2]||(t[2]=TM(" 至少有两个类别,且每个类别都需有图像样本。 "))]),_:1},8,["disabled"]),t[3]||(t[3]=gM("br",null,null,-1)),_M(xI(iIe),null,{default:MA(()=>[TM($E(o.value),1)]),_:1})]),_:1}))}},sIe=(0,d3.A)(rIe,[["__scopeId","data-v-1deba862"]]),oIe={class:"main-splitter"},aIe={class:"class-area"},lIe={class:"add-class-content"},uIe={__name:"teachableModel",setup(e){const t=_I([]);XC("shotList",t);const n=_I([{title:"类别 1",list:[],disabled:!1},{title:"类别 2",list:[],disabled:!1}]);XC("picList",n);async function i(e,i){n.value[e].disabled?mW.error("该类别已被禁用"):i?n.value[e].list.push(i):(await a(),t.value[t.value.length-1]&&"data:,"!==t.value[t.value.length-1]?n.value[e].list.push(t.value[t.value.length-1]):mW.error("未获取到有效样本"))}function r(){n.value.push({title:`类别 ${n.value.length+1}`,list:[],disabled:!1})}XC("states",_I({isTraining:0}));const s=_I(!0),o=_I(null);async function a(){await(o.value?.captureShot())}const l=_I(null);async function u(){await l.value.train()}return(e,t)=>(iM(),uM("div",oIe,[_M(xI(PW),null,{default:MA(()=>[_M(xI(BW),{size:"70%",min:200},{default:MA(()=>[gM("div",aIe,[(iM(!0),uM(ZO,null,aC(n.value,(e,r)=>(iM(),cM(l3,{key:r,title:e.title,"pic-list":e.list,disabled:e.disabled,onAddSample:e=>i(r,e),onDeleteSample:e=>n.value[r].list=n.value[r].list.filter(t=>t!==e),onDeleteClass:e=>function(e){n.value.splice(e,1)}(r),onDisableClass:e=>function(e){n.value[e].disabled=!n.value[e].disabled}(r),onRenameClass:e=>function(e,t){n.value[e].title=t}(r,e),onClearSamples:e=>function(e){n.value[e].list=[]}(r)},{default:MA(()=>[_M(xI(SX),{type:"primary",size:"mini",onClick:e=>i(r)},{default:MA(()=>t[0]||(t[0]=[TM(" 添加样本 ")])),_:2},1032,["onClick"])]),_:2},1032,["title","pic-list","disabled","onAddSample","onDeleteSample","onDeleteClass","onDisableClass","onRenameClass","onClearSamples"]))),128)),_M(xI(kX),{class:"add-class-card",onClick:r},{default:MA(()=>[gM("div",lIe,[t[1]||(t[1]=TM(" 添加一个类别 ")),_M(xI(WH),null,{default:MA(()=>[_M(xI(zG))]),_:1})])]),_:1})])]),_:1}),_M(xI(BW),{min:200},{default:MA(()=>[_M(h3,{ref_key:"cameraBoxRef",ref:o},null,512),_M(Ak,{name:"fade-scale"},{default:MA(()=>[s.value?(iM(),cM(Gwe,{key:0,ref_key:"modelAreaRef",ref:l,onShot:a},null,512)):EM("v-if",!0)]),_:1}),_M(sIe,{onTrain:u})]),_:1})]),_:1})]))}},cIe=(0,d3.A)(uIe,[["__scopeId","data-v-02bafc86"]]),dIe={__name:"App",setup:e=>(e,t)=>(iM(),cM(xI(xG),null,{default:MA(()=>[_M(cIe)]),_:1}))};class hIe{static{ze.HTMLTemplate.add("html/statusbar/loader.html",new ze.HTMLTemplate('\r\n
\r\n
\r\n

{{d.msg.loading}}

\r\n
')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=Cx()(ze.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:Ve.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){ze.app.getFooterBar().getContent().after(this.$loader);const e=Ax.relative(ze.Env.indexDirPath,ze.Env.boardDirPath),t=new sP({rootPath:Ax.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();if(!n)return;await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.statusBarImage=oP.init(),this.statusBarFileSystem=jz.init(),this.statusBarTool=Yz.init();eN(dIe).mount(this.statusBarTool.getContent()[0]),this.statusBarGame=Gz.init(),this.pythonShell=new hIe,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader&&this.$loader.remove&&this.$loader.remove(),this.$loader=null},this.run=async function(){if(!this.kernelLoaded)return;const e=ze.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#C=null;#O=null;#M=null;#k={row:0,column:0};#R="";#N=null;#D=null;#F=!1;#L=!1;#P=null;#B=()=>this.#$();#U=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#k.row){const e=this.#C.getEndPos();let t=this.#C.getValueRange(this.#k,e);t=t.replace(this.#R,""),this.#N?.(t),this.#N=null,this.#D=null,this.#C.addValue("\n"),this.#V()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row{this.#L=!1,this.#C.addValue(`\n==${ze.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(ze.Debug.error)}),this.#P.addEventListener("eval.output",e=>{this.#C.addValue(e.content)}),this.#P.addEventListener("eval.error",()=>{this.#L=!1,this.#C.addValue(`\n==${ze.Msg.Lang["shell.finish"]}==`)}),this.#P.addEventListener("eval.input",e=>{const t=String(e?.content?.prompt);this.#C.addValue(t),this.#R=t,this.#N=e.resolve,this.#D=e.reject,this.#z()}),this.#P.addEventListener("eval.display",e=>{this.#M.changeTo("images"),this.#O.display(e)})}#$(){const e=this.#C.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row{window.pyodide.FS.syncfs(e,t)})}sleep(e){return new Promise(t=>setTimeout(t,e))}}const pIe={init:async function(){const e=ze.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Ve.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{hIe.run().catch(ze.Debug.error)},scopeType:ze.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Ve.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{hIe.stop().catch(ze.Debug.error)},scopeType:ze.Nav.Scope.LEFT,weight:5}),await hIe.init()}},fIe=pIe,mIe=new ze.Registry,gIe=function(e){let t={ok:!1,buffer:null,json:function(){const e=new TextDecoder("utf-8").decode(this.buffer);return JSON.parse(e)},arrayBuffer:function(){return this.buffer}};return mIe.hasKey(e)?(t.ok=!0,t.buffer=mIe.getItem(e),t):t},_Ie={modelsValue:{},loadGraphModel:async function(e){return await foe(e,{fromTFHub:!1,fetchFunc:(...e)=>gIe(e[0])})},loadLayersModel:async function(e){return await Cee(e,{fromTFHub:!1,fetchFunc:(...e)=>gIe(e[0])})},setModelsValue:function(e,t){mIe.hasKey(e)&&mIe.unregister(e),mIe.register(e,t),_Ie.modelsValue[e]=t}};window.tensorflow=_Ie,window.addEventListener("error",e=>e.error&&e.error.message&&e.error.message.includes("openOrClosedShadowRoot")?(console.warn("捕获到Blockly DOM操作错误,这通常是无害的:",e.error.message),e.preventDefault(),!1):e.error&&e.error.message&&(e.error.message.includes("DOM")||e.error.message.includes("Element")||e.error.message.includes("Node"))?(console.warn("捕获到DOM操作错误:",e.error.message),e.preventDefault(),!1):void 0),window.addEventListener("unhandledrejection",e=>{if(e.reason&&e.reason.message&&e.reason.message.includes("openOrClosedShadowRoot"))return console.warn("捕获到未处理的Promise拒绝(Blockly DOM错误):",e.reason.message),e.preventDefault(),!1});const yIe=console.error;console.error=function(...e){const t=e.join(" ");t.includes("openOrClosedShadowRoot")||t.includes("DOM")||t.includes("Element")||t.includes("Node")?console.warn("过滤的DOM错误:",...e):yIe.apply(console,e)};const vIe=(e,t)=>{try{if(e&&t&&e.appendChild)return e.appendChild(t)}catch(e){console.warn("安全DOM添加失败:",e.message)}return null},bIe=(e,t)=>{try{if(e&&t&&e.removeChild&&t.parentNode===e)return e.removeChild(t)}catch(e){console.warn("安全DOM移除失败:",e.message)}return null},TIe=(e,t)=>{try{if(e&&e.querySelector)return e.querySelector(t)}catch(e){console.warn("安全DOM查询失败:",e.message)}return null},xIe=e=>e&&e.parentNode&&document.contains(e),EIe={volume:100,effects:{pitch:0,pan:0},builtin:{Meow:"meow"},isRecording:!1,mediaRecorder:null,recordedChunks:[],recordedAudio:null,activeAudios:[],isStopped:!1,abortController:null,blockAllAudio:!1,audioHistory:[],soundQueue:[],isProcessingQueue:!1,currentlyPlaying:null,initAudioContext:()=>{if(!EIe.audioContext)try{EIe.audioContext=new(window.AudioContext||window.webkitAudioContext)}catch(e){console.error("Error initializing audio context:",e)}},createAudio:e=>{if(EIe.blockAllAudio||EIe.isStopped||EIe.abortController&&EIe.abortController.signal.aborted){return{play:()=>Promise.reject(new Error("Audio playback blocked")),pause:()=>{},currentTime:0,src:"",volume:1,playbackRate:1,onended:null,onerror:null,onloadstart:null,oncanplay:null,onplay:null,onpause:null,tagName:"AUDIO",addEventListener:()=>{},removeEventListener:()=>{},load:()=>{},duration:0,ended:!1,paused:!0,muted:!1,readyState:0,networkState:0,preload:"none"}}return new Audio(e)},play:async e=>{try{if(EIe.isStopped)return;if(EIe.abortController&&EIe.abortController.signal.aborted)return;if(EIe.blockAllAudio)return;if(EIe.soundQueue.length>0||EIe.isProcessingQueue)return EIe.soundQueue.push({name:e,resolve:()=>{},reject:()=>{}}),void EIe.processQueue();if(EIe.activeAudios.length>0&&(EIe.activeAudios.forEach(e=>{try{e&&"AUDIO"===e.tagName&&(e.pause(),e.currentTime=0,e.src="")}catch(e){console.warn("停止现有音频时出错:",e)}}),EIe.activeAudios=[]),e.startsWith("recording")&&EIe.builtin[e]){if(EIe.blockAllAudio||EIe.isStopped)return;const t=EIe.createAudio(EIe.builtin[e]);t.volume=EIe.volume/100;const n=EIe.effects.pitch,i=EIe.effects.pan;if(0===n&&0===i)return void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)});if(EIe.initAudioContext(),!EIe.audioContext)return console.warn("音频上下文初始化失败,无法应用增强音效"),void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)});try{const e=EIe.audioContext.createMediaElementSource(t),r=EIe.audioContext.createGain();if(0!==n){const t=EIe.audioContext.createBiquadFilter();t.type="peaking",t.frequency.setValueAtTime(1e3,EIe.audioContext.currentTime),t.Q.setValueAtTime(1,EIe.audioContext.currentTime);const i=Math.max(-20,Math.min(20,.8*n));t.gain.setValueAtTime(i,EIe.audioContext.currentTime),e.connect(t),t.connect(r)}else e.connect(r);if(0!==i){const e=EIe.audioContext.createStereoPanner(),t=Math.max(-1,Math.min(1,i/100*1.5));e.pan.setValueAtTime(t,EIe.audioContext.currentTime),r.connect(e),e.connect(EIe.audioContext.destination)}else r.connect(EIe.audioContext.destination);r.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime)}catch(e){return console.warn("应用增强音效失败,使用默认播放:",e),void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)})}return EIe.activeAudios.push(t),t.onended=()=>{const e=EIe.activeAudios.indexOf(t);e>-1&&EIe.activeAudios.splice(e,1)},void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e);const n=EIe.activeAudios.indexOf(t);n>-1&&EIe.activeAudios.splice(n,1)})}if("Meow"===e&&(EIe.initAudioContext(),EIe.audioContext)){const e=EIe.audioContext.createOscillator(),t=EIe.audioContext.createGain();let n=440;if(0!==EIe.effects.pitch&&(n*=Math.pow(2,EIe.effects.pitch/12)),e.frequency.setValueAtTime(n,EIe.audioContext.currentTime),e.type="sine",t.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime),0!==EIe.effects.pan){const n=EIe.audioContext.createStereoPanner(),i=EIe.effects.pan/100;n.pan.setValueAtTime(i,EIe.audioContext.currentTime),e.connect(n),n.connect(t)}else e.connect(t);t.connect(EIe.audioContext.destination),e.start(),e.stop(EIe.audioContext.currentTime+.5)}}catch(e){console.error("Error in sound.play:",e)}},_playAudioInternal:async e=>new Promise((t,n)=>{try{if(EIe.isStopped||EIe.blockAllAudio)return void n(new Error("Playback blocked"));if(e.startsWith("recording")&&EIe.builtin[e]){const i=EIe.createAudio(EIe.builtin[e]);i.volume=EIe.volume/100;const r=EIe.effects.pitch,s=EIe.effects.pan;if((0!==r||0!==s)&&(EIe.initAudioContext(),EIe.audioContext))try{const e=EIe.audioContext.createMediaElementSource(i),t=EIe.audioContext.createGain();if(0!==r){const n=EIe.audioContext.createBiquadFilter();n.type="peaking",n.frequency.setValueAtTime(1e3,EIe.audioContext.currentTime),n.Q.setValueAtTime(1,EIe.audioContext.currentTime);const i=Math.max(-20,Math.min(20,.8*r));n.gain.setValueAtTime(i,EIe.audioContext.currentTime),e.connect(n),n.connect(t)}else e.connect(t);if(0!==s){const e=EIe.audioContext.createStereoPanner(),n=Math.max(-1,Math.min(1,s/100*1.5));e.pan.setValueAtTime(n,EIe.audioContext.currentTime),t.connect(e),e.connect(EIe.audioContext.destination)}else t.connect(EIe.audioContext.destination);t.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime)}catch(e){console.warn("应用音效失败:",e)}i.onended=()=>{const e=EIe.activeAudios.indexOf(i);e>-1&&EIe.activeAudios.splice(e,1),t()},i.onerror=t=>{console.error(`音频播放失败: ${e}`,t);const r=EIe.activeAudios.indexOf(i);r>-1&&EIe.activeAudios.splice(r,1),n(t)},EIe.activeAudios.push(i),i.play().catch(e=>{"AbortError"===e.name?t():(console.error("播放音频失败:",e),n(e))})}else if("Meow"===e)if(EIe.initAudioContext(),EIe.audioContext){const e=EIe.audioContext.createOscillator(),n=EIe.audioContext.createGain();let i=440;if(0!==EIe.effects.pitch&&(i*=Math.pow(2,EIe.effects.pitch/12)),e.frequency.setValueAtTime(i,EIe.audioContext.currentTime),e.type="sine",n.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime),0!==EIe.effects.pan){const t=EIe.audioContext.createStereoPanner(),i=EIe.effects.pan/100;t.pan.setValueAtTime(i,EIe.audioContext.currentTime),e.connect(t),t.connect(n)}else e.connect(n);n.connect(EIe.audioContext.destination),e.start(),e.stop(EIe.audioContext.currentTime+.5),setTimeout(()=>{t()},500)}else n(new Error("AudioContext not available"));else n(new Error(`Unknown sound: ${e}`))}catch(e){console.error("内部播放错误:",e),n(e)}}),processQueue:async()=>{if(!EIe.isProcessingQueue&&0!==EIe.soundQueue.length){for(EIe.isProcessingQueue=!0;EIe.soundQueue.length>0;){const e=EIe.soundQueue.shift();try{if("frequency"===e.type){const{frequency:t,duration:n,resolve:i}=e;EIe.currentlyPlaying={type:"frequency",frequency:t,startTime:Date.now()},await new Promise(e=>{if(EIe.initAudioContext(),EIe.audioContext){const i=EIe.audioContext.createOscillator(),r=EIe.audioContext.createGain();i.frequency.setValueAtTime(t,EIe.audioContext.currentTime),i.type="sine";const s=EIe.effects.pitch;0!==s&&i.frequency.setValueAtTime(t*Math.pow(2,s/12),EIe.audioContext.currentTime),r.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime),i.connect(r),r.connect(EIe.audioContext.destination),i.onended=()=>{EIe.currentlyPlaying=null,e()},i.start(),i.stop(EIe.audioContext.currentTime+n/1e3)}else e()}),EIe.currentlyPlaying=null,i()}else{const{name:t,resolve:n}=e;EIe.currentlyPlaying={name:t,startTime:Date.now()},await EIe._playAudioInternal(t),EIe.currentlyPlaying=null,n()}}catch(t){console.error("队列播放失败:",t),EIe.currentlyPlaying=null,e.reject&&e.reject(t)}}EIe.isProcessingQueue=!1}},play_blocking:e=>new Promise((t,n)=>{EIe.soundQueue.push({name:e,resolve:t,reject:n}),EIe.processQueue()}),stop_all:()=>{try{if(EIe.isStopped=!0,EIe.blockAllAudio=!0,EIe.soundQueue.length>0&&(EIe.soundQueue.forEach(({reject:e})=>{e(new Error("Playback stopped"))}),EIe.soundQueue=[]),EIe.isProcessingQueue=!1,EIe.currentlyPlaying=null,EIe.abortController&&EIe.abortController.abort(),EIe.abortController=new AbortController,EIe.activeAudios.length>0&&(EIe.activeAudios.forEach(e=>{try{e&&"AUDIO"===e.tagName&&(e.pause(),e.currentTime=0,e.src="",e.load(),e.onended=null,e.onerror=null,e.onloadstart=null,e.oncanplay=null,e.onplay=null,e.onpause=null)}catch(e){console.warn("停止音频时出错:",e)}}),EIe.activeAudios=[]),EIe.audioContext)try{EIe.audioContext.close(),EIe.audioContext=null}catch(e){console.warn("关闭音频上下文时出错:",e)}EIe.effects.pitch=0,EIe.effects.pan=0;const e=document.querySelectorAll("audio");e.length>0&&e.forEach(e=>{try{e.pause(),e.currentTime=0,e.src=""}catch(e){console.warn("停止页面音频元素时出错:",e)}}),setTimeout(()=>{EIe.isStopped=!1,EIe.blockAllAudio=!1},100)}catch(e){console.error("Error in sound.stop_all:",e)}},adjust_volume:e=>{const t=Math.max(0,Math.min(100,EIe.volume+e));EIe.volume=t},set_volume:e=>{EIe.volume=Math.max(0,Math.min(100,e))},get_volume:()=>EIe.volume,noteFrequencies:{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},play_frequency:(e,t=1e3)=>{try{if(EIe.initAudioContext(),EIe.audioContext){const n=EIe.audioContext.createOscillator(),i=EIe.audioContext.createGain();n.frequency.setValueAtTime(e,EIe.audioContext.currentTime),n.type="sine";const r=EIe.effects.pitch;0!==r&&n.frequency.setValueAtTime(e*Math.pow(2,r/12),EIe.audioContext.currentTime),i.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime),n.connect(i),i.connect(EIe.audioContext.destination),n.start(),n.stop(EIe.audioContext.currentTime+t/1e3),console.log(`播放频率: ${e}Hz, 持续时间: ${t}ms, 音量: ${EIe.volume}%`)}}catch(e){console.error("播放频率声音失败:",e)}},play_frequency_continuous:e=>{try{if(EIe.initAudioContext(),EIe.audioContext){const t=EIe.audioContext.createOscillator(),n=EIe.audioContext.createGain();t.frequency.setValueAtTime(e,EIe.audioContext.currentTime),t.type="sine";const i=EIe.effects.pitch;0!==i&&t.frequency.setValueAtTime(e*Math.pow(2,i/12),EIe.audioContext.currentTime),n.gain.setValueAtTime(EIe.volume/100,EIe.audioContext.currentTime),t.connect(n),n.connect(EIe.audioContext.destination),t.start(),t.stop(EIe.audioContext.currentTime+2),console.log(`播放频率(持续): ${e}Hz, 无持续时间限制, 音量: ${EIe.volume}%`)}}catch(e){console.error("播放频率声音失败:",e)}},play_frequency_blocking:(e,t=1e3)=>(console.log(`=== 🔒 阻塞播放频率(加入队列): ${e}Hz, ${t}ms ===`),new Promise((n,i)=>{const r={type:"frequency",frequency:e,duration:t,resolve:n,reject:i};EIe.soundQueue.push(r),console.log(`✅ 频率已加入声音队列,当前队列长度: ${EIe.soundQueue.length}`),EIe.processQueue()})),play_frequency_continuous_blocking:e=>(console.log(`=== 🔒 阻塞播放频率(持续,加入队列): ${e}Hz ===`),new Promise((t,n)=>{const i={type:"frequency",frequency:e,duration:2e3,resolve:t,reject:n};EIe.soundQueue.push(i),console.log(`✅ 频率(持续)已加入声音队列,当前队列长度: ${EIe.soundQueue.length}`),EIe.processQueue()})),play_note_list:e=>{try{const t={DADADADUM:[{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500}],BIRTHDAY:[{note:"NOTE_C4",duration:400},{note:"NOTE_C4",duration:400},{note:"NOTE_D4",duration:800},{note:"NOTE_C4",duration:800},{note:"NOTE_F4",duration:800},{note:"NOTE_E4",duration:1600}],BA_DING:[{note:"NOTE_C5",duration:200},{note:"NOTE_E5",duration:200},{note:"NOTE_G5",duration:400}],JUMP_UP:[{note:"NOTE_C5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_G5",duration:100}],JUMP_DOWN:[{note:"NOTE_G5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_C5",duration:100}],POWER_UP:[{note:"NOTE_C4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_C5",duration:300}],POWER_DOWN:[{note:"NOTE_C5",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_C4",duration:300}]}[e];if(t){let e=0;t.forEach(t=>{const n=EIe.noteFrequencies[t.note]||440,i=t.duration;setTimeout(()=>{EIe.play_frequency(n,i)},e),e+=i})}else console.warn(`未知的音符列表: ${e}`)}catch(e){console.error("播放音符列表失败:",e)}},play_note_list_blocking:e=>new Promise((t,n)=>{(async()=>{try{const i={DADADADUM:[{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500}],BIRTHDAY:[{note:"NOTE_C4",duration:400},{note:"NOTE_C4",duration:400},{note:"NOTE_D4",duration:800},{note:"NOTE_C4",duration:800},{note:"NOTE_F4",duration:800},{note:"NOTE_E4",duration:1600}],BA_DING:[{note:"NOTE_C5",duration:200},{note:"NOTE_E5",duration:200},{note:"NOTE_G5",duration:400}],JUMP_UP:[{note:"NOTE_C5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_G5",duration:100}],JUMP_DOWN:[{note:"NOTE_G5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_C5",duration:100}],POWER_UP:[{note:"NOTE_C4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_C5",duration:300}],POWER_DOWN:[{note:"NOTE_C5",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_C4",duration:300}]}[e];if(i){for(const e of i){const t=EIe.noteFrequencies[e.note]||440;await EIe.play_frequency_blocking(t,e.duration)}t()}else console.warn(`未知的音符列表: ${e}`),n(new Error(`未知的音符列表: ${e}`))}catch(e){console.error("播放音符列表失败:",e),n(e)}})()}),adjust_effect:(e,t)=>{"pitch"===e?EIe.effects.pitch=Math.max(-24,Math.min(24,EIe.effects.pitch+t)):"pan"===e&&(EIe.effects.pan=Math.max(-100,Math.min(100,EIe.effects.pan+t)))},set_effect:(e,t)=>{"pitch"===e?EIe.effects.pitch=Math.max(-24,Math.min(24,t)):"pan"===e&&(EIe.effects.pan=Math.max(-100,Math.min(100,t)))},clear_effects:()=>{EIe.effects.pitch=0,EIe.effects.pan=0},record:()=>{if(!EIe.isRecording)try{navigator.mediaDevices.getUserMedia({audio:!0}).then(e=>{EIe.mediaRecorder=new MediaRecorder(e),EIe.recordedChunks=[],EIe.mediaRecorder.ondataavailable=e=>{e.data.size>0&&EIe.recordedChunks.push(e.data)},EIe.mediaRecorder.onstart=()=>{EIe.isRecording=!0},EIe.mediaRecorder.onstop=()=>{EIe.isRecording=!1;const t=new Blob(EIe.recordedChunks,{type:"audio/wav"});EIe.recordedAudio=URL.createObjectURL(t),e.getTracks().forEach(e=>{e.stop()}),EIe.showPlaybackInterface(t)},EIe.mediaRecorder.onerror=e=>{console.error("MediaRecorder 错误:",e.error),EIe.isRecording=!1},EIe.mediaRecorder.start(100),EIe.showRecordInterface()}).catch(e=>{console.error("获取麦克风权限失败:",e),alert("无法访问麦克风,请检查权限设置。错误: "+e.message)})}catch(e){console.error("录制功能初始化失败:",e),alert("录制功能初始化失败: "+e.message)}},showRecordInterface:()=>{const e=document.createElement("div");e.id="recordModal",e.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10000;\n ";const t=document.createElement("div");t.style.cssText="\n background: white;\n border-radius: 10px;\n padding: 20px;\n text-align: center;\n min-width: 300px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n ",t.innerHTML='\n

录制声音

\n
\n
\n
\n
\n
\n \n
\n
正在录制...
\n ',e.appendChild(t);try{vIe(document.body,e)}catch(e){return void console.error("添加录制界面到DOM失败:",e)}e.addEventListener("click",e=>{if("stopRecord"===e.target.id)try{EIe.mediaRecorder&&EIe.isRecording?EIe.mediaRecorder.stop():console.warn("MediaRecorder 不存在或未在录制状态")}catch(e){console.error("停止录制时出错:",e),alert("停止录制时出错: "+e.message)}});const n=e.querySelector("#waveformBars");if(n){for(let e=0;e<20;e++){const t=document.createElement("div");t.style.cssText=`\n position: absolute;\n left: ${10*e}px;\n bottom: 0;\n width: 8px;\n height: 20px;\n background: #4a90e2;\n border-radius: 2px;\n transition: height 0.1s ease;\n `,n.appendChild(t)}const t=setInterval(()=>{if(EIe.isRecording&&e.parentNode){const e=n.children;for(let t=0;t{EIe.isRecording&&e.parentNode?(i=60*Math.random()+40,r.style.height=i+"%",s.textContent=`正在录制... 音量: ${Math.round(i)}%`,r.style.opacity=.8+i/100*.2):(clearInterval(t),s&&e.parentNode&&(s.textContent="录制完成",s.style.color="#4CAF50"),r&&e.parentNode&&(r.style.height="100%",r.style.background="linear-gradient(to top, #4CAF50, #4CAF50)"))},200);e.volumeInterval=t}else console.error("找不到音量计或状态显示元素");const o=e=>{"Space"===e.code&&EIe.isRecording&&(e.preventDefault(),EIe.mediaRecorder&&EIe.mediaRecorder.stop())};document.addEventListener("keydown",o),e.keyHandler=o},showPlaybackInterface:e=>{const t=document.getElementById("recordModal");if(t){t.volumeInterval&&clearInterval(t.volumeInterval),t.waveformInterval&&clearInterval(t.waveformInterval),t.keyHandler&&document.removeEventListener("keydown",t.keyHandler);try{xIe(t)&&bIe(document.body,t)}catch(e){console.warn("移除录制界面时出错:",e)}}const n=document.createElement("div");n.id="playbackModal",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10000;\n ";const i=document.createElement("div");i.style.cssText="\n background: white;\n border-radius: 10px;\n padding: 20px;\n text-align: center;\n min-width: 350px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n ",i.innerHTML='\n

录音完成

\n
\n
\n
\n
\n \n
\n
\n \n \n
\n ',n.appendChild(i);try{vIe(document.body,n)}catch(e){return void console.error("添加播放界面到DOM失败:",e)}const r=n.querySelector("#playRecording");r&&(r.onclick=()=>{try{EIe.createAudio(EIe.recordedAudio).play().catch(e=>{console.error("播放录音失败:",e),alert("播放录音失败: "+e.message)});const e=n.querySelector("#waveformLine");e&&(e.style.background="#FF5722",setTimeout(()=>{e.parentNode&&(e.style.background="#4a90e2")},1e3))}catch(e){console.error("播放录音时出错:",e),alert("播放录音时出错: "+e.message)}});const s=n.querySelector("#reRecord");s&&(s.onclick=()=>{try{xIe(n)&&bIe(document.body,n),EIe.record()}catch(e){console.error("重新录制时出错:",e),alert("重新录制时出错: "+e.message)}});const o=n.querySelector("#saveRecording");o&&(o.onclick=()=>{try{EIe.saveRecording(e),xIe(n)&&bIe(document.body,n)}catch(e){console.error("添加到列表时出错:",e),alert("添加到列表时出错: "+e.message)}}),EIe.createWaveformDisplay(e,n)},createWaveformDisplay:async(e,t)=>{try{if(!t||!t.parentNode)return void console.warn("波形显示容器不存在或已被移除");const n=await e.arrayBuffer(),i=new(window.AudioContext||window.webkitAudioContext),r=(await i.decodeAudioData(n)).getChannelData(0),s=t.querySelector("#playbackWaveform");if(s&&s.parentNode){s.innerHTML="";const e=100,t=Math.floor(r.length/e);for(let n=0;n{try{const t=`recording${Object.keys(EIe.builtin).filter(e=>e.startsWith("recording")).length+1}`,n=e?URL.createObjectURL(e):EIe.recordedAudio;if(!n)throw new Error("录音数据不存在");EIe.builtin[t]=n,alert(`录音已保存为: ${t}`);const i=document.getElementById("playbackModal");if(xIe(i)){const e=TIe(i,"#playRecording");e&&(e.innerHTML=` 播放 ${t}`)}}catch(e){console.error("保存录音失败:",e),alert("保存录音失败: "+e.message)}}},wIe=EIe,IIe=window.Audio;if(window.Audio=function(e){if(EIe.blockAllAudio||EIe.isStopped||EIe.abortController&&EIe.abortController.signal.aborted){return{play:()=>Promise.reject(new Error("Audio playback blocked globally")),pause:()=>{},currentTime:0,src:"",volume:1,playbackRate:1,onended:null,onerror:null,onloadstart:null,oncanplay:null,onplay:null,onpause:null,tagName:"AUDIO",addEventListener:()=>{},removeEventListener:()=>{},load:()=>{},duration:0,ended:!1,paused:!0,muted:!1,readyState:0,networkState:0,preload:"none"}}return new IIe(e)},window.Audio.original=IIe,"undefined"!=typeof window){const e=console.error;console.error=function(...t){const n=t.join(" ");n.includes("sound")&&(n.includes("no-unused-vars")||n.includes("no-trailing-spaces")||n.includes("new-cap"))?console.warn("过滤的sound模块ESLint错误:",...t):e.apply(console,t)}}let AIe=!1;function SIe(e){if(!e)return!1;if("PythonError"===e.name||"KeyboardInterrupt"===e.name){const t=e.message||String(e);return t.includes("KeyboardInterrupt")||t.includes("interrupted")}return!1}function CIe(){if(AIe)return!1;if(window.pyodide&&window.pyodide.globals)try{AIe=!0;const e={play:e=>EIe.play(e),play_blocking:e=>EIe.play_blocking(e),stop_all:()=>EIe.stop_all(),adjust_volume:e=>EIe.adjust_volume(e),set_volume:e=>EIe.set_volume(e),get_volume:()=>EIe.get_volume(),adjust_effect:(e,t)=>EIe.adjust_effect(e,t),set_effect:(e,t)=>EIe.set_effect(e,t),clear_effects:()=>EIe.clear_effects(),play_frequency:(e,t)=>(console.log(`Python调用: sound.play_frequency(${e}, ${t})`),EIe.soundQueue.length>0||EIe.isProcessingQueue?EIe.play_frequency_blocking(e,t):EIe.play_frequency(e,t)),play_frequency_no_duration:e=>(console.log(`Python调用: sound.play_frequency_no_duration(${e})`),EIe.soundQueue.length>0||EIe.isProcessingQueue?EIe.play_frequency_continuous_blocking(e):EIe.play_frequency_continuous(e)),play_frequency_blocking:(e,t)=>(console.log(`Python调用: sound.play_frequency_blocking(${e}, ${t})`),EIe.play_frequency_blocking(e,t)),play_frequency_continuous:e=>(console.log(`Python调用: sound.play_frequency_continuous(${e})`),EIe.play_frequency_continuous(e)),play_frequency_continuous_blocking:e=>(console.log(`Python调用: sound.play_frequency_continuous_blocking(${e})`),EIe.play_frequency_continuous_blocking(e)),play_note_list:e=>EIe.play_note_list(e),play_note_list_blocking:e=>EIe.play_note_list_blocking(e),record:()=>EIe.record(),volume:EIe.volume,effects:EIe.effects};window.pyodide.globals.set("sound",e);const t=new(0,window.pyodide.pyimport("types").ModuleType)("sound");Object.keys(e).forEach(n=>{e[n],t[n]=e[n]});try{window.pyodide.runPython('\nimport sys\nsys.modules[\'sound\'] = sound\n\n# 创建同步版本的play_blocking包装函数\nimport asyncio\nfrom js import Promise\n\n# 保存原始的play_blocking(返回Promise的版本)\n_original_play_blocking = sound.play_blocking\n\ndef _sync_play_blocking(name):\n """同步版本的play_blocking,会等待声音播放完成"""\n promise = _original_play_blocking(name)\n # 使用Pyodide的Promise支持\n # 在Pyodide中,可以直接等待JS Promise\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n # Pyodide 0.21+\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n # 降级方案:使用asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n # 将JS Promise转换为Python awaitable\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n \n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换sound.play_blocking为同步版本\nsound.play_blocking = _sync_play_blocking\n\n# 创建同步版本的play_frequency包装函数\n_original_play_frequency = sound.play_frequency\n\ndef _sync_play_frequency(frequency, duration):\n """同步版本的play_frequency,会自动判断是否需要阻塞"""\n promise = _original_play_frequency(frequency, duration)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 创建同步版本的play_frequency_no_duration包装函数\n_original_play_frequency_no_duration = sound.play_frequency_no_duration\n\ndef _sync_play_frequency_no_duration(frequency):\n """同步版本的play_frequency_no_duration,会自动判断是否需要阻塞"""\n promise = _original_play_frequency_no_duration(frequency)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换为同步版本\nsound.play_frequency = _sync_play_frequency\nsound.play_frequency_no_duration = _sync_play_frequency_no_duration\n\n# 创建同步版本的play_frequency_continuous_blocking包装函数\n_original_play_frequency_continuous_blocking = sound.play_frequency_continuous_blocking\n\ndef _sync_play_frequency_continuous_blocking(frequency):\n """同步版本的play_frequency_continuous_blocking,会等待频率播放完成"""\n promise = _original_play_frequency_continuous_blocking(frequency)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n return pyodide.ffi.run_sync(promise)\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n return await promise\n\n return loop.run_until_complete(wait_promise())\n\n# 替换为同步版本\nsound.play_frequency_continuous_blocking = _sync_play_frequency_continuous_blocking\n\n# 创建同步版本的play_frequency_blocking包装函数\n_original_play_frequency_blocking = sound.play_frequency_blocking\n\ndef _sync_play_frequency_blocking(frequency, duration):\n """同步版本的play_frequency_blocking,会等待频率播放完成"""\n promise = _original_play_frequency_blocking(frequency, duration)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 创建同步版本的play_note_list_blocking包装函数\n_original_play_note_list_blocking = sound.play_note_list_blocking\n\ndef _sync_play_note_list_blocking(note_list):\n """同步版本的play_note_list_blocking,会等待音符列表播放完成"""\n promise = _original_play_note_list_blocking(note_list)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换为同步版本\nsound.play_frequency_blocking = _sync_play_frequency_blocking\nsound.play_note_list_blocking = _sync_play_note_list_blocking\n ')}catch(e){if(SIe(e))return AIe=!1,!1;throw e}return window.pyodide.globals.get("sound")?(AIe=!1,!0):(AIe=!1,console.error("Sound对象注入失败:验证时未找到对象"),!1)}catch(e){return AIe=!1,SIe(e)?!1:(console.error("注入sound对象到Python环境失败:",e),!1)}return!1}function OIe(){!function(){const e=Element.prototype.remove;if(Element.prototype.remove=function(){if(this)if("function"==typeof this.remove)try{return e.call(this)}catch(e){console.warn("remove()调用失败,已安全处理:",e)}else console.warn("对象没有remove方法,已安全忽略");else console.warn("尝试在null对象上调用remove(),已安全忽略")},window.$&&window.$.fn&&window.$.fn.remove){const e=window.$.fn.remove;window.$.fn.remove=function(){if(!this||0===this.length)return console.warn("尝试在空的jQuery对象上调用remove(),已安全忽略"),this;try{return e.call(this)}catch(e){return console.warn("jQuery remove()调用失败,已安全处理:",e),this}}}}(),function(){if(CIe())return;const e=setInterval(()=>{CIe()&&clearInterval(e)},100);setTimeout(()=>{clearInterval(e)},1e4)}()}function MIe(){if(window.pyodide&&window.pyodide.globals)try{window.pyodide.globals.get("sound")||CIe()}catch(e){if(SIe(e))return;console.warn("强制注入检查失败:",e)}}function kIe(){const e=window.eval;if(window.eval=function(t){if("string"==typeof t&&t.includes("sound."))try{MIe()}catch(e){SIe(e)||console.warn("执行拦截时出错:",e)}return e.call(this,t)},window.pyodide&&window.pyodide.runPython){const e=window.pyodide.runPython;window.pyodide.runPython=function(t){if("string"==typeof t&&t.includes("sound."))try{MIe()}catch(e){SIe(e)||console.warn("执行拦截时出错:",e)}return e.call(this,t)}}}function RIe(){document.getElementById("modalOverlay").style.display="none"}function NIe(e){const t=document.getElementById("imported-models");if([...t.children].some(t=>t.dataset.modelName===e))return;const n=document.createElement("div");n.className="model-item",n.dataset.modelName=e,n.innerHTML=`\n
\n ${e}\n \n
\n `,n.querySelector(".delete-model").addEventListener("click",()=>{!async function(e){try{await p3.io.removeModel(`indexeddb://${e}`);const t=document.querySelector(`.model-item[data-model-name="${e}"]`);t&&t.remove()}catch(e){console.error("删除模型失败:",e),alert("删除模型失败: "+e.message)}}(e)}),t.appendChild(n)}async function DIe(){try{const e=await p3.io.listModels();document.getElementById("imported-models").innerHTML="";for(const[t]of Object.entries(e)){NIe(t.replace("indexeddb://",""))}}catch(e){console.error("加载模型列表失败:",e)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{OIe(),kIe()}):(OIe(),kIe()),window.addEventListener("pyodideLoaded",()=>{OIe(),kIe()}),setTimeout(()=>{OIe(),kIe()},1e3),window.addEventListener("load",()=>{OIe(),kIe()}),setInterval(MIe,5e3),fIe.init(),window.tf=Ue,async function(){const e=document.createElement("div");e.id="modalOverlay",Object.assign(e.style,{display:"none",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",zIndex:"20011216",pointerEvents:"auto"});const t=document.createElement("div");Object.assign(t.style,{backgroundColor:"white",width:"60%",maxHeight:"80%",margin:"12vh auto",padding:"20px 30px",borderRadius:"12px"}),t.innerHTML='\n

选择本地模型

\n
\x3c!-- 新增 min-height 和 position --\x3e\n \n \n
\n 导入模型名称:\n \n \n
\n
\n
\n ❌ 模型结构描述文件(model.json)\n\n
未选择
\n
\n
\n ❌ 权重文件(model.weights.bin)\n
0 个已选择
\n
\n
\n
\n
\n
\n

已导入模型

\n
\n \n \n
\n
\n
\n
加载中...
\n
\n
\n
\n \n
\n
\n ',e.appendChild(t),document.body.appendChild(e),t.querySelector(".close-btn").addEventListener("click",RIe),e.addEventListener("click",t=>{t.target===e&&RIe()});const n=document.getElementById("model-upload"),i=document.getElementById("model-handle"),r=document.getElementById("output");let s=null,o=[];n.addEventListener("change",async e=>{const t=e.target.files,n=document.getElementById("json-status"),i=document.getElementById("weights-status");n.querySelector("span").textContent="❌ 模型结构描述文件(model.json)",n.querySelector("div").textContent="未选择",i.querySelector("span").textContent="❌ 权重文件(model.weights.bin)",i.querySelector("div").textContent="0 个已选择",o=[];for(let e=0;e0&&(i.querySelector("span").textContent="✅ 权重文件(model.weights.bin)",i.querySelector("div").textContent=`${o.length} 个已选择`)}else alert("未找到 model.json 文件")}),i.addEventListener("click",async()=>{try{const e=document.getElementById("model-name").value||"mixly-model",t=await Cee(p3.io.browserFiles([s,...o]));await t.save(`indexeddb://${e}`),DIe(),r.innerHTML=`模型已成功保存为 ${e}!`}catch(e){r.innerHTML=`保存模型出错: ${e.message}`,console.error(e)}}),t.querySelector("#refresh-models").addEventListener("click",DIe),t.querySelector("#clear-models").addEventListener("click",async()=>{confirm("确定要删除所有模型吗?此操作不可恢复!")&&await async function(){try{const e=await p3.io.listModels(),t=Object.keys(e).map(e=>e.replace("indexeddb://","")).map(e=>p3.io.removeModel(`indexeddb://${e}`));await Promise.all(t),document.getElementById("imported-models").innerHTML=""}catch(e){console.error("清空模型失败:",e),alert("清空模型失败: "+e.message)}}()})}(),(async()=>{await DIe()})();Ve.getMainWorkspace().registerButtonCallback("handleModels",function(){DIe(),document.getElementById("modalOverlay").style.display="block"}),window.prepare_qmyixtxi=async function(e){let t=null;window.featureExtractor?t=window.featureExtractor:(t=await foe("../common/media/tfmodel/model.json"),window.featureExtractor=t);const n=e.resizeBilinear([224,224]).toFloat().div(p3.scalar(127.5)).sub(p3.scalar(1)).expandDims(0);return window.featureExtractor.predict(n)};const FIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(new Ve.FieldDropdown(this.getSoundOptions),"SOUND"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_TOOLTIP)},getSoundOptions:function(){const e=[["Meow","Meow"],[Ve.Msg.MIXLY_SOUND_RECORD_OPTION,"record"]];if(window.sound&&window.sound.builtin){Object.keys(window.sound.builtin).filter(e=>e.startsWith("recording")).forEach(t=>{e.push([t,t])})}return e}},LIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(new Ve.FieldDropdown(this.getSoundOptions),"SOUND").appendField(Ve.Msg.MIXLY_SOUND_WAIT_FINISH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_WAIT_TOOLTIP)},getSoundOptions:function(){const e=[["Meow","Meow"],[Ve.Msg.MIXLY_SOUND_RECORD_OPTION,"record"]];if(window.sound&&window.sound.builtin){Object.keys(window.sound.builtin).filter(e=>e.startsWith("recording")).forEach(t=>{e.push([t,t])})}return e}},PIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_STOP_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_STOP_ALL_TOOLTIP)}},BIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_SET_TO).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SOUND_EFFECT_PITCH,"pitch"],[Ve.Msg.MIXLY_SOUND_EFFECT_PAN,"pan"]]),"EFFECT").appendField(Ve.Msg.MIXLY_SOUND_EFFECT_ADD_BY),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_ADD_TOOLTIP)}},$Ie={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_SET_TO).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SOUND_EFFECT_PITCH,"pitch"],[Ve.Msg.MIXLY_SOUND_EFFECT_PAN,"pan"]]),"EFFECT").appendField(Ve.Msg.MIXLY_SOUND_EFFECT_SET_TO),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_SET_TOOLTIP)}},UIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_CLEAR_EFFECTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_CLEAR_TOOLTIP)}},VIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_INCREASE),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_ADD_TOOLTIP)}},zIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_SET),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_SET_TOOLTIP)}},jIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_GET),this.setOutput(!0,"Volume"),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_GET_TOOLTIP)}},YIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_RECORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_RECORD_TOOLTIP)}},GIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(Ve.Msg.MIXLY_SOUND_FREQUENCY),this.appendValueInput("FREQUENCY").setCheck(Number).setAlign(Ve.ALIGN_RIGHT),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_DURATION),this.appendValueInput("DURATION").setCheck(Number).setAlign(Ve.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_TOOLTIP)}},HIe={init:function(){this.setColour("#acc159"),this.appendValueInput("FREQUENCY").setCheck(Number).appendField(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION_TOOLTIP)}},WIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY_NOTE_LIST).appendField(new Ve.FieldDropdown([["DADADADUM","DADADADUM"],["BIRTHDAY","BIRTHDAY"],["BA_DING","BA_DING"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]]),"NOTE_LIST"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_NOTE_LIST_TOOLTIP)}},XIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(new Ve.FieldDropdown([["NOTE_A4","440"],["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"),this.setOutput(!0,null),this.setOutputShape(Ve.OUTPUT_SHAPE_ROUND),this.setTooltip(Ve.Msg.MIXLY_SOUND_NOTE_TOOLTIP)}};Object.assign(Ve.Variables,Ye),Object.assign(Ve.Procedures,oc),Ve.Python=ac,Ve.generator=ac,ze.Profile.default={},Object.assign(Ve.Blocks,e,t,n,i,r,s,o,a,l,u,c,d,h,A,S,C,O,M,k,R,N,D,F,L,P,B,U,V,ne,re),Object.assign(Ve.Python.forBlock,p,f,m,g,_,y,v,b,T,x,E,w,I,z,j,Y,dy,G,H,W,X,q,K,Z,Q,J,ee,te,ie,se);const qIe={sound_play:FIe,sound_play_wait:LIe,sound_stop_all:PIe,sound_effect_add:BIe,sound_effect_set:$Ie,sound_effect_clear:UIe,sound_volume_add:VIe,sound_volume_set:zIe,sound_volume_get:jIe,sound_record:YIe,sound_play_frequency:GIe,sound_play_frequency_no_duration:HIe,sound_play_note_list:WIe,sound_note:XIe},KIe={sound_play:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("SOUND");return"record"===n?"sound.record()\n":`sound.play("${n}")\n`},sound_play_wait:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("SOUND");return"record"===n?"sound.record()\n":`sound.play_blocking("${n}")\n`},sound_stop_all:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.stop_all()\n"},sound_effect_add:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("EFFECT"),i=e.getInputTargetBlock("VALUE");let r;return r=i?"math_number"===i.type?i.getFieldValue("NUM")||"10":t.valueToCode(i,"VALUE",t.ORDER_NONE)||"10":"10",`sound.adjust_effect("${n}", ${r})\n`},sound_effect_set:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("EFFECT"),i=e.getInputTargetBlock("VALUE");let r;return r=i?"math_number"===i.type?i.getFieldValue("NUM")||"100":t.valueToCode(i,"VALUE",t.ORDER_NONE)||"100":"100",`sound.set_effect("${n}", ${r})\n`},sound_effect_clear:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.clear_effects()\n"},sound_volume_add:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.adjust_volume(${t.valueToCode(e,"VALUE",t.ORDER_NONE)||"0"})\n`},sound_volume_set:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.set_volume(${t.valueToCode(e,"VALUE",t.ORDER_NONE)||"100"})\n`},sound_volume_get:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),["sound.get_volume()",t.ORDER_ATOMIC]},sound_record:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.record()\n"},sound_play_frequency:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_frequency(${t.valueToCode(this,"FREQUENCY",t.ORDER_ATOMIC)}, ${t.valueToCode(this,"DURATION",t.ORDER_ATOMIC)})\n`},sound_play_frequency_no_duration:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_frequency_no_duration(${t.valueToCode(this,"FREQUENCY",t.ORDER_ATOMIC)})\n`},sound_play_note_list:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_note_list("${this.getFieldValue("NOTE_LIST")}")\n`},sound_note:function(e,t){return[this.getFieldValue("NOTE"),t.ORDER_ATOMIC]}};Object.assign(Ve.Blocks,qIe),Object.assign(Ve.Python.forBlock,KIe),window.sound=wIe})()})(); \ No newline at end of file