(()=>{var __webpack_modules__={936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(t,e){return e.definitions_.import_cv2="import cv2",["cv2.imread("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cv_show_image=function(t,e){return e.definitions_.import_cv2="import cv2","cv2.imshow("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+","+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cv_write_image=function(t,e){return e.definitions_.import_cv2="import cv2","cv2.imwrite("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+","+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cv_waitkey=function(t,e){return e.definitions_.import_cv2="import cv2","cv2.waitKey("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(t,e){e.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(t,e){return e.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cv_face_detect=function(t,e){e.definitions_.import_cv2="import cv2";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return[e.valueToCode(this,"FACE",e.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+e.valueToCode(this,"SCALE",e.ORDER_ATOMIC)+",minNeighbors="+e.valueToCode(this,"NEIGHBOR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cv_face_detect_all=function(t,e){e.definitions_.import_cv2="import cv2";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return[e.valueToCode(this,"FACE",e.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+e.valueToCode(this,"SCALE",e.ORDER_ATOMIC)+",minNeighbors="+e.valueToCode(this,"NEIGHBOR",e.ORDER_ATOMIC)+",minSize=("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+"),maxSize=("+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+","+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]}},153:(t,e,n)=>{"use strict";const{SymbolDispose:i}=n(4184),{AbortError:s,codes:o}=n(6605),{isNodeStream:r,isWebStream:a,kControllerErrorFunction:l}=n(6569),u=n(9700),{ERR_INVALID_ARG_TYPE:p}=o;let _;t.exports.addAbortSignal=function(e,n){if(((t,e)=>{if("object"!=typeof t||!("aborted"in t))throw new p(e,"AbortSignal",t)})(e,"signal"),!r(n)&&!a(n))throw new p("stream",["ReadableStream","WritableStream","Stream"],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(t,e){if("object"!=typeof t||!("aborted"in t))return e;const o=r(e)?()=>{e.destroy(new s(void 0,{cause:t.reason}))}:()=>{e[l](new s(void 0,{cause:t.reason}))};if(t.aborted)o();else{_=_||n(798).addAbortListener;const s=_(t,o);u(e,s[i])}return e}},1515:(t,e,n)=>{"use strict";const{StringPrototypeSlice:i,SymbolIterator:s,TypedArrayPrototypeSet:o,Uint8Array:r}=n(4184),{Buffer:a}=n(8287),{inspect:l}=n(798);t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}unshift(t){const e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}shift(){if(0===this.length)return;const t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(0===this.length)return"";let e=this.head,n=""+e.data;for(;null!==(e=e.next);)n+=t+e.data;return n}concat(t){if(0===this.length)return a.alloc(0);const e=a.allocUnsafe(t>>>0);let n=this.head,i=0;for(;n;)o(e,n.data,i),i+=n.data.length,n=n.next;return e}consume(t,e){const n=this.head.data;if(to.length)){t===o.length?(e+=o,++s,n.next?this.head=n.next:this.head=this.tail=null):(e+=i(o,0,t),this.head=n,n.data=i(o,t));break}e+=o,t-=o.length,++s}while(null!==(n=n.next));return this.length-=s,e}_getBuffer(t){const e=a.allocUnsafe(t),n=t;let i=this.head,s=0;do{const a=i.data;if(!(t>a.length)){t===a.length?(o(e,a,n-t),++s,i.next?this.head=i.next:this.head=this.tail=null):(o(e,new r(a.buffer,a.byteOffset,t),n-t),this.head=i,i.data=a.slice(t));break}o(e,a,n-t),t-=a.length,++s}while(null!==(i=i.next));return this.length-=s,e}[Symbol.for("nodejs.util.inspect.custom")](t,e){return l(this,{...e,depth:0,customInspect:!1})}}},6864:(t,e,n)=>{"use strict";const{pipeline:i}=n(872),s=n(4992),{destroyer:o}=n(2430),{isNodeStream:r,isReadable:a,isWritable:l,isWebStream:u,isTransformStream:p,isWritableStream:_,isReadableStream:d}=n(6569),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:c,ERR_MISSING_ARGS:T}}=n(6605),I=n(9700);t.exports=function(...t){if(0===t.length)throw new T("streams");if(1===t.length)return s.from(t[0]);const e=[...t];if("function"==typeof t[0]&&(t[0]=s.from(t[0])),"function"==typeof t[t.length-1]){const e=t.length-1;t[e]=s.from(t[e])}for(let n=0;n0&&!(l(t[n])||_(t[n])||p(t[n])))throw new c(`streams[${n}]`,e[n],"must be writable")}let n,m,E,f,g;const O=t[0],M=i(t,(function(t){const e=f;f=null,e?e(t):t?g.destroy(t):A||R||g.destroy()})),R=!!(l(O)||_(O)||p(O)),A=!!(a(M)||d(M)||p(M));if(g=new s({writableObjectMode:!(null==O||!O.writableObjectMode),readableObjectMode:!(null==M||!M.readableObjectMode),writable:R,readable:A}),R){if(r(O))g._write=function(t,e,i){O.write(t,e)?i():n=i},g._final=function(t){O.end(),m=t},O.on("drain",(function(){if(n){const t=n;n=null,t()}}));else if(u(O)){const t=(p(O)?O.writable:O).getWriter();g._write=async function(e,n,i){try{await t.ready,t.write(e).catch((()=>{})),i()}catch(t){i(t)}},g._final=async function(e){try{await t.ready,t.close().catch((()=>{})),m=e}catch(t){e(t)}}}const t=p(M)?M.readable:M;I(t,(()=>{if(m){const t=m;m=null,t()}}))}if(A)if(r(M))M.on("readable",(function(){if(E){const t=E;E=null,t()}})),M.on("end",(function(){g.push(null)})),g._read=function(){for(;;){const t=M.read();if(null===t)return void(E=g._read);if(!g.push(t))return}};else if(u(M)){const t=(p(M)?M.readable:M).getReader();g._read=async function(){for(;;)try{const{value:e,done:n}=await t.read();if(!g.push(e))return;if(n)return void g.push(null)}catch{return}}}return g._destroy=function(t,e){t||null===f||(t=new h),E=null,n=null,m=null,null===f?e(t):(f=e,r(M)&&o(M,t))},g}},2430:(t,e,n)=>{"use strict";const i=n(5606),{aggregateTwoErrors:s,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:r}=n(6605),{Symbol:a}=n(4184),{kIsDestroyed:l,isDestroyed:u,isFinished:p,isServerRequest:_}=n(6569),d=a("kDestroy"),h=a("kConstruct");function c(t,e,n){t&&(t.stack,e&&!e.errored&&(e.errored=t),n&&!n.errored&&(n.errored=t))}function T(t,e,n){let s=!1;function o(e){if(s)return;s=!0;const o=t._readableState,r=t._writableState;c(e,r,o),r&&(r.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(e),e?i.nextTick(I,t,e):i.nextTick(m,t)}try{t._destroy(e||null,o)}catch(e){o(e)}}function I(t,e){E(t,e),m(t)}function m(t){const e=t._readableState,n=t._writableState;n&&(n.closeEmitted=!0),e&&(e.closeEmitted=!0),(null!=n&&n.emitClose||null!=e&&e.emitClose)&&t.emit("close")}function E(t,e){const n=t._readableState,i=t._writableState;null!=i&&i.errorEmitted||null!=n&&n.errorEmitted||(i&&(i.errorEmitted=!0),n&&(n.errorEmitted=!0),t.emit("error",e))}function f(t,e,n){const s=t._readableState,o=t._writableState;if(null!=o&&o.destroyed||null!=s&&s.destroyed)return this;null!=s&&s.autoDestroy||null!=o&&o.autoDestroy?t.destroy(e):e&&(e.stack,o&&!o.errored&&(o.errored=e),s&&!s.errored&&(s.errored=e),n?i.nextTick(E,t,e):E(t,e))}function g(t){let e=!1;function n(n){if(e)return void f(t,null!=n?n:new o);e=!0;const s=t._readableState,r=t._writableState,a=r||s;s&&(s.constructed=!0),r&&(r.constructed=!0),a.destroyed?t.emit(d,n):n?f(t,n,!0):i.nextTick(O,t)}try{t._construct((t=>{i.nextTick(n,t)}))}catch(t){i.nextTick(n,t)}}function O(t){t.emit(h)}function M(t){return(null==t?void 0:t.setHeader)&&"function"==typeof t.abort}function R(t){t.emit("close")}function A(t,e){t.emit("error",e),i.nextTick(R,t)}t.exports={construct:function(t,e){if("function"!=typeof t._construct)return;const n=t._readableState,s=t._writableState;n&&(n.constructed=!1),s&&(s.constructed=!1),t.once(h,e),t.listenerCount(h)>1||i.nextTick(g,t)},destroyer:function(t,e){t&&!u(t)&&(e||p(t)||(e=new r),_(t)?(t.socket=null,t.destroy(e)):M(t)?t.abort():M(t.req)?t.req.abort():"function"==typeof t.destroy?t.destroy(e):"function"==typeof t.close?t.close():e?i.nextTick(A,t,e):i.nextTick(R,t),t.destroyed||(t[l]=!0))},destroy:function(t,e){const n=this._readableState,i=this._writableState,o=i||n;return null!=i&&i.destroyed||null!=n&&n.destroyed?("function"==typeof e&&e(),this):(c(t,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),o.constructed?T(this,t,e):this.once(d,(function(n){T(this,s(n,t),e)})),this)},undestroy:function(){const t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=!1===t.readable,t.endEmitted=!1===t.readable),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=!1===e.writable,e.ending=!1===e.writable,e.finished=!1===e.writable)},errorOrDestroy:f}},4992:(t,e,n)=>{"use strict";const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:s,ObjectKeys:o,ObjectSetPrototypeOf:r}=n(4184);t.exports=u;const a=n(6566),l=n(394);r(u.prototype,a.prototype),r(u,a);{const t=o(l.prototype);for(let e=0;e{const i=n(5606),s=n(8287),{isReadable:o,isWritable:r,isIterable:a,isNodeStream:l,isReadableNodeStream:u,isWritableNodeStream:p,isDuplexNodeStream:_,isReadableStream:d,isWritableStream:h}=n(6569),c=n(9700),{AbortError:T,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:m}}=n(6605),{destroyer:E}=n(2430),f=n(4992),g=n(6566),O=n(394),{createDeferredPromise:M}=n(798),R=n(3182),A=globalThis.Blob||s.Blob,S=void 0!==A?function(t){return t instanceof A}:function(t){return!1},C=globalThis.AbortController||n(5568).AbortController,{FunctionPrototypeCall:L}=n(4184);class y extends f{constructor(t){super(t),!1===(null==t?void 0:t.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==t?void 0:t.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function D(t){const e=t.readable&&"function"!=typeof t.readable.read?g.wrap(t.readable):t.readable,n=t.writable;let i,s,a,l,u,p=!!o(e),_=!!r(n);function d(t){const e=l;l=null,e?e(t):t&&u.destroy(t)}return u=new y({readableObjectMode:!(null==e||!e.readableObjectMode),writableObjectMode:!(null==n||!n.writableObjectMode),readable:p,writable:_}),_&&(c(n,(t=>{_=!1,t&&E(e,t),d(t)})),u._write=function(t,e,s){n.write(t,e)?s():i=s},u._final=function(t){n.end(),s=t},n.on("drain",(function(){if(i){const t=i;i=null,t()}})),n.on("finish",(function(){if(s){const t=s;s=null,t()}}))),p&&(c(e,(t=>{p=!1,t&&E(e,t),d(t)})),e.on("readable",(function(){if(a){const t=a;a=null,t()}})),e.on("end",(function(){u.push(null)})),u._read=function(){for(;;){const t=e.read();if(null===t)return void(a=u._read);if(!u.push(t))return}}),u._destroy=function(t,o){t||null===l||(t=new T),a=null,i=null,s=null,null===l?o(t):(l=o,E(n,t),E(e,t))},u}t.exports=function t(e,n){if(_(e))return e;if(u(e))return D({readable:e});if(p(e))return D({writable:e});if(l(e))return D({writable:!1,readable:!1});if(d(e))return D({readable:g.fromWeb(e)});if(h(e))return D({writable:O.fromWeb(e)});if("function"==typeof e){const{value:t,write:s,final:o,destroy:r}=function(t){let{promise:e,resolve:n}=M();const s=new C,o=s.signal,r=t(async function*(){for(;;){const t=e;e=null;const{chunk:s,done:r,cb:a}=await t;if(i.nextTick(a),r)return;if(o.aborted)throw new T(void 0,{cause:o.reason});({promise:e,resolve:n}=M()),yield s}}(),{signal:o});return{value:r,write(t,e,i){const s=n;n=null,s({chunk:t,done:!1,cb:i})},final(t){const e=n;n=null,e({done:!0,cb:t})},destroy(t,e){s.abort(),e(t)}}}(e);if(a(t))return R(y,t,{objectMode:!0,write:s,final:o,destroy:r});const l=null==t?void 0:t.then;if("function"==typeof l){let e;const n=L(l,t,(t=>{if(null!=t)throw new m("nully","body",t)}),(t=>{E(e,t)}));return e=new y({objectMode:!0,readable:!1,write:s,final(t){o((async()=>{try{await n,i.nextTick(t,null)}catch(e){i.nextTick(t,e)}}))},destroy:r})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,t)}if(S(e))return t(e.arrayBuffer());if(a(e))return R(y,e,{objectMode:!0,writable:!1});if(d(null==e?void 0:e.readable)&&h(null==e?void 0:e.writable))return y.fromWeb(e);if("object"==typeof(null==e?void 0:e.writable)||"object"==typeof(null==e?void 0:e.readable)){return D({readable:null!=e&&e.readable?u(null==e?void 0:e.readable)?null==e?void 0:e.readable:t(e.readable):void 0,writable:null!=e&&e.writable?p(null==e?void 0:e.writable)?null==e?void 0:e.writable:t(e.writable):void 0})}const s=null==e?void 0:e.then;if("function"==typeof s){let t;return L(s,e,(e=>{null!=e&&t.push(e),t.push(null)}),(e=>{E(t,e)})),t=new y({objectMode:!0,writable:!1,read(){}})}throw new I(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)}},9700:(t,e,n)=>{const i=n(5606),{AbortError:s,codes:o}=n(6605),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:u}=n(798),{validateAbortSignal:p,validateFunction:_,validateObject:d,validateBoolean:h}=n(6283),{Promise:c,PromisePrototypeThen:T,SymbolDispose:I}=n(4184),{isClosed:m,isReadable:E,isReadableNodeStream:f,isReadableStream:g,isReadableFinished:O,isReadableErrored:M,isWritable:R,isWritableNodeStream:A,isWritableStream:S,isWritableFinished:C,isWritableErrored:L,isNodeStream:y,willEmitClose:D,kIsClosedPromise:N}=n(6569);let b;const v=()=>{};function w(t,e,o){var h,c;if(2===arguments.length?(o=e,e=l):null==e?e=l:d(e,"options"),_(o,"callback"),p(e.signal,"options.signal"),o=u(o),g(t)||S(t))return function(t,e,o){let r=!1,a=v;if(e.signal)if(a=()=>{r=!0,o.call(t,new s(void 0,{cause:e.signal.reason}))},e.signal.aborted)i.nextTick(a);else{b=b||n(798).addAbortListener;const i=b(e.signal,a),s=o;o=u(((...e)=>{i[I](),s.apply(t,e)}))}const l=(...e)=>{r||i.nextTick((()=>o.apply(t,e)))};return T(t[N].promise,l,l),v}(t,e,o);if(!y(t))throw new r("stream",["ReadableStream","WritableStream","Stream"],t);const w=null!==(h=e.readable)&&void 0!==h?h:f(t),F=null!==(c=e.writable)&&void 0!==c?c:A(t),P=t._writableState,k=t._readableState,V=()=>{t.writable||U()};let Y=D(t)&&f(t)===w&&A(t)===F,x=C(t,!1);const U=()=>{x=!0,t.destroyed&&(Y=!1),(!Y||t.readable&&!w)&&(w&&!B||o.call(t))};let B=O(t,!1);const X=()=>{B=!0,t.destroyed&&(Y=!1),(!Y||t.writable&&!F)&&(F&&!x||o.call(t))},G=e=>{o.call(t,e)};let H=m(t);const W=()=>{H=!0;const e=L(t)||M(t);return e&&"boolean"!=typeof e?o.call(t,e):w&&!B&&f(t,!0)&&!O(t,!1)?o.call(t,new a):!F||x||C(t,!1)?void o.call(t):o.call(t,new a)},j=()=>{H=!0;const e=L(t)||M(t);if(e&&"boolean"!=typeof e)return o.call(t,e);o.call(t)},K=()=>{t.req.on("finish",U)};!function(t){return t.setHeader&&"function"==typeof t.abort}(t)?F&&!P&&(t.on("end",V),t.on("close",V)):(t.on("complete",U),Y||t.on("abort",W),t.req?K():t.on("request",K)),Y||"boolean"!=typeof t.aborted||t.on("aborted",W),t.on("end",X),t.on("finish",U),!1!==e.error&&t.on("error",G),t.on("close",W),H?i.nextTick(W):null!=P&&P.errorEmitted||null!=k&&k.errorEmitted?Y||i.nextTick(j):(w||Y&&!E(t)||!x&&!1!==R(t))&&(F||Y&&!R(t)||!B&&!1!==E(t))?k&&t.req&&t.aborted&&i.nextTick(j):i.nextTick(j);const q=()=>{o=v,t.removeListener("aborted",W),t.removeListener("complete",U),t.removeListener("abort",W),t.removeListener("request",K),t.req&&t.req.removeListener("finish",U),t.removeListener("end",V),t.removeListener("close",V),t.removeListener("finish",U),t.removeListener("end",X),t.removeListener("error",G),t.removeListener("close",W)};if(e.signal&&!H){const r=()=>{const n=o;q(),n.call(t,new s(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)i.nextTick(r);else{b=b||n(798).addAbortListener;const i=b(e.signal,r),s=o;o=u(((...e)=>{i[I](),s.apply(t,e)}))}}return q}t.exports=w,t.exports.finished=function(t,e){var n;let i=!1;return null===e&&(e=l),null!==(n=e)&&void 0!==n&&n.cleanup&&(h(e.cleanup,"cleanup"),i=e.cleanup),new c(((n,s)=>{const o=w(t,e,(t=>{i&&o(),t?s(t):n()}))}))}},3182:(t,e,n)=>{"use strict";const i=n(5606),{PromisePrototypeThen:s,SymbolAsyncIterator:o,SymbolIterator:r}=n(4184),{Buffer:a}=n(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:u}=n(6605).codes;t.exports=function(t,e,n){let p,_;if("string"==typeof e||e instanceof a)return new t({objectMode:!0,...n,read(){this.push(e),this.push(null)}});if(e&&e[o])_=!0,p=e[o]();else{if(!e||!e[r])throw new l("iterable",["Iterable"],e);_=!1,p=e[r]()}const d=new t({objectMode:!0,highWaterMark:1,...n});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:t,done:e}=_?await p.next():p.next();if(e)d.push(null);else{const e=t&&"function"==typeof t.then?await t:t;if(null===e)throw h=!1,new u;if(d.push(e))continue;h=!1}}catch(t){d.destroy(t)}break}}())},d._destroy=function(t,e){s(async function(t){const e=null!=t,n="function"==typeof p.throw;if(e&&n){const{value:e,done:n}=await p.throw(t);if(await e,n)return}if("function"==typeof p.return){const{value:t}=await p.return();await t}}(t),(()=>i.nextTick(e,t)),(n=>i.nextTick(e,n||t)))},d}},2913:(t,e,n)=>{"use strict";const{ArrayIsArray:i,ObjectSetPrototypeOf:s}=n(4184),{EventEmitter:o}=n(7007);function r(t){o.call(this,t)}function a(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?i(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}s(r.prototype,o.prototype),s(r,o),r.prototype.pipe=function(t,e){const n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function s(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",s),t._isStdio||e&&!1===e.end||(n.on("end",l),n.on("close",u));let r=!1;function l(){r||(r=!0,t.end())}function u(){r||(r=!0,"function"==typeof t.destroy&&t.destroy())}function p(t){_(),0===o.listenerCount(this,"error")&&this.emit("error",t)}function _(){n.removeListener("data",i),t.removeListener("drain",s),n.removeListener("end",l),n.removeListener("close",u),n.removeListener("error",p),t.removeListener("error",p),n.removeListener("end",_),n.removeListener("close",_),t.removeListener("close",_)}return a(n,"error",p),a(t,"error",p),n.on("end",_),n.on("close",_),t.on("close",_),t.emit("pipe",n),t},t.exports={Stream:r,prependListener:a}},5589:(t,e,n)=>{"use strict";const i=globalThis.AbortController||n(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:s,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:a},AbortError:l}=n(6605),{validateAbortSignal:u,validateInteger:p,validateObject:_}=n(6283),d=n(4184).Symbol("kWeak"),h=n(4184).Symbol("kResistStopPropagation"),{finished:c}=n(9700),T=n(6864),{addAbortSignalNoValidate:I}=n(153),{isWritable:m,isNodeStream:E}=n(6569),{deprecate:f}=n(798),{ArrayPrototypePush:g,Boolean:O,MathFloor:M,Number:R,NumberIsNaN:A,Promise:S,PromiseReject:C,PromiseResolve:L,PromisePrototypeThen:y,Symbol:D}=n(4184),N=D("kEmpty"),b=D("kEof");function v(t,e){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");let i=1;null!=(null==e?void 0:e.concurrency)&&(i=M(e.concurrency));let s=i-1;return null!=(null==e?void 0:e.highWaterMark)&&(s=M(e.highWaterMark)),p(i,"options.concurrency",1),p(s,"options.highWaterMark",0),s+=i,async function*(){const o=n(798).AbortSignalAny([null==e?void 0:e.signal].filter(O)),r=this,a=[],u={signal:o};let p,_,d=!1,h=0;function c(){d=!0,T()}function T(){h-=1,I()}function I(){_&&!d&&h=s||h>=i)&&await new S((t=>{_=t}))}a.push(b)}catch(t){const e=C(t);y(e,T,c),a.push(e)}finally{d=!0,p&&(p(),p=null)}}();try{for(;;){for(;a.length>0;){const t=await a[0];if(t===b)return;if(o.aborted)throw new l;t!==N&&(yield t),a.shift(),I()}await new S((t=>{p=t}))}}finally{d=!0,_&&(_(),_=null)}}.call(this)}async function w(t,e=void 0){for await(const n of F.call(this,t,e))return!0;return!1}function F(t,e){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);return v.call(this,(async function(e,n){return await t(e,n)?e:N}),e)}class P extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function k(t){if(t=R(t),A(t))return 0;if(t<0)throw new a("number",">= 0",t);return t}t.exports.streamReturningOperators={asIndexedPairs:f((function(t=void 0){return null!=t&&_(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),async function*(){let e=0;for await(const i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l({cause:t.signal.reason});yield[e++,i]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(t,e=void 0){return null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),t=k(t),async function*(){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var i;if(null!=e&&null!==(i=e.signal)&&void 0!==i&&i.aborted)throw new l;t--<=0&&(yield n)}}.call(this)},filter:F,flatMap:function(t,e){const n=v.call(this,t,e);return async function*(){for await(const t of n)yield*t}.call(this)},map:v,take:function(t,e=void 0){return null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),t=k(t),async function*(){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var i;if(null!=e&&null!==(i=e.signal)&&void 0!==i&&i.aborted)throw new l;if(t-- >0&&(yield n),t<=0)return}}.call(this)},compose:function(t,e){if(null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),E(t)&&!m(t))throw new s("stream",t,"must be writable");const n=T(this,t);return null!=e&&e.signal&&I(e.signal,n),n}},t.exports.promiseReturningOperators={every:async function(t,e=void 0){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);return!await w.call(this,(async(...e)=>!await t(...e)),e)},forEach:async function(t,e){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);for await(const n of v.call(this,(async function(e,n){return await t(e,n),N}),e));},reduce:async function(t,e,n){var s;if("function"!=typeof t)throw new o("reducer",["Function","AsyncFunction"],t);null!=n&&_(n,"options"),null!=(null==n?void 0:n.signal)&&u(n.signal,"options.signal");let r=arguments.length>1;if(null!=n&&null!==(s=n.signal)&&void 0!==s&&s.aborted){const t=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await c(this.destroy(t)),t}const a=new i,p=a.signal;if(null!=n&&n.signal){const t={once:!0,[d]:this,[h]:!0};n.signal.addEventListener("abort",(()=>a.abort()),t)}let T=!1;try{for await(const i of this){var I;if(T=!0,null!=n&&null!==(I=n.signal)&&void 0!==I&&I.aborted)throw new l;r?e=await t(e,i,{signal:p}):(e=i,r=!0)}if(!T&&!r)throw new P}finally{a.abort()}return e},toArray:async function(t){null!=t&&_(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");const e=[];for await(const i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:t.signal.reason});g(e,i)}return e},some:w,find:async function(t,e){for await(const n of F.call(this,t,e))return n}}},6898:(t,e,n)=>{"use strict";const{ObjectSetPrototypeOf:i}=n(4184);t.exports=o;const s=n(208);function o(t){if(!(this instanceof o))return new o(t);s.call(this,t)}i(o.prototype,s.prototype),i(o,s),o.prototype._transform=function(t,e,n){n(null,t)}},872:(t,e,n)=>{const i=n(5606),{ArrayIsArray:s,Promise:o,SymbolAsyncIterator:r,SymbolDispose:a}=n(4184),l=n(9700),{once:u}=n(798),p=n(2430),_=n(4992),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:c,ERR_MISSING_ARGS:T,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:E}=n(6605),{validateFunction:f,validateAbortSignal:g}=n(6283),{isIterable:O,isReadable:M,isReadableNodeStream:R,isNodeStream:A,isTransformStream:S,isWebStream:C,isReadableStream:L,isReadableFinished:y}=n(6569),D=globalThis.AbortController||n(5568).AbortController;let N,b,v;function w(t,e,n){let i=!1;t.on("close",(()=>{i=!0}));return{destroy:e=>{i||(i=!0,p.destroyer(t,e||new I("pipe")))},cleanup:l(t,{readable:e,writable:n},(t=>{i=!t}))}}function F(t){if(O(t))return t;if(R(t))return async function*(t){b||(b=n(6566));yield*b.prototype[r].call(t)}(t);throw new h("val",["Readable","Iterable","AsyncIterable"],t)}async function P(t,e,n,{end:i}){let s,r=null;const a=t=>{if(t&&(s=t),r){const t=r;r=null,t()}},u=()=>new o(((t,e)=>{s?e(s):r=()=>{s?e(s):t()}}));e.on("drain",a);const p=l(e,{readable:!1},a);try{e.writableNeedDrain&&await u();for await(const n of t)e.write(n)||await u();i&&(e.end(),await u()),n()}catch(t){n(s!==t?d(s,t):t)}finally{p(),e.off("drain",a)}}async function k(t,e,n,{end:i}){S(e)&&(e=e.writable);const s=e.getWriter();try{for await(const e of t)await s.ready,s.write(e).catch((()=>{}));await s.ready,i&&await s.close(),n()}catch(t){try{await s.abort(t),n(t)}catch(t){n(t)}}}function V(t,e,o){if(1===t.length&&s(t[0])&&(t=t[0]),t.length<2)throw new T("streams");const r=new D,l=r.signal,u=null==o?void 0:o.signal,p=[];function d(){U(new E)}let I,m,f;g(u,"options.signal"),v=v||n(798).addAbortListener,u&&(I=v(u,d));const y=[];let b,V=0;function x(t){U(t,0==--V)}function U(t,n){var s;if(!t||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=t),m||n){for(;y.length;)y.shift()(m);null===(s=I)||void 0===s||s[a](),r.abort(),n&&(m||p.forEach((t=>t())),i.nextTick(e,m,f))}}for(let H=0;H0,q=j||!1!==(null==o?void 0:o.end),$=H===t.length-1;if(A(W)){if(q){const{destroy:z,cleanup:Q}=w(W,j,K);y.push(z),M(W)&&$&&p.push(Q)}function B(t){t&&"AbortError"!==t.name&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code&&x(t)}W.on("error",B),M(W)&&$&&p.push((()=>{W.removeListener("error",B)}))}if(0===H)if("function"==typeof W){if(b=W({signal:l}),!O(b))throw new c("Iterable, AsyncIterable or Stream","source",b)}else b=O(W)||R(W)||S(W)?W:_.from(W);else if("function"==typeof W){var X;if(S(b))b=F(null===(X=b)||void 0===X?void 0:X.readable);else b=F(b);if(b=W(b,{signal:l}),j){if(!O(b,!0))throw new c("AsyncIterable",`transform[${H-1}]`,b)}else{var G;N||(N=n(6898));const J=new N({objectMode:!0}),Z=null===(G=b)||void 0===G?void 0:G.then;if("function"==typeof Z)V++,Z.call(b,(t=>{f=t,null!=t&&J.write(t),q&&J.end(),i.nextTick(x)}),(t=>{J.destroy(t),i.nextTick(x,t)}));else if(O(b,!0))V++,P(b,J,x,{end:q});else{if(!L(b)&&!S(b))throw new c("AsyncIterable or Promise","destination",b);{const nt=b.readable||b;V++,P(nt,J,x,{end:q})}}b=J;const{destroy:tt,cleanup:et}=w(b,!1,!0);y.push(tt),$&&p.push(et)}}else if(A(W)){if(R(b)){V+=2;const it=Y(b,W,x,{end:q});M(W)&&$&&p.push(it)}else if(S(b)||L(b)){const st=b.readable||b;V++,P(st,W,x,{end:q})}else{if(!O(b))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);V++,P(b,W,x,{end:q})}b=W}else if(C(W)){if(R(b))V++,k(F(b),W,x,{end:q});else if(L(b)||O(b))V++,k(b,W,x,{end:q});else{if(!S(b))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);V++,k(b.readable,W,x,{end:q})}b=W}else b=_.from(W)}return(null!=l&&l.aborted||null!=u&&u.aborted)&&i.nextTick(d),b}function Y(t,e,n,{end:s}){let o=!1;if(e.on("close",(()=>{o||n(new m)})),t.pipe(e,{end:!1}),s){function r(){o=!0,e.end()}y(t)?i.nextTick(r):t.once("end",r)}else n();return l(t,{readable:!0,writable:!1},(e=>{const i=t._readableState;e&&"ERR_STREAM_PREMATURE_CLOSE"===e.code&&i&&i.ended&&!i.errored&&!i.errorEmitted?t.once("end",n).once("error",n):n(e)})),l(e,{readable:!1,writable:!0},n)}t.exports={pipelineImpl:V,pipeline:function(...t){return V(t,u(function(t){return f(t[t.length-1],"streams[stream.length - 1]"),t.pop()}(t)))}}},6566:(t,e,n)=>{const i=n(5606),{ArrayPrototypeIndexOf:s,NumberIsInteger:o,NumberIsNaN:r,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:p,Promise:_,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:c,Symbol:T}=n(4184);t.exports=K,K.ReadableState=j;const{EventEmitter:I}=n(7007),{Stream:m,prependListener:E}=n(2913),{Buffer:f}=n(8287),{addAbortSignal:g}=n(153),O=n(9700);let M=n(798).debuglog("stream",(t=>{M=t}));const R=n(1515),A=n(2430),{getHighWaterMark:S,getDefaultHighWaterMark:C}=n(9153),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:y,ERR_METHOD_NOT_IMPLEMENTED:D,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:b,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:v},AbortError:w}=n(6605),{validateObject:F}=n(6283),P=T("kPaused"),{StringDecoder:k}=n(8707),V=n(3182);p(K.prototype,m.prototype),p(K,m);const Y=()=>{},{errorOrDestroy:x}=A,U=1,B=16,X=32,G=2048,H=4096;function W(t){return{enumerable:!1,get(){return!!(this.state&t)},set(e){e?this.state|=t:this.state&=~t}}}function j(t,e,i){"boolean"!=typeof i&&(i=e instanceof n(4992)),this.state=G|H|B|X,t&&t.objectMode&&(this.state|=U),i&&t&&t.readableObjectMode&&(this.state|=U),this.highWaterMark=t?S(this,t,"readableHighWaterMark",i):C(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[P]=null,t&&!1===t.emitClose&&(this.state&=~G),t&&!1===t.autoDestroy&&(this.state&=~H),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new k(t.encoding),this.encoding=t.encoding)}function K(t){if(!(this instanceof K))return new K(t);const e=this instanceof n(4992);this._readableState=new j(t,this,e),t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&!e&&g(t.signal,this)),m.call(this,t),A.construct(this,(()=>{this._readableState.needReadable&&Z(this,this._readableState)}))}function q(t,e,n,i){M("readableAddChunk",e);const s=t._readableState;let o;if(s.state&U||("string"==typeof e?(n=n||s.defaultEncoding,s.encoding!==n&&(i&&s.encoding?e=f.from(e,n).toString(s.encoding):(e=f.from(e,n),n=""))):e instanceof f?n="":m._isUint8Array(e)?(e=m._uint8ArrayToBuffer(e),n=""):null!=e&&(o=new y("chunk",["string","Buffer","Uint8Array"],e))),o)x(t,o);else if(null===e)s.state&=-9,function(t,e){if(M("onEofChunk"),e.ended)return;if(e.decoder){const t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?Q(t):(e.needReadable=!1,e.emittedReadable=!0,J(t))}(t,s);else if(s.state&U||e&&e.length>0)if(i)if(4&s.state)x(t,new v);else{if(s.destroyed||s.errored)return!1;$(t,s,e,!0)}else if(s.ended)x(t,new b);else{if(s.destroyed||s.errored)return!1;s.state&=-9,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?$(t,s,e,!1):Z(t,s)):$(t,s,e,!1)}else i||(s.state&=-9,Z(t,s));return!s.ended&&(s.length0?(65536&e.state?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),64&e.state&&Q(t)),Z(t,e)}l(j.prototype,{objectMode:W(U),ended:W(2),endEmitted:W(4),reading:W(8),constructed:W(B),sync:W(X),needReadable:W(64),emittedReadable:W(128),readableListening:W(256),resumeScheduled:W(512),errorEmitted:W(1024),emitClose:W(G),autoDestroy:W(H),destroyed:W(8192),closed:W(16384),closeEmitted:W(32768),multiAwaitDrain:W(65536),readingMore:W(1<<17),dataEmitted:W(1<<18)}),K.prototype.destroy=A.destroy,K.prototype._undestroy=A.undestroy,K.prototype._destroy=function(t,e){e(t)},K.prototype[I.captureRejectionSymbol]=function(t){this.destroy(t)},K.prototype[h]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new w,this.destroy(t)),new _(((e,n)=>O(this,(i=>i&&i!==t?n(i):e(null)))))},K.prototype.push=function(t,e){return q(this,t,e,!1)},K.prototype.unshift=function(t,e){return q(this,t,e,!0)},K.prototype.isPaused=function(){const t=this._readableState;return!0===t[P]||!1===t.flowing},K.prototype.setEncoding=function(t){const e=new k(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let i="";for(const t of n)i+=e.write(t);return n.clear(),""!==i&&n.push(i),this._readableState.length=i.length,this};function z(t,e){return t<=0||0===e.length&&e.ended?0:e.state&U?1:r(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}function Q(t){const e=t._readableState;M("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(J,t))}function J(t){const e=t._readableState;M("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||e.errored||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,st(t)}function Z(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,i.nextTick(tt,t,e))}function tt(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!1===e[P]?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function nt(t){M("readable nexttick read 0"),t.read(0)}function it(t,e){M("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),st(t),e.flowing&&!e.reading&&t.read(0)}function st(t){const e=t._readableState;for(M("flow",e.flowing);e.flowing&&null!==t.read(););}function ot(t,e){"function"!=typeof t.read&&(t=K.wrap(t,{objectMode:!0}));const n=async function*(t,e){let n,i=Y;function s(e){this===t?(i(),i=Y):i=e}t.on("readable",s);const o=O(t,{writable:!1},(t=>{n=t?L(n,t):null,i(),i=Y}));try{for(;;){const e=t.destroyed?null:t.read();if(null!==e)yield e;else{if(n)throw n;if(null===n)return;await new _(s)}}}catch(t){throw n=L(n,t),n}finally{!n&&!1===(null==e?void 0:e.destroyOnReturn)||void 0!==n&&!t._readableState.autoDestroy?(t.off("readable",s),o()):A.destroyer(t,null)}}(t,e);return n.stream=t,n}function rt(t,e){if(0===e.length)return null;let n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n}function at(t){const e=t._readableState;M("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(lt,e,t))}function lt(t,e){if(M("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&0===t.length)if(t.endEmitted=!0,e.emit("end"),e.writable&&!1===e.allowHalfOpen)i.nextTick(ut,e);else if(t.autoDestroy){const t=e._writableState;(!t||t.autoDestroy&&(t.finished||!1===t.writable))&&e.destroy()}}function ut(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}let pt;function _t(){return void 0===pt&&(pt={}),pt}K.prototype.read=function(t){M("read",t),void 0===t?t=NaN:o(t)||(t=a(t,10));const e=this._readableState,n=t;if(t>e.highWaterMark&&(e.highWaterMark=function(t){if(t>1073741824)throw new N("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,++t}(t)),0!==t&&(e.state&=-129),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return M("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?at(this):Q(this),null;if(0===(t=z(t,e))&&e.ended)return 0===e.length&&at(this),null;let i,s=!!(64&e.state);if(M("need readable",s),(0===e.length||e.length-t0?rt(t,e):null,null===i?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&at(this)),null===i||e.errorEmitted||e.closeEmitted||(e.dataEmitted=!0,this.emit("data",i)),i},K.prototype._read=function(t){throw new D("_read()")},K.prototype.pipe=function(t,e){const n=this,s=this._readableState;1===s.pipes.length&&(s.multiAwaitDrain||(s.multiAwaitDrain=!0,s.awaitDrainWriters=new d(s.awaitDrainWriters?[s.awaitDrainWriters]:[]))),s.pipes.push(t),M("pipe count=%d opts=%j",s.pipes.length,e);const o=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?a:I;function r(e,i){M("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,function(){M("cleanup"),t.removeListener("close",c),t.removeListener("finish",T),l&&t.removeListener("drain",l);t.removeListener("error",h),t.removeListener("unpipe",r),n.removeListener("end",a),n.removeListener("end",I),n.removeListener("data",_),u=!0,l&&s.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}())}function a(){M("onend"),t.end()}let l;s.endEmitted?i.nextTick(o):n.once("end",o),t.on("unpipe",r);let u=!1;function p(){u||(1===s.pipes.length&&s.pipes[0]===t?(M("false write response, pause",0),s.awaitDrainWriters=t,s.multiAwaitDrain=!1):s.pipes.length>1&&s.pipes.includes(t)&&(M("false write response, pause",s.awaitDrainWriters.size),s.awaitDrainWriters.add(t)),n.pause()),l||(l=function(t,e){return function(){const n=t._readableState;n.awaitDrainWriters===e?(M("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(M("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!t.listenerCount("data")||t.resume()}}(n,t),t.on("drain",l))}function _(e){M("ondata");const n=t.write(e);M("dest.write",n),!1===n&&p()}function h(e){if(M("onerror",e),I(),t.removeListener("error",h),0===t.listenerCount("error")){const n=t._writableState||t._readableState;n&&!n.errorEmitted?x(t,e):t.emit("error",e)}}function c(){t.removeListener("finish",T),I()}function T(){M("onfinish"),t.removeListener("close",c),I()}function I(){M("unpipe"),n.unpipe(t)}return n.on("data",_),E(t,"error",h),t.once("close",c),t.once("finish",T),t.emit("pipe",n),!0===t.writableNeedDrain?p():s.flowing||(M("pipe resume"),n.resume()),t},K.prototype.unpipe=function(t){const e=this._readableState;if(0===e.pipes.length)return this;if(!t){const t=e.pipes;e.pipes=[],this.pause();for(let e=0;e0,!1!==s.flowing&&this.resume()):"readable"===t&&(s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,M("on readable",s.length,s.reading),s.length?Q(this):s.reading||i.nextTick(nt,this))),n},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(t,e){const n=m.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(et,this),n},K.prototype.off=K.prototype.removeListener,K.prototype.removeAllListeners=function(t){const e=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(et,this),e},K.prototype.resume=function(){const t=this._readableState;return t.flowing||(M("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(it,t,e))}(this,t)),t[P]=!1,this},K.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[P]=!0,this},K.prototype.wrap=function(t){let e=!1;t.on("data",(n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())})),t.on("end",(()=>{this.push(null)})),t.on("error",(t=>{x(this,t)})),t.on("close",(()=>{this.destroy()})),t.on("destroy",(()=>{this.destroy()})),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};const n=u(t);for(let e=1;e{"use strict";const{MathFloor:i,NumberIsInteger:s}=n(4184),{validateInteger:o}=n(6283),{ERR_INVALID_ARG_VALUE:r}=n(6605).codes;let a=16384,l=16;function u(t){return t?l:a}t.exports={getHighWaterMark:function(t,e,n,o){const a=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,o,n);if(null!=a){if(!s(a)||a<0){throw new r(o?`options.${n}`:"options.highWaterMark",a)}return i(a)}return u(t.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(t,e){o(e,"value",0),t?l=e:a=e}}},208:(t,e,n)=>{"use strict";const{ObjectSetPrototypeOf:i,Symbol:s}=n(4184);t.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:o}=n(6605).codes,r=n(4992),{getHighWaterMark:a}=n(9153);i(u.prototype,r.prototype),i(u,r);const l=s("kCallback");function u(t){if(!(this instanceof u))return new u(t);const e=t?a(this,t,"readableHighWaterMark",!0):null;0===e&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),r.call(this,t),this._readableState.sync=!1,this[l]=null,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",_)}function p(t){"function"!=typeof this._flush||this.destroyed?(this.push(null),t&&t()):this._flush(((e,n)=>{e?t?t(e):this.destroy(e):(null!=n&&this.push(n),this.push(null),t&&t())}))}function _(){this._final!==p&&p.call(this)}u.prototype._final=p,u.prototype._transform=function(t,e,n){throw new o("_transform()")},u.prototype._write=function(t,e,n){const i=this._readableState,s=this._writableState,o=i.length;this._transform(t,e,((t,e)=>{t?n(t):(null!=e&&this.push(e),s.ended||o===i.length||i.length{"use strict";const{SymbolAsyncIterator:i,SymbolIterator:s,SymbolFor:o}=n(4184),r=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),u=o("nodejs.stream.writable"),p=o("nodejs.stream.disturbed"),_=o("nodejs.webstream.isClosedPromise"),d=o("nodejs.webstream.controllerErrorFunction");function h(t,e=!1){var n;return!(!t||"function"!=typeof t.pipe||"function"!=typeof t.on||e&&("function"!=typeof t.pause||"function"!=typeof t.resume)||t._writableState&&!1===(null===(n=t._readableState)||void 0===n?void 0:n.readable)||t._writableState&&!t._readableState)}function c(t){var e;return!(!t||"function"!=typeof t.write||"function"!=typeof t.on||t._readableState&&!1===(null===(e=t._writableState)||void 0===e?void 0:e.writable))}function T(t){return t&&(t._readableState||t._writableState||"function"==typeof t.write&&"function"==typeof t.on||"function"==typeof t.pipe&&"function"==typeof t.on)}function I(t){return!(!t||T(t)||"function"!=typeof t.pipeThrough||"function"!=typeof t.getReader||"function"!=typeof t.cancel)}function m(t){return!(!t||T(t)||"function"!=typeof t.getWriter||"function"!=typeof t.abort)}function E(t){return!(!t||T(t)||"object"!=typeof t.readable||"object"!=typeof t.writable)}function f(t){if(!T(t))return null;const e=t._writableState,n=t._readableState,i=e||n;return!!(t.destroyed||t[r]||null!=i&&i.destroyed)}function g(t){if(!c(t))return null;if(!0===t.writableEnded)return!0;const e=t._writableState;return(null==e||!e.errored)&&("boolean"!=typeof(null==e?void 0:e.ended)?null:e.ended)}function O(t,e){if(!h(t))return null;const n=t._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===e&&!0===n.ended&&0===n.length))}function M(t){return t&&null!=t[l]?t[l]:"boolean"!=typeof(null==t?void 0:t.readable)?null:!f(t)&&(h(t)&&t.readable&&!O(t))}function R(t){return t&&null!=t[u]?t[u]:"boolean"!=typeof(null==t?void 0:t.writable)?null:!f(t)&&(c(t)&&t.writable&&!g(t))}function A(t){return"boolean"==typeof t._closed&&"boolean"==typeof t._defaultKeepAlive&&"boolean"==typeof t._removedConnection&&"boolean"==typeof t._removedContLen}function S(t){return"boolean"==typeof t._sent100&&A(t)}t.exports={isDestroyed:f,kIsDestroyed:r,isDisturbed:function(t){var e;return!(!t||!(null!==(e=t[p])&&void 0!==e?e:t.readableDidRead||t.readableAborted))},kIsDisturbed:p,isErrored:function(t){var e,n,i,s,o,r,l,u,p,_;return!(!t||!(null!==(e=null!==(n=null!==(i=null!==(s=null!==(o=null!==(r=t[a])&&void 0!==r?r:t.readableErrored)&&void 0!==o?o:t.writableErrored)&&void 0!==s?s:null===(l=t._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==i?i:null===(u=t._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==n?n:null===(p=t._readableState)||void 0===p?void 0:p.errored)&&void 0!==e?e:null===(_=t._writableState)||void 0===_?void 0:_.errored))},kIsErrored:a,isReadable:M,kIsReadable:l,kIsClosedPromise:_,kControllerErrorFunction:d,kIsWritable:u,isClosed:function(t){if(!T(t))return null;if("boolean"==typeof t.closed)return t.closed;const e=t._writableState,n=t._readableState;return"boolean"==typeof(null==e?void 0:e.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==e?void 0:e.closed)||(null==n?void 0:n.closed):"boolean"==typeof t._closed&&A(t)?t._closed:null},isDuplexNodeStream:function(t){return!(!t||"function"!=typeof t.pipe||!t._readableState||"function"!=typeof t.on||"function"!=typeof t.write)},isFinished:function(t,e){return T(t)?!!f(t)||(!1===(null==e?void 0:e.readable)||!M(t))&&(!1===(null==e?void 0:e.writable)||!R(t)):null},isIterable:function(t,e){return null!=t&&(!0===e?"function"==typeof t[i]:!1===e?"function"==typeof t[s]:"function"==typeof t[i]||"function"==typeof t[s])},isReadableNodeStream:h,isReadableStream:I,isReadableEnded:function(t){if(!h(t))return null;if(!0===t.readableEnded)return!0;const e=t._readableState;return!(!e||e.errored)&&("boolean"!=typeof(null==e?void 0:e.ended)?null:e.ended)},isReadableFinished:O,isReadableErrored:function(t){var e,n;return T(t)?t.readableErrored?t.readableErrored:null!==(e=null===(n=t._readableState)||void 0===n?void 0:n.errored)&&void 0!==e?e:null:null},isNodeStream:T,isWebStream:function(t){return I(t)||m(t)||E(t)},isWritable:R,isWritableNodeStream:c,isWritableStream:m,isWritableEnded:g,isWritableFinished:function(t,e){if(!c(t))return null;if(!0===t.writableFinished)return!0;const n=t._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===e&&!0===n.ended&&0===n.length))},isWritableErrored:function(t){var e,n;return T(t)?t.writableErrored?t.writableErrored:null!==(e=null===(n=t._writableState)||void 0===n?void 0:n.errored)&&void 0!==e?e:null:null},isServerRequest:function(t){var e;return"boolean"==typeof t._consuming&&"boolean"==typeof t._dumped&&void 0===(null===(e=t.req)||void 0===e?void 0:e.upgradeOrConnect)},isServerResponse:S,willEmitClose:function(t){if(!T(t))return null;const e=t._writableState,n=t._readableState,i=e||n;return!i&&S(t)||!!(i&&i.autoDestroy&&i.emitClose&&!1===i.closed)},isTransformStream:E}},394:(t,e,n)=>{const i=n(5606),{ArrayPrototypeSlice:s,Error:o,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:p,Symbol:_,SymbolHasInstance:d}=n(4184);t.exports=F,F.WritableState=v;const{EventEmitter:h}=n(7007),c=n(2913).Stream,{Buffer:T}=n(8287),I=n(2430),{addAbortSignal:m}=n(153),{getHighWaterMark:E,getDefaultHighWaterMark:f}=n(9153),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:S,ERR_STREAM_NULL_VALUES:C,ERR_STREAM_WRITE_AFTER_END:L,ERR_UNKNOWN_ENCODING:y}=n(6605).codes,{errorOrDestroy:D}=I;function N(){}u(F.prototype,c.prototype),u(F,c);const b=_("kOnFinished");function v(t,e,i){"boolean"!=typeof i&&(i=e instanceof n(4992)),this.objectMode=!(!t||!t.objectMode),i&&(this.objectMode=this.objectMode||!(!t||!t.writableObjectMode)),this.highWaterMark=t?E(this,t,"writableHighWaterMark",i):f(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const s=!(!t||!1!==t.decodeStrings);this.decodeStrings=!s,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Y.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,w(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||!1!==t.emitClose,this.autoDestroy=!t||!1!==t.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[b]=[]}function w(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}function F(t){const e=this instanceof n(4992);if(!e&&!r(F,this))return new F(t);this._writableState=new v(t,this,e),t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&m(t.signal,this)),c.call(this,t),I.construct(this,(()=>{const t=this._writableState;t.writing||X(this,t),W(this,t)}))}function P(t,e,n,s){const o=t._writableState;if("function"==typeof n)s=n,n=o.defaultEncoding;else{if(n){if("buffer"!==n&&!T.isEncoding(n))throw new y(n)}else n=o.defaultEncoding;"function"!=typeof s&&(s=N)}if(null===e)throw new C;if(!o.objectMode)if("string"==typeof e)!1!==o.decodeStrings&&(e=T.from(e,n),n="buffer");else if(e instanceof T)n="buffer";else{if(!c._isUint8Array(e))throw new g("chunk",["string","Buffer","Uint8Array"],e);e=c._uint8ArrayToBuffer(e),n="buffer"}let r;return o.ending?r=new L:o.destroyed&&(r=new A("write")),r?(i.nextTick(s,r),D(t,r,!0),r):(o.pendingcb++,function(t,e,n,i,s){const o=e.objectMode?1:n.length;e.length+=o;const r=e.lengthn.bufferedIndex&&X(t,n),s?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:t,state:n},i.nextTick(x,n.afterWriteTickInfo)):U(t,n,1,o))):D(t,new M)}function x({stream:t,state:e,count:n,cb:i}){return e.afterWriteTickInfo=null,U(t,e,n,i)}function U(t,e,n,i){for(!e.ending&&!t.destroyed&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));n-- >0;)e.pendingcb--,i();e.destroyed&&B(e),W(t,e)}function B(t){if(t.writing)return;for(let n=t.bufferedIndex;n1&&t._writev){e.pendingcb-=r-1;const i=e.allNoop?N:t=>{for(let e=a;e256?(n.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}function G(t){return t.ending&&!t.destroyed&&t.constructed&&0===t.length&&!t.errored&&0===t.buffered.length&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function H(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.finalCalled=!0,function(t,e){let n=!1;function s(s){if(n)D(t,null!=s?s:M());else if(n=!0,e.pendingcb--,s){const n=e[b].splice(0);for(let t=0;t{G(e)?j(t,e):e.pendingcb--}),t,e)):G(e)&&(e.pendingcb++,j(t,e))))}function j(t,e){e.pendingcb--,e.finished=!0;const n=e[b].splice(0);for(let t=0;t{"use strict";const{ArrayIsArray:i,ArrayPrototypeIncludes:s,ArrayPrototypeJoin:o,ArrayPrototypeMap:r,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:p,NumberParseInt:_,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:c,StringPrototypeToUpperCase:T,StringPrototypeTrim:I}=n(4184),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:f,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:O,ERR_UNKNOWN_SIGNAL:M}}=n(6605),{normalizeEncoding:R}=n(798),{isAsyncFunction:A,isArrayBufferView:S}=n(798).types,C={};const L=/^[0-7]+$/;const y=m(((t,e,n=p,i=u)=>{if("number"!=typeof t)throw new f(e,"number",t);if(!a(t))throw new O(e,"an integer",t);if(ti)throw new O(e,`>= ${n} && <= ${i}`,t)})),D=m(((t,e,n=-2147483648,i=2147483647)=>{if("number"!=typeof t)throw new f(e,"number",t);if(!a(t))throw new O(e,"an integer",t);if(ti)throw new O(e,`>= ${n} && <= ${i}`,t)})),N=m(((t,e,n=!1)=>{if("number"!=typeof t)throw new f(e,"number",t);if(!a(t))throw new O(e,"an integer",t);const i=n?1:0,s=4294967295;if(ts)throw new O(e,`>= ${i} && <= ${s}`,t)}));function b(t,e){if("string"!=typeof t)throw new f(e,"string",t)}const v=m(((t,e,n)=>{if(!s(n,t)){const i=o(r(n,(t=>"string"==typeof t?`'${t}'`:c(t))),", ");throw new g(e,t,"must be one of: "+i)}}));function w(t,e){if("boolean"!=typeof t)throw new f(e,"boolean",t)}function F(t,e,n){return null!=t&&d(t,e)?t[e]:n}const P=m(((t,e,n=null)=>{const s=F(n,"allowArray",!1),o=F(n,"allowFunction",!1);if(!F(n,"nullable",!1)&&null===t||!s&&i(t)||"object"!=typeof t&&(!o||"function"!=typeof t))throw new f(e,"Object",t)})),k=m(((t,e)=>{if(null!=t&&"object"!=typeof t&&"function"!=typeof t)throw new f(e,"a dictionary",t)})),V=m(((t,e,n=0)=>{if(!i(t))throw new f(e,"Array",t);if(t.length{if(!S(t))throw new f(e,["Buffer","TypedArray","DataView"],t)}));const x=m(((t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new f(e,"AbortSignal",t)})),U=m(((t,e)=>{if("function"!=typeof t)throw new f(e,"Function",t)})),B=m(((t,e)=>{if("function"!=typeof t||A(t))throw new f(e,"Function",t)})),X=m(((t,e)=>{if(void 0!==t)throw new f(e,"undefined",t)}));const G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(t,e){if(void 0===t||!h(G,t))throw new g(e,t,'must be an array or string of format "; rel=preload; as=style"')}t.exports={isInt32:function(t){return t===(0|t)},isUint32:function(t){return t===t>>>0},parseFileMode:function(t,e,n){if(void 0===t&&(t=n),"string"==typeof t){if(null===h(L,t))throw new g(e,t,"must be a 32-bit unsigned integer or an octal string");t=_(t,8)}return N(t,e),t},validateArray:V,validateStringArray:function(t,e){V(t,e);for(let n=0;ni||(null!=n||null!=i)&&l(t))throw new O(e,`${null!=n?`>= ${n}`:""}${null!=n&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,t)},validateObject:P,validateOneOf:v,validatePlainFunction:B,validatePort:function(t,e="Port",n=!0){if("number"!=typeof t&&"string"!=typeof t||"string"==typeof t&&0===I(t).length||+t!=+t>>>0||t>65535||0===t&&!n)throw new E(e,t,n);return 0|t},validateSignalName:function(t,e="signal"){if(b(t,e),void 0===C[t]){if(void 0!==C[T(t)])throw new M(t+" (signals must use all capital letters)");throw new M(t)}},validateString:b,validateUint32:N,validateUndefined:X,validateUnion:function(t,e,n){if(!s(n,t))throw new f(e,`('${o(n,"|")}')`,t)},validateAbortSignal:x,validateLinkHeaderValue:function(t){if("string"==typeof t)return H(t,"hints"),t;if(i(t)){const e=t.length;let n="";if(0===e)return n;for(let i=0;i; rel=preload; as=style"')}}},6248:(t,e,n)=>{"use strict";const i=n(4612),s=n(105),o=i.Readable.destroy;t.exports=i.Readable,t.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,t.exports._isUint8Array=i._isUint8Array,t.exports.isDisturbed=i.isDisturbed,t.exports.isErrored=i.isErrored,t.exports.isReadable=i.isReadable,t.exports.Readable=i.Readable,t.exports.Writable=i.Writable,t.exports.Duplex=i.Duplex,t.exports.Transform=i.Transform,t.exports.PassThrough=i.PassThrough,t.exports.addAbortSignal=i.addAbortSignal,t.exports.finished=i.finished,t.exports.destroy=i.destroy,t.exports.destroy=o,t.exports.pipeline=i.pipeline,t.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get:()=>s}),t.exports.Stream=i.Stream,t.exports.default=t.exports},6605:(t,e,n)=>{"use strict";const{format:i,inspect:s,AggregateError:o}=n(798),r=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,p={};function _(t,e){if(!t)throw new p.ERR_INTERNAL_ASSERTION(e)}function d(t){let e="",n=t.length;const i="-"===t[0]?1:0;for(;n>=i+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function h(t,e,n){n||(n=Error);class s extends n{constructor(...n){super(function(t,e,n){if("function"==typeof e)return _(e.length<=n.length,`Code: ${t}; The provided arguments length (${n.length}) does not match the required ones (${e.length}).`),e(...n);const s=(e.match(/%[dfijoOs]/g)||[]).length;return _(s===n.length,`Code: ${t}; The provided arguments length (${n.length}) does not match the required ones (${s}).`),0===n.length?e:i(e,...n)}(t,e,n))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(s.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),s.prototype.code=t,s.prototype[a]=!0,p[t]=s}function c(t){const e="__node_internal_"+t.name;return Object.defineProperty(t,"name",{value:e}),t}class T extends Error{constructor(t="The operation was aborted",e=void 0){if(void 0!==e&&"object"!=typeof e)throw new p.ERR_INVALID_ARG_TYPE("options","Object",e);super(t,e),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((t,e,n)=>{_("string"==typeof t,"'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";const o=[],r=[],a=[];for(const t of e)_("string"==typeof t,"All expected entries have to be of type string"),l.includes(t)?o.push(t.toLowerCase()):u.test(t)?r.push(t):(_("object"!==t,'The value "object" should be written as "Object"'),a.push(t));if(r.length>0){const t=o.indexOf("object");-1!==t&&(o.splice(o,t,1),r.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{const t=o.pop();i+=`one of type ${o.join(", ")}, or ${t}`}}(r.length>0||a.length>0)&&(i+=" or ")}if(r.length>0){switch(r.length){case 1:i+=`an instance of ${r[0]}`;break;case 2:i+=`an instance of ${r[0]} or ${r[1]}`;break;default:{const t=r.pop();i+=`an instance of ${r.join(", ")}, or ${t}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{const t=a.pop();i+=`one of ${a.join(", ")}, or ${t}`}}if(null==n)i+=`. Received ${n}`;else if("function"==typeof n&&n.name)i+=`. Received function ${n.name}`;else if("object"==typeof n){var p;if(null!==(p=n.constructor)&&void 0!==p&&p.name)i+=`. Received an instance of ${n.constructor.name}`;else{i+=`. Received ${s(n,{depth:-1})}`}}else{let t=s(n,{colors:!1});t.length>25&&(t=`${t.slice(0,25)}...`),i+=`. Received type ${typeof n} (${t})`}return i}),TypeError),h("ERR_INVALID_ARG_VALUE",((t,e,n="is invalid")=>{let i=s(e);i.length>128&&(i=i.slice(0,128)+"...");return`The ${t.includes(".")?"property":"argument"} '${t}' ${n}. Received ${i}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((t,e,n)=>{var i;return`Expected ${t} to be returned from the "${e}" function but got ${null!=n&&null!==(i=n.constructor)&&void 0!==i&&i.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),h("ERR_MISSING_ARGS",((...t)=>{let e;_(t.length>0,"At least one arg needs to be specified");const n=t.length;switch(t=(Array.isArray(t)?t:[t]).map((t=>`"${t}"`)).join(" or "),n){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{const n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}}return`${e} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((t,e,n)=>{let i;return _(e,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?i=d(String(n)):"bigint"==typeof n?(i=String(n),(n>2n**32n||n<-(2n**32n))&&(i=d(i)),i+="n"):i=s(n),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:T,aggregateTwoErrors:c((function(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;const n=new r([e,t],e.message);return n.code=e.code,n}return t||e})),hideStackFrames:c,codes:p}},4184:t=>{"use strict";t.exports={ArrayIsArray:t=>Array.isArray(t),ArrayPrototypeIncludes:(t,e)=>t.includes(e),ArrayPrototypeIndexOf:(t,e)=>t.indexOf(e),ArrayPrototypeJoin:(t,e)=>t.join(e),ArrayPrototypeMap:(t,e)=>t.map(e),ArrayPrototypePop:(t,e)=>t.pop(e),ArrayPrototypePush:(t,e)=>t.push(e),ArrayPrototypeSlice:(t,e,n)=>t.slice(e,n),Error,FunctionPrototypeCall:(t,e,...n)=>t.call(e,...n),FunctionPrototypeSymbolHasInstance:(t,e)=>Function.prototype[Symbol.hasInstance].call(t,e),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(t,e)=>Object.defineProperties(t,e),ObjectDefineProperty:(t,e,n)=>Object.defineProperty(t,e,n),ObjectGetOwnPropertyDescriptor:(t,e)=>Object.getOwnPropertyDescriptor(t,e),ObjectKeys:t=>Object.keys(t),ObjectSetPrototypeOf:(t,e)=>Object.setPrototypeOf(t,e),Promise,PromisePrototypeCatch:(t,e)=>t.catch(e),PromisePrototypeThen:(t,e,n)=>t.then(e,n),PromiseReject:t=>Promise.reject(t),PromiseResolve:t=>Promise.resolve(t),ReflectApply:Reflect.apply,RegExpPrototypeTest:(t,e)=>t.test(e),SafeSet:Set,String,StringPrototypeSlice:(t,e,n)=>t.slice(e,n),StringPrototypeToLowerCase:t=>t.toLowerCase(),StringPrototypeToUpperCase:t=>t.toUpperCase(),StringPrototypeTrim:t=>t.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(t,e,n)=>t.set(e,n),Boolean,Uint8Array}},798:(t,e,n)=>{"use strict";const i=n(8287),{kResistStopPropagation:s,SymbolDispose:o}=n(4184),r=globalThis.AbortSignal||n(5568).AbortSignal,a=globalThis.AbortController||n(5568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,u=globalThis.Blob||i.Blob,p=void 0!==u?function(t){return t instanceof u}:function(t){return!1},_=(t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)};class d extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError("Expected input to be an Array, got "+typeof t);let e="";for(let n=0;n{t=n,e=i})),resolve:t,reject:e}},promisify:t=>new Promise(((e,n)=>{t(((t,...i)=>t?n(t):e(...i)))})),debuglog:()=>function(){},format:(t,...e)=>t.replace(/%([sdifj])/g,(function(...[t,n]){const i=e.shift();if("f"===n)return i.toFixed(6);if("j"===n)return JSON.stringify(i);if("s"===n&&"object"==typeof i){return`${i.constructor!==Object?i.constructor.name:""} {}`.trim()}return i.toString()})),inspect(t){switch(typeof t){case"string":if(t.includes("'")){if(!t.includes('"'))return`"${t}"`;if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction:t=>t instanceof l,isArrayBufferView:t=>ArrayBuffer.isView(t)},isBlob:p,deprecate:(t,e)=>t,addAbortListener:n(7007).addAbortListener||function(t,e){if(void 0===t)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);let n;return _(t,"signal"),((t,e)=>{if("function"!=typeof t)throw new ERR_INVALID_ARG_TYPE(e,"Function",t)})(e,"listener"),t.aborted?queueMicrotask((()=>e())):(t.addEventListener("abort",e,{__proto__:null,once:!0,[s]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[o](){var t;null===(t=n)||void 0===t||t()}}},AbortSignalAny:r.any||function(t){if(1===t.length)return t[0];const e=new a,n=()=>e.abort();return t.forEach((t=>{_(t,"signals"),t.addEventListener("abort",n,{once:!0})})),e.signal.addEventListener("abort",(()=>{t.forEach((t=>t.removeEventListener("abort",n)))}),{once:!0}),e.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},4612:(t,e,n)=>{const{Buffer:i}=n(8287),{ObjectDefineProperty:s,ObjectKeys:o,ReflectApply:r}=n(4184),{promisify:{custom:a}}=n(798),{streamReturningOperators:l,promiseReturningOperators:u}=n(5589),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=n(6605),_=n(6864),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=n(9153),{pipeline:c}=n(872),{destroyer:T}=n(2430),I=n(9700),m=n(105),E=n(6569),f=t.exports=n(2913).Stream;f.isDestroyed=E.isDestroyed,f.isDisturbed=E.isDisturbed,f.isErrored=E.isErrored,f.isReadable=E.isReadable,f.isWritable=E.isWritable,f.Readable=n(6566);for(const M of o(l)){const R=l[M];function g(...t){if(new.target)throw p();return f.Readable.from(r(R,this,t))}s(g,"name",{__proto__:null,value:R.name}),s(g,"length",{__proto__:null,value:R.length}),s(f.Readable.prototype,M,{__proto__:null,value:g,enumerable:!1,configurable:!0,writable:!0})}for(const A of o(u)){const S=u[A];function g(...t){if(new.target)throw p();return r(S,this,t)}s(g,"name",{__proto__:null,value:S.name}),s(g,"length",{__proto__:null,value:S.length}),s(f.Readable.prototype,A,{__proto__:null,value:g,enumerable:!1,configurable:!0,writable:!0})}f.Writable=n(394),f.Duplex=n(4992),f.Transform=n(208),f.PassThrough=n(6898),f.pipeline=c;const{addAbortSignal:O}=n(153);f.addAbortSignal=O,f.finished=I,f.destroy=T,f.compose=_,f.setDefaultHighWaterMark=d,f.getDefaultHighWaterMark=h,s(f,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),s(c,a,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),s(I,a,{__proto__:null,enumerable:!0,get:()=>m.finished}),f.Stream=f,f._isUint8Array=function(t){return t instanceof Uint8Array},f._uint8ArrayToBuffer=function(t){return i.from(t.buffer,t.byteOffset,t.byteLength)}},105:(t,e,n)=>{"use strict";const{ArrayPrototypePop:i,Promise:s}=n(4184),{isIterable:o,isNodeStream:r,isWebStream:a}=n(6569),{pipelineImpl:l}=n(872),{finished:u}=n(9700);n(4612),t.exports={finished:u,pipeline:function(...t){return new s(((e,n)=>{let s,u;const p=t[t.length-1];if(p&&"object"==typeof p&&!r(p)&&!o(p)&&!a(p)){const e=i(t);s=e.signal,u=e.end}l(t,((t,i)=>{t?n(t):e(i)}),{signal:s,end:u})}))}}},8707:(t,e,n)=>{"use strict";var i=n(2861).Buffer,s=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===s||!s(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=p,this.end=_,e=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function p(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function _(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return s>0&&(t.lastNeed=s-1),s;if(--i=0)return s>0&&(t.lastNeed=s-2),s;if(--i=0)return s>0&&(2===s?s=0:t.lastNeed=s-3),s;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},5568:t=>{"use strict";const{AbortController:e,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;t.exports=e,t.exports.AbortSignal=n,t.exports.default=e},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){var e,n,o=a(t),r=o[0],l=o[1],u=new s(function(t,e,n){return 3*(e+n)/4-n}(0,r,l)),p=0,_=l>0?r-4:r;for(n=0;n<_;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[p++]=e>>16&255,u[p++]=e>>8&255,u[p++]=255&e;2===l&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[p++]=255&e);1===l&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[p++]=e>>8&255,u[p++]=255&e);return u},e.fromByteArray=function(t){for(var e,i=t.length,s=i%3,o=[],r=16383,a=0,u=i-s;au?u:a+r));1===s?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===s&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)n[r]=o[r],i[o.charCodeAt(r)]=r;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,i){for(var s,o,r=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return r.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8287:(t,e,n)=>{"use strict"; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */const i=n(7526),s=n(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50;const r=2147483647;function a(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return _(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|T(t,e);let i=a(n);const s=i.write(t,e);s!==n&&(i=i.slice(0,s));return i}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return h(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return h(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return l.from(i,e,n);const s=function(t){if(l.isBuffer(t)){const e=0|c(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||z(t.length)?a(0):d(t);if("Buffer"===t.type&&Array.isArray(t.data))return d(t.data)}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function _(t){return p(t),a(t<0?0:0|c(t))}function d(t){const e=t.length<0?0:0|c(t.length),n=a(e);for(let i=0;i=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function T(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(t).length;default:if(s)return i?-1:j(t).length;e=(""+e).toLowerCase(),s=!0}}function I(t,e,n){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return y(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function E(t,e,n,i,s){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=s?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:f(t,e,n,i,s);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):f(t,[e],n,i,s);throw new TypeError("val must be string, number or Buffer")}function f(t,e,n,i,s){let o,r=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;r=2,a/=2,l/=2,n/=2}function u(t,e){return 1===r?t[e]:t.readUInt16BE(e*r)}if(s){let i=-1;for(o=n;oa&&(n=a-l),o=n;o>=0;o--){let n=!0;for(let i=0;is&&(i=s):i=s;const o=e.length;let r;for(i>o/2&&(i=o/2),r=0;r>8,s=n%256,o.push(s),o.push(i);return o}(e,t.length-n),t,n,i)}function S(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);const i=[];let s=e;for(;s239?4:e>223?3:e>191?2:1;if(s+r<=n){let n,i,a,l;switch(r){case 1:e<128&&(o=e);break;case 2:n=t[s+1],128==(192&n)&&(l=(31&e)<<6|63&n,l>127&&(o=l));break;case 3:n=t[s+1],i=t[s+2],128==(192&n)&&128==(192&i)&&(l=(15&e)<<12|(63&n)<<6|63&i,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=t[s+1],i=t[s+2],a=t[s+3],128==(192&n)&&128==(192&i)&&128==(192&a)&&(l=(15&e)<<18|(63&n)<<12|(63&i)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,r=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),s+=r}return function(t){const e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);let n="",i=0;for(;ii.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(i,s)):Uint8Array.prototype.set.call(i,e,s);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,s)}s+=e.length}return i},l.byteLength=T,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;en&&(t+=" ... "),""},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(t,e,n,i,s){if($(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(this===t)return 0;let o=(s>>>=0)-(i>>>=0),r=(n>>>=0)-(e>>>=0);const a=Math.min(o,r),u=this.slice(i,s),p=t.slice(e,n);for(let t=0;t>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const s=this.length-e;if((void 0===n||n>s)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return O(this,t,e,n);case"ascii":case"latin1":case"binary":return M(this,t,e,n);case"base64":return R(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const L=4096;function y(t,e,n){let i="";n=Math.min(t.length,n);for(let s=e;si)&&(n=i);let s="";for(let i=e;in)throw new RangeError("Trying to access beyond buffer length")}function w(t,e,n,i,s,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||et.length)throw new RangeError("Index out of range")}function F(t,e,n,i,s){X(e,i,s,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let r=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r,n}function P(t,e,n,i,s){X(e,i,s,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let r=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=r,r>>=8,t[n+2]=r,r>>=8,t[n+1]=r,r>>=8,t[n]=r,n+8}function k(t,e,n,i,s,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,n,i,o){return e=+e,n>>>=0,o||k(t,0,n,4),s.write(t,e,n,i,23,4),n+4}function Y(t,e,n,i,o){return e=+e,n>>>=0,o||k(t,0,n,8),s.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||v(t,e,this.length);let i=this[t],s=1,o=0;for(;++o>>=0,e>>>=0,n||v(t,e,this.length);let i=this[t+--e],s=1;for(;e>0&&(s*=256);)i+=this[t+--e]*s;return i},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=J((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,s=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(i)+(BigInt(s)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],s=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(i)<>>=0,e>>>=0,n||v(t,e,this.length);let i=this[t],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||v(t,e,this.length);let i=e,s=1,o=this[t+--i];for(;i>0&&(s*=256);)o+=this[t+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=J((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(i)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<>>=0,e||v(t,4,this.length),s.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),s.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),s.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),s.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e>>>=0,n>>>=0,!i){w(this,t,e,n,Math.pow(2,8*n)-1,0)}let s=1,o=0;for(this[e]=255&t;++o>>=0,n>>>=0,!i){w(this,t,e,n,Math.pow(2,8*n)-1,0)}let s=n-1,o=1;for(this[e+s]=255&t;--s>=0&&(o*=256);)this[e+s]=t/o&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=J((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=J((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*n-1);w(this,t,e,n,i-1,-i)}let s=0,o=1,r=0;for(this[e]=255&t;++s>>=0,!i){const i=Math.pow(2,8*n-1);w(this,t,e,n,i-1,-i)}let s=n-1,o=1,r=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===r&&0!==this[e+s+1]&&(r=1),this[e+s]=(t/o|0)-r&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=J((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=J((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return Y(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return Y(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s=i+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function X(t,e,n,i,s,o){if(t>n||t3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${e}${i} and <= ${n}${i}`,new x.ERR_OUT_OF_RANGE("value",s,t)}!function(t,e,n){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||H(e,t.length-(n+1))}(i,s,o)}function G(t,e){if("number"!=typeof t)throw new x.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,n){if(Math.floor(t)!==t)throw G(t,n),new x.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new x.ERR_BUFFER_OUT_OF_BOUNDS;throw new x.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(t,e,n){let i=`The value of "${t}" is out of range.`,s=n;return Number.isInteger(n)&&Math.abs(n)>2**32?s=B(String(n)):"bigint"==typeof n&&(s=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(s=B(s)),s+="n"),i+=` It must be ${e}. Received ${s}`,i}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function j(t,e){let n;e=e||1/0;const i=t.length;let s=null;const o=[];for(let r=0;r55295&&n<57344){if(!s){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(r+1===i){(e-=3)>-1&&o.push(239,191,189);continue}s=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(e-=3)>-1&&o.push(239,191,189);if(s=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function K(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,i){let s;for(s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}const Q=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let s=0;s<16;++s)e[i+s]=t[n]+t[s]}return e}();function J(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function i(){}function s(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,o||t,r),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,s=[];if(0===this._eventsCount)return s;for(i in t=this._events)e.call(t,i)&&s.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,o=i.length,r=new Array(o);s{"use strict";var e,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(n,i){function s(n){t.removeListener(e,o),i(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",s),n([].slice.call(arguments))}T(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&T(t,"error",e,n)}(t,s,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var r=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,n,i){var s,o,r,u;if(a(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),r=o[e]),void 0===r)r=o[e]=n,++t._eventsCount;else if("function"==typeof r?r=o[e]=i?[n,r]:[r,n]:i?r.unshift(n):r.push(n),(s=l(t))>0&&r.length>s&&!r.warned){r.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=e,p.count=r.length,u=p,console&&console.warn&&console.warn(u)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=p.bind(i);return s.listener=n,i.wrapFn=s,s}function d(t,e,n){var i=t._events;if(void 0===i)return[];var s=i[e];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var l=o[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,p=c(l,u);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){r=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},251:(t,e)=>{ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ e.read=function(t,e,n,i,s){var o,r,a=8*s-i-1,l=(1<>1,p=-7,_=n?s-1:0,d=n?-1:1,h=t[e+_];for(_+=d,o=h&(1<<-p)-1,h>>=-p,p+=a;p>0;o=256*o+t[e+_],_+=d,p-=8);for(r=o&(1<<-p)-1,o>>=-p,p+=i;p>0;r=256*r+t[e+_],_+=d,p-=8);if(0===o)o=1-u;else{if(o===l)return r?NaN:1/0*(h?-1:1);r+=Math.pow(2,i),o-=u}return(h?-1:1)*r*Math.pow(2,o-i)},e.write=function(t,e,n,i,s,o){var r,a,l,u=8*o-s-1,p=(1<>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,c=i?1:-1,T=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,r=p):(r=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-r))<1&&(r--,l*=2),(e+=r+_>=1?d/l:d*Math.pow(2,1-_))*l>=2&&(r++,l/=2),r+_>=p?(a=0,r=p):r+_>=1?(a=(e*l-1)*Math.pow(2,s),r+=_):(a=e*Math.pow(2,_-1)*Math.pow(2,s),r=0));s>=8;t[n+h]=255&a,h+=c,a/=256,s-=8);for(r=r<0;t[n+h]=255&r,h+=c,r/=256,u-=8);t[n+h-c]|=128*T}},5606:t=>{var e,n,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(t){if(e===setTimeout)return setTimeout(t,0);if((e===s||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:s}catch(t){e=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var a,l=[],u=!1,p=-1;function _(){u&&a&&(u=!1,a.length?l=a.concat(l):p=-1,l.length&&d())}function d(){if(!u){var t=r(_);u=!0;for(var e=l.length;e;){for(a=l,l=[];++p1)for(var n=1;n{"use strict";n.d(e,{D:()=>i});var i=function(){function t(t){var e=this;void 0===t&&(t=!1),this.ignoreMultipleSettles=t,this.isSettled=!1,this.promise=new Promise((function(t,n){e.resolveCallback=t,e.rejectCallback=n}))}return t.prototype.markAsSettled=function(){var t=this.isSettled;if(t&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!t},Object.defineProperty(t.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),t.prototype.resolve=function(t){this.markAsSettled()&&this.resolveCallback(t)},t.prototype.reject=function(t){this.markAsSettled()&&this.rejectCallback(t)},t}()},2861:(t,e,n)=>{ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var i=n(8287),s=i.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function r(t,e,n){return s(t,e,n)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=r),r.prototype=Object.create(s.prototype),o(s,r),r.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,n)},r.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=s(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},r.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},r.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},6944:t=>{"use strict";t.exports=path}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var s=2&e&&t;"object"==typeof s&&!~leafPrototypes.indexOf(s);s=getProto(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,__webpack_require__.d(n,i),n},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.f={},__webpack_require__.e=t=>Promise.all(Object.keys(__webpack_require__.f).reduce(((e,n)=>(__webpack_require__.f[n](t,e),e)),[])),__webpack_require__.u=t=>t+".bundle."+{38:"8f8d27e0",97:"2c190343",195:"9cae47ea",211:"788652b1",317:"a52389ac",837:"d262d1fb",950:"945b23cb",960:"3ea6f3cd",974:"0d9230d6"}[t]+".js",__webpack_require__.miniCssF=t=>"styles/"+t+".45554be0.css",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(t,e,n,i)=>{if(inProgress[t])inProgress[t].push(e);else{var s,o;if(void 0!==n)for(var r=document.getElementsByTagName("script"),a=0;a{s.onerror=s.onload=null,clearTimeout(p);var i=inProgress[t];if(delete inProgress[t],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((t=>t(n))),e)return e(n)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),o&&document.head.appendChild(s)}},__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;__webpack_require__.g.importScripts&&(t=__webpack_require__.g.location+"");var e=__webpack_require__.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=t})(),(()=>{if("undefined"!=typeof document){var t=t=>new Promise(((e,n)=>{var i=__webpack_require__.miniCssF(t),s=__webpack_require__.p+i;if(((t,e)=>{for(var n=document.getElementsByTagName("link"),i=0;i{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",__webpack_require__.nc&&(o.nonce=__webpack_require__.nc),o.onerror=o.onload=n=>{if(o.onerror=o.onload=null,"load"===n.type)i();else{var r=n&&n.type,a=n&&n.target&&n.target.href||e,l=new Error("Loading CSS chunk "+t+" failed.\n("+r+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=r,l.request=a,o.parentNode&&o.parentNode.removeChild(o),s(l)}},o.href=e,n?n.parentNode.insertBefore(o,n.nextSibling):document.head.appendChild(o)})(t,s,null,e,n)})),e={792:0};__webpack_require__.f.miniCss=(n,i)=>{e[n]?i.push(e[n]):0!==e[n]&&{317:1}[n]&&i.push(e[n]=t(n).then((()=>{e[n]=0}),(t=>{throw delete e[n],t})))}}})(),(()=>{var t={792:0};__webpack_require__.f.j=(e,n)=>{var i=__webpack_require__.o(t,e)?t[e]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise(((n,s)=>i=t[e]=[n,s]));n.push(i[2]=s);var o=__webpack_require__.p+__webpack_require__.u(e),r=new Error;__webpack_require__.l(o,(n=>{if(__webpack_require__.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",r.name="ChunkLoadError",r.type=s,r.request=o,i[1](r)}}),"chunk-"+e,e)}};var e=(e,n)=>{var i,s,[o,r,a]=n,l=0;if(o.some((e=>0!==t[e]))){for(i in r)__webpack_require__.o(r,i)&&(__webpack_require__.m[i]=r[i]);if(a)a(__webpack_require__)}for(e&&e(n);l{"use strict";var t={};__webpack_require__.r(t),__webpack_require__.d(t,{controls_type:()=>It,controls_typeLists:()=>mt,lists_zip:()=>Et,lists_zip_container:()=>ft,lists_zip_item:()=>gt,unpack_iterable_object:()=>Ot,variables_change:()=>ct,variables_get:()=>dt,variables_global:()=>Tt,variables_set:()=>ht});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{base_setup:()=>At,controls_delay:()=>St,controls_end_program:()=>Ct,controls_except:()=>xt,controls_finally:()=>Ut,controls_flow_statements:()=>vt,controls_for:()=>wt,controls_forEach:()=>Dt,controls_for_range:()=>Ft,controls_if:()=>Lt,controls_if_else:()=>Vt,controls_if_elseif:()=>kt,controls_if_if:()=>Pt,controls_lambda:()=>Xt,controls_main:()=>Rt,controls_pass:()=>Gt,controls_range:()=>yt,controls_repeat_ext:()=>Bt,controls_thread:()=>Ht,controls_try:()=>Yt,controls_try_finally:()=>bt,controls_whileUntil:()=>Nt,datetime_fromtimestamp:()=>zt,do_while:()=>Wt,garbage_collection:()=>jt,gene_unique_identifier:()=>Qt,get_mem_alloc:()=>Kt,get_mem_free:()=>qt,get_unique_identifier:()=>$t});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{base_map:()=>Ee,generate_cartesian_product:()=>ge,math_arithmetic:()=>ne,math_bit:()=>se,math_constant:()=>te,math_constant_mp:()=>ee,math_constrain:()=>_e,math_dec:()=>re,math_degree_to_radian:()=>Me,math_indexer_number:()=>he,math_map:()=>de,math_max_min:()=>le,math_number:()=>Zt,math_number_base_conversion:()=>ue,math_radian_to_degree:()=>Oe,math_random:()=>pe,math_random_seed:()=>ce,math_round:()=>Te,math_selfcalcu:()=>ie,math_to_int:()=>ae,math_trig:()=>oe,text_to_number:()=>Ie,text_to_number_skulpt:()=>me,turn_to_int:()=>fe});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{ascii_to_char:()=>ye,char_to_ascii:()=>De,number_to_text:()=>Ne,os_system:()=>en,text:()=>Ae,text_capital:()=>xe,text_center:()=>Ue,text_char:()=>Ce,text_char_at:()=>we,text_char_at2:()=>ve,text_char_at3:()=>Qe,text_compareTo:()=>ze,text_compare_to:()=>Ye,text_create_with_container:()=>Ke,text_create_with_item:()=>qe,text_encode:()=>Ze,text_equals_starts_ends:()=>Ve,text_eval:()=>tn,text_find:()=>Be,text_format:()=>je,text_format_noreturn:()=>Je,text_join:()=>Le,text_join_seq:()=>Xe,text_length:()=>be,text_random_char:()=>Fe,text_replace:()=>Ge,text_split:()=>He,text_strip:()=>We,text_substring:()=>ke,text_substring2:()=>Pe,text_substring3:()=>$e,text_textarea:()=>Se});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{ENUMERATE:()=>Yn,content_in_lists:()=>Un,enumerate:()=>xn,list_many_input:()=>Sn,list_tolist:()=>Dn,list_tolist2:()=>Vn,list_trig:()=>Mn,lists_2d_get_col_row_data:()=>an,lists_2d_get_data_with_col_row:()=>rn,lists_append_extend:()=>hn,lists_change_to:()=>An,lists_change_to_general:()=>Ln,lists_clear:()=>En,lists_create_with:()=>ln,lists_create_with2:()=>Nn,lists_create_with_container:()=>pn,lists_create_with_item:()=>_n,lists_create_with_noreturn:()=>Cn,lists_create_with_text:()=>un,lists_create_with_text2:()=>bn,lists_del_general:()=>yn,lists_find:()=>On,lists_getIndex3:()=>vn,lists_getSublist3:()=>wn,lists_get_index:()=>sn,lists_get_random_item:()=>cn,lists_get_random_sublist:()=>Tn,lists_get_sublist:()=>on,lists_insert_value:()=>In,lists_insert_value2:()=>Pn,lists_pop:()=>gn,lists_remove_at:()=>fn,lists_remove_at2:()=>kn,lists_reverse:()=>mn,lists_setIndex3:()=>Fn,lists_set_index:()=>dn,lists_sort:()=>Rn});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{dicts_add_change_del:()=>ni,dicts_add_or_change:()=>qn,dicts_clear:()=>Qn,dicts_create_with:()=>Xn,dicts_create_with_container:()=>Gn,dicts_create_with_item:()=>Hn,dicts_create_with_noreturn:()=>oi,dicts_deldict:()=>ei,dicts_delete:()=>$n,dicts_get:()=>jn,dicts_get_default:()=>Kn,dicts_items:()=>Jn,dicts_keys:()=>Wn,dicts_length:()=>ti,dicts_pop:()=>ii,dicts_setdefault:()=>si,dicts_to_json:()=>ai,dicts_to_json2:()=>pi,dicts_to_to:()=>ui,dicts_todict:()=>ri,dicts_update:()=>zn,dicts_values:()=>Zn,json_to_dicts:()=>li});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{logic_boolean:()=>Ii,logic_compare:()=>di,logic_compare_continous:()=>hi,logic_is:()=>gi,logic_is_in:()=>fi,logic_negate:()=>Ti,logic_null:()=>mi,logic_operation:()=>ci,logic_tobool:()=>Oi,logic_true_or_false:()=>Ei});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{sdcard_mount:()=>Hi,sdcard_use_spi_init:()=>Gi,storage_can_write_ornot:()=>Ni,storage_change_dir:()=>Bi,storage_close_file:()=>vi,storage_delete_file:()=>Fi,storage_file_seek:()=>Vi,storage_file_tell:()=>ki,storage_file_write:()=>Ci,storage_fileopen:()=>Ri,storage_fileopen_new:()=>Ai,storage_fileopen_new_encoding:()=>Si,storage_get_a_line:()=>Di,storage_get_contents:()=>yi,storage_get_contents_without_para:()=>Li,storage_get_current_dir:()=>Yi,storage_get_file_size:()=>Pi,storage_get_filename:()=>bi,storage_is_file:()=>Xi,storage_list_all_files:()=>wi,storage_make_dir:()=>xi,storage_open_file_with_os:()=>Mi,storage_rename:()=>Ui});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{procedures_callnoreturn:()=>$i,procedures_callreturn:()=>zi,procedures_defnoreturn:()=>Wi,procedures_defreturn:()=>ji,procedures_ifreturn:()=>Qi,procedures_mutatorarg:()=>qi,procedures_mutatorcontainer:()=>Ki,procedures_return:()=>Ji});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{tuple_change_to:()=>ps,tuple_create_with:()=>ts,tuple_create_with_container:()=>es,tuple_create_with_item:()=>ns,tuple_create_with_noreturn:()=>cs,tuple_create_with_text2:()=>is,tuple_create_with_text_return:()=>ss,tuple_del:()=>as,tuple_find:()=>_s,tuple_getIndex:()=>os,tuple_getSublist:()=>hs,tuple_get_random_item:()=>Is,tuple_get_sublist:()=>Ts,tuple_input:()=>Es,tuple_join:()=>ls,tuple_length:()=>rs,tuple_max:()=>us,tuple_totuple:()=>ms,tuple_trig:()=>ds});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{set_add_discard:()=>ys,set_clear:()=>Ss,set_create_with:()=>gs,set_create_with_container:()=>Os,set_create_with_item:()=>Ms,set_create_with_text_return:()=>bs,set_length:()=>Rs,set_operate:()=>Cs,set_operate_update:()=>Ls,set_pop:()=>As,set_sub:()=>Ds,set_toset:()=>vs,set_update:()=>Ns});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{html_content:()=>Vs,html_content_more:()=>Ys,html_document:()=>Fs,html_form:()=>Us,html_head_body:()=>ks,html_style:()=>xs,html_style_color:()=>Xs,html_style_content:()=>Bs,html_text:()=>Gs,html_title:()=>Ps});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{attribute_access:()=>io,function_call:()=>to,function_call_container:()=>eo,function_call_item:()=>no,raw_block:()=>js,raw_empty:()=>qs,raw_expression:()=>Ks,raw_table:()=>Ws,text_comment:()=>$s,text_print_multiple:()=>Qs,text_print_multiple_container:()=>Js,text_print_multiple_item:()=>Zs,type_check:()=>zs});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{controls_type:()=>lo,controls_typeLists:()=>uo,lists_zip:()=>po,unpack_iterable_object:()=>_o,variables_change:()=>ro,variables_get:()=>so,variables_global:()=>ao,variables_set:()=>oo});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{Panic_with_status_code:()=>Mo,base_setup:()=>co,controls_delay:()=>Oo,controls_flow_statements:()=>go,controls_for:()=>mo,controls_forEach:()=>Lo,controls_for_range:()=>Eo,controls_if:()=>To,controls_interrupts:()=>So,controls_lambda:()=>Do,controls_main:()=>ho,controls_millis:()=>Ro,controls_nointerrupts:()=>Co,controls_pass:()=>bo,controls_range:()=>yo,controls_repeat:()=>xo,controls_repeat_ext:()=>Fo,controls_thread:()=>vo,controls_try_finally:()=>Io,controls_whileUntil:()=>fo,datetime_fromtimestamp:()=>Uo,do_while:()=>wo,garbage_collection:()=>Po,gene_unique_identifier:()=>Bo,get_mem_alloc:()=>ko,get_mem_free:()=>Vo,get_unique_identifier:()=>Yo,reset:()=>Ao,time_sleep:()=>No});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{base_map:()=>lr,generate_cartesian_product:()=>pr,math_arithmetic:()=>jo,math_bit:()=>Wo,math_constant:()=>Go,math_constant_mp:()=>Ho,math_constrain:()=>er,math_dec:()=>zo,math_degree_to_radian:()=>dr,math_indexer_number:()=>sr,math_map:()=>tr,math_max_min:()=>Jo,math_number:()=>Xo,math_number_base_conversion:()=>nr,math_radian_to_degree:()=>_r,math_random:()=>Zo,math_random_seed:()=>ir,math_round:()=>or,math_selfcalcu:()=>Ko,math_single:()=>qo,math_to_int:()=>Qo,math_trig:()=>$o,text_to_number:()=>rr,text_to_number_skulpt:()=>ar,turn_to_int:()=>ur});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{ascii_to_char:()=>mr,char_to_ascii:()=>Er,number_to_text:()=>fr,os_system:()=>Xr,text:()=>hr,text_capital:()=>yr,text_center:()=>Dr,text_char:()=>Tr,text_char_at:()=>Mr,text_char_at2:()=>Or,text_char_at3:()=>xr,text_compareTo:()=>Yr,text_compare_to:()=>Sr,text_encode:()=>Ur,text_equals_starts_ends:()=>Ar,text_eval:()=>Br,text_find:()=>Nr,text_format:()=>Pr,text_format_noreturn:()=>kr,text_join:()=>Ir,text_join_seq:()=>br,text_length:()=>gr,text_random_char:()=>Rr,text_replace:()=>vr,text_split:()=>wr,text_strip:()=>Fr,text_substring:()=>Lr,text_substring2:()=>Cr,text_substring3:()=>Vr,text_textarea:()=>cr});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{content_in_lists:()=>Ma,enumerate:()=>Oa,list_many_input:()=>la,list_tolist:()=>fa,list_tolist2:()=>ga,list_trig:()=>oa,lists_2d_get_col_row_data:()=>Wr,lists_2d_get_data_with_col_row:()=>Hr,lists_append_extend:()=>zr,lists_change_to:()=>aa,lists_change_to_general:()=>pa,lists_clear:()=>ea,lists_create_with:()=>jr,lists_create_with2:()=>da,lists_create_with_noreturn:()=>ua,lists_create_with_text:()=>Kr,lists_create_with_text2:()=>ha,lists_del_general:()=>_a,lists_find:()=>na,lists_getIndex3:()=>ca,lists_getSublist3:()=>Ta,lists_get_index:()=>qr,lists_get_random_item:()=>Qr,lists_get_random_sublist:()=>Jr,lists_get_sublist:()=>Gr,lists_insert_value:()=>Zr,lists_insert_value2:()=>ma,lists_pop:()=>sa,lists_remove_at:()=>ia,lists_remove_at2:()=>Ea,lists_reverse:()=>ta,lists_setIndex3:()=>Ia,lists_set_index:()=>$r,lists_sort:()=>ra});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{dicts_add_change_del:()=>Pa,dicts_add_or_change:()=>La,dicts_clear:()=>Na,dicts_create_with:()=>Ra,dicts_create_with_noreturn:()=>Ya,dicts_deldict:()=>Fa,dicts_delete:()=>ya,dicts_get:()=>Sa,dicts_get_default:()=>Ca,dicts_items:()=>ba,dicts_keys:()=>Aa,dicts_length:()=>wa,dicts_pop:()=>ka,dicts_setdefault:()=>Va,dicts_to_json:()=>Ua,dicts_to_json2:()=>Ga,dicts_to_to:()=>Xa,dicts_todict:()=>xa,dicts_update:()=>Da,dicts_values:()=>va,json_to_dicts:()=>Ba});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{logic_boolean:()=>qa,logic_compare:()=>Ha,logic_compare_continous:()=>Wa,logic_is:()=>Ja,logic_is_in:()=>Qa,logic_negate:()=>Ka,logic_null:()=>$a,logic_operation:()=>ja,logic_tobool:()=>Za,logic_true_or_false:()=>za});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{sdcard_mount:()=>Ml,sdcard_use_spi_init:()=>Ol,storage_can_write_ornot:()=>ll,storage_change_dir:()=>Il,storage_close_file:()=>pl,storage_delete_file:()=>dl,storage_file_seek:()=>Tl,storage_file_tell:()=>cl,storage_file_write:()=>sl,storage_fileopen:()=>el,storage_fileopen_new:()=>nl,storage_fileopen_new_encoding:()=>il,storage_get_a_line:()=>al,storage_get_contents:()=>rl,storage_get_contents_without_para:()=>ol,storage_get_current_dir:()=>ml,storage_get_file_size:()=>hl,storage_get_filename:()=>ul,storage_is_file:()=>gl,storage_list_all_files:()=>_l,storage_make_dir:()=>El,storage_open_file_with_os:()=>tl,storage_rename:()=>fl});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{procedures_callnoreturn:()=>Cl,procedures_callreturn:()=>Sl,procedures_defnoreturn:()=>Al,procedures_defreturn:()=>Rl,procedures_ifreturn:()=>Ll,procedures_return:()=>yl});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{tuple_change_to:()=>Vl,tuple_create_with:()=>Dl,tuple_create_with_noreturn:()=>Bl,tuple_create_with_text2:()=>Nl,tuple_create_with_text_return:()=>bl,tuple_del:()=>Fl,tuple_find:()=>Yl,tuple_getIndex:()=>vl,tuple_getSublist:()=>Ul,tuple_get_random_item:()=>Gl,tuple_get_sublist:()=>Xl,tuple_input:()=>Wl,tuple_join:()=>Pl,tuple_length:()=>wl,tuple_max:()=>kl,tuple_totuple:()=>Hl,tuple_trig:()=>xl});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{set_add_discard:()=>Jl,set_clear:()=>$l,set_create_with:()=>jl,set_create_with_text_return:()=>eu,set_length:()=>Kl,set_operate:()=>zl,set_operate_update:()=>Ql,set_pop:()=>ql,set_sub:()=>Zl,set_toset:()=>nu,set_update:()=>tu});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{html_content:()=>ru,html_content_more:()=>au,html_document:()=>iu,html_form:()=>uu,html_head_body:()=>ou,html_style:()=>lu,html_style_content:()=>pu,html_text:()=>_u,html_title:()=>su});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{attribute_access:()=>Eu,function_call:()=>mu,raw_block:()=>du,raw_empty:()=>cu,raw_expression:()=>hu,raw_table:()=>Tu,type_check:()=>Iu});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{AI_ChooseAndGet:()=>Ru,AI_Face_match:()=>Du,AI_ImageClassify:()=>Lu,AI_ImageClassify_Func:()=>yu,AI_Nlp:()=>vu,AI_Nlp_Func:()=>Fu,AI_Nlp_Func_sim:()=>Pu,AI_Nlp_Sim:()=>wu,AI_Nlp_Topic:()=>ku,AI_Nlp_newsSummary:()=>Vu,AI_Ocr:()=>Nu,AI_Ocr_Func:()=>bu,AI_Speech_asr:()=>Cu,AI_Speech_synthesis:()=>Su,AI_audio:()=>Yu,AI_client:()=>Au,AI_photo:()=>xu,AI_result:()=>Uu});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{algorithm_add_path:()=>Ku,algorithm_add_school:()=>Gu,algorithm_all_books:()=>up,algorithm_all_books_sequence:()=>pp,algorithm_book_scale:()=>Mp,algorithm_check_feet:()=>wp,algorithm_chick_calculate:()=>vp,algorithm_color_seclet:()=>Qp,algorithm_current_school:()=>Zu,algorithm_del_path:()=>qu,algorithm_delete_book:()=>Ep,algorithm_delete_books:()=>fp,algorithm_delete_books2:()=>gp,algorithm_divide_books:()=>Ip,algorithm_find_path:()=>Hu,algorithm_first_book:()=>_p,algorithm_fz_calc:()=>Vp,algorithm_fz_calc_first_min:()=>Yp,algorithm_fz_compare:()=>xp,algorithm_fz_move:()=>Bp,algorithm_fz_set_min:()=>Up,algorithm_get_book_num:()=>Cp,algorithm_get_current_location:()=>$p,algorithm_get_half_books:()=>mp,algorithm_hxdb_add:()=>jp,algorithm_hxdb_init_soldier:()=>Gp,algorithm_hxdb_last_line:()=>Wp,algorithm_hxdb_result:()=>Kp,algorithm_hxdb_stand_in_line:()=>Hp,algorithm_init_fzsf:()=>kp,algorithm_init_hxdb:()=>Xp,algorithm_init_jttl:()=>Dp,algorithm_move_recent:()=>ip,algorithm_new_path:()=>Wu,algorithm_next_book:()=>cp,algorithm_no_left:()=>zu,algorithm_no_path:()=>tp,algorithm_no_ring2:()=>dp,algorithm_not_home:()=>sp,algorithm_not_school:()=>op,algorithm_number_add:()=>Ap,algorithm_number_zero:()=>Rp,algorithm_prepare:()=>Xu,algorithm_prepare2:()=>Ju,algorithm_prepare_2_1:()=>ep,algorithm_prepare_2_2:()=>np,algorithm_print_book2:()=>Op,algorithm_print_divide:()=>yp,algorithm_print_jttl_answer:()=>Fp,algorithm_print_number:()=>Sp,algorithm_print_path:()=>Qu,algorithm_print_path2:()=>rp,algorithm_print_sequence:()=>Lp,algorithm_rabbit_add:()=>Pp,algorithm_rabbit_number_in_range:()=>bp,algorithm_rabbit_zero:()=>Np,algorithm_return_path:()=>$u,algorithm_set_path:()=>ju,algorithm_two_left:()=>Tp,algorithm_void_path:()=>zp,algorithm_yes_ring2:()=>hp,hanoi_init:()=>ap,hanoi_init_offline:()=>qp,hanoi_move:()=>lp});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{requests_attribute:()=>n_,requests_get:()=>t_,requests_get_old:()=>Zp,requests_method:()=>i_,requests_post:()=>e_});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{cv_destroy_all:()=>u_,cv_face_classifier:()=>d_,cv_face_detect:()=>h_,cv_face_detect_all:()=>c_,cv_line_rect:()=>p_,cv_read_image:()=>o_,cv_show_image:()=>r_,cv_text:()=>__,cv_waitkey:()=>l_,cv_write_image:()=>a_});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{array_create:()=>b_,array_toarray:()=>W_,dataframe_aggregate_func:()=>Ud,dataframe_create:()=>E_,dataframe_create_from_index:()=>g_,dataframe_create_from_one_index:()=>f_,dataframe_fillna:()=>Cd,dataframe_get:()=>X_,dataframe_groupby:()=>xd,dataframe_head_tail:()=>Vd,dataframe_info:()=>Ld,dataframe_median:()=>Sd,dataframe_select:()=>Yd,dataframe_sort_values:()=>kd,matrix_multiplication:()=>Rd,matrix_transpose:()=>Md,numpy_argmin_template_match:()=>cd,numpy_astype:()=>_d,numpy_c_:()=>gd,numpy_dot:()=>bd,numpy_linalg_det:()=>Od,numpy_linalg_inv:()=>Ad,numpy_max:()=>Dd,numpy_mean:()=>Td,numpy_mean_digit:()=>hd,numpy_min:()=>yd,numpy_ones:()=>fd,numpy_random_random:()=>Fd,numpy_reshape:()=>pd,numpy_shape:()=>ud,numpy_size:()=>Nd,numpy_square:()=>vd,numpy_std:()=>Id,numpy_sum:()=>wd,numpy_trig:()=>x_,pandas_drop_columns:()=>Ed,pandas_dropna:()=>md,pandas_readcsv:()=>B_,pl_axes:()=>L_,pl_bar:()=>P_,pl_hist:()=>V_,pl_label:()=>N_,pl_legend:()=>y_,pl_pie:()=>k_,pl_plot:()=>S_,pl_plot_bar:()=>v_,pl_plot_easy:()=>A_,pl_plot_scatter:()=>w_,pl_plot_xy:()=>F_,pl_savefig:()=>G_,pl_show:()=>C_,pl_subplot:()=>U_,pl_text:()=>H_,pl_ticks:()=>Y_,pl_title:()=>D_,plot_axes:()=>$_,plot_bar:()=>nd,plot_cla:()=>Bd,plot_hist:()=>sd,plot_label:()=>J_,plot_legend:()=>z_,plot_pie:()=>id,plot_plot:()=>K_,plot_plot_bar:()=>Z_,plot_plot_easy:()=>j_,plot_plot_scatter:()=>td,plot_plot_xy:()=>ed,plot_savefig:()=>ad,plot_show:()=>q_,plot_subplot:()=>rd,plot_text:()=>ld,plot_ticks:()=>od,plot_title:()=>Q_,py_sum:()=>Pd,pylab_imshow:()=>dd,series_create:()=>I_,series_create_from_index:()=>m_,series_create_from_text:()=>O_,series_get_num:()=>R_,series_index_value:()=>M_});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{ds_add_node_by_attr:()=>zd,ds_add_node_by_name:()=>$d,ds_create_linkedlist:()=>Gd,ds_create_linkedlist_container:()=>Hd,ds_create_linkedlist_item:()=>Wd,ds_create_node:()=>jd,ds_del_node_by_attr:()=>Jd,ds_del_node_by_name:()=>Qd,ds_get_node_attr:()=>Kd,ds_reverse_linkedlist:()=>Zd,ds_set_node_attr:()=>qd});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{factory_block:()=>ph,factory_block_return:()=>_h,factory_block_return_with_textarea:()=>hh,factory_block_with_textarea:()=>dh,factory_callMethod_noreturn:()=>lh,factory_callMethod_return:()=>uh,factory_create_with_container:()=>sh,factory_create_with_item:()=>oh,factory_declare:()=>ah,factory_from_import:()=>eh,factory_function_noreturn:()=>ih,factory_function_return:()=>rh,factory_import:()=>nh});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{hardware_arduino_analog_read:()=>gh,hardware_arduino_analog_write:()=>fh,hardware_arduino_digital_read:()=>Eh,hardware_arduino_digital_write:()=>mh,hardware_arduino_start:()=>Th,inout_highlow:()=>Ih});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{inout_input:()=>Oh,inout_print:()=>Mh,inout_print_container:()=>yh,inout_print_end:()=>Ah,inout_print_inline:()=>Rh,inout_print_item:()=>Dh,inout_print_many:()=>Lh,inout_type_input:()=>Sh,pyinout_type_input:()=>Ch});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Zh,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Jh,IOT_EMQX_PING:()=>zh,IOT_FORMATTING:()=>qh,IOT_FORMAT_STRING:()=>$h,IOT_MIXIO_NTP:()=>Qh,IOT_MIXIO_PUBLISH:()=>Uh,IOT_MIXIO_SUBSCRIBE:()=>Bh,IOT_MIXIO_UNSUBSCRIBE:()=>Xh,iot_checkonenet:()=>uc,iot_client_onboard:()=>nc,iot_create_with_item:()=>Yh,iot_http_client:()=>ic,iot_http_data:()=>sc,iot_mixio_check:()=>Wh,iot_mixio_connect:()=>xh,iot_mixio_connect_only:()=>Hh,iot_mixio_disconnect:()=>Gh,iot_mixio_format_msg:()=>Kh,iot_mixio_format_topic:()=>jh,iot_mixly_key:()=>ec,iot_mixly_key_py:()=>tc,iot_mqtt_client:()=>oc,iot_mqtt_data:()=>rc,iot_onenet_check:()=>wh,iot_onenet_connect:()=>bh,iot_onenet_disconnect:()=>vh,iot_onenet_publish:()=>Ph,iot_onenet_publish_dict:()=>Fh,iot_onenetconnect:()=>ac,iot_onenetdisconnect:()=>lc,iot_publish:()=>pc,iot_publish_container:()=>kh,iot_publish_item:()=>Vh});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{pins_analog_read:()=>Tc,pins_analog_write:()=>cc,pins_digital_read:()=>hc,pins_digital_write:()=>dc});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{serial_close:()=>fc,serial_open:()=>Ic,serial_read_b:()=>Ec,serial_write:()=>mc});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{sklearn_DecisionTreeClassifier_Regressor:()=>Nc,sklearn_GaussianNB:()=>wc,sklearn_KMeans:()=>kc,sklearn_KMeans_fit:()=>Vc,sklearn_KNeighborsClassifier_Regressor:()=>vc,sklearn_LinearRegression:()=>yc,sklearn_RandomForestClassifier_Regressor:()=>bc,sklearn_Ridge:()=>Dc,sklearn_cluster_centers_labels_inertia:()=>Hc,sklearn_coef_intercept:()=>Gc,sklearn_data_target:()=>Sc,sklearn_fit:()=>Yc,sklearn_fit_no_target:()=>xc,sklearn_load:()=>Ac,sklearn_make_blobs:()=>Rc,sklearn_make_classification:()=>Oc,sklearn_make_regression:()=>Mc,sklearn_pca:()=>Fc,sklearn_pca_fit_transform:()=>Pc,sklearn_predict:()=>Uc,sklearn_save_load_model:()=>Wc,sklearn_score:()=>Bc,sklearn_score_no_target:()=>Xc,sklearn_train_test_split:()=>Cc,sklearn_train_test_split_no_target:()=>Lc});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{Panic_with_status_code:()=>zc,base_delay:()=>Kc,controls_millis:()=>qc,controls_mstimer2:()=>Jc,controls_mstimer2_start:()=>Zc,controls_mstimer2_stop:()=>tT,reset:()=>Qc,time_localtime:()=>$c,time_sleep:()=>eT});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{turtle_bgcolor:()=>MT,turtle_bgcolor_hex:()=>bT,turtle_bgcolor_hex_new:()=>CT,turtle_circle:()=>fT,turtle_circle_advanced:()=>gT,turtle_clear:()=>hT,turtle_clone:()=>ST,turtle_color:()=>DT,turtle_color_hex:()=>NT,turtle_color_seclet:()=>BT,turtle_create:()=>iT,turtle_done:()=>sT,turtle_exitonclick:()=>oT,turtle_fill:()=>TT,turtle_fillcolor:()=>AT,turtle_fillcolor_hex:()=>wT,turtle_fillcolor_hex_new:()=>yT,turtle_getscreen:()=>XT,turtle_goto:()=>pT,turtle_listen:()=>jT,turtle_move:()=>rT,turtle_numinput:()=>kT,turtle_onclick:()=>HT,turtle_onkey:()=>GT,turtle_ontimer:()=>WT,turtle_pencolor:()=>RT,turtle_pencolor_hex:()=>vT,turtle_pencolor_hex_new:()=>LT,turtle_penup:()=>cT,turtle_pos_shape:()=>dT,turtle_rotate:()=>aT,turtle_screen_delay:()=>uT,turtle_screen_savefig:()=>KT,turtle_setheading:()=>lT,turtle_setxy:()=>_T,turtle_shape:()=>FT,turtle_shapesize:()=>PT,turtle_size:()=>mT,turtle_size_speed:()=>IT,turtle_speed:()=>ET,turtle_textinput:()=>VT,turtle_visible:()=>OT,turtle_write:()=>YT,turtle_write_format:()=>xT,turtle_write_format_skulpt:()=>UT});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{AI_ChooseAndGet:()=>qT,AI_Face_match:()=>ZT,AI_ImageClassify:()=>JT,AI_ImageClassify_Func:()=>oI,AI_Nlp:()=>eI,AI_Nlp_Func:()=>aI,AI_Nlp_Func_sim:()=>lI,AI_Nlp_Sim:()=>nI,AI_Nlp_Topic:()=>iI,AI_Nlp_newsSummary:()=>sI,AI_Ocr:()=>tI,AI_Ocr_Func:()=>rI,AI_Speech_asr:()=>QT,AI_Speech_synthesis:()=>zT,AI_audio:()=>uI,AI_client:()=>$T,AI_photo:()=>pI,AI_result:()=>_I});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{algorithm_add_path:()=>mI,algorithm_add_school:()=>hI,algorithm_all_books:()=>FI,algorithm_all_books_sequence:()=>wI,algorithm_book_scale:()=>HI,algorithm_check_feet:()=>JI,algorithm_chick_calculate:()=>QI,algorithm_color_seclet:()=>Tm,algorithm_current_school:()=>RI,algorithm_del_path:()=>EI,algorithm_delete_book:()=>XI,algorithm_divide_books:()=>UI,algorithm_find_path:()=>cI,algorithm_first_book:()=>PI,algorithm_fz_calc:()=>nm,algorithm_fz_compare:()=>im,algorithm_fz_move:()=>om,algorithm_fz_set_min:()=>sm,algorithm_get_current_location:()=>hm,algorithm_get_half_books:()=>BI,algorithm_hxdb_add:()=>pm,algorithm_hxdb_init_soldier:()=>am,algorithm_hxdb_last_line:()=>um,algorithm_hxdb_result:()=>_m,algorithm_hxdb_stand_in_line:()=>lm,algorithm_init_fzsf:()=>em,algorithm_init_hxdb:()=>rm,algorithm_init_jttl:()=>qI,algorithm_move_recent:()=>LI,algorithm_new_path:()=>TI,algorithm_next_book:()=>YI,algorithm_no_left:()=>gI,algorithm_no_path:()=>AI,algorithm_no_ring2:()=>kI,algorithm_not_home:()=>yI,algorithm_not_school:()=>DI,algorithm_number_add:()=>jI,algorithm_number_zero:()=>WI,algorithm_prepare:()=>dI,algorithm_prepare2:()=>MI,algorithm_prepare_2_1:()=>SI,algorithm_prepare_2_2:()=>CI,algorithm_print_book2:()=>GI,algorithm_print_jttl_answer:()=>ZI,algorithm_print_number:()=>KI,algorithm_print_path:()=>OI,algorithm_print_path2:()=>NI,algorithm_rabbit_add:()=>tm,algorithm_rabbit_number_in_range:()=>zI,algorithm_rabbit_zero:()=>$I,algorithm_return_path:()=>fI,algorithm_set_path:()=>II,algorithm_two_left:()=>xI,algorithm_void_path:()=>cm,algorithm_yes_ring2:()=>VI,hanoi_init:()=>bI,hanoi_init_offline:()=>dm,hanoi_move:()=>vI});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{requests_attribute:()=>fm,requests_get:()=>mm,requests_get_old:()=>Im,requests_method:()=>gm,requests_post:()=>Em});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{array_create:()=>Vm,array_toarray:()=>Qm,dataframe_aggregate_func:()=>jE,dataframe_create:()=>Am,dataframe_create_from_index:()=>Sm,dataframe_create_from_one_index:()=>Cm,dataframe_fillna:()=>vE,dataframe_get:()=>qm,dataframe_groupby:()=>WE,dataframe_head_tail:()=>GE,dataframe_info:()=>wE,dataframe_median:()=>bE,dataframe_select:()=>HE,dataframe_sort_values:()=>XE,matrix_multiplication:()=>DE,matrix_transpose:()=>yE,numpy_argmin_template_match:()=>gE,numpy_astype:()=>mE,numpy_c_:()=>CE,numpy_dot:()=>VE,numpy_linalg_det:()=>LE,numpy_linalg_inv:()=>NE,numpy_max:()=>PE,numpy_mean:()=>OE,numpy_mean_digit:()=>fE,numpy_min:()=>FE,numpy_ones:()=>SE,numpy_random_random:()=>UE,numpy_reshape:()=>IE,numpy_shape:()=>TE,numpy_size:()=>kE,numpy_square:()=>YE,numpy_std:()=>ME,numpy_sum:()=>xE,numpy_trig:()=>Wm,pandas_drop_columns:()=>AE,pandas_dropna:()=>RE,pandas_readcsv:()=>Km,pl_axes:()=>bm,pl_bar:()=>Bm,pl_hist:()=>Gm,pl_label:()=>km,pl_legend:()=>Fm,pl_pie:()=>Xm,pl_plot:()=>wm,pl_plot_bar:()=>Ym,pl_plot_easy:()=>vm,pl_plot_scatter:()=>xm,pl_plot_xy:()=>Um,pl_savefig:()=>$m,pl_show:()=>Nm,pl_subplot:()=>jm,pl_text:()=>zm,pl_ticks:()=>Hm,pl_title:()=>Pm,plot_axes:()=>Zm,plot_bar:()=>lE,plot_cla:()=>KE,plot_hist:()=>pE,plot_label:()=>sE,plot_legend:()=>nE,plot_pie:()=>uE,plot_plot:()=>eE,plot_plot_bar:()=>oE,plot_plot_easy:()=>tE,plot_plot_scatter:()=>rE,plot_plot_xy:()=>aE,plot_savefig:()=>hE,plot_show:()=>Jm,plot_subplot:()=>dE,plot_text:()=>cE,plot_ticks:()=>_E,plot_title:()=>iE,py_sum:()=>BE,pylab_imshow:()=>EE,series_create:()=>Mm,series_create_from_index:()=>Rm,series_create_from_text:()=>Lm,series_get_num:()=>Dm,series_index_value:()=>ym});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{ds_add_node_by_attr:()=>ZE,ds_add_node_by_name:()=>JE,ds_create_linkedlist:()=>qE,ds_create_node:()=>$E,ds_del_node_by_attr:()=>ef,ds_del_node_by_name:()=>tf,ds_get_node_attr:()=>zE,ds_reverse_linkedlist:()=>nf,ds_set_node_attr:()=>QE});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{factory_block:()=>_f,factory_block_return:()=>df,factory_block_return_with_textarea:()=>cf,factory_block_with_textarea:()=>hf,factory_callMethod_noreturn:()=>uf,factory_callMethod_return:()=>pf,factory_declare:()=>lf,factory_from_import:()=>sf,factory_function_noreturn:()=>rf,factory_function_return:()=>af,factory_import:()=>of});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{hardware_arduino_analog_read:()=>ff,hardware_arduino_analog_write:()=>gf,hardware_arduino_digital_read:()=>Ef,hardware_arduino_digital_write:()=>mf,hardware_arduino_start:()=>Tf,inout_highlow:()=>If});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{inout_input:()=>Of,inout_print:()=>Mf,inout_print_end:()=>Af,inout_print_inline:()=>Rf,inout_print_many:()=>Lf,inout_type_input:()=>Sf,pyinout_type_input:()=>Cf});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>xf,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Xf,IOT_EMQX_PING:()=>Gf,IOT_FORMATTING:()=>Vf,IOT_FORMAT_STRING:()=>Yf,IOT_MIXIO_NTP:()=>Hf,IOT_MIXIO_PUBLISH:()=>Df,IOT_MIXIO_SUBSCRIBE:()=>Nf,IOT_MIXIO_UNSUBSCRIBE:()=>bf,iot_mixio_check:()=>Ff,iot_mixio_connect:()=>yf,iot_mixio_connect_only:()=>wf,iot_mixio_disconnect:()=>vf,iot_mixio_format_msg:()=>kf,iot_mixio_format_topic:()=>Pf,iot_mixly_key:()=>Uf,iot_mixly_key_py:()=>Bf});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{pins_analog_read:()=>$f,pins_analog_write:()=>qf,pins_digital:()=>Wf,pins_digital_read:()=>Kf,pins_digital_write:()=>jf});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{serial_close:()=>Zf,serial_open:()=>zf,serial_read_b:()=>Jf,serial_write:()=>Qf});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{sklearn_DecisionTreeClassifier_Regressor:()=>ug,sklearn_GaussianNB:()=>dg,sklearn_KMeans:()=>Tg,sklearn_KMeans_fit:()=>Ig,sklearn_KNeighborsClassifier_Regressor:()=>_g,sklearn_LinearRegression:()=>ag,sklearn_RandomForestClassifier_Regressor:()=>pg,sklearn_Ridge:()=>lg,sklearn_cluster_centers_labels_inertia:()=>Rg,sklearn_coef_intercept:()=>Mg,sklearn_data_target:()=>sg,sklearn_fit:()=>mg,sklearn_fit_no_target:()=>Eg,sklearn_load:()=>ig,sklearn_make_blobs:()=>ng,sklearn_make_classification:()=>tg,sklearn_make_regression:()=>eg,sklearn_pca:()=>hg,sklearn_pca_fit_transform:()=>cg,sklearn_predict:()=>fg,sklearn_save_load_model:()=>Ag,sklearn_score:()=>gg,sklearn_score_no_target:()=>Og,sklearn_train_test_split:()=>og,sklearn_train_test_split_no_target:()=>rg});var tt={};__webpack_require__.r(tt),__webpack_require__.d(tt,{controls_end_program:()=>Cg,controls_millis:()=>Sg,time_localtime:()=>Lg});var et={};__webpack_require__.r(et),__webpack_require__.d(et,{turtle_bgcolor:()=>Kg,turtle_bgcolor_hex:()=>Qg,turtle_bgcolor_hex_new:()=>tO,turtle_circle:()=>Gg,turtle_circle_advanced:()=>Wg,turtle_clear:()=>Vg,turtle_clone:()=>zg,turtle_color:()=>sO,turtle_color_hex:()=>iO,turtle_color_seclet:()=>dO,turtle_create:()=>yg,turtle_done:()=>Dg,turtle_exitonclick:()=>Ng,turtle_fill:()=>xg,turtle_fillcolor:()=>$g,turtle_fillcolor_hex:()=>Zg,turtle_fillcolor_hex_new:()=>nO,turtle_getscreen:()=>hO,turtle_goto:()=>Pg,turtle_listen:()=>mO,turtle_move:()=>bg,turtle_numinput:()=>lO,turtle_onclick:()=>TO,turtle_onkey:()=>cO,turtle_ontimer:()=>IO,turtle_pencolor:()=>qg,turtle_pencolor_hex:()=>Jg,turtle_pencolor_hex_new:()=>eO,turtle_penup:()=>Yg,turtle_pos_shape:()=>kg,turtle_rotate:()=>vg,turtle_screen_delay:()=>Fg,turtle_screen_savefig:()=>EO,turtle_setheading:()=>wg,turtle_setxy:()=>Hg,turtle_shape:()=>oO,turtle_shapesize:()=>rO,turtle_size:()=>Bg,turtle_size_speed:()=>Ug,turtle_speed:()=>Xg,turtle_textinput:()=>aO,turtle_visible:()=>jg,turtle_write:()=>uO,turtle_write_format:()=>pO,turtle_write_format_skulpt:()=>_O});var nt={};__webpack_require__.r(nt),__webpack_require__.d(nt,{COPYFILE_EXCL:()=>ZO,COPYFILE_FICLONE:()=>tM,COPYFILE_FICLONE_FORCE:()=>eM,F_OK:()=>$O,O_APPEND:()=>uM,O_CREAT:()=>oM,O_DIRECT:()=>IM,O_DIRECTORY:()=>pM,O_DSYNC:()=>cM,O_EXCL:()=>rM,O_NOATIME:()=>_M,O_NOCTTY:()=>aM,O_NOFOLLOW:()=>dM,O_NONBLOCK:()=>mM,O_RDONLY:()=>nM,O_RDWR:()=>sM,O_SYMLINK:()=>TM,O_SYNC:()=>hM,O_TRUNC:()=>lM,O_WRONLY:()=>iM,R_OK:()=>zO,S_IFBLK:()=>MM,S_IFCHR:()=>AM,S_IFDIR:()=>RM,S_IFIFO:()=>SM,S_IFLNK:()=>gM,S_IFMT:()=>EM,S_IFREG:()=>OM,S_IFSOCK:()=>fM,S_IRGRP:()=>FM,S_IROTH:()=>YM,S_IRUSR:()=>NM,S_IRWXG:()=>wM,S_IRWXO:()=>VM,S_IRWXU:()=>DM,S_ISGID:()=>LM,S_ISUID:()=>CM,S_ISVTX:()=>yM,S_IWGRP:()=>PM,S_IWOTH:()=>xM,S_IWUSR:()=>bM,S_IXGRP:()=>kM,S_IXOTH:()=>UM,S_IXUSR:()=>vM,UV_FS_O_FILEMAP:()=>BM,W_OK:()=>QO,X_OK:()=>JO,size_max:()=>XM});var it={};__webpack_require__.r(it),__webpack_require__.d(it,{FileHandle:()=>uS,access:()=>PS,appendFile:()=>gS,chmod:()=>DS,chown:()=>LS,constants:()=>nt,copyFile:()=>YS,cp:()=>US,exists:()=>_S,lchmod:()=>NS,lchown:()=>yS,link:()=>AS,lstat:()=>hS,lutimes:()=>vS,mkdir:()=>MS,mkdtemp:()=>VS,open:()=>mS,opendir:()=>xS,readFile:()=>ES,readdir:()=>RS,readlink:()=>CS,realpath:()=>wS,rename:()=>pS,rm:()=>kS,rmdir:()=>OS,stat:()=>dS,statfs:()=>BS,symlink:()=>SS,truncate:()=>cS,unlink:()=>TS,utimes:()=>bS,watch:()=>FS,writeFile:()=>fS});var st={};__webpack_require__.r(st),__webpack_require__.d(st,{BigIntStatsFs:()=>$M,Dir:()=>iS,Dirent:()=>nS,ReadStream:()=>oS,Stats:()=>jM,StatsFs:()=>qM,WriteStream:()=>rS,_synced:()=>JR,access:()=>MC,accessSync:()=>KA,appendFile:()=>JS,appendFileSync:()=>RA,chmod:()=>mC,chmodSync:()=>XA,chown:()=>TC,chownSync:()=>UA,chroot:()=>iA,close:()=>tC,closeSync:()=>SA,constants:()=>nt,copyFile:()=>bC,copyFileSync:()=>zA,cp:()=>PC,cpSync:()=>tS,createReadStream:()=>LC,createWriteStream:()=>yC,exists:()=>HS,existsSync:()=>dA,fchmod:()=>aC,fchmodSync:()=>vA,fchown:()=>rC,fchownSync:()=>bA,fdatasync:()=>iC,fdatasyncSync:()=>yA,fstat:()=>ZS,fstatSync:()=>AA,fsync:()=>nC,fsyncSync:()=>LA,ftruncate:()=>eC,ftruncateSync:()=>CA,futimes:()=>lC,futimesSync:()=>wA,lchmod:()=>EC,lchmodSync:()=>GA,lchown:()=>IC,lchownSync:()=>BA,link:()=>dC,linkSync:()=>VA,lopenSync:()=>fA,lstat:()=>jS,lstatSync:()=>cA,lutimes:()=>gC,lutimesSync:()=>WA,mkdir:()=>pC,mkdirSync:()=>PA,mkdtemp:()=>NC,mkdtempSync:()=>$A,mount:()=>$R,mountObject:()=>eA,mounts:()=>qR,open:()=>$S,openAsBlob:()=>VC,openSync:()=>EA,opendir:()=>FC,opendirSync:()=>ZA,promises:()=>it,read:()=>oC,readFile:()=>zS,readFileSync:()=>OA,readSync:()=>NA,readdir:()=>_C,readdirSync:()=>kA,readlink:()=>cC,readlinkSync:()=>xA,readv:()=>vC,readvSync:()=>QA,realpath:()=>OC,realpathSync:()=>jA,rename:()=>GS,renameSync:()=>_A,rm:()=>DC,rmSync:()=>qA,rmdir:()=>uC,rmdirSync:()=>FA,stat:()=>WS,statSync:()=>hA,statfs:()=>kC,statfsSync:()=>eS,symlink:()=>hC,symlinkSync:()=>YA,truncate:()=>KS,truncateSync:()=>TA,umount:()=>zR,unlink:()=>qS,unlinkSync:()=>IA,unwatchFile:()=>SC,utimes:()=>fC,utimesSync:()=>HA,watch:()=>CC,watchFile:()=>AC,write:()=>sC,writeFile:()=>QS,writeFileSync:()=>MA,writeSync:()=>DA,writev:()=>wC,writevSync:()=>JA});const ot=Blockly;Object.assign(ot.Lang.ZhHans,{PYTHON_PYODIDE_IMAGE:"图像",PYTHON_PYODIDE_LOADING:"Python3内核载入中...",PYTHON_PYODIDE_FILE_SYSTEM:"本地文件系统",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"载入本地文件夹"}),Object.assign(ot.Lang.ZhHant,{PYTHON_PYODIDE_IMAGE:"影像",PYTHON_PYODIDE_LOADING:"Python3核心載入...",PYTHON_PYODIDE_FILE_SYSTEM:"本機檔案系統",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"載入本機資料夾"}),Object.assign(ot.Lang.En,{PYTHON_PYODIDE_IMAGE:"Image",PYTHON_PYODIDE_LOADING:"Python3 kernel loading...",PYTHON_PYODIDE_FILE_SYSTEM:"Local File System",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"Load Local Folder"}),Object.assign(ot.Lang.ZhHans.MSG,{}),Object.assign(ot.Lang.ZhHant.MSG,{}),Object.assign(ot.Lang.En.MSG,{});const rt=Mixly,at={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 n=Object.create(null),i=0;i1&&(r+=i)):n=r}else n="i";return n}},lt=at; /** * @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 ut{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),n.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 n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},yt={init:function(){this.setColour(Mt),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Dt={init:function(){this.setColour(Mt),this.appendValueInput("LIST").setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ot.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Nt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ot.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ot.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},bt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),n.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 n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},vt={init:function(){this.setColour(Mt);var t=new ot.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ot.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(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},wt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ft={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Nt.OPERATORS=[[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],vt.OPERATORS=[[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Pt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Vt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Yt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},xt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ut={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Bt={init:function(){this.jsonInit({message0:ot.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Mt,tooltip:ot.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ot.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Xt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_STAT),this.setOutput(!0)}},Gt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ht={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Wt={init:function(){this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ot.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ot.FieldDropdown([[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Mt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},jt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},$t={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET+ot.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_GET_UNIQUE_IDEN)}},zt={init:function(){this.setColour(Mt),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ot.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},Jt=230;ot.FieldTextInput.math_number_validator=function(t){return String(t)},ot.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 Zt={init:function(){this.setColour(Jt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},te={init:function(){this.setColour(Jt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},ee={init:function(){this.setColour(Jt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ne={init:function(){this.setColour(Jt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.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:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ie={init:function(){this.setColour(Jt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.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:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},se={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ot.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},oe={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.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:ot.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ot.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ot.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ot.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ot.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ot.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ot.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},re={init:function(){var t=[[ot.Msg.MATH_BIN,"bin"],[ot.Msg.MATH_OCT,"oct"],[ot.Msg.MATH_HEX,"hex"]];this.setColour(Jt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ot.Msg.MATH_DEC_TOOLTIP_BIN,oct:ot.Msg.MATH_DEC_TOOLTIP_OCT,hex:ot.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},ae={init:function(){var t=[[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"],[ot.Msg.MATH_ABS,"fabs"],[ot.Msg.MATH_SQRT,"sqrt"]];this.setColour(Jt),this.appendValueInput("A").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ot.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ot.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ot.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ot.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ot.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ot.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},le={init:function(){var t=[[ot.Msg.MIXLY_MAX,"max"],[ot.Msg.MIXLY_MIN,"min"]];this.setColour(Jt),this.appendValueInput("A").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ot.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ot.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},ue={init:function(){var t=[[ot.Msg.MATH_TWO,"two"],[ot.Msg.MATH_EIGHT,"eight"],[ot.Msg.MATH_TEN,"ten"],[ot.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Jt),this.appendDummyInput("").appendField(ot.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ot.FieldDropdown(t),"OP").appendField(ot.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ot.Msg.MATH_ZHW).appendField(new ot.FieldDropdown(t),"OP2").appendField(ot.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:ot.Msg.MATH_Before_two,eight:ot.Msg.MATH_Before_eight,ten:ot.Msg.MATH_Before_ten,sixteen:ot.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:ot.Msg.MATH_Behind_two,eight:ot.Msg.MATH_Behind_eight,ten:ot.Msg.MATH_Behind_ten,sixteen:ot.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},pe={init:function(){var t=[[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Jt),this.setOutput(!0,Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ot.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:ot.Msg.LANG_MATH_INT,float:ot.Msg.LANG_MATH_FLOAT_RANDOM};return ot.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},_e={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_CONSTRAIN_TOOLTIP)}},de={init:function(){this.setColour(Jt),this.appendValueInput("NUM",Number).appendField(ot.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ot.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ot.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_MAP)}},he={init:function(){this.setColour(Jt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},ce={init:function(){this.setColour(Jt),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Te={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MATH_ROUND).appendField(ot.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ot.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ie={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"],[ot.Msg.MIXLY_TO_BITES,"b"],[ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Jt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ot.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},me={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Jt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ot.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Ee=de,fe={init:function(){this.setColour(Jt),this.appendValueInput("VAR").appendField(ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},ge={init:function(){this.setColour(Jt),this.itemCount_=1,this.setMutator(new ot.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ot.Msg.MIXLY_PRODUCT+ot.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ot.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Ce={init:function(){this.setColour(Re),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput("",ot.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ot.FieldImage(e,7,12,'"')}},Le={init:function(){this.setColour(Re),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ot.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ye={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},De={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Ne={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},be={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ve={init:function(){this.WHERE_OPTIONS=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.TEXT_GET_INDEX_RANDOM+1+ot.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.LISTS_GET_INDEX_GET,"MODE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ot.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+ot.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ot.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:ot.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ot.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ot.Msg.TEXT_GET_INDEX_RANDOM};return ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+ot.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ot.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),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ot.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},we={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.LISTS_GET_INDEX_FROM_START+"n"+ot.Msg.TEXT_CHARAT2)}},Fe={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ot.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ot.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Pe={init:function(){this.WHERE_OPTIONS_1=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ot.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ot.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(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ot.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new ot.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},ke={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ot.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Ve={init:function(){var t=[[ot.Msg.MIXLY_EQUALS,"==="],[ot.Msg.MIXLY_STARTSWITH,"startswith"],[ot.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Re),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ot.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ye={init:function(){this.setColour(Re),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_COMPARETO_HELP)}},xe={init:function(){var t=[[ot.Msg.TEXT_UPPER,"upper"],[ot.Msg.TEXT_TITLE,"title"],[ot.Msg.TEXT_CAPITALIZE,"capitalize"],[ot.Msg.TEXT_SWAPCASE,"swapcase"],[ot.Msg.TEXT_LOWER,"lower"]];this.setColour(Re),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ot.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ot.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ot.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ot.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ot.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ue={init:function(){var t=[[ot.Msg.TEXT_LJUST,"ljust"],[ot.Msg.TEXT_CENTER,"center"],[ot.Msg.TEXT_RJUST,"rjust"]];this.setColour(Re),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ot.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ot.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Be={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_MID+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ot.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Xe={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ge={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},He={init:function(){this.setColour(Re),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ot.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ot.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},We={init:function(){var t=[[ot.Msg.TEXT_TRIM_BOTH,"strip"],[ot.Msg.TEXT_TRIM_LEFT,"lstrip"],[ot.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Re),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ot.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ot.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ot.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ot.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},je={init:function(){this.setColour(Re),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ot.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ot.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Gn={init:function(){this.setColour(Bn),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Hn={init:function(){this.setColour(Bn),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Wn={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_KEYS),this.setTooltip(ot.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},jn={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_TOOLTIP)}},Kn={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},qn={init:function(){this.setColour(Bn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},$n={init:function(){this.setColour(Bn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_DELETE_TOOLTIP)}},zn={init:function(){this.setColour(Bn),this.appendValueInput("DICT2").setCheck("Dict").appendField(ot.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ot.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MID),this.setTooltip(ot.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qn={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_CLEAR),this.setTooltip(ot.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jn={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_ITEMS),this.setTooltip(ot.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Zn={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_VALUES),this.setTooltip(ot.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},ti={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_LENGTH),this.setTooltip(ot.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},ei={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_DELDICT),this.setTooltip(ot.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ni={init:function(){this.MODE=[[ot.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ot.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ot.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=ot.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ot.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ot.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 ot.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},ii={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setTooltip(ot.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},si={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_SETDEFAULT_TOOLTIP)}},oi={init:function(){this.setColour(Bn),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.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 ot.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ri={init:function(){this.setColour(Bn),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ai={init:function(){this.setColour(Bn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TO_JSON),this.setTooltip(ot.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},li={init:function(){this.setColour(Bn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},ui={init:function(){this.setColour(Bn),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(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},pi={init:function(){this.setColour(Bn),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TO_JSON),this.setTooltip(ot.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},_i=210,di={init:function(){var t=ot.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(_i),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ot.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ot.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},hi={init:function(){var t=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(_i),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ot.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},ci={init:function(){var t=[[ot.Msg.LOGIC_OPERATION_AND,"AND"],[ot.Msg.LOGIC_OPERATION_OR,"OR"],[ot.Msg.LOGIC_OPERATION_NOR,"NOR"],[ot.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(_i),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ot.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ot.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Ti={init:function(){this.setColour(_i),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ot.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},Ii={init:function(){var t=[[ot.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ot.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(_i),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ot.FieldDropdown(t),"BOOL"),this.setTooltip(ot.Msg.LOGIC_BOOLEAN_TOOLTIP)}},mi={init:function(){this.setColour(_i),this.setOutput(!0),this.appendDummyInput().appendField(ot.Msg.LOGIC_NULL),this.setTooltip(ot.Msg.LOGIC_NULL_TOOLTIP)}},Ei={init:function(){this.setColour(_i),this.appendValueInput("A"),this.appendValueInput("B").appendField(ot.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ot.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},fi={init:function(){var t=[[ot.Msg.TEXT_APPEND_TO,"in"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(_i),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ot.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ot.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.IN)}},gi={init:function(){var t=[[ot.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(_i),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Oi={init:function(){this.setColour(_i),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Mi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ot.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ri={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ai={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},Si={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXPY_TEXT_ENCODE).appendField(new ot.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},Ci={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Li={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},yi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},Di={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MICROBIT_PYTHON_TYPE)}},Ni={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.HTML_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},bi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},vi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},wi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Fi={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ot.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(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Pi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},ki={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},Vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},Yi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},xi={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ot.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 ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ot.Msg.MIXLY_ESP32_SET+{mkdir:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Ui={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ot.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Bi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Xi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.HTML_FILE,"isfile"],[ot.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 ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Gi={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP+ot.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ot.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ot.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Wi={init:function(){var t=ot.Procedures.findLegalName("",this),e=new ot.FieldTextInput(t,ot.Procedures.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new ot.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&ot.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(ot.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(ot.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(ot.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(ot.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=ot.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),ot.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{ot.Events.enable()}},mutationToDom:function(t){var e=ot.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(ot.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Us={init:function(){this.setColour(ws),this.appendDummyInput().appendField(ot.Msg.HTML_FORM_CONTENT).appendField(new ot.FieldDropdown([[ot.Msg.HTML_TEXT,"text"],[ot.Msg.HTML_EMAIL,"email"],[ot.Msg.HTML_NUMBER,"number"],[ot.Msg.HTML_PASSWORD,"password"],[ot.Msg.HTML_CHECKBOX,"checkbox"],[ot.Msg.HTML_RADIOBUTTON,"radiobutton"],[ot.Msg.HTML_BUTTON,"button"],[ot.Msg.HTML_COLOUR,"colour"],[ot.Msg.HTML_DATE,"date"],[ot.Msg.HTML_LOCALTIME,"local time"],[ot.Msg.HTML_FILE,"file"],[ot.Msg.HTML_HIDDEN,"hidden"],[ot.Msg.HTML_IMAGE,"image"],[ot.Msg.HTML_MONTH,"month"],[ot.Msg.HTML_RANGE,"range"],[ot.Msg.HTML_RESET,"reset"],[ot.Msg.HTML_SEARCH,"search"],[ot.Msg.HTML_SUBMIT,"submit"],[ot.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ot.Msg.HTML_TIME,"time"],[ot.Msg.HTML_URL,"url"],[ot.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ot.Msg.HTML_NAME).appendField(new ot.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ot.Msg.HTML_VALUE).appendField(new ot.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gs={init:function(){this.setColour(ws),this.appendDummyInput().appendField(ot.Msg.HTML_TEXT).appendField(new ot.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hs=160,Ws={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ot.FieldTable(""),"TEXT")}},js={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT")}},Ks={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},qs={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},$s={init:function(){this.setColour(Hs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ot.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},zs={init:function(){this.setColour(Hs),this.appendValueInput("VALUE").appendField(ot.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Qs={init:function(){this.setColour(Hs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ot.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=ot.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},ot.isNumber(i)&&ot.isNumber(s)&&ot.isNumber(o))i=parseFloat(i),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==i%1&&0==s%1&&0==o%1?(i<=s?(s++,t=0==i&&1==o?s:i+", "+s,1!=o&&(t+=", "+o)):t=i+", "+--s+", -"+o,t="range("+t+")"):(t=i",GTE:">="};const ja=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",o=e.valueToCode(this,"B",i)||"False";if("AND"==n)var r=s+" and "+o;else if("OR"==n)r=s+" or "+o;else if("NOR"==n)r="not("+s+"^"+o+")";else r=s+"^"+o;return[r,i]},Ka=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},qa=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},$a=function(t,e){return["None",e.ORDER_ATOMIC]},za=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Qa=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ja=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Za=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},tl=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},el=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},nl=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},il=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},sl=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},ol=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},rl=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},al=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ll=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},ul=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},pl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},_l=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},dl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},Tl=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},Il=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ml=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},El=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},fl=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"},gl=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},Ol=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"},Ml=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"},Rl=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],r=0;r\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},su=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},ou=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},ru=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},au=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},lu=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},uu=function(t,e){return'"},pu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},_u=function(){return this.getFieldValue("TEXT")+"\n"},du=function(t){return t.getFieldValue("TEXT")+"\n"},hu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},cu=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Tu=function(){return""},Iu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},mu=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+n.join("\n")+i.join("\n")+r.join("\n")+a.join("")+t+"while True:\n"+l.join("")+u.join("\n"):e.join("\n")+n.join("\n")+i.join("\n")+r.join("\n")+a.join("")+t+u.join("\n")},Ou.scrubNakedValue=function(t){return t+"\n"},Ou.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},Ou.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},Ou.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=ot.utils.string.wrap(o,Ou.COMMENT_WRAP-3),i+=Ou.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const Mu=205,Ru={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CHOOSE_AND_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[ot.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[ot.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},Au={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[ot.Msg.MIXLY_AipSpeech,"AipSpeech"],[ot.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[ot.Msg.MIXLY_AipFace,"AipFace"],[ot.Msg.MIXLY_AipOcr,"AipOcr"],[ot.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Su={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_synthesis).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Cu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_asr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_AipSpeech_File).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Lu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipImageClassify).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},yu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[ot.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[ot.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[ot.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[ot.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[ot.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},Du={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipFace_match).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"1"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"2"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Nu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipOcr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},bu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[ot.Msg.MIXLY_AipOcr_webImage,"webImage"],[ot.Msg.MIXLY_AipOcr_idcard,"idcard"],[ot.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[ot.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[ot.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[ot.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[ot.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[ot.Msg.MIXLY_AipOcr_receipt,"receipt"],[ot.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[ot.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[ot.Msg.MIXLY_AipOcr_form,"tableRecognition"],[ot.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[ot.Msg.MIXLY_AipOcr_passport,"passport"],[ot.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},vu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},wu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_Sim).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.OLED_STRING+"1").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.OLED_STRING+"2").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Fu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_lexer,"lexer"],[ot.Msg.MIXLY_AipNlp_depParser,"depParser"],[ot.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[ot.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[ot.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[ot.Msg.MIXLY_AipNlp_keyword,"keyword"],[ot.Msg.MIXLY_AipNlp_topic,"topic"],[ot.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[ot.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Pu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[ot.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},ku={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_topic).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_AipNlp_Topic_Title).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Vu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_summary).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(ot.Msg.MIXLY_LIST_LEN).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Yu={init:function(){this.setColour(Mu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(ot.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},xu={init:function(){this.setColour(Mu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(ot.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},Uu={init:function(){this.setColour(Mu),this.appendValueInput("AI").appendField(ot.Msg.MIXPY_AI_RESULT).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"Image"],[ot.Msg.MIXLY_AipSpeech_asr,"Speech"],[ot.Msg.MIXLY_AipFace_match,"Face"],[ot.Msg.MIXLY_AipOcr,"Ocr"],[ot.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},Bu="#526FC3",Xu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Gu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},ju={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ku={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},qu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$u={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},Qu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ju={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zu={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},tp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ep={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},np={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ip={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},op={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},rp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ap={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},lp={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(Bu),this.setTooltip(""),this.setHelpUrl("")}},up={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},_p={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},hp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},cp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},Ip={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ep={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},gp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Op={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new ot.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Rp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ap={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Sp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Cp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField("n"+ot.Msg.MIXLY_VALUE2).appendField(new ot.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Lp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},yp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Np={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},bp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},vp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},wp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},kp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Vp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Yp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},xp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Up={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Bp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Xp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Gp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new ot.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Hp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("使士兵").appendField(new ot.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Wp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("剩余").appendField(new ot.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},jp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},Kp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setTooltip(""),this.setHelpUrl("")}},qp={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bu),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},$p={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zp={init:function(){this.setColour(Bu),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},Qp={init:function(){this.setColour(Bu),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Jp="#3288dd",Zp={init:function(){this.setColour(Jp),this.appendValueInput("DOMAIN").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS_GET).appendField(new ot.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},t_={init:function(){this.setColour(Jp),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS).appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},e_={init:function(){this.setColour(Jp),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ot.Msg.blockpy_REQUESTS+ot.Msg.OLED_STRING),this.appendDummyInput("").appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},n_={init:function(){this.appendValueInput("VAL");var t=[[ot.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ot.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Jp),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ot.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},i_={init:function(){this.appendValueInput("VAR").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Jp),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},s_="f0a559",o_={init:function(){this.setColour(s_),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},r_={init:function(){this.setColour(s_),this.appendValueInput("FILE").appendField(ot.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},a_={init:function(){this.setColour(s_),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},l_={init:function(){this.setColour(s_),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS+ot.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},u_={init:function(){this.setColour(s_),this.appendDummyInput().appendField(ot.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},p_={init:function(){this.setColour(s_),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);var t=[[ot.Msg.MIXLY_CV_RECT,"rectangle"],[ot.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},__={init:function(){this.setColour(s_),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new ot.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(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},d_={init:function(){this.setColour(s_),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},h_={init:function(){this.setColour(s_),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},c_={init:function(){this.setColour(s_),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(ot.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(ot.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},T_=170,I_={init:function(){this.setColour(T_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},m_={init:function(){this.setColour(T_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},E_={init:function(){this.setColour(T_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},f_={init:function(){this.setColour(T_);var t=[[ot.Msg.DATAFRAME_RAW,"index"],[ot.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},g_={init:function(){this.setColour(T_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},O_={init:function(){this.setColour(T_),this.appendDummyInput("").appendField(new ot.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new ot.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},M_={init:function(){this.setColour(T_);var t=[[ot.Msg.SERIES_INDEX,"index"],[ot.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(ot.Msg.SERIES_INDEX_VALUE).appendField(new ot.FieldDropdown(t),"INDEX_VALUE"),this.setOutput(!0,"List");var e=this;this.setTooltip((function(){var t=e.getFieldValue("INDEX_VALUE");return{index:ot.Msg.SERIES_INDEX_TOOLTIP,value:ot.Msg.HTML_VALUE_TOOLTIP}[t]}))}},R_={init:function(){this.setColour(T_),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(ot.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(ot.Msg.TUPLE_GET_INDEX_TOOLTIP)}},A_={init:function(){this.setColour(T_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},S_={init:function(){this.setColour(T_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},C_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},L_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},y_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},D_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},N_={init:function(){this.setColour(T_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},b_={init:function(){this.setColour(T_),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_SPLITBYDOU).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},v_={init:function(){this.setColour(T_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},w_={init:function(){this.setColour(T_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},F_={init:function(){this.setColour(T_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},P_={init:function(){this.setColour(T_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},k_={init:function(){this.setColour(T_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},V_={init:function(){this.setColour(T_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Y_={init:function(){this.setColour(T_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},x_={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(T_),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(ot.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setTooltip(ot.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},U_={init:function(){this.setColour(T_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},B_={init:function(){this.setColour(T_),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[ot.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},X_={init:function(){this.setColour(T_),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(ot.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new ot.FieldDropdown([[ot.Msg.DATAFRAME_COLUMN,"column"],[ot.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(ot.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},G_={init:function(){this.setColour(T_),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},H_={init:function(){this.setColour(T_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},W_={init:function(){this.setColour(T_),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},j_={init:function(){this.setColour(T_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},K_={init:function(){this.setColour(T_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},q_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},z_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Q_={init:function(){this.setColour(T_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},J_={init:function(){this.setColour(T_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Z_={init:function(){this.setColour(T_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},td={init:function(){this.setColour(T_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},ed={init:function(){this.setColour(T_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},nd={init:function(){this.setColour(T_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},id={init:function(){this.setColour(T_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},sd={init:function(){this.setColour(T_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},od={init:function(){this.setColour(T_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},rd={init:function(){this.setColour(T_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ad={init:function(){this.setColour(T_),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},ld={init:function(){this.setColour(T_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},ud={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},pd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},_d={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new ot.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},dd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new ot.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.")}},hd={init:function(){this.setColour(T_),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.")}},cd={init:function(){this.setColour(T_),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.")}},Td={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},Id={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},md={init:function(){this.setColour(T_),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},Ed={init:function(){this.setColour(T_),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},fd={init:function(){this.setColour(T_),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},gd={init:function(){this.setColour(T_),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_.")}},Od={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},Md={init:function(){this.setColour(T_),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},Rd={init:function(){this.setColour(T_),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},Ad={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},Sd={init:function(){this.setColour(T_),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},Cd={init:function(){this.setColour(T_),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new ot.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.")}},Ld={init:function(){this.setColour(T_),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},yd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},Dd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},Nd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},bd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},vd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},wd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},Fd={init:function(){this.setColour(T_),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Pd={init:function(){this.setColour(T_),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},kd={init:function(){this.setColour(T_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("排序方式").appendField(new ot.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Vd={init:function(){this.setColour(T_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("获取").appendField(new ot.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(ot.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Yd={init:function(){this.setColour(T_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},xd={init:function(){this.setColour(T_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ud={init:function(){this.setColour(T_),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Bd={init:function(){this.setColour(T_),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xd=80,Gd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new ot.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_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("ds_create_linkedlist_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:"name"),"KEY"+e).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hd={init:function(){this.setColour(Xd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},Wd={init:function(){this.setColour(Xd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},jd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_USE).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_CREATE_NODE_TOOLTIP)}},Kd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(ot.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},qd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},$d={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},zd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},Qd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Jd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_DEL_NODE_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Zd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},th="#777777",eh={init:function(){this.setColour(th),this.appendDummyInput("").appendField("from ").appendField(new ot.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new ot.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nh={init:function(){this.setColour(th),this.appendDummyInput("").appendField("import ").appendField(new ot.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ih={init:function(){this.setColour(th),this.appendDummyInput("").appendField(new ot.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.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]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},kh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Vh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Yh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},xh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ot.Msg.MIXLY_WIFI_USERNAME).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ot.Msg.MIXLY_IOT_PASSWORD).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_PROJECT).setAlign(ot.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Uh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ot.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Bh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_SUBSCRIBE+ot.Msg.MIXLY_MICROBIT_MSG).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ot.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Xh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MSG.stop+ot.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Gh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Kh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},qh={init:function(){this.setColour(Nh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},$h={init:function(){this.setColour(Nh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},zh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Qh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ot.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Jh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+ot.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zh={init:function(){this.setColour(Nh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},tc={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Nh),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new ot.FieldImage(e,12,12,'"')}},ec={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Nh),this.appendDummyInput("").appendField(new ot.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")}},nc={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},ic={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ot.Msg.MIXLY_REQUESTS_GET).appendField(ot.Msg.MIXLY_GET_CURRENT_TIME).appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},sc={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},oc={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ot.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ot.MQTT_Topic).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rc={init:function(){this.setColour(Nh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},ac=bh,lc=vh,uc=wh,pc=Ph,_c=230,dc={init:function(){this.setColour(_c),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},hc={init:function(){this.setColour(_c),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},cc={init:function(){this.setColour(_c),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},Tc={init:function(){this.setColour(_c),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},Ic={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXPY_SERIAL_OPEN)).appendField(new ot.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(ot.Msg.MIXLY_SERIAL_BEGIN).appendField(new ot.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(ot.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},mc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},Ec={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},fc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(ot.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},gc=80,Oc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Mc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Rc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Ac={init:function(){var t=[[ot.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[ot.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[ot.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[ot.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[ot.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[ot.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+ot.Msg.LOAD).appendField(new ot.FieldDropdown(t),"type").appendField(new ot.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("name"))&&this.setTitleValue(e,"name")}},Sc={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+ot.Msg.DATA_SET),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.EIGENVALUES,"data"],[ot.Msg.LABEL_VALUE,"target"],[ot.Msg.FEATURE,"feature_names"],[ot.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Lc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},yc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Dc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Nc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},bc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},vc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KNN_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},wc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Fc={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Pc={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},kc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Vc={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Yc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},xc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Uc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Bc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Xc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Gc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(ot.inputs.Align.RIGHT).setCheck(null).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_COEF,"coef_"],[ot.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Hc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[ot.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[ot.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},Wc={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("sklearn").appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_SAVE_MODEL,"dump"],[ot.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+ot.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(gc),this.setTooltip(""),this.setHelpUrl("")}},jc=120,Kc={init:function(){this.setColour(jc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY+"("+ot.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},qc={init:function(){this.setColour(jc),this.appendDummyInput().appendField(ot.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},$c={init:function(){this.setColour(jc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},zc={init:function(){this.setColour(jc),this.appendValueInput("STATUS_CODE",Number).appendField(ot.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Qc={init:function(){this.setColour(jc),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},Jc={init:function(){this.setColour(jc),this.appendValueInput("TIME").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zc={init:function(){this.setColour(jc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},tT={init:function(){this.setColour(jc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eT={init:function(){this.setColour(jc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},nT=180,iT={init:function(){this.setColour(nT),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_create).appendField(new ot.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},sT={init:function(){this.setColour(nT),this.appendDummyInput().appendField(ot.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},oT={init:function(){this.setColour(nT),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_forward,"forward"],[ot.Msg.blockpy_backward,"backward"]];this.setColour(nT),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},aT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_left,"left"],[ot.Msg.blockpy_right,"right"]];this.setColour(nT),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_rotate).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{left:ot.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:ot.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[t]}))}},lT={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_setheading),this.appendDummyInput().appendField(ot.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},uT={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pT={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_T={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(nT),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},dT={init:function(){this.setColour(nT);var t=[[ot.Msg.TURTLE_POS,"pos"],[ot.Msg.TURTLE_SHAPE,"shape"],[ot.Msg.TURTLE_HEADING,"heading"],[ot.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_POS_SHAPE).appendField(new ot.FieldDropdown(t),"DIR");var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pos:ot.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:ot.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:ot.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[t]})),this.setOutput(!0),this.setInputsInline(!0)}},hT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[ot.Msg.blockpy_turtle_reset,"reset"],[ot.Msg.blockpy_turtle_home,"home"]];this.setColour(nT),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ot.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ot.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ot.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},cT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_penup,"penup"],[ot.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(nT),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{penup:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[t]}))}},TT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_beginfill,"begin"],[ot.Msg.blockpy_turtle_endfill,"end"]];this.setColour(nT),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{begin:ot.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:ot.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[t]}))}},IT={init:function(){this.appendDummyInput("").appendField(new ot.FieldTextInput("tina"),"TUR");var t=[[ot.Msg.blockpy_turtle_size,"pensize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.setColour(nT),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_set).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pensize:ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[t]}))}},mT={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_size),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ET={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_speed),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_circle,"circle"],[ot.Msg.blockpy_turtle_dot,"dot"]];this.setColour(nT),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_draw).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{circle:ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:ot.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[t]}))}},gT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(ot.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},OT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_hide,"hideturtle"],[ot.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(nT),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{hideturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[t]}))}},MT={init:function(){this.setColour(nT),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_bgcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},RT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},AT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ST={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_CLONE),this.setTooltip(ot.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},CT={init:function(){this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},LT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},DT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},NT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR1").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bT={init:function(){this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},FT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_shape_arrow,"arrow"],[ot.Msg.blockpy_turtle_shape_turtle,"turtle"],[ot.Msg.blockpy_turtle_shape_circle,"circle"],[ot.Msg.blockpy_turtle_shape_square,"square"],[ot.Msg.blockpy_turtle_shape_triangle,"triangle"],[ot.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(nT),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_shape).appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_SHAPE_TOOLTIP)}},PT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},kT={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(nT),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TURTLE_NUMINPUT_TOOLTIP)}},VT={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(nT),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},YT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},xT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},UT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nT),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},BT={init:function(){this.setColour(nT),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},XT={init:function(){this.setColour(nT),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new ot.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},GT={init:function(){this.setColour(nT),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},HT={init:function(){this.setColour(nT),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},WT={init:function(){this.setColour(nT),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(ot.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},jT={init:function(){this.setColour(nT),this.appendValueInput("TUR"),this.appendDummyInput().appendField(ot.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},KT={init:function(){this.setColour(nT),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},qT=function(t,e){var n=this.getFieldValue("TYPE");return e.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",e.ORDER_ATOMIC]},$T=function(t,e){var n=this.getFieldValue("CTYPE");return e.definitions_.import_aip="import aip",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = aip."+n+"("+e.valueToCode(this,"API_KEY",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SECRET_KEY",e.ORDER_ATOMIC)+")\n"},zT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".synthesis("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},QT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".asr("+(e.valueToCode(this,"FILE",e.ORDER_ATOMIC)||'""')+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},JT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},ZT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".match("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"VAR2",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},tI=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},eI=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},nI=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR1",e.ORDER_ATOMIC),s=e.valueToCode(this,"STR2",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+","+s+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},iI=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".topic("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},sI=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".newsSummary("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"LEN",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},oI=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},rI=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},aI=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},lI=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},uI=function(t,e){return e.definitions_.import_audio="import audio","audio.audio_record("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"TIME",e.ORDER_ATOMIC)||"0")+")\n"},pI=function(t,e){return e.definitions_.import_audio="import cam","cam.photo_capture("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"BUT",e.ORDER_ATOMIC)||'""')+")\n"},_I=function(t,e){var n=e.valueToCode(this,"AI",e.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var s=n+'["result"][0]["keyword"]';if("Speech"==i)s=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)s=n+'["score"]';if("Ocr"==i)s=n+'["words_result"]';return[s,e.ORDER_ATOMIC]},dI=function(t,e){e.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"},hI=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"},cI=function(t,e){e.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"},TI=function(t,e){return["flag == 1",e.ORDER_ATOMIC]},II=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},mI=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},EI=function(t,e){e.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},fI=function(){var t="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return t="house[f].hide()\ndrive(path[len(path) - 1])\n"+t},gI=function(t,e){return["len(path) == 7",e.ORDER_ATOMIC]},OI=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},MI=function(t,e){e.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"},RI=function(t,e){return["f == 1",e.ORDER_ATOMIC]},AI=function(){return"print('没有符合条件的路线')\n"},SI=function(t,e){e.definitions_.import_time="import time",e.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'},CI=function(t,e){e.definitions_.import_time="import time",e.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'},LI=function(t,e){e.definitions_.import_time="import time",e.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'},yI=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},DI=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},NI=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},bI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},vI=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},wI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},FI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},PI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},kI=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},VI=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},YI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},xI=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},UI=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},BI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},XI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},GI=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"},HI=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},WI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},jI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},KI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},qI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},$I=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},zI=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},QI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},JI=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},ZI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},tm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},em=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},nm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},im=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},sm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},om=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},rm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},am=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},lm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},um=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},pm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},_m=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},dm=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,e.ORDER_ATOMIC]},WE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.groupby(by=${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"'tag'"})`,e.ORDER_ATOMIC]},jE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.${t.getFieldValue("TYPE")}()`,e.ORDER_ATOMIC]},KE=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},qE=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),s="class "+i+":\n";s+=" def __init__(self):\n";for(var o=new Array(this.itemCount_),r=0;r{document.removeEventListener("DOMContentLoaded",t),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",t)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:e}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new e(t);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new i(t);break;case"js":case"javascript":const{KernelJavaScript:s}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new s(t);break;case"sql":const{KernelSQL:o}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new o(t);break;case"ocaml":const{KernelOCaml:r}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new r(t);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 t=await this.kernelAvailable();return await t.loaded(),t}get kernel(){return this._kernel}get kernelSafe(){var t;return(null===(t=this.kernel)||void 0===t?void 0:t.ready)?this.kernel:null}async showLoader(t,e=!1,n=!0){this.kernelAvailable().then((()=>{var t;return null===(t=this.kernel)||void 0===t?void 0:t.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(e?"full":"foot"),s=document.createElement("div");s.id=this._loaderId,s.classList.add("darklighted"),s.classList.add("basthon-loader-root"),s.classList.add(i);const o=document.createElement("div");o.classList.add("basthon-loader-container"),o.classList.add(i),s.appendChild(o);const r=document.createElement("div");r.classList.add("basthon-loader-spinner"),r.classList.add(i),r.innerHTML="",o.appendChild(r);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),o.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=t,o.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",o.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(s),this._rootLoader=s;try{await this.kernelLoaded()}catch(t){const e=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${e.name} ${e.version}.`);for(const t of document.body.querySelectorAll(".basthon-loader-foot"))t.classList.remove("basthon-loader-foot"),t.classList.add("basthon-loader-full");return r.classList.remove("basthon-loader-spinner"),r.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(t){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=t)}setErrorText(t){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=t)}hideLoader(){if(this._doNotHideLoader)return;const t=this._rootLoader;null!=t&&(t.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,t.remove()}),1100))}browser(){var t,e=navigator.userAgent,n=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1]||""}:"Chrome"===n[1]&&null!=(t=e.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:t[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&n.splice(1,1,t[1]),{name:n[0],version:n[1]})}}class AO extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-image.html",new rt.HTMLTemplate('\r\n
')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["images"],AO);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("images","images",ot.Msg.PYTHON_PYODIDE_IMAGE),t.changeTo("output"),t.get("images")}}constructor(){super();const t=OO()(rt.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,o=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(OO()(t.content.replace("overflow-y%3A%20hidden%3B",""))),o=this.getContent()[0].getElementsByTagName("iframe")[0],null==o)return;o.style.maxHeight=o.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(o.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(o);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const SO=layui;var CO;!function(t){t[t.EPERM=1]="EPERM",t[t.ENOENT=2]="ENOENT",t[t.EINTR=4]="EINTR",t[t.EIO=5]="EIO",t[t.ENXIO=6]="ENXIO",t[t.EBADF=9]="EBADF",t[t.EAGAIN=11]="EAGAIN",t[t.ENOMEM=12]="ENOMEM",t[t.EACCES=13]="EACCES",t[t.EFAULT=14]="EFAULT",t[t.ENOTBLK=15]="ENOTBLK",t[t.EBUSY=16]="EBUSY",t[t.EEXIST=17]="EEXIST",t[t.EXDEV=18]="EXDEV",t[t.ENODEV=19]="ENODEV",t[t.ENOTDIR=20]="ENOTDIR",t[t.EISDIR=21]="EISDIR",t[t.EINVAL=22]="EINVAL",t[t.ENFILE=23]="ENFILE",t[t.EMFILE=24]="EMFILE",t[t.ETXTBSY=26]="ETXTBSY",t[t.EFBIG=27]="EFBIG",t[t.ENOSPC=28]="ENOSPC",t[t.ESPIPE=29]="ESPIPE",t[t.EROFS=30]="EROFS",t[t.EMLINK=31]="EMLINK",t[t.EPIPE=32]="EPIPE",t[t.EDOM=33]="EDOM",t[t.ERANGE=34]="ERANGE",t[t.EDEADLK=35]="EDEADLK",t[t.ENAMETOOLONG=36]="ENAMETOOLONG",t[t.ENOLCK=37]="ENOLCK",t[t.ENOSYS=38]="ENOSYS",t[t.ENOTEMPTY=39]="ENOTEMPTY",t[t.ELOOP=40]="ELOOP",t[t.ENOMSG=42]="ENOMSG",t[t.EBADE=52]="EBADE",t[t.EBADR=53]="EBADR",t[t.EXFULL=54]="EXFULL",t[t.ENOANO=55]="ENOANO",t[t.EBADRQC=56]="EBADRQC",t[t.ENOSTR=60]="ENOSTR",t[t.ENODATA=61]="ENODATA",t[t.ETIME=62]="ETIME",t[t.ENOSR=63]="ENOSR",t[t.ENONET=64]="ENONET",t[t.EREMOTE=66]="EREMOTE",t[t.ENOLINK=67]="ENOLINK",t[t.ECOMM=70]="ECOMM",t[t.EPROTO=71]="EPROTO",t[t.EBADMSG=74]="EBADMSG",t[t.EOVERFLOW=75]="EOVERFLOW",t[t.EBADFD=77]="EBADFD",t[t.ESTRPIPE=86]="ESTRPIPE",t[t.ENOTSOCK=88]="ENOTSOCK",t[t.EDESTADDRREQ=89]="EDESTADDRREQ",t[t.EMSGSIZE=90]="EMSGSIZE",t[t.EPROTOTYPE=91]="EPROTOTYPE",t[t.ENOPROTOOPT=92]="ENOPROTOOPT",t[t.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",t[t.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",t[t.ENOTSUP=95]="ENOTSUP",t[t.ENETDOWN=100]="ENETDOWN",t[t.ENETUNREACH=101]="ENETUNREACH",t[t.ENETRESET=102]="ENETRESET",t[t.ETIMEDOUT=110]="ETIMEDOUT",t[t.ECONNREFUSED=111]="ECONNREFUSED",t[t.EHOSTDOWN=112]="EHOSTDOWN",t[t.EHOSTUNREACH=113]="EHOSTUNREACH",t[t.EALREADY=114]="EALREADY",t[t.EINPROGRESS=115]="EINPROGRESS",t[t.ESTALE=116]="ESTALE",t[t.EREMOTEIO=121]="EREMOTEIO",t[t.EDQUOT=122]="EDQUOT"}(CO||(CO={}));const LO={[CO.EPERM]:"Operation not permitted",[CO.ENOENT]:"No such file or directory",[CO.EINTR]:"Interrupted system call",[CO.EIO]:"Input/output error",[CO.ENXIO]:"No such device or address",[CO.EBADF]:"Bad file descriptor",[CO.EAGAIN]:"Resource temporarily unavailable",[CO.ENOMEM]:"Cannot allocate memory",[CO.EACCES]:"Permission denied",[CO.EFAULT]:"Bad address",[CO.ENOTBLK]:"Block device required",[CO.EBUSY]:"Resource busy or locked",[CO.EEXIST]:"File exists",[CO.EXDEV]:"Invalid cross-device link",[CO.ENODEV]:"No such device",[CO.ENOTDIR]:"File is not a directory",[CO.EISDIR]:"File is a directory",[CO.EINVAL]:"Invalid argument",[CO.ENFILE]:"Too many open files in system",[CO.EMFILE]:"Too many open files",[CO.ETXTBSY]:"Text file busy",[CO.EFBIG]:"File is too big",[CO.ENOSPC]:"No space left on disk",[CO.ESPIPE]:"Illegal seek",[CO.EROFS]:"Cannot modify a read-only file system",[CO.EMLINK]:"Too many links",[CO.EPIPE]:"Broken pipe",[CO.EDOM]:"Numerical argument out of domain",[CO.ERANGE]:"Numerical result out of range",[CO.EDEADLK]:"Resource deadlock would occur",[CO.ENAMETOOLONG]:"File name too long",[CO.ENOLCK]:"No locks available",[CO.ENOSYS]:"Function not implemented",[CO.ENOTEMPTY]:"Directory is not empty",[CO.ELOOP]:"Too many levels of symbolic links",[CO.ENOMSG]:"No message of desired type",[CO.EBADE]:"Invalid exchange",[CO.EBADR]:"Invalid request descriptor",[CO.EXFULL]:"Exchange full",[CO.ENOANO]:"No anode",[CO.EBADRQC]:"Invalid request code",[CO.ENOSTR]:"Device not a stream",[CO.ENODATA]:"No data available",[CO.ETIME]:"Timer expired",[CO.ENOSR]:"Out of streams resources",[CO.ENONET]:"Machine is not on the network",[CO.EREMOTE]:"Object is remote",[CO.ENOLINK]:"Link has been severed",[CO.ECOMM]:"Communication error on send",[CO.EPROTO]:"Protocol error",[CO.EBADMSG]:"Bad message",[CO.EOVERFLOW]:"Value too large for defined data type",[CO.EBADFD]:"File descriptor in bad state",[CO.ESTRPIPE]:"Streams pipe error",[CO.ENOTSOCK]:"Socket operation on non-socket",[CO.EDESTADDRREQ]:"Destination address required",[CO.EMSGSIZE]:"Message too long",[CO.EPROTOTYPE]:"Protocol wrong type for socket",[CO.ENOPROTOOPT]:"Protocol not available",[CO.EPROTONOSUPPORT]:"Protocol not supported",[CO.ESOCKTNOSUPPORT]:"Socket type not supported",[CO.ENOTSUP]:"Operation is not supported",[CO.ENETDOWN]:"Network is down",[CO.ENETUNREACH]:"Network is unreachable",[CO.ENETRESET]:"Network dropped connection on reset",[CO.ETIMEDOUT]:"Connection timed out",[CO.ECONNREFUSED]:"Connection refused",[CO.EHOSTDOWN]:"Host is down",[CO.EHOSTUNREACH]:"No route to host",[CO.EALREADY]:"Operation already in progress",[CO.EINPROGRESS]:"Operation now in progress",[CO.ESTALE]:"Stale file handle",[CO.EREMOTEIO]:"Remote I/O error",[CO.EDQUOT]:"Disk quota exceeded"};class yO extends Error{static fromJSON(t){const e=new yO(t.errno,t.message,t.path,t.syscall);return e.code=t.code,e.stack=t.stack,e}static With(t,e,n){return new yO(CO[t],LO[CO[t]],e,n)}constructor(t,e=LO[t],n,i=""){super(e),this.errno=t,this.path=n,this.syscall=i,this.code=CO[t],this.message=this.code+": "+e+(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 DO="/";function NO(t,e){let n="",i=0,s=-1,o=0,r="\0";for(let a=0;a<=t.length;++a){if(a2){const t=n.lastIndexOf("/");-1===t?(n="",i=0):(n=n.slice(0,t),i=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}if(0!==n.length){n="",i=0,s=a,o=0;continue}}e&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),i=a-s-1;s=a,o=0}else"."===r&&-1!==o?++o:o=-1}return n}function bO(...t){let e="";for(const n of[...t.reverse(),DO])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;const n=e.startsWith("/");return e=NO(e,!n),n?`/${e}`:e.length?e:"/"}function vO(...t){if(!t.length)return".";const e=t.join("/");return e?.length?function(t){if(!t.length)return".";const e=t.startsWith("/"),n=t.endsWith("/");return(t=NO(t,!e)).length?(n&&(t+="/"),e?`/${t}`:t):e?"/":n?"./":"."}(e):"."}function wO(t){if(0===t.length)return".";const e="/"===t[0];let n=-1,i=!0;for(let e=t.length-1;e>=1;--e)if("/"===t[e]){if(!i){n=e;break}}else i=!1;return-1===n?e?"/":".":e&&1===n?"//":t.slice(0,n)}function FO(t,e){let n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,r=-1;for(let a=t.length-1;a>=0;--a)if("/"===t[a]){if(!s){n=a+1;break}}else-1===r&&(s=!1,r=a+1),o>=0&&(t[a]===e[o]?-1==--o&&(i=a):(o=-1,i=r));return n===i?i=r:-1===i&&(i=t.length),t.slice(n,i)}for(let e=t.length-1;e>=0;--e)if("/"===t[e]){if(!s){n=e+1;break}}else-1===i&&(s=!1,i=e+1);return-1===i?"":t.slice(n,i)}function PO(t){const e=t.startsWith("/"),n={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(0===t.length)return n;const i=e?1:0;let s=-1,o=0,r=-1,a=!0,l=t.length-1,u=0;for(;l>=i;--l)if("/"!==t[l])-1===r&&(a=!1,r=l+1),"."===t[l]?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!a){o=l+1;break}if(-1!==r){const i=0===o&&e?1:o;-1===s||0===u||1===u&&s===r-1&&s===o+1?n.base=n.name=t.slice(i,r):(n.name=t.slice(i,s),n.base=t.slice(i,r),n.ext=t.slice(s,r))}return o>0?n.dir=t.slice(0,o-1):e&&(n.dir="/"),n}const kO=new TextEncoder;function VO(t){if("string"!=typeof t)throw new yO(CO.EINVAL,"Can not encode a non-string");return kO.encode(t)}const YO=new TextDecoder;function xO(t){if(!(t instanceof Uint8Array))throw new yO(CO.EINVAL,"Can not decode a non-Uint8Array");return YO.decode(t)}function UO(t){return JSON.parse(xO(t),((t,e)=>""==t?e:BigInt(e)))}function BO(t){return VO(JSON.stringify(t,((t,e)=>""==t?e:e.toString())))}function XO(t,e){if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,8);if(!isNaN(e))return e}if("number"==typeof e)return e;throw new yO(CO.EINVAL,"Invalid mode: "+t?.toString())}function GO(t){if(t instanceof Date)return t;try{return new Date(t)}catch{throw new yO(CO.EINVAL,"Invalid time.")}}function HO(t){if((t=t.toString()).includes("\0"))throw new yO(CO.EINVAL,"Path can not contain null character");if(0==t.length)throw new yO(CO.EINVAL,"Path can not be empty");return bO(t.replaceAll(/[/\\]+/g,"/"))}function WO(t,e="utf8",n,i=0){return"object"!=typeof t||null===t?{encoding:"string"==typeof t?t:e??null,flag:n,mode:i}:{encoding:"string"==typeof t?.encoding?t.encoding:e??null,flag:"string"==typeof t?.flag?t.flag:n,mode:XO("mode"in t?t?.mode:null,i)}}function jO(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const KO={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function qO(t){return{suid:t.uid,sgid:t.gid,euid:t.uid,egid:t.gid,groups:[],...t}}const $O=0,zO=4,QO=2,JO=1,ZO=1,tM=2,eM=4,nM=0,iM=1,sM=2,oM=64,rM=128,aM=256,lM=512,uM=1024,pM=65536,_M=262144,dM=131072,hM=1052672,cM=4096,TM=32768,IM=16384,mM=2048,EM=61440,fM=49152,gM=40960,OM=32768,MM=24576,RM=16384,AM=8192,SM=4096,CM=2048,LM=1024,yM=512,DM=448,NM=256,bM=128,vM=64,wM=56,FM=32,PM=16,kM=8,VM=7,YM=4,xM=2,UM=1,BM=0,XM=2**32-1,GM={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let t,e;const n=new Promise(((n,i)=>{t=n,e=i}));return{promise:n,resolve:t,reject:e}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class HM{_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}constructor({atimeMs:t,mtimeMs:e,ctimeMs:n,birthtimeMs:i,uid:s,gid:o,size:r,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(t??u),this.mtimeMs=this._convert(e??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(s??0),this.gid=this._convert(o??0),this.size=this._convert(r??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&OM),this.mode&EM||(this.mode=this.mode|this._convert(OM))}isFile(){return(this.mode&EM)===OM}isDirectory(){return(this.mode&EM)===RM}isSymbolicLink(){return(this.mode&EM)===gM}isSocket(){return(this.mode&EM)===fM}isBlockDevice(){return(this.mode&EM)===MM}isCharacterDevice(){return(this.mode&EM)===AM}isFIFO(){return(this.mode&EM)===SM}hasAccess(t,e){const n=e?.credentials||KO;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&NM&&(i|=zO),this.mode&bM&&(i|=QO),this.mode&vM&&(i|=JO)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&FM&&(i|=zO),this.mode&PM&&(i|=QO),this.mode&kM&&(i|=JO)),this.mode&YM&&(i|=zO),this.mode&xM&&(i|=QO),this.mode&UM&&(i|=JO),(i&t)===t}chmod(t){this.mode=this._convert(this.mode&EM|t)}chown(t,e){t=Number(t),e=Number(e),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(e)&&0<=e&&e<2**32&&(this.gid=this._convert(e))}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 WM(t,e,n){!isNaN(e)&&0<=e&&e<2**32&&(t.uid=e),!isNaN(n)&&0<=n&&n<2**32&&(t.gid=n)}class jM extends HM{constructor(){super(...arguments),this._isBigint=!1}}class KM extends HM{constructor(){super(...arguments),this._isBigint=!0}}class qM{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=XM,this.ffree=XM}}class $M{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(XM),this.ffree=BigInt(XM)}}const zM=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function QM(t){if("number"==typeof t)return function(t){switch(t){case nM:return"r";case nM|hM:return"rs";case sM:return"r+";case sM|hM:return"rs+";case lM|oM|iM:return"w";case lM|oM|iM|rM:return"wx";case lM|oM|sM:return"w+";case lM|oM|sM|rM:return"wx+";case uM|oM|iM:return"a";case uM|oM|iM|rM:return"ax";case uM|oM|sM:return"a+";case uM|oM|sM|rM:return"ax+";default:throw new Error("Invalid flag number: "+t)}}(t);if(!zM.includes(t))throw new Error("Invalid flag string: "+t);return t}function JM(t){let e=0;return e<<=1,e+=+ZM(t),e<<=1,e+=+tR(t),e<<=1,e}function ZM(t){return-1!==t.indexOf("r")||-1!==t.indexOf("+")}function tR(t){return-1!==t.indexOf("w")||-1!==t.indexOf("a")||-1!==t.indexOf("+")}function eR(t){return-1!==t.indexOf("w")}function nR(t){return-1!==t.indexOf("a")}function iR(t){return-1!==t.indexOf("x")}class sR{constructor(t,e){this.fs=t,this.path=e}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class oR extends sR{constructor(t,e,n,i,s=new Uint8Array(new ArrayBuffer(0,t.metadata().noResizableBuffers?{}:{maxByteLength:XM}))){if(super(t,e),this.flag=n,this.stats=i,this._buffer=s,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=s.byteLength){if(ZM(this.flag))throw new Error(`Size mismatch: buffer length ${s.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return nR(this.flag)?this.stats.size:this._position}set position(t){this._position=t}async sync(){if(this.closed)throw yO.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 yO.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 yO.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw yO.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(t){if(this.closed)throw yO.With("EBADF",this.path,"File.dispose");if(this.dirty&&!t)throw yO.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw yO.With("EBADF",this.path,"File.stat");return Promise.resolve(new jM(this.stats))}statSync(){if(this.closed)throw yO.With("EBADF",this.path,"File.stat");return new jM(this.stats)}_truncate(t){if(this.closed)throw yO.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!tR(this.flag))throw new yO(CO.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),t>this._buffer.length){const e=new Uint8Array(t-this._buffer.length);this._write(e,0,e.length,this._buffer.length)}else this.stats.size=t,this._buffer=t?this._buffer.slice(0,t):new Uint8Array}async truncate(t){this._truncate(t),GM.syncImmediately&&await this.sync()}truncateSync(t){this._truncate(t),GM.syncImmediately&&this.syncSync()}_write(t,e=0,n=this.stats.size,i=this.position){if(this.closed)throw yO.With("EBADF",this.path,"File.write");if(!tR(this.flag))throw new yO(CO.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const s=i+n,o=t.slice(e,e+n);if(s>this.stats.size&&(this.stats.size=s,s>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=s)this._buffer.buffer.resize(s);else if(GM.unsafeBufferReplace)this._buffer=o;else{const t=new Uint8Array(new ArrayBuffer(s,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:XM}));t.set(this._buffer),this._buffer=t}return this._buffer.set(o,i),this.stats.mtimeMs=Date.now(),this.position=i+o.byteLength,o.byteLength}async write(t,e,n,i){const s=this._write(t,e,n,i);return GM.syncImmediately&&await this.sync(),s}writeSync(t,e=0,n=this.stats.size,i=this.position){const s=this._write(t,e,n,i);return GM.syncImmediately&&this.syncSync(),s}_read(t,e=0,n=this.stats.size,i){if(this.closed)throw yO.With("EBADF",this.path,"File.read");if(!ZM(this.flag))throw new yO(CO.EPERM,"File not opened with a readable mode.");GM.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let s=i+n;s>this.stats.size&&(s=i+Math.max(this.stats.size-i,0)),this._position=s;const o=s-i;return 0==o||new Uint8Array(t.buffer,e,n).set(this._buffer.slice(i,s)),o}async read(t,e,n,i){const s=this._read(t,e,n,i);return GM.syncImmediately&&await this.sync(),{bytesRead:s,buffer:t}}readSync(t,e,n,i){const s=this._read(t,e,n,i);return GM.syncImmediately&&this.syncSync(),s}async chmod(t){if(this.closed)throw yO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>EM?~EM:EM)|t,(GM.syncImmediately||t>EM)&&await this.sync()}chmodSync(t){if(this.closed)throw yO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>EM?~EM:EM)|t,(GM.syncImmediately||t>EM)&&this.syncSync()}async chown(t,e){if(this.closed)throw yO.With("EBADF",this.path,"File.chown");this.dirty=!0,WM(this.stats,t,e),GM.syncImmediately&&await this.sync()}chownSync(t,e){if(this.closed)throw yO.With("EBADF",this.path,"File.chown");this.dirty=!0,WM(this.stats,t,e),GM.syncImmediately&&this.syncSync()}async utimes(t,e){if(this.closed)throw yO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,GM.syncImmediately&&await this.sync()}utimesSync(t,e){if(this.closed)throw yO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,GM.syncImmediately&&this.syncSync()}}class rR{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(t){return"ENOENT"!=t.code}}existsSync(t){try{return this.statSync(t),!0}catch(t){return"ENOENT"!=t.code}}}var aR=__webpack_require__(228);Symbol.toStringTag,Symbol.iterator;const lR=Intl.NumberFormat("en",{notation:"compact"});lR.format.bind(lR);function uR(t){return t.at(0).toUpperCase()+t.slice(1)}const pR=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],_R=[...pR,...pR.map((t=>uR(t))),"char"],dR=/^(u?int|float)(8|16|32|64)$/i;function hR(t){return"char"==t?"uint8":t.toLowerCase()}function cR(t){return dR.test(t.toString())}function TR(t){return"char"==t||dR.test(t.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function IR(t){const e=Symbol.metadata||Object.getOwnPropertySymbols(t).find((t=>"Symbol.metadata"==t.description));var n;if(n=t,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!e)throw new ReferenceError("Could not get a reference to Symbol.metadata");return e}function mR(t){return"function"==typeof t&&IR(t)in t&&function(t){return null!=t&&"object"==typeof t&&Symbol.struct_metadata in t}(t[IR(t)])}function ER(t){return null!=t&&"object"==typeof t&&mR(t.constructor)}function fR(t){if(!ER(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct instance")}function gR(t){if(!function(t){return ER(t)||mR(t)}(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct")}function OR(t){if("string"==typeof t)return function(t){if(!TR(t))throw new TypeError("Not a valid primitive type: "+t)}(t),+hR(t).match(dR)[2]/8;gR(t);const e=mR(t)?t:t.constructor;return e[IR(e)][Symbol.struct_metadata].size}function MR(t={}){return function(e,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const s=new Map;for(const e of n.metadata[Symbol.struct_init]){const{name:n,type:a,length:l}=e;if(!TR(a)&&!mR(a))throw new TypeError("Not a valid type: "+a);s.set(n,{offset:i,type:TR(a)?hR(a):a,length:l}),i+=OR(a)*(l||1),o=i,r=t.align||1,i=Math.ceil(o/r)*r}var o,r;return n.metadata[Symbol.struct_metadata]={options:t,members:s,size:i},e}}function RR(t,e){return function(n,i){let s=i.name;if("symbol"==typeof s&&(console.warn("Symbol used for struct member name will be coerced to string: "+s.toString()),s=s.toString()),!s)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:s,type:t,length:e}),n}}function AR(t){fR(t);const{options:e,members:n}=t.constructor[IR(t.constructor)][Symbol.struct_metadata],i=new Uint8Array(OR(t)),s=new DataView(i.buffer);for(const[o,{type:r,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+OR(r)*n;let p=a>0?t[o][n]:t[o];if("string"==typeof p&&(p=p.charCodeAt(0)),!cR(r)){i.set(p?AR(p):new Uint8Array(OR(r)),u);continue}const _="set"+uR(r);"setInt64"!=_?"setUint64"!=_?s[_](u,Number(p),!e.bigEndian):s.setBigUint64(u,BigInt(p),!e.bigEndian):s.setBigInt64(u,BigInt(p),!e.bigEndian)}return i}function SR(t,e){fR(t);const{options:n,members:i}=t.constructor[IR(t.constructor)][Symbol.struct_metadata],s=e instanceof Uint8Array?e:new Uint8Array("buffer"in e?e.buffer:e),o=new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength));for(const[e,{type:r,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?t[e]:t;const p=l>0?i:e,_=a+OR(r)*i;if("string"==typeof t[e]){t[e]=t[e].slice(0,i)+String.fromCharCode(o.getUint8(_))+t[e].slice(i+1);continue}if(!cR(r)){if(null===u[p]||void 0===u[p])continue;SR(u[p],new Uint8Array(s.slice(_,_+OR(r))));continue}l>0&&(u||=[]);const d="get"+uR(r);"getInt64"!=d?u[p]="getUint64"!=d?o[d](_,!n.bigEndian):o.getBigUint64(_,!n.bigEndian):u[p]=o.getBigInt64(_,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const CR=Object.fromEntries(_R.map((t=>{return[t,(e=t,function(t,n){return"number"==typeof t?RR(e,t):RR(e)(t,n)})];var e})));var LR=function(t,e,n,i,s,o){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?i.static?t:t.prototype:null,_=e||(p?Object.getOwnPropertyDescriptor(p,i.name):{}),d=!1,h=n.length-1;h>=0;h--){var c={};for(var T in i)c[T]="access"===T?{}:i[T];for(var T in i.access)c.access[T]=i.access[T];c.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(r(t||null))};var I=(0,n[h])("accessor"===l?{get:_.get,set:_.set}:_[u],c);if("accessor"===l){if(void 0===I)continue;if(null===I||"object"!=typeof I)throw new TypeError("Object expected");(a=r(I.get))&&(_.get=a),(a=r(I.set))&&(_.set=a),(a=r(I.init))&&s.unshift(a)}else(a=r(I))&&("field"===l?s.unshift(a):_[u]=a)}p&&Object.defineProperty(p,i.name,_),d=!0},yR=function(t,e,n){for(var i=arguments.length>2,s=0;s{var t,e,n,i,s,o,r,a,l,u,p;let _,d,h,c,T,I,m,E,f,g,O,M,R,A=[MR()],S=[],C=[],L=[],y=[],D=[],N=[],b=[],v=[],w=[],F=[],P=[],k=[],V=[],Y=[],x=[],U=[],B=[],X=[],G=[],H=[],W=[],j=[],K=[];var q=d=class{constructor(t){if(this.data=yR(this,C,void 0),this.size=(yR(this,L),yR(this,y,void 0)),this.mode=(yR(this,D),yR(this,N,void 0)),this.nlink=(yR(this,b),yR(this,v,void 0)),this.uid=(yR(this,w),yR(this,F,void 0)),this.gid=(yR(this,P),yR(this,k,void 0)),this.atimeMs=(yR(this,V),yR(this,Y,void 0)),this.birthtimeMs=(yR(this,x),yR(this,U,void 0)),this.mtimeMs=(yR(this,B),yR(this,X,void 0)),this.ctimeMs=(yR(this,G),yR(this,H,void 0)),this.ino=(yR(this,W),yR(this,j,void 0)),yR(this,K),t){const e=OR(q),n=e-OR("uint64");if(t.byteLength{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[(t=CR).uint64.bind(t)],c=[(e=CR).uint32.bind(e)],T=[(n=CR).uint16.bind(n)],I=[(i=CR).uint32.bind(i)],m=[(s=CR).uint32.bind(s)],E=[(o=CR).uint32.bind(o)],f=[(r=CR).float64.bind(r)],g=[(a=CR).float64.bind(a)],O=[(l=CR).float64.bind(l)],M=[(u=CR).float64.bind(u)],R=[(p=CR).uint64.bind(p)],LR(null,null,h,{kind:"field",name:"data",static:!1,private:!1,access:{has:t=>"data"in t,get:t=>t.data,set:(t,e)=>{t.data=e}},metadata:$},C,L),LR(null,null,c,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:$},y,D),LR(null,null,T,{kind:"field",name:"mode",static:!1,private:!1,access:{has:t=>"mode"in t,get:t=>t.mode,set:(t,e)=>{t.mode=e}},metadata:$},N,b),LR(null,null,I,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:t=>"nlink"in t,get:t=>t.nlink,set:(t,e)=>{t.nlink=e}},metadata:$},v,w),LR(null,null,m,{kind:"field",name:"uid",static:!1,private:!1,access:{has:t=>"uid"in t,get:t=>t.uid,set:(t,e)=>{t.uid=e}},metadata:$},F,P),LR(null,null,E,{kind:"field",name:"gid",static:!1,private:!1,access:{has:t=>"gid"in t,get:t=>t.gid,set:(t,e)=>{t.gid=e}},metadata:$},k,V),LR(null,null,f,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:t=>"atimeMs"in t,get:t=>t.atimeMs,set:(t,e)=>{t.atimeMs=e}},metadata:$},Y,x),LR(null,null,g,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:t=>"birthtimeMs"in t,get:t=>t.birthtimeMs,set:(t,e)=>{t.birthtimeMs=e}},metadata:$},U,B),LR(null,null,O,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:t=>"mtimeMs"in t,get:t=>t.mtimeMs,set:(t,e)=>{t.mtimeMs=e}},metadata:$},X,G),LR(null,null,M,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:t=>"ctimeMs"in t,get:t=>t.ctimeMs,set:(t,e)=>{t.ctimeMs=e}},metadata:$},H,W),LR(null,null,R,{kind:"field",name:"ino",static:!1,private:!1,access:{has:t=>"ino"in t,get:t=>t.ino,set:(t,e)=>{t.ino=e}},metadata:$},j,K),LR(null,_={value:d},A,{kind:"class",name:d.name,metadata:$},null,S),q=d=_.value,$&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),yR(d,S)})(),q=d})();var bR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},vR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class wR extends rR{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(t){super(),this.store=t,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(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=bR(n,this.store.transaction(),!0),s=PO(t),o=PO(e),r=await this.findInode(i,s.dir,"rename"),a=UO(await this.get(i,r.data,s.dir,"rename"));if(!a[s.base])throw yO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0===(o.dir+"/").indexOf(t+"/"))throw new yO(CO.EBUSY,s.dir);const u=o.dir==s.dir,p=u?r:await this.findInode(i,o.dir,"rename"),_=u?a:UO(await this.get(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new NR(await this.get(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw yO.With("EPERM",e,"rename");await i.remove(t.data),await i.remove(_[o.base])}_[o.base]=l,await i.set(r.data,BO(a)),await i.set(p.data,BO(_)),await i.commit()}catch(t){n.error=t,n.hasError=!0}finally{const t=vR(n);t&&await t}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=bR(n,this.store.transaction(),!1),s=PO(t),o=PO(e),r=this.findInodeSync(i,s.dir,"rename"),a=UO(this.getSync(i,r.data,s.dir,"rename"));if(!a[s.base])throw yO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0==(o.dir+"/").indexOf(t+"/"))throw new yO(CO.EBUSY,s.dir);const u=o.dir===s.dir,p=u?r:this.findInodeSync(i,o.dir,"rename"),_=u?a:UO(this.getSync(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new NR(this.getSync(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw yO.With("EPERM",e,"rename");i.removeSync(t.data),i.removeSync(_[o.base])}_[o.base]=l,i.setSync(r.data,BO(a)),i.setSync(p.data,BO(_)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{vR(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{const n=bR(e,this.store.transaction(),!0);return(await this.findInode(n,t,"stat")).toStats()}catch(t){e.error=t,e.hasError=!0}finally{const t=vR(e);t&&await t}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=bR(e,this.store.transaction(),!1);return this.findInodeSync(n,t,"stat").toStats()}catch(t){e.error=t,e.hasError=!0}finally{vR(e)}}async createFile(t,e,n){const i=await this.commitNew(t,OM,n,new Uint8Array,"createFile");return new oR(this,t,e,i.toStats(),new Uint8Array)}createFileSync(t,e,n){const i=this.commitNewSync(t,OM,n,new Uint8Array,"createFile");return new oR(this,t,e,i.toStats(),new Uint8Array)}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=bR(n,this.store.transaction(),!0),s=await this.findInode(i,t,"openFile"),o=await this.get(i,s.data,t,"openFile");return new oR(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{const t=vR(n);t&&await t}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=bR(n,this.store.transaction(),!1),s=this.findInodeSync(i,t,"openFile"),o=this.getSync(i,s.data,t,"openFile");return new oR(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{vR(n)}}async unlink(t){return this.remove(t,!1,"unlink")}unlinkSync(t){this.removeSync(t,!1,"unlink")}async rmdir(t){if((await this.readdir(t)).length)throw yO.With("ENOTEMPTY",t,"rmdir");await this.remove(t,!0,"rmdir")}rmdirSync(t){if(this.readdirSync(t).length)throw yO.With("ENOTEMPTY",t,"rmdir");this.removeSync(t,!0,"rmdir")}async mkdir(t,e){await this.commitNew(t,RM,e,VO("{}"),"mkdir")}mkdirSync(t,e){this.commitNewSync(t,RM,e,VO("{}"),"mkdir")}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{const n=bR(e,this.store.transaction(),!0),i=await this.findInode(n,t,"readdir");return Object.keys(UO(await this.get(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{const t=vR(e);t&&await t}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=bR(e,this.store.transaction(),!1),i=this.findInodeSync(n,t,"readdir");return Object.keys(UO(this.getSync(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{vR(e)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=bR(i,this.store.transaction(),!0),o=await this._findInode(s,t,"sync"),r=new NR(await this.get(s,o,t,"sync")),a=r.update(n);await s.set(r.data,e),a&&await s.set(o,AR(r)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=vR(i);t&&await t}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=bR(i,this.store.transaction(),!1),o=this._findInodeSync(s,t,"sync"),r=new NR(this.getSync(s,o,t,"sync")),a=r.update(n);s.setSync(r.data,e),a&&s.setSync(o,AR(r)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{vR(i)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=bR(n,this.store.transaction(),!0),s=wO(e),o=await this.findInode(i,s,"link"),r=UO(await this.get(i,o.data,s,"link")),a=await this._findInode(i,t,"link"),l=new NR(await this.get(i,a,t,"link"));l.nlink++,r[FO(e)]=a,i.setSync(a,AR(l)),i.setSync(o.data,BO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{const t=vR(n);t&&await t}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=bR(n,this.store.transaction(),!1),s=wO(e),o=this.findInodeSync(i,s,"link"),r=UO(this.getSync(i,o.data,s,"link")),a=this._findInodeSync(i,t,"link"),l=new NR(this.getSync(i,a,t,"link"));l.nlink++,r[FO(e)]=a,i.setSync(a,AR(l)),i.setSync(o.data,BO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{vR(n)}}async checkRoot(){const t={stack:[],error:void 0,hasError:!1};try{const e=bR(t,this.store.transaction(),!0);if(await e.get(0n))return;const n=new NR;n.ino=0n,n.mode=511|RM,await e.set(n.data,VO("{}")),await e.set(0n,AR(n)),await e.commit()}catch(e){t.error=e,t.hasError=!0}finally{const e=vR(t);e&&await e}}checkRootSync(){const t={stack:[],error:void 0,hasError:!1};try{const e=bR(t,this.store.transaction(),!1);if(e.getSync(0n))return;const n=new NR;n.ino=0n,n.mode=511|RM,e.setSync(n.data,VO("{}")),e.setSync(0n,AR(n)),e.commitSync()}catch(e){t.error=e,t.hasError=!0}finally{vR(t)}}async _findInode(t,e,n,i=new Set){if(i.has(e))throw new yO(CO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=PO(e),r="/"==s?new NR(await this.get(t,0n,s,n)):await this.findInode(t,s,n,i),a=UO(await this.get(t,r.data,s,n));if(!(o in a))throw yO.With("ENOENT",bO(s,o),n);return a[o]}_findInodeSync(t,e,n,i=new Set){if(i.has(e))throw new yO(CO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=PO(e),r="/"==s?new NR(this.getSync(t,0n,s,n)):this.findInodeSync(t,s,n,i),a=UO(this.getSync(t,r.data,s,n));if(!(o in a))throw yO.With("ENOENT",bO(s,o),n);return a[o]}async findInode(t,e,n,i=new Set){const s=await this._findInode(t,e,n,i);return new NR(await this.get(t,s,e,n))}findInodeSync(t,e,n,i=new Set){const s=this._findInodeSync(t,e,n,i);return new NR(this.getSync(t,s,e,n))}async get(t,e,n,i){const s=await t.get(e);if(!s)throw yO.With("ENOENT",n,i);return s}getSync(t,e,n,i){const s=t.getSync(e);if(!s)throw yO.With("ENOENT",n,i);return s}async allocNew(t,e,n){for(let e=0;e<5;e++){const e=jO();if(!await t.get(e))return e}throw new yO(CO.ENOSPC,"No IDs available",e,n)}allocNewSync(t,e,n){for(let e=0;e<5;e++){const e=jO();if(!t.getSync(e))return e}throw new yO(CO.ENOSPC,"No IDs available",e,n)}async commitNew(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw yO.With("EEXIST",t,s);const r=bR(o,this.store.transaction(),!0),{dir:a,base:l}=PO(t),u=await this.findInode(r,a,s),p=UO(await this.get(r,u.data,a,s));if(p[l])throw yO.With("EEXIST",t,s);const _=new NR;return _.ino=await this.allocNew(r,t,s),_.data=await this.allocNew(r,t,s),_.mode=n|e,_.uid=u.mode&CM?u.uid:KO.uid,_.gid=u.mode&LM?u.gid:KO.gid,_.size=i.length,await r.set(_.ino,AR(_)),await r.set(_.data,i),p[l]=_.ino,await r.set(u.data,BO(p)),await r.commit(),_}catch(t){o.error=t,o.hasError=!0}finally{const t=vR(o);t&&await t}}commitNewSync(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw yO.With("EEXIST",t,s);const r=bR(o,this.store.transaction(),!1),{dir:a,base:l}=PO(t),u=this.findInodeSync(r,a,s),p=UO(this.getSync(r,u.data,a,s));if(p[l])throw yO.With("EEXIST",t,s);const _=new NR;return _.ino=this.allocNewSync(r,t,s),_.data=this.allocNewSync(r,t,s),_.size=i.length,_.mode=n|e,_.uid=u.mode&CM?u.uid:KO.uid,_.gid=u.mode&LM?u.gid:KO.gid,r.setSync(_.ino,AR(_)),r.setSync(_.data,i),p[l]=_.ino,r.setSync(u.data,BO(p)),r.commitSync(),_}catch(t){o.error=t,o.hasError=!0}finally{vR(o)}}async remove(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=bR(i,this.store.transaction(),!0),{dir:o,base:r}=PO(t),a=await this.findInode(s,o,n),l=UO(await this.get(s,a.data,o,n));if(!l[r])throw yO.With("ENOENT",t,"remove");const u=l[r],p=new NR(await this.get(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw yO.With("EISDIR",t,"remove");await s.set(a.data,BO(l)),--p.nlink<1&&(await s.remove(p.data),await s.remove(u)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=vR(i);t&&await t}}removeSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=bR(i,this.store.transaction(),!1),{dir:o,base:r}=PO(t),a=this.findInodeSync(s,o,n),l=UO(this.getSync(s,a.data,o,n)),u=l[r];if(!u)throw yO.With("ENOENT",t,"remove");const p=new NR(this.getSync(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw yO.With("EISDIR",t,"remove");s.setSync(a.data,BO(l)),--p.nlink<1&&(s.removeSync(p.data),s.removeSync(u)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{vR(i)}}}class FR{constructor(t){this.store=t,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class PR extends FR{async keys(){return this.keysSync()}async get(t){return this.getSync(t)}async set(t,e){return this.setSync(t,e)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class kR extends PR{constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(t){const e=this.store.get(t);return this.stashOldValue(t,e),e}setSync(t,e){return this.markModified(t),this.store.set(t,e)}removeSync(t){this.markModified(t),this.store.delete(t)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const t of this.modifiedKeys){const e=this.originalData.get(t);e?this.store.set(t,e):this.store.delete(t)}this.done=!0}}stashOldValue(t,e){this.originalData.has(t)||this.originalData.set(t,e)}markModified(t){this.modifiedKeys.add(t),this.originalData.has(t)||this.originalData.set(t,this.store.get(t))}}class VR extends Map{constructor(t="tmp"){super(),this.name=t}async sync(){}clearSync(){this.clear()}transaction(){return new kR(this)}}const YR={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:t}){const e=new wR(new VR(t));return e.checkRootSync(),e}};"function"==typeof SuppressedError&&SuppressedError;class xR{constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(t){return this.isEnabled&&this.sync.has(t)}get(t){if(this.isEnabled)return this.sync.get(t)}set(t,e){this.isEnabled&&(this.sync.set(t,e),this.async.set(t,Promise.resolve(e)))}hasAsync(t){return this.isEnabled&&this.async.has(t)}getAsync(t){if(this.isEnabled)return this.async.get(t)}setAsync(t,e){this.isEnabled&&(this.async.set(t,e),e.then((e=>this.sync.set(t,e))))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const UR=new xR,BR=new xR;var XR=__webpack_require__(8287);function GR(t,e){return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,"function"==typeof n?n.bind(e):n])))}const HR=new Map;let WR=100;function jR(t){const e=WR++;return HR.set(e,t),e}function KR(t){if(!HR.has(t))throw new yO(CO.EBADF);return HR.get(t)}const qR=new Map;function $R(t,e){if("/"!==t[0]&&(t="/"+t),t=bO(t),qR.has(t))throw new yO(CO.EINVAL,"Mount point "+t+" is already in use.");qR.set(t,e),BR.clear()}function zR(t){if("/"!==t[0]&&(t="/"+t),t=bO(t),!qR.has(t))throw new yO(CO.EINVAL,"Mount point "+t+" is already unmounted.");qR.delete(t),BR.clear()}function QR(t,e){const n=e?.root||"/";t=HO(vO(n,t));const i=[...qR].sort(((t,e)=>t[0].length>e[0].length?-1:1));for(const[e,s]of i)if(e.length<=t.length&&t.startsWith(e))return""===(t=t.slice(e.length>1?e.length:0))&&(t=n),{fs:s,path:t,mountPoint:e,root:n};throw new yO(CO.EIO,"No file system")}async function JR(){await Promise.all([...qR.values()].map((t=>t.ready())))}function ZR(t,e){for(const[n,i]of Object.entries(e))t=t?.replaceAll(n,i);return t}function tA(t,e){"string"==typeof t.stack&&(t.stack=ZR(t.stack,e));try{t.message=ZR(t.message,e)}catch{}return t.path&&(t.path=ZR(t.path,e)),t}function eA(t){"/"in t&&zR("/");for(const[e,n]of Object.entries(t))$R(e,n)}function nA(t,e){const n=t.metadata(),i=n.blockSize||4096;return{type:(e?BigInt:Number)(n.type),bsize:(e?BigInt:Number)(i),ffree:(e?BigInt:Number)(n.freeNodes||XM),files:(e?BigInt:Number)(n.totalNodes||XM),bavail:(e?BigInt:Number)(n.freeSpace/i),bfree:(e?BigInt:Number)(n.freeSpace/i),blocks:(e?BigInt:Number)(n.totalSpace/i)}}function iA(t,e){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new yO(CO.EPERM,"Can not chroot() as non-root user");return e&&this?(this.root+=t,this):function(t,e=structuredClone(KO)){const n={root:t,credentials:qO(e)},i=GR(st,n),s=GR(it,n);return{...n,...i,promises:s}}(vO(this?.root||"/",t),n)}$R("/",YR.create({name:"root"}));class sA extends aR{off(t,e,n,i){return super.off(t,e,n,i)}removeListener(t,e,n,i){return super.removeListener(t,e,n,i)}constructor(t){super(),this.path=t}setMaxListeners(){throw yO.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw yO.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw yO.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw yO.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw yO.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class oA extends sA{constructor(t,e){super(t),this.options=e,function(t,e){const n=HO(t);aA.has(n)||aA.set(n,new Set);aA.get(n).add(e)}(t.toString(),this)}close(){super.emit("close"),function(t,e){const n=HO(t);aA.has(n)&&(aA.get(n).delete(e),0===aA.get(n).size&&aA.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class rA extends sA{constructor(t,e){super(t),this.options=e,this.start()}onInterval(){try{const n=hA(this.path);t=this.previous,e=n,(t.size!=e.size||+t.atime!=+e.atime||+t.mtime!=+e.mtime||+t.ctime!=+e.ctime||t.mode!=e.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(t){this.emit("error",t)}var t,e}start(){const t=this.options.interval||5e3;try{this.previous=hA(this.path)}catch(t){return void this.emit("error",t)}this.intervalId=setInterval(this.onInterval.bind(this),t),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const aA=new Map;function lA(t,e){if(e=HO(e),aA.has(e))for(const n of aA.get(e))n.emit("change",t,FO(e));let n,i=e;for(;i!==n;)if(n=i,i=wO(i),aA.has(i))for(const n of aA.get(i))n.emit("change",t,e.slice(i.length+("/"==i?0:1)))}var uA=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},pA=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function _A(t,e){t=HO(t),e=HO(e);const n=QR(t,this),i=QR(e,this);if(GM.checkAccess&&!hA.call(this,wO(t)).hasAccess(QO,this))throw yO.With("EACCES",t,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),lA("rename",t.toString()),void lA("change",e.toString());MA.call(this,e,OA(t)),IA.call(this,t),lA("rename",t.toString())}catch(s){throw tA(s,{[n.path]:t,[i.path]:e})}}function dA(t){t=HO(t);try{const{fs:e,path:n}=QR(jA.call(this,t),this);return e.existsSync(n)}catch(t){if(t.errno==CO.ENOENT)return!1;throw t}}function hA(t,e){t=HO(t);const{fs:n,path:i}=QR(jA.call(this,t),this);try{const t=n.statSync(i);if(GM.checkAccess&&!t.hasAccess(zO,this))throw yO.With("EACCES",i,"stat");return e?.bigint?new KM(t):t}catch(e){throw tA(e,{[i]:t})}}function cA(t,e){t=HO(t);const{fs:n,path:i}=QR(t,this);try{const t=n.statSync(i);return e?.bigint?new KM(t):t}catch(e){throw tA(e,{[i]:t})}}function TA(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=uA(n,mA.call(this,t,"r+"),!1);if(e||(e=0),e<0)throw new yO(CO.EINVAL);i.truncateSync(e)}catch(t){n.error=t,n.hasError=!0}finally{pA(n)}}function IA(t){t=HO(t);const{fs:e,path:n}=QR(t,this);try{if(GM.checkAccess&&!(UR.get(t)||e.statSync(n)).hasAccess(QO,this))throw yO.With("EACCES",n,"unlink");e.unlinkSync(n),lA("rename",t.toString())}catch(e){throw tA(e,{[n]:t})}}function mA(t,e,n,i=!0){t=HO(t);const s=XO(n,420),o=QM(e);t=i?jA.call(this,t):t;const{fs:r,path:a}=QR(t,this);let l;try{l=r.statSync(a)}catch{}if(!l){if(!tR(o)&&!nR(o)||"r+"==o)throw yO.With("ENOENT",t,"_open");const e=r.statSync(wO(a));if(GM.checkAccess&&!e.hasAccess(QO,this))throw yO.With("EACCES",wO(t),"_open");if(!e.isDirectory())throw yO.With("ENOTDIR",wO(t),"_open");return r.createFileSync(a,o,s)}if(GM.checkAccess&&(!l.hasAccess(s,this)||!l.hasAccess(JM(o),this)))throw yO.With("EACCES",t,"_open");if(iR(o))throw yO.With("EEXIST",t,"_open");const u=r.openFileSync(a,o);return eR(o)&&u.truncateSync(0),u}function EA(t,e,n=$O){return jR(mA.call(this,t,e,n,!0))}function fA(t,e,n){return jR(mA.call(this,t,e,n,!1))}function gA(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=uA(i,mA.call(this,t,e,420,n),!1),o=s.statSync(),r=new Uint8Array(o.size);return s.readSync(r,0,o.size,0),r}catch(t){i.error=t,i.hasError=!0}finally{pA(i)}}function OA(t,e={}){const n=WO(e,null,"r",420);if(!ZM(QM(n.flag)))throw new yO(CO.EINVAL,"Flag passed to readFile must allow for reading.");const i=XR.Buffer.from(gA.call(this,"number"==typeof t?KR(t).path:t.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function MA(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=WO(n,"utf8","w+",420),o=QM(s.flag);if(!tR(o))throw new yO(CO.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof e&&!s.encoding)throw new yO(CO.EINVAL,"Encoding not specified");const r="string"==typeof e?XR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!r)throw new yO(CO.EINVAL,"Data not specified");uA(i,mA.call(this,"number"==typeof t?KR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength,0),lA("change",t.toString())}catch(t){i.error=t,i.hasError=!0}finally{pA(i)}}function RA(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=WO(n,"utf8","a+",420),o=QM(s.flag);if(!nR(o))throw new yO(CO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new yO(CO.EINVAL,"Encoding not specified");const r="string"==typeof e?XR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);uA(i,mA.call(this,"number"==typeof t?KR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength)}catch(t){i.error=t,i.hasError=!0}finally{pA(i)}}function AA(t,e){const n=KR(t).statSync();return e?.bigint?new KM(n):n}function SA(t){KR(t).closeSync(),HR.delete(t)}function CA(t,e=0){if(e||(e=0),e<0)throw new yO(CO.EINVAL);KR(t).truncateSync(e)}function LA(t){KR(t).syncSync()}function yA(t){KR(t).datasyncSync()}function DA(t,e,n,i,s){let o,r,a,l;if("string"==typeof e){l="number"==typeof n?n:null;const t="string"==typeof i?i:"utf8";r=0,o=XR.Buffer.from(e,t),a=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=n,a=i,l="number"==typeof s?s:null;const u=KR(t);l??(l=u.position);const p=u.writeSync(o,r,a,l);return lA("change",u.path),p}function NA(t,e,n,i,s){const o=KR(t),r="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,s=n.position),s=Number(s),isNaN(s)&&(s=o.position),o.readSync(e,r,i,s)}function bA(t,e,n){KR(t).chownSync(e,n)}function vA(t,e){const n=XO(e,-1);if(n<0)throw new yO(CO.EINVAL,"Invalid mode.");KR(t).chmodSync(n)}function wA(t,e,n){KR(t).utimesSync(GO(e),GO(n))}function FA(t){t=HO(t);const{fs:e,path:n}=QR(jA.call(this,t),this);try{const i=UR.get(t)||e.statSync(n);if(!i.isDirectory())throw yO.With("ENOTDIR",n,"rmdir");if(GM.checkAccess&&!i.hasAccess(QO,this))throw yO.With("EACCES",n,"rmdir");e.rmdirSync(n),lA("rename",t.toString())}catch(e){throw tA(e,{[n]:t})}}function PA(t,e){e="object"==typeof e?e:{mode:e};const n=XO(e?.mode,511);t=jA.call(this,t);const{fs:i,path:s,root:o}=QR(t,this),r={[s]:t};try{if(!e?.recursive){if(GM.checkAccess&&!i.statSync(wO(s)).hasAccess(QO,this))throw yO.With("EACCES",wO(s),"mkdir");return i.mkdirSync(s,n)}const a=[];for(let e=s,n=t;!i.existsSync(e);e=wO(e),n=wO(n))a.unshift(e),r[e]=n;for(const t of a){if(GM.checkAccess&&!i.statSync(wO(t)).hasAccess(QO,this))throw yO.With("EACCES",wO(t),"mkdir");i.mkdirSync(t,n),lA("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw tA(t,r)}}function kA(t,e){e="object"==typeof e?e:{encoding:e},t=HO(t);const{fs:n,path:i}=QR(jA.call(this,t),this);let s;try{const e=UR.get(t)||n.statSync(i);if(UR.set(t,e),GM.checkAccess&&!e.hasAccess(zO,this))throw yO.With("EACCES",i,"readdir");if(!e.isDirectory())throw yO.With("ENOTDIR",i,"readdir");s=n.readdirSync(i)}catch(e){throw tA(e,{[i]:t})}const o=[];for(const r of s){const s=UR.get(vO(t,r))||n.statSync(vO(i,r));if(UR.set(vO(t,r),s),e?.withFileTypes?o.push(new nS(r,s)):"buffer"==e?.encoding?o.push(XR.Buffer.from(r)):o.push(r),s.isDirectory()&&e?.recursive)for(const n of kA.call(this,vO(t,r),{...e,_isIndirect:!0}))n instanceof nS?(n.path=vO(r,n.path),o.push(n)):XR.Buffer.isBuffer(n)?o.push(XR.Buffer.from(vO(r,xO(n)))):o.push(vO(r,n))}return e?._isIndirect||UR.clear(),o}function VA(t,e){if(t=HO(t),GM.checkAccess&&!hA(wO(t)).hasAccess(zO,this))throw yO.With("EACCES",wO(t),"link");if(e=HO(e),GM.checkAccess&&!hA(wO(e)).hasAccess(QO,this))throw yO.With("EACCES",wO(e),"link");const{fs:n,path:i}=QR(t,this),s=QR(e,this);if(n!=s.fs)throw yO.With("EXDEV",e,"link");try{if(GM.checkAccess&&!n.statSync(i).hasAccess(zO,this))throw yO.With("EACCES",i,"link");return n.linkSync(i,e)}catch(n){throw tA(n,{[i]:t,[s.path]:e})}}function YA(t,e,n="file"){if(!["file","dir","junction"].includes(n))throw new yO(CO.EINVAL,"Invalid type: "+n);if(dA.call(this,e))throw yO.With("EEXIST",e.toString(),"symlink");MA.call(this,e,t.toString());mA.call(this,e,"r+",420,!1).chmodSync(gM)}function xA(t,e){const n=XR.Buffer.from(gA.call(this,t.toString(),"r",!1)),i="object"==typeof e?e?.encoding:e;return"buffer"==i?n:n.toString(i)}function UA(t,e,n){const i=EA.call(this,t,"r+");bA(i,e,n),SA(i)}function BA(t,e,n){const i=fA.call(this,t,"r+");bA(i,e,n),SA(i)}function XA(t,e){const n=EA.call(this,t,"r+");vA(n,e),SA(n)}function GA(t,e){const n=fA.call(this,t,"r+");vA(n,e),SA(n)}function HA(t,e,n){const i=EA.call(this,t,"r+");wA(i,e,n),SA(i)}function WA(t,e,n){const i=fA.call(this,t,"r+");wA(i,e,n),SA(i)}function jA(t,e){t=HO(t);const n=(this?.root||"")+t;if(BR.has(n))return BR.get(n);const{base:i,dir:s}=PO(t),o="/"==s?"/":BR.get((this?.root||"")+s)||jA.call(this,s),r=vO(o,i),{fs:a,path:l}=QR(r,this);try{const i=UR.get(r)||a.statSync(l);if(UR.set(r,i),!i.isSymbolicLink())return BR.set(t,r),r;const s=bO(o,xA.call(this,r,e).toString()),u=BR.get((this?.root||"")+s)||jA.call(this,s);return BR.set(n,u),u}catch(e){if("ENOENT"==e.code)return t;throw tA(e,{[l]:r})}}function KA(t,e=384){if(GM.checkAccess&&!hA.call(this,t).hasAccess(e,this))throw new yO(CO.EACCES)}function qA(t,e){let n;t=HO(t);try{n=UR.get(t)||cA.bind(this)(t)}catch(t){if("ENOENT"!=t.code||!e?.force)throw t}if(n){switch(UR.set(t,n),n.mode&EM){case RM:if(e?.recursive)for(const n of kA.call(this,t,{_isIndirect:!0}))qA.call(this,vO(t,n),{...e,_isIndirect:!0});FA.call(this,t);break;case OM:case gM:case MM:case AM:IA.call(this,t);break;default:throw UR.clear(),new yO(CO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||UR.clear()}}function $A(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return PA.call(this,i),"buffer"==n?XR.Buffer.from(i):i}function zA(t,e,n){if(t=HO(t),e=HO(e),n&&n&ZO&&dA(e))throw new yO(CO.EEXIST,"Destination file already exists.",e,"copyFile");MA.call(this,e,OA(t)),lA("rename",e.toString())}function QA(t,e,n){const i=KR(t);let s=0;for(const t of e)s+=i.readSync(t,0,t.byteLength,n+s);return s}function JA(t,e,n){const i=KR(t);let s=0;for(const t of e)s+=i.writeSync(new Uint8Array(t.buffer),0,t.byteLength,n+s);return s}function ZA(t,e){return t=HO(t),new iS(t,this)}function tS(t,e,n){t=HO(t),e=HO(e);const i=cA.call(this,t);if(n?.errorOnExist&&dA.call(this,e))throw new yO(CO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&EM){case RM:if(!n?.recursive)throw new yO(CO.EISDIR,t+" is a directory (not copied)",t,"cp");PA.call(this,e,{recursive:!0});for(const i of kA.call(this,t,{withFileTypes:!0}))n.filter&&!n.filter(vO(t,i.name),vO(e,i.name))||tS.call(this,vO(t,i.name),vO(e,i.name),n);break;case OM:case gM:zA.call(this,t,e);break;default:throw new yO(CO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&HA.call(this,e,i.atime,i.mtime)}function eS(t,e){t=HO(t);const{fs:n}=QR(t,this);return nA(n,e?.bigint)}class nS{get name(){return FO(this.path)}constructor(t,e){this.path=t,this.stats=e}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 iS{checkClosed(){if(this.closed)throw new yO(CO.EBADF,"Can not use closed Dir")}constructor(t,e){this.path=t,this.context=e,this.closed=!1}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await RS.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then((e=>t(void 0,e)))}readSync(){return this.checkClosed(),this._entries??(this._entries=kA.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var sS=__webpack_require__(6248);class oS extends sS.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new yO(CO.EIO,e.toString()))}}}class rS extends sS.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new yO(CO.EIO,e.toString()))}}}var aS=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},lS=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class uS{constructor(t,e){this.context=e;const n="number"!=typeof t;this.fd=n?jR(t):t,this.file=n?t:KR(t)}async chown(t,e){await this.file.chown(t,e),lA("change",this.file.path)}async chmod(t){const e=XO(t,-1);if(e<0)throw new yO(CO.EINVAL,"Invalid mode.");await this.file.chmod(e),lA("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||(t=0),t<0)throw new yO(CO.EINVAL);await this.file.truncate(t),lA("change",this.file.path)}async utimes(t,e){await this.file.utimes(GO(t),GO(e)),lA("change",this.file.path)}async appendFile(t,e={}){const n=WO(e,"utf8","a",420);if(!nR(QM(n.flag)))throw new yO(CO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!n.encoding)throw new yO(CO.EINVAL,"Encoding not specified");const i="string"==typeof t?XR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length),lA("change",this.file.path)}read(t,e,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(t,e,n,i)}async readFile(t){const e=WO(t,null,"r",292);if(!ZM(QM(e.flag)))throw new yO(CO.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),s=XR.Buffer.from(i);return e.encoding?s.toString(e.encoding):s}readableWebStream(t={}){const e=globalThis;if(!("ReadableStream"in e))throw new yO(CO.ENOSYS,"ReadableStream is missing on globalThis");return new e.ReadableStream({start:async t=>{try{const e=65536,n=1e7;let i=0,s=0,o=NaN;for(;o>0;){const r=await this.read(new Uint8Array(e),0,e,s);if(!r.bytesRead)return void t.close();if(t.enqueue(r.buffer.slice(0,r.bytesRead)),s+=r.bytesRead,++i>=n)throw new yO(CO.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");o=r.bytesRead}}catch(e){t.error(e)}},type:t.type})}readLines(t){throw yO.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){const e=await this.file.stat();if(GM.checkAccess&&!e.hasAccess(zO,this.context))throw yO.With("EACCES",this.file.path,"stat");return t?.bigint?new KM(e):e}async write(t,e,n,i){let s,o,r;if("string"==typeof t){i="number"==typeof e?e:null;const a="string"==typeof n?n:"utf8";o=0,s=XR.Buffer.from(t,a),r=s.length}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=e,r=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(s,o,r,i);return lA("change",this.file.path),{buffer:s,bytesWritten:a}}async writeFile(t,e={}){const n=WO(e,"utf8","w",420);if(!tR(QM(n.flag)))throw new yO(CO.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof t&&!n.encoding)throw new yO(CO.EINVAL,"Encoding not specified");const i="string"==typeof t?XR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length,0),lA("change",this.file.path)}async close(){await this.file.close(),HR.delete(this.fd)}async writev(t,e){let n=0;for(const i of t)n+=(await this.write(i,0,i.length,e+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,e){let n=0;for(const i of t)n+=(await this.read(i,0,i.byteLength,e+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){const e=new oS({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:async t=>{try{const n=await this.read(new Uint8Array(t),0,t,this.file.position);e.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(t){e.destroy(t)}}});return e.path=this.file.path,e}createWriteStream(t){const e=new rS({highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:async(t,e,n)=>{try{const{bytesWritten:i}=await this.write(t,null,e);n(i==t.length?null:new Error("Failed to write full chunk"))}catch(t){n(t)}}});return e.path=this.file.path,e}}async function pS(t,e){t=HO(t),e=HO(e);const n=QR(t,this),i=QR(e,this);if(GM.checkAccess&&!(await dS.call(this,wO(t))).hasAccess(QO,this))throw yO.With("EACCES",t,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),lA("rename",t.toString()),void lA("change",e.toString());await fS.call(this,e,await ES(t)),await TS.call(this,t),lA("rename",t.toString())}catch(s){throw tA(s,{[n.path]:t,[i.path]:e})}}async function _S(t){try{const{fs:e,path:n}=QR(await wS.call(this,t),this);return await e.exists(n)}catch(t){if(t instanceof yO&&"ENOENT"==t.code)return!1;throw t}}async function dS(t,e){t=HO(t);const{fs:n,path:i}=QR(await wS.call(this,t),this);try{const t=await n.stat(i);if(GM.checkAccess&&!t.hasAccess(zO,this))throw yO.With("EACCES",i,"stat");return e?.bigint?new KM(t):t}catch(e){throw tA(e,{[i]:t})}}async function hS(t,e){t=HO(t);const{fs:n,path:i}=QR(t,this);try{const t=await n.stat(i);return e?.bigint?new KM(t):t}catch(e){throw tA(e,{[i]:t})}}async function cS(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=aS(n,await mS.call(this,t,"r+"),!0);await i.truncate(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=lS(n);t&&await t}}async function TS(t){t=HO(t);const{fs:e,path:n}=QR(t,this);try{if(GM.checkAccess&&!(await(UR.getAsync(t)||e.stat(n))).hasAccess(QO,this))throw yO.With("EACCES",n,"unlink");await e.unlink(n),lA("rename",t.toString())}catch(e){throw tA(e,{[n]:t})}}async function IS(t,e,n=420,i){t=HO(t);const s=XO(n,420),o=QM(e);t=i?await wS.call(this,t):t;const{fs:r,path:a}=QR(t,this),l=await r.stat(a).catch((()=>null));if(!l){if(!tR(o)&&!nR(o)||"r+"==o)throw yO.With("ENOENT",t,"_open");const e=await r.stat(wO(a));if(GM.checkAccess&&!e.hasAccess(QO,this))throw yO.With("EACCES",wO(t),"_open");if(!e.isDirectory())throw yO.With("ENOTDIR",wO(t),"_open");return new uS(await r.createFile(a,o,s),this)}if(GM.checkAccess&&!l.hasAccess(JM(o),this))throw yO.With("EACCES",t,"_open");if(iR(o))throw yO.With("EEXIST",t,"_open");const u=new uS(await r.openFile(a,o),this);return eR(o)&&await u.truncate(0),u}async function mS(t,e="r",n=420){return await IS.call(this,t,e,n,!0)}async function ES(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=WO(e,null,"r",420),s=aS(n,"object"==typeof t&&"fd"in t?t:await mS.call(this,t,i.flag,i.mode),!0);return await s.readFile(i)}catch(t){n.error=t,n.hasError=!0}finally{const t=lS(n);t&&await t}}async function fS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=WO(n,"utf8","w+",420),o=aS(i,t instanceof uS?t:await mS.call(this,t.toString(),s.flag,s.mode),!0),r=e;if("string"!=typeof r&&!(r instanceof Uint8Array))throw new yO(CO.EINVAL,"Iterables and streams not supported",o.file.path,"writeFile");await o.writeFile(r,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function gS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=WO(n,"utf8","a",420);if(!nR(QM(s.flag)))throw new yO(CO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new yO(CO.EINVAL,"Encoding not specified");const o="string"==typeof e?XR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=aS(i,"object"==typeof t&&"fd"in t?t:await mS.call(this,t,s.flag,s.mode),!0);await r.appendFile(o,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function OS(t){t=await wS.call(this,t);const{fs:e,path:n}=QR(t,this);try{const i=await(UR.getAsync(t)||e.stat(n));if(!i)throw yO.With("ENOENT",t,"rmdir");if(!i.isDirectory())throw yO.With("ENOTDIR",n,"rmdir");if(GM.checkAccess&&!i.hasAccess(QO,this))throw yO.With("EACCES",n,"rmdir");await e.rmdir(n),lA("rename",t.toString())}catch(e){throw tA(e,{[n]:t})}}async function MS(t,e){e="object"==typeof e?e:{mode:e};const n=XO(e?.mode,511);t=await wS.call(this,t);const{fs:i,path:s,root:o}=QR(t,this),r={[s]:t};try{if(!e?.recursive){if(GM.checkAccess&&!(await i.stat(wO(s))).hasAccess(QO,this))throw yO.With("EACCES",wO(s),"mkdir");return await i.mkdir(s,n),void lA("rename",t.toString())}const a=[];for(let e=s,n=t;!await i.exists(e);e=wO(e),n=wO(n))a.unshift(e),r[e]=n;for(const t of a){if(GM.checkAccess&&!(await i.stat(wO(t))).hasAccess(QO,this))throw yO.With("EACCES",wO(t),"mkdir");await i.mkdir(t,n),lA("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw tA(t,r)}}async function RS(t,e){e="object"==typeof e?e:{encoding:e},t=await wS.call(this,t);const n=e=>{throw tA(e,{[s]:t})},{fs:i,path:s}=QR(t,this),o=UR.getAsync(t)||i.stat(s).catch(n);UR.setAsync(t,o);const r=await o;if(!r)throw yO.With("ENOENT",t,"readdir");if(GM.checkAccess&&!r.hasAccess(zO,this))throw yO.With("EACCES",t,"readdir");if(!r.isDirectory())throw yO.With("ENOTDIR",t,"readdir");const a=await i.readdir(s).catch(n),l=[];return await Promise.all(a.map((async o=>{let r;if(e?.recursive||e?.withFileTypes){const e=UR.getAsync(vO(t,o))||i.stat(vO(s,o)).catch(n);UR.setAsync(vO(t,o),e),r=await e}if(e?.withFileTypes?l.push(new nS(o,r)):"buffer"==e?.encoding?l.push(XR.Buffer.from(o)):l.push(o),e?.recursive&&r?.isDirectory())for(const n of await RS.call(this,vO(t,o),{...e,_isIndirect:!0}))n instanceof nS?(n.path=vO(o,n.path),l.push(n)):XR.Buffer.isBuffer(n)?l.push(XR.Buffer.from(vO(o,xO(n)))):l.push(vO(o,n))}))),e?._isIndirect||UR.clear(),l}async function AS(t,e){t=HO(t),e=HO(e);const{fs:n,path:i}=QR(t,this),s=QR(e,this);if(n!=s.fs)throw yO.With("EXDEV",e,"link");try{if(GM.checkAccess&&!(await n.stat(wO(t))).hasAccess(zO,this))throw yO.With("EACCES",wO(i),"link");if(GM.checkAccess&&!(await dS.call(this,wO(e))).hasAccess(QO,this))throw yO.With("EACCES",wO(e),"link");if(GM.checkAccess&&!(await n.stat(i)).hasAccess(zO,this))throw yO.With("EACCES",i,"link");return await n.link(i,s.path)}catch(n){throw tA(n,{[s.path]:e,[i]:t})}}async function SS(t,e,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new yO(CO.EINVAL,"Invalid symlink type: "+n);if(await _S.call(this,e))throw yO.With("EEXIST",e.toString(),"symlink");const s=aS(i,await IS.call(this,e,"w+",420,!1),!0);await s.writeFile(t.toString()),await s.file.chmod(gM)}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function CS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=aS(n,await IS.call(this,HO(t),"r",420,!1),!0),s=await i.readFile(),o="object"==typeof e?e?.encoding:e;return"buffer"==o?s:s.toString(o)}catch(t){n.error=t,n.hasError=!0}finally{const t=lS(n);t&&await t}}async function LS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=aS(i,await mS.call(this,t,"r+"),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function yS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=aS(i,await IS.call(this,t,"r+",420,!1),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function DS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=aS(n,await mS.call(this,t,"r+"),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=lS(n);t&&await t}}async function NS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=aS(n,await IS.call(this,t,"r+",420,!1),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=lS(n);t&&await t}}async function bS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=aS(i,await mS.call(this,t,"r+"),!0);await s.utimes(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function vS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=aS(i,await IS.call(this,t,"r+",420,!1),!0);await s.utimes(new Date(e),new Date(n))}catch(t){i.error=t,i.hasError=!0}finally{const t=lS(i);t&&await t}}async function wS(t,e){t=HO(t);const n=(this?.root||"")+t;if(BR.hasAsync(n))return BR.getAsync(n);const{base:i,dir:s}=PO(t),o="/"==s?"/":await(BR.getAsync((this?.root||"")+s)||wS.call(this,s)),r=vO(o,i),{fs:a,path:l}=QR(r,this);try{const e=UR.getAsync(r)||a.stat(l);if(UR.setAsync(r,e),!(await e).isSymbolicLink())return BR.set(t,r),r;const i=bO(o,(await CS.call(this,r)).toString()),s=BR.getAsync((this?.root||"")+i)||wS.call(this,i);return BR.setAsync(n,s),await s}catch(e){if("ENOENT"==e.code)return t;throw tA(e,{[l]:r})}}function FS(t,e={}){return{[Symbol.asyncIterator](){const n=new oA(t.toString(),"string"!=typeof e?e:{encoding:e}),i=[];function s(){n.close();for(const t of i)t({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",((t,e)=>{i.shift()?.({value:{eventType:t,filename:e},done:!1})})),{async next(){const{promise:t,resolve:e}=Promise.withResolvers();return i.push(e),t},return:s,throw:s}}}}async function PS(t,e=$O){if(!GM.checkAccess)return;if(!(await dS.call(this,t)).hasAccess(e,this))throw new yO(CO.EACCES)}async function kS(t,e){t=HO(t);const n=await(UR.getAsync(t)||hS.call(this,t).catch((t=>{if("ENOENT"!=t.code||!e?.force)throw t})));if(n){switch(UR.set(t,n),n.mode&EM){case RM:if(e?.recursive)for(const n of await RS.call(this,t,{_isIndirect:!0}))await kS.call(this,vO(t,n),{...e,_isIndirect:!0});await OS.call(this,t);break;case OM:case gM:case MM:case AM:await TS.call(this,t);break;default:throw UR.clear(),new yO(CO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||UR.clear()}}async function VS(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await MS.call(this,i),"buffer"==n?XR.Buffer.from(i):i}async function YS(t,e,n){if(t=HO(t),e=HO(e),n&&n&ZO&&await _S.call(this,e))throw new yO(CO.EEXIST,"Destination file already exists.",e,"copyFile");await fS.call(this,e,await ES.call(this,t)),lA("rename",e.toString())}function xS(t,e){return t=HO(t),Promise.resolve(new iS(t,this))}async function US(t,e,n){t=HO(t),e=HO(e);const i=await hS.call(this,t);if(n?.errorOnExist&&await _S.call(this,e))throw new yO(CO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&EM){case RM:{if(!n?.recursive)throw new yO(CO.EISDIR,t+" is a directory (not copied)",t,"cp");const[i]=await Promise.all([RS.call(this,t,{withFileTypes:!0}),MS.call(this,e,{recursive:!0})]),s=async i=>{n.filter&&!n.filter(vO(t,i.name),vO(e,i.name))||await US.call(this,vO(t,i.name),vO(e,i.name),n)};await Promise.all(i.map(s));break}case OM:case gM:await YS.call(this,t,e);break;default:throw new yO(CO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&await bS.call(this,e,i.atime,i.mtime)}async function BS(t,e){t=HO(t);const{fs:n}=QR(t,this);return Promise.resolve(nA(n,e?.bigint))}const XS=()=>{};function GS(t,e,n=XS){pS.call(this,t,e).then((()=>n())).catch(n)}function HS(t,e=XS){_S.call(this,t).then(e).catch((()=>e(!1)))}function WS(t,e,n=XS){n="function"==typeof e?e:n,dS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function jS(t,e,n=XS){n="function"==typeof e?e:n,hS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function KS(t,e=0,n=XS){n="function"==typeof e?e:n;const i="number"==typeof e?e:0;cS.call(this,t,i).then((()=>n())).catch(n)}function qS(t,e=XS){TS.call(this,t).then((()=>e())).catch(e)}function $S(t,e,n,i=XS){const s=XO(n,420);i="function"==typeof n?n:i,mS.call(this,t,e,s).then((t=>i(void 0,t.fd))).catch(i)}function zS(t,e,n=XS){n="function"==typeof e?e:n,ES.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function QS(t,e,n,i=XS){i="function"==typeof n?n:i,fS.call(this,t,e,"function"!=typeof n?n:null).then((()=>i(void 0))).catch(i)}function JS(t,e,n,i=XS){const s="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,gS.call(this,t,e,s).then((()=>i())).catch(i)}function ZS(t,e,n=XS){n="function"==typeof e?e:n,KR(t).stat().then((t=>n(void 0,"object"==typeof e&&e?.bigint?new KM(t):t))).catch(n)}function tC(t,e=XS){const n=KR(t).close();HR.delete(t),n.then((()=>e())).catch(e)}function eC(t,e,n=XS){const i="number"==typeof e?e:0;n="function"==typeof e?e:n;const s=KR(t);if(i<0)throw new yO(CO.EINVAL);s.truncate(i).then((()=>n())).catch(n)}function nC(t,e=XS){KR(t).sync().then((()=>e())).catch(e)}function iC(t,e=XS){KR(t).datasync().then((()=>e())).catch(e)}function sC(t,e,n,i,s,o=XS){let r,a,l,u,p;const _=new uS(t,this);if("string"==typeof e){switch(p="utf8",typeof n){case"function":o=n;break;case"number":u=n,p="string"==typeof i?i:"utf8",o="function"==typeof s?s:o;break;default:return void(o="function"==typeof i?i:"function"==typeof s?s:o)(new yO(CO.EINVAL,"Invalid arguments."))}r=XR.Buffer.from(e),a=0,l=r.length;const t=o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r.toString(p)))).catch(t)}else{r=XR.Buffer.from(e.buffer),a=n,l=i,u="number"==typeof s?s:null;const t="function"==typeof s?s:o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r))).catch(t)}}function oC(t,e,n,i,s,o=XS){new uS(t,this).read(e,n,i,s).then((({bytesRead:t,buffer:e})=>o(void 0,t,e))).catch(o)}function rC(t,e,n,i=XS){new uS(t,this).chown(e,n).then((()=>i())).catch(i)}function aC(t,e,n){new uS(t,this).chmod(e).then((()=>n())).catch(n)}function lC(t,e,n,i=XS){new uS(t,this).utimes(e,n).then((()=>i())).catch(i)}function uC(t,e=XS){OS.call(this,t).then((()=>e())).catch(e)}function pC(t,e,n=XS){MS.call(this,t,e).then((()=>n())).catch(n)}function _C(t,e,n=XS){n="function"==typeof e?e:n;const i="function"!=typeof e?e:{};RS.call(this,t,i).then((t=>n(void 0,t))).catch(n)}function dC(t,e,n=XS){AS.call(this,t,e).then((()=>n())).catch(n)}function hC(t,e,n,i=XS){const s="string"==typeof n?n:"file";i="function"==typeof n?n:i,SS.call(this,t,e,s).then((()=>i())).catch(i)}function cC(t,e,n=XS){n="function"==typeof e?e:n,CS.call(this,t).then((t=>n(void 0,t))).catch(n)}function TC(t,e,n,i=XS){LS.call(this,t,e,n).then((()=>i())).catch(i)}function IC(t,e,n,i=XS){yS.call(this,t,e,n).then((()=>i())).catch(i)}function mC(t,e,n=XS){DS.call(this,t,e).then((()=>n())).catch(n)}function EC(t,e,n=XS){NS.call(this,t,e).then((()=>n())).catch(n)}function fC(t,e,n,i=XS){bS.call(this,t,e,n).then((()=>i())).catch(i)}function gC(t,e,n,i=XS){vS.call(this,t,e,n).then((()=>i())).catch(i)}function OC(t,e,n=XS){n="function"==typeof e?e:n,wS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function MC(t,e,n=XS){const i="number"==typeof e?e:zO;n="function"==typeof e?e:n,PS.call(this,t,i).then((()=>n())).catch(n)}const RC=new Map;function AC(t,e,n){const i=HO(t.toString()),s="function"!=typeof e?e:{};if("function"==typeof e&&(n=e),!n)throw new yO(CO.EINVAL,"No listener specified",t.toString(),"watchFile");if(RC.has(i)){const t=RC.get(i);return void(t&&t.listeners.add(n))}const o=new rA(i,s);o.on("change",((t,e)=>{const n=RC.get(i);if(n)for(const i of n.listeners)i(t,e)})),RC.set(i,{watcher:o,listeners:new Set})}function SC(t,e=XS){const n=HO(t.toString()),i=RC.get(n);i&&(e&&e!==XS?i.listeners.delete(e):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),RC.delete(n)))}function CC(t,e,n){const i=new oA(HO(t),"object"==typeof e?e:{});return n="function"==typeof e?e:n,i.on("change",n||XS),i}function LC(t,e){const n=this;let i;const s=new oS({highWaterMark:(e="object"==typeof e?e:{encoding:e}).highWaterMark||65536,encoding:e.encoding||"utf8",async read(o){try{i||(i=await mS.call(n,t,"r",e?.mode));const r=await i.read(new Uint8Array(o),0,o,i.file.position);s.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),i.file.position+=r.bytesRead,r.bytesRead||await i.close()}catch(t){await(i?.close()),s.destroy(t)}},destroy(t,e){i?.close().then((()=>e(t))).catch(XS)}});return s.path=t.toString(),s}function yC(t,e){const n=this;let i;e="object"==typeof e?e:{encoding:e};const s=new rS({highWaterMark:e?.highWaterMark,async write(s,o,r){try{i||(i=await mS.call(n,t,"w",e?.mode||438)),await i.write(s,0,o),r(void 0)}catch(t){await(i?.close()),r(t)}},destroy(t,e){e(t),i?.close().then((()=>e(t))).catch(e)},final(t){i?.close().then((()=>t())).catch(t)}});return s.path=t.toString(),s}function DC(t,e,n=XS){n="function"==typeof e?e:n,kS.call(this,t,"function"==typeof e?void 0:e).then((()=>n(void 0))).catch(n)}function NC(t,e,n=XS){n="function"==typeof e?e:n,VS.call(this,t,"function"!=typeof e?e:null).then((t=>n(void 0,t))).catch(n)}function bC(t,e,n,i=XS){i="function"==typeof n?n:i,YS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function vC(t,e,n,i=XS){i="function"==typeof n?n:i,new uS(t,this).readv(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesRead:e})=>i(void 0,e,t))).catch(i)}function wC(t,e,n,i=XS){i="function"==typeof n?n:i,new uS(t,this).writev(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesWritten:e})=>i(void 0,e,t))).catch(i)}function FC(t,e,n=XS){n="function"==typeof e?e:n,xS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}function PC(t,e,n,i=XS){i="function"==typeof n?n:i,US.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function kC(t,e,n=XS){n="function"==typeof e?e:n,BS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}async function VC(t,e){const n=await mS.call(this,t.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],e)}var YC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},xC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function UC(t){return class extends t{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise((t=>{const e=()=>this._queueRunning?setTimeout(e):t();e()}))}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof wR&&this instanceof wR){const t=this._sync.store.transaction(),e=this.store.transaction(),n=[];for(const i of await e.keys())n.push(e.get(i).then((e=>t.setSync(i,e))));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(t){throw this._isInitialized=!1,t}}}checkSync(t,e){if(this._disableSync)throw new yO(CO.ENOTSUP,"Sync caching has been disabled for this async file system",t,e);if(!this._sync)throw new yO(CO.ENOTSUP,"No sync cache is attached to this async file system",t,e)}renameSync(t,e){this.checkSync(t,"rename"),this._sync.renameSync(t,e),this.queue("rename",t,e)}statSync(t){return this.checkSync(t,"stat"),this._sync.statSync(t)}createFileSync(t,e,n){return this.checkSync(t,"createFile"),this._sync.createFileSync(t,e,n),this.queue("createFile",t,e,n),this.openFileSync(t,e)}openFileSync(t,e){this.checkSync(t,"openFile");const n=this._sync.openFileSync(t,e+"+"),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new oR(this,t,e,i,s)}unlinkSync(t){this.checkSync(t,"unlinkSync"),this._sync.unlinkSync(t),this.queue("unlink",t)}rmdirSync(t){this.checkSync(t,"rmdir"),this._sync.rmdirSync(t),this.queue("rmdir",t)}mkdirSync(t,e){this.checkSync(t,"mkdir"),this._sync.mkdirSync(t,e),this.queue("mkdir",t,e)}readdirSync(t){return this.checkSync(t,"readdir"),this._sync.readdirSync(t)}linkSync(t,e){this.checkSync(t,"link"),this._sync.linkSync(t,e),this.queue("link",t,e)}syncSync(t,e,n){this.checkSync(t,"sync"),this._sync.syncSync(t,e,n),this.queue("sync",t,e,n)}existsSync(t){return this.checkSync(t,"exists"),this._sync.existsSync(t)}async crossCopy(t){this.checkSync(t,"crossCopy");const e=await this.stat(t);if(!e.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=YC(n,await this.openFile(t,QM("r")),!0),s=YC(n,this._sync.createFileSync(t,QM("w"),e.mode),!1),o=new Uint8Array(e.size);return await i.read(o),void s.writeSync(o,0,e.size)}catch(t){n.error=t,n.hasError=!0}finally{const t=xC(n);t&&await t}}if("/"!==t){const e=await this.stat(t);this._sync.mkdirSync(t,e.mode)}const n=[];for(const e of await this.readdir(t))n.push(this.crossCopy(vO(t,e)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[t,...e]=this._queue.shift();await this[t](...e),await this._next()}queue(...t){this._queue.push(t),this._next()}}}new Map;UC(rR);new Map;Map;BC=rR;var BC;var XC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},GC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class HC{get isLocked(){return this._isLocked}constructor(t){this.previous=t,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 WC{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const t=new HC(this.currentLock);return this.currentLock=t,t}async lock(t,e){const n=this.currentLock,i=this.addLock(),s=(new Error).stack;return setTimeout((()=>{if(i.isLocked){const n=yO.With("EDEADLK",t,e);throw n.stack+=s?.slice(5),n}}),5e3),await(n?.done()),i}lockSync(t,e){if(this.currentLock?.isLocked)throw yO.With("EBUSY",t,e);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,await this.lock(t,"rename"),!1);await this._fs.rename(t,e)}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,this.lockSync(t,"rename"),!1);return this._fs.renameSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,await this.lock(t,"stat"),!1);return await this._fs.stat(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,this.lockSync(t,"stat"),!1);return this._fs.statSync(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,await this.lock(t,"openFile"),!1);const i=await this._fs.openFile(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,this.lockSync(t,"openFile"),!1);const i=this._fs.openFileSync(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}async createFile(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{XC(i,await this.lock(t,"createFile"),!1);const s=await this._fs.createFile(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{GC(i)}}createFileSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{XC(i,this.lockSync(t,"createFile"),!1);const s=this._fs.createFileSync(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{GC(i)}}async unlink(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,await this.lock(t,"unlink"),!1);await this._fs.unlink(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}unlinkSync(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,this.lockSync(t,"unlink"),!1);return this._fs.unlinkSync(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}async rmdir(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,await this.lock(t,"rmdir"),!1);await this._fs.rmdir(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}rmdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,this.lockSync(t,"rmdir"),!1);return this._fs.rmdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}async mkdir(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,await this.lock(t,"mkdir"),!1);await this._fs.mkdir(t,e)}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}mkdirSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,this.lockSync(t,"mkdir"),!1);return this._fs.mkdirSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,await this.lock(t,"readdir"),!1);return await this._fs.readdir(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,this.lockSync(t,"readdir"),!1);return this._fs.readdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}async exists(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,await this.lock(t,"exists"),!1);return await this._fs.exists(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}existsSync(t){const e={stack:[],error:void 0,hasError:!1};try{XC(e,this.lockSync(t,"exists"),!1);return this._fs.existsSync(t)}catch(t){e.error=t,e.hasError=!0}finally{GC(e)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,await this.lock(t,"link"),!1);await this._fs.link(t,e)}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{XC(n,this.lockSync(t,"link"),!1);return this._fs.linkSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{GC(n)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{XC(i,await this.lock(t,"sync"),!1);await this._fs.sync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{GC(i)}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{XC(i,this.lockSync(t,"sync"),!1);return this._fs.syncSync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{GC(i)}}}var jC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},KC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});const qC="/.deleted";class $C extends rR{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:t,readable:e}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=t,this.readable=e,this.writable.metadata().readonly)throw new yO(CO.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:zC.name}}async sync(t,e,n){await this.copyForWrite(t),await this.writable.exists(t)||await this.writable.createFile(t,"w",420),await this.writable.sync(t,e,n)}syncSync(t,e,n){this.copyForWriteSync(t),this.writable.syncSync(t,e,n)}async _initialize(){if(!this._isInitialized){try{const t=await this.writable.openFile(qC,QM("r")),{size:e}=await t.stat(),{buffer:n}=await t.read(new Uint8Array(e));this._deleteLog=xO(n)}catch(t){if(t.errno!==CO.ENOENT)throw t}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(t){this._deleteLog=t,this._reparseDeletionLog(),await this.updateLog("")}async rename(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),await this.copyForWrite(t);try{await this.writable.rename(t,e)}catch{if(this._deletedFiles.has(t))throw yO.With("ENOENT",t,"rename")}}renameSync(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),this.copyForWriteSync(t);try{this.writable.renameSync(t,e)}catch{if(this._deletedFiles.has(t))throw yO.With("ENOENT",t,"rename")}}async stat(t){this.checkInitialized();try{return await this.writable.stat(t)}catch{if(this._deletedFiles.has(t))throw yO.With("ENOENT",t,"stat");const e=await this.readable.stat(t);return e.mode|=146,e}}statSync(t){this.checkInitialized();try{return this.writable.statSync(t)}catch{if(this._deletedFiles.has(t))throw yO.With("ENOENT",t,"stat");const e=this.readable.statSync(t);return e.mode|=146,e}}async openFile(t,e){if(await this.writable.exists(t))return this.writable.openFile(t,e);const n=await this.readable.openFile(t,QM("r")),i=await n.stat(),{buffer:s}=await n.read(new Uint8Array(i.size));return new oR(this,t,e,i,s)}openFileSync(t,e){if(this.writable.existsSync(t))return this.writable.openFileSync(t,e);const n=this.readable.openFileSync(t,QM("r")),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new oR(this,t,e,i,s)}async createFile(t,e,n){return this.checkInitialized(),await this.writable.createFile(t,e,n),this.openFile(t,e)}createFileSync(t,e,n){return this.checkInitialized(),this.writable.createFileSync(t,e,n),this.openFileSync(t,e)}async link(t,e){this.checkInitialized(),await this.copyForWrite(t),await this.writable.link(t,e)}linkSync(t,e){this.checkInitialized(),this.copyForWriteSync(t),this.writable.linkSync(t,e)}async unlink(t){if(this.checkInitialized(),this.checkPath(t),!await this.exists(t))throw yO.With("ENOENT",t,"unlink");await this.writable.exists(t)&&await this.writable.unlink(t),await this.exists(t)&&await this.deletePath(t)}unlinkSync(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw yO.With("ENOENT",t,"unlink");this.writable.existsSync(t)&&this.writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)}async rmdir(t){if(this.checkInitialized(),!await this.exists(t))throw yO.With("ENOENT",t,"rmdir");if(await this.writable.exists(t)&&await this.writable.rmdir(t),await this.exists(t)){if((await this.readdir(t)).length)throw yO.With("ENOTEMPTY",t,"rmdir");await this.deletePath(t)}}rmdirSync(t){if(this.checkInitialized(),!this.existsSync(t))throw yO.With("ENOENT",t,"rmdir");if(this.writable.existsSync(t)&&this.writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length)throw yO.With("ENOTEMPTY",t,"rmdir");this.deletePath(t)}}async mkdir(t,e){if(this.checkInitialized(),await this.exists(t))throw yO.With("EEXIST",t,"mkdir");await this.createParentDirectories(t),await this.writable.mkdir(t,e)}mkdirSync(t,e){if(this.checkInitialized(),this.existsSync(t))throw yO.With("EEXIST",t,"mkdir");this.createParentDirectoriesSync(t),this.writable.mkdirSync(t,e)}async readdir(t){this.checkInitialized();const e=[];try{e.push(...await this.writable.readdir(t))}catch{}try{e.push(...(await this.readable.readdir(t)).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}readdirSync(t){this.checkInitialized();let e=[];try{e=e.concat(this.writable.readdirSync(t))}catch{}try{e=e.concat(this.readable.readdirSync(t).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}async deletePath(t){this._deletedFiles.add(t),await this.updateLog(`d${t}\n`)}async updateLog(t){if(this._deleteLog+=t,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const e=await this.writable.openFile(qC,QM("w"));try{await e.write(VO(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(t){this._deleteLogError=t}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const t of this._deleteLog.split("\n"))t.startsWith("d")&&this._deletedFiles.add(t.slice(1))}checkInitialized(){if(!this._isInitialized)throw new yO(CO.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const t=this._deleteLogError;throw delete this._deleteLogError,t}checkPath(t){if(t==qC)throw yO.With("EPERM",t,"checkPath")}createParentDirectoriesSync(t){let e=wO(t);const n=[];for(;!this.writable.existsSync(e);)n.push(e),e=wO(e);for(const t of n.reverse())this.writable.mkdirSync(t,this.statSync(t).mode)}async createParentDirectories(t){let e=wO(t);const n=[];for(;!await this.writable.exists(e);)n.push(e),e=wO(e);for(const t of n.reverse()){const e=await this.stat(t);await this.writable.mkdir(t,e.mode)}}copyForWriteSync(t){if(!this.existsSync(t))throw yO.With("ENOENT",t,"copyForWrite");this.writable.existsSync(wO(t))||this.createParentDirectoriesSync(t),this.writable.existsSync(t)||this.copyToWritableSync(t)}async copyForWrite(t){if(!await this.exists(t))throw yO.With("ENOENT",t,"copyForWrite");if(await this.writable.exists(wO(t))||await this.createParentDirectories(t),!await this.writable.exists(t))return this.copyToWritable(t)}copyToWritableSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(t);if(n.isDirectory())return void this.writable.mkdirSync(t,n.mode);const i=new Uint8Array(n.size);jC(e,this.readable.openFileSync(t,"r"),!1).readSync(i);jC(e,this.writable.createFileSync(t,"w",146|n.mode),!1).writeSync(i)}catch(t){e.error=t,e.hasError=!0}finally{KC(e)}}async copyToWritable(t){const e={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(t);if(n.isDirectory())return void await this.writable.mkdir(t,n.mode);const i=new Uint8Array(n.size),s=jC(e,await this.readable.openFile(t,"r"),!0);await s.read(i);const o=jC(e,await this.writable.createFile(t,"w",146|n.mode),!0);await o.write(i)}catch(t){e.error=t,e.hasError=!0}finally{const t=KC(e);t&&await t}}}class zC extends(function(t){return class extends WC{constructor(...e){super(),this._fs=new t(...e)}}}($C)){}function QC(t,e,n){if(t instanceof yO)return t;const i=t instanceof DOMException?CO[function(t){switch(t.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"}}(t)]:CO.EIO,s=new yO(i,t.message,e,n);return s.stack=t.stack,s.cause=t.cause,s}globalThis.__zenfs__=st;class JC extends(UC(rR)){constructor(t){super(),this._handles=new Map,this._sync=YR.create({name:"accessfs-cache"}),this._handles.set("/",t)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(t,e){await this.writeFile(t,e)}async rename(t,e){const n=await this.getHandle(t);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(t);if(await this.mkdir(e),!n.length)return void await this.unlink(t);for(const i of n)await this.rename(vO(t,i),vO(e,i)),await this.unlink(t);return}if(!(n instanceof FileSystemFileHandle))throw new yO(CO.ENOTSUP,"Not a file or directory handle",t,"rename");const i=await n.getFile().catch((e=>{throw QC(e,t,"rename")})),s=await this.getHandle(wO(e));if(!(s instanceof FileSystemDirectoryHandle))return;const o=await s.getFileHandle(FO(e),{create:!0}).catch((t=>{throw QC(t,e,"rename")})),r=await o.createWritable();await r.write(await i.arrayBuffer()),await r.close(),await this.unlink(t)}async writeFile(t,e){if(e.buffer.resizable)throw new yO(CO.EINVAL,"Resizable buffers can not be written",t,"write");const n=await this.getHandle(wO(t));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(FO(t),{create:!0}),s=await i.createWritable();await s.write(e),await s.close()}async createFile(t,e){return await this.writeFile(t,new Uint8Array),this.openFile(t,e)}async stat(t){const e=await this.getHandle(t);if(!e)throw yO.With("ENOENT",t,"stat");if(e instanceof FileSystemDirectoryHandle)return new jM({mode:511|RM,size:4096});if(e instanceof FileSystemFileHandle){const{lastModified:t,size:n}=await e.getFile();return new jM({mode:511|OM,size:n,mtimeMs:t})}throw new yO(CO.EBADE,"Handle is not a directory or file",t,"stat")}async openFile(t,e){const n=await this.getHandle(t);if(!(n instanceof FileSystemFileHandle))throw yO.With("EISDIR",t,"openFile");const i=await n.getFile().catch((e=>{throw QC(e,t,"openFile")})),s=new Uint8Array(await i.arrayBuffer()),o=new jM({mode:511|OM,size:i.size,mtimeMs:i.lastModified});return new oR(this,t,e,o,s)}async unlink(t){const e=await this.getHandle(wO(t));if(!(e instanceof FileSystemDirectoryHandle))throw yO.With("ENOTDIR",wO(t),"unlink");await e.removeEntry(FO(t),{recursive:!0}).catch((e=>{throw QC(e,t,"unlink")}))}async link(t){}async rmdir(t){return this.unlink(t)}async mkdir(t){if(await this.getHandle(t).catch((t=>{if("ENOENT"!=t.code)throw t})))throw yO.With("EEXIST",t,"mkdir");const e=await this.getHandle(wO(t));if(!(e instanceof FileSystemDirectoryHandle))throw yO.With("ENOTDIR",t,"mkdir");await e.getDirectoryHandle(FO(t),{create:!0})}async readdir(t){const e=await this.getHandle(t);if(!(e instanceof FileSystemDirectoryHandle))throw yO.With("ENOTDIR",t,"readdir");const n=[];for await(const t of e.keys())n.push(t);return n}async getHandle(t){if(this._handles.has(t))return this._handles.get(t);let e="/";for(const n of t.split("/").slice(1)){const t=this._handles.get(e);if(!(t instanceof FileSystemDirectoryHandle))throw yO.With("ENOTDIR",e,"getHandle");e=vO(e,n);const i=await t.getDirectoryHandle(n).catch((i=>{switch(i.name){case"TypeMismatchError":return t.getFileHandle(n).catch((t=>{}));case"TypeError":throw new yO(CO.ENOENT,i.message,e,"getHandle");default:throw QC(i,e,"getHandle")}}));i&&this._handles.set(e,i)}return this._handles.get(t)}}function ZC(t){return new Promise(((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)}))}let tL;function eL(){return tL||(tL=function(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const i=ZC(n);return(t,n)=>i.then((i=>n(i.transaction(e,t).objectStore(e))))}("keyval-store","keyval")),tL}class nL extends JC{constructor(t){super(t)}async readFile(t){const e=await this.getHandle(t);if(e instanceof window.FileSystemFileHandle){const t=await e.getFile();return await t.text()}return""}}class iL extends rt.FS{#t=null;#e=new TextEncoder;constructor(){super()}async showDirectoryPicker(){const t=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(t),this.#t=new nL(t),t}async loadFS(){let t=await this.getFSCache();if(!t)return null;if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#t=new nL(t),t}async getFSCache(){return function(t,e=eL()){return e("readonly",(e=>ZC(e.get(t))))}("mixly-pyodide-fs")}async setFSCache(t){await function(t,e,n=eL()){return n("readwrite",(n=>(n.put(e,t),ZC(n.transaction))))}("mixly-pyodide-fs",t)}async createFile(t){return this.#t.createFile(t,"")}async readFile(t){return this.#t.readFile(t)}async writeFile(t,e){const n=this.#e.encode(e);return this.#t.writeFile(t,n)}async isFile(t){const e=await this.#t.stat(t);return!(!e||33279!==e.mode)}async renameFile(t,e){return await this.#t.rename(t,e)}async moveFile(t,e){return this.renameFile(t,e)}async deleteFile(t){return this.#t.unlink(t)}async createDirectory(t){return this.#t.mkdir(t,511)}async readDirectory(t){return await this.#t.readdir(t)}async isDirectory(t){const e=await this.#t.stat(t);return!(!e||16895!==e.mode)}async isDirectoryEmpty(t){const e=await this.readDirectory(t);return!e?.length}async renameDirectory(t,e){return this.#t.rename(t,e)}async moveDirectory(t,e){return this.#t.rename(t,e)}async deleteDirectory(t){return this.#t.rmdir(t)}}class sL extends rt.FileTree{constructor(){super(new iL)}async readFolder(t){let e=[];try{const n=this.getFS();if(!await n.isDirectory(t))return e;const i=await n.readDirectory(t);for(let s of i){const i=fO.join(t,s);if(await n.isDirectory(i)){const t=await n.isDirectoryEmpty(i);e.push({type:"folder",id:i,children:!t,title:`/${this.getRootFolderName()}${i}`})}else e.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(t){rt.Debug.error(t)}return e}}class oL extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n
\r\n
')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new rt.HTMLTemplate('\r\n
\r\n \r\n
')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["file-system"],oL);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("file-system","file-system",ot.Msg.PYTHON_PYODIDE_FILE_SYSTEM),t.changeTo("output"),t.get("file-system")}}#n=null;#i=null;#s=null;#o=null;#r=null;#a=null;#l=null;#u=null;#p=!1;#_=!1;#d=!1;#h=null;constructor(){super();const t=OO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(t),this.#l=new sL,this.#i=t.children(".file-tree"),this.#o=OO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:ot.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#i.append(this.#o),this.#a=new rt.StatusBar,this.#s=t.children(".editor"),this.#r=OO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#s.append(this.#r)}#c(){this.#u=new rt.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#u.bind("sizeChanged",(()=>{this.resize()})),this.#o.children("button").click((()=>{this.selectFS().catch(rt.Debug.error)})),this.#l.bind("beforeSelectLeaf",(t=>{const e=t[0].id,n=this.#a.getFileMode(fO.extname(e));return n?(this.#a.setMode(n),!0):(SO.layer.msg(rt.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)})),this.#l.bind("afterSelectLeaf",(async t=>{const e=t[0].id;this.#l.showProgress();const n=this.#l.getFS();try{const t=await n.readFile(e);this.showEditor(),this.#a.setValue(t),this.#a.scrollToTop(),this.#a.focus(),this.setStatus(!1)}catch(t){rt.Debug.error(t),this.hideEditor(),this.#l.deselectAll()}this.#l.hideProgress()})),this.#l.bind("afterCreateNode",(t=>{this.#l.refreshFolder(t)})),this.#l.bind("afterDeleteNode",(t=>{this.#l.refreshFolder(t)})),this.#l.bind("afterRenameNode",(t=>{this.#l.refreshFolder(t)})),this.#l.bind("afterRefreshNode",(()=>{this.#l.getSelectedNodeId()||this.hideEditor()}));const t=this.#l.getContextMenu().getItem("menu");t.add({weight:7,type:"copy_path",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["fileTree.copyPath"],""),callback:(t,{$trigger:e})=>{let n=null;n="root"===e.attr("type")?this.#l.getRootFolderTitle():e.attr("title"),navigator.clipboard.writeText(n).catch(rt.Debug.error)}}}),t.add({weight:14,type:"sep5",preconditionFn:t=>{const e=this.#l.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:"---------"}),t.add({weight:15,type:"refresh",preconditionFn:t=>{const e=this.#l.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.refresh"],""),callback:(t,{$trigger:e})=>{let n=e.attr("type");if("root"===n)this.#l.openRootFolder(),this.#l.refreshFolder("/");else if("folder"===n){let t=e.attr("id");this.#l.openNode(t),this.#l.refreshFolder(t)}else{const t=this.#l.getSelectedNodes();this.#l.runEvent("afterSelectLeaf",t)}}}}),t.add({weight:16,type:"sep6",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:"---------"}),t.add({weight:17,type:"exit",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.exit"],""),callback:()=>{this.closeFS()}}}),t.remove("copy"),t.remove("cut"),t.remove("paste"),t.remove("sep2");const e=this.#a.getContextMenu().getItem("code");e.empty(),e.add({weight:0,type:"cut",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#a.cut()}}),e.add({weight:1,type:"copy",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#a.copy()}}),e.add({weight:2,type:"paste",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#a.paste()}}),e.add({weight:3,type:"sep1",data:"---------"}),e.add({weight:4,type:"togglecomment",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#a.commentLine()}}),e.add({weight:6,type:"sep2",preconditionFn:()=>this.#d,data:"---------"}),e.add({weight:7,type:"save",preconditionFn:()=>this.#d,data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.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.#d&&await this.put()}})}async put(){this.#l.showProgress();const t=this.#l.getSelectedNodeId(),e=this.#l.getFS();try{await e.writeFile(t,this.#a.getValue()),this.setStatus(!1)}catch(t){rt.Debug.error(t)}finally{this.#l.hideProgress()}}showFileTree(){this.#p||(this.#o.detach(),this.#i.empty(),this.#i.append(this.#l.getContent()),this.#p=!0)}hideFileTree(){this.#p&&(this.#l.getContent().detach(),this.#i.empty(),this.#i.append(this.#o),this.#p=!1)}showEditor(){this.#_||(this.#r.detach(),this.#s.empty(),this.#s.append(this.#a.getContent()),this.#_=!0)}hideEditor(){this.#_&&(this.#a.getContent().detach(),this.#s.empty(),this.#s.append(this.#r),this.#_=!1,this.setStatus(!1))}getDrag(){return this.#u}init(){super.init(),this.hideCloseBtn(),this.#a.init(),this.#c();const t=this.#a.getEditor();t.setReadOnly(!1),t.renderer.setShowGutter(!0),t.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),t.on("change",(()=>{this.setStatus(!0)})),this.loadFS().catch(rt.Debug.error)}async loadFS(){const t=this.#l.getFS(),e=await t.loadFS();await this.openFS(e)}async selectFS(){const t=this.#l.getFS(),e=await t.showDirectoryPicker();await this.openFS(e)}async openFS(t){if(!t?.name)return;const e="/"+t.name;this.#l.setFolderPath("/"),this.#l.setRootFolderTitle(e),this.#l.setRootFolderName(t.name),this.#l.openRootFolder(),this.showFileTree(),this.#h=await window.pyodide.mountNativeFS(e,t)}closeFS(){const t=this.#l.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(fO.basename(t))){const e=window.pyodide.FS.lookupPath(t,{follow_mount:!1});window.pyodide.FS.isMountpoint(e.node)&&window.pyodide.FS.unmount(t)}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(t){this.#d!==t&&(this.#d=t)}getNativeFS(){return this.#h}dispose(){this.#a.dispose(),this.#a=null,this.#l.dispose(),this.#l=null,super.dispose()}}class rL{static{rt.HTMLTemplate.add("html/statusbar/loader.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n

{{d.msg.loading}}

\r\n
')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=OO()(rt.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:ot.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){rt.app.getFooterBar().getContent().after(this.$loader);const t=fO.relative(rt.Env.indexDirPath,rt.Env.boardDirPath),e=new RO({rootPath:fO.join(t,"deps"),language:"python3"}),n=await e.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=e,this.kernel=n,this.statusBarImage=AO.init(),this.statusBarFileSystem=oL.init(),this.pythonShell=new rL,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader=null)},this.run=async function(){if(!this.kernelLoaded)return;const t=rt.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#T=null;#I=null;#m=null;#E={row:0,column:0};#f="";#g=null;#O=null;#M=!1;#R=!1;#A=null;#S=()=>this.#C();#L=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#E.row){const t=this.#T.getEndPos();let e=this.#T.getValueRange(this.#E,t);e=e.replace(this.#f,""),this.#g?.(e),this.#g=null,this.#O=null,this.#T.addValue("\n"),this.#y()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#R=!1,this.#T.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(rt.Debug.error)})),this.#A.addEventListener("eval.output",(t=>{this.#T.addValue(t.content)})),this.#A.addEventListener("eval.error",(()=>{this.#R=!1,this.#T.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`)})),this.#A.addEventListener("eval.input",(t=>{const e=String(t?.content?.prompt);this.#T.addValue(e),this.#f=e,this.#g=t.resolve,this.#O=t.reject,this.#D()})),this.#A.addEventListener("eval.display",(t=>{this.#m.changeTo("images"),this.#I.display(t)}))}#C(){const t=this.#T.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.row{window.pyodide.FS.syncfs(t,e)}))}sleep(t){return new Promise((e=>setTimeout(e,t)))}}const aL={init:async function(){const t=rt.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:ot.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{rL.run().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:ot.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{rL.stop().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:5}),await rL.init()}};aL.init(),Object.assign(ot.Variables,lt),Object.assign(ot.Procedures,gu),ot.Python=Ou,ot.generator=Ou,rt.Profile.default={},Object.assign(ot.Blocks,t,e,n,i,s,o,r,a,l,u,p,_,d,C,L,y,D,N,b,v,w,F,P,k,V,Y,x,U),Object.assign(ot.Python.forBlock,h,c,T,I,m,E,f,g,O,M,R,A,S,B,X,G,Om,H,W,j,K,q,z,Q,J,Z,tt,et)})()})();