Files
mixly3/boards/default/python_pyodide/main.bundle.2f838b4c.js

86 lines
922 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{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 i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return[e.valueToCode(this,"FACE",e.ORDER_ATOMIC)+".detectMultiScale("+i+",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 i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return[e.valueToCode(this,"FACE",e.ORDER_ATOMIC)+".detectMultiScale("+i+",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,i)=>{"use strict";const{SymbolDispose:n}=i(4184),{AbortError:s,codes:r}=i(6605),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=i(6569),u=i(9700),{ERR_INVALID_ARG_TYPE:p}=r;let h;t.exports.addAbortSignal=function(e,i){if(((t,e)=>{if("object"!=typeof t||!("aborted"in t))throw new p(e,"AbortSignal",t)})(e,"signal"),!o(i)&&!a(i))throw new p("stream",["ReadableStream","WritableStream","Stream"],i);return t.exports.addAbortSignalNoValidate(e,i)},t.exports.addAbortSignalNoValidate=function(t,e){if("object"!=typeof t||!("aborted"in t))return e;const r=o(e)?()=>{e.destroy(new s(void 0,{cause:t.reason}))}:()=>{e[l](new s(void 0,{cause:t.reason}))};if(t.aborted)r();else{h=h||i(798).addAbortListener;const s=h(t,r);u(e,s[n])}return e}},1515:(t,e,i)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:s,TypedArrayPrototypeSet:r,Uint8Array:o}=i(4184),{Buffer:a}=i(8287),{inspect:l}=i(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,i=""+e.data;for(;null!==(e=e.next);)i+=t+e.data;return i}concat(t){if(0===this.length)return a.alloc(0);const e=a.allocUnsafe(t>>>0);let i=this.head,n=0;for(;i;)r(e,i.data,n),n+=i.data.length,i=i.next;return e}consume(t,e){const i=this.head.data;if(t<i.length){const e=i.slice(0,t);return this.head.data=i.slice(t),e}return t===i.length?this.shift():e?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[s](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let e="",i=this.head,s=0;do{const r=i.data;if(!(t>r.length)){t===r.length?(e+=r,++s,i.next?this.head=i.next:this.head=this.tail=null):(e+=n(r,0,t),this.head=i,i.data=n(r,t));break}e+=r,t-=r.length,++s}while(null!==(i=i.next));return this.length-=s,e}_getBuffer(t){const e=a.allocUnsafe(t),i=t;let n=this.head,s=0;do{const a=n.data;if(!(t>a.length)){t===a.length?(r(e,a,i-t),++s,n.next?this.head=n.next:this.head=this.tail=null):(r(e,new o(a.buffer,a.byteOffset,t),i-t),this.head=n,n.data=a.slice(t));break}r(e,a,i-t),t-=a.length,++s}while(null!==(n=n.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,i)=>{"use strict";const{pipeline:n}=i(872),s=i(4992),{destroyer:r}=i(2430),{isNodeStream:o,isReadable:a,isWritable:l,isWebStream:u,isTransformStream:p,isWritableStream:h,isReadableStream:d}=i(6569),{AbortError:c,codes:{ERR_INVALID_ARG_VALUE:_,ERR_MISSING_ARGS:f}}=i(6605),T=i(9700);t.exports=function(...t){if(0===t.length)throw new f("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 i=0;i<t.length;++i)if(o(t[i])||u(t[i])){if(i<t.length-1&&!(a(t[i])||d(t[i])||p(t[i])))throw new _(`streams[${i}]`,e[i],"must be readable");if(i>0&&!(l(t[i])||h(t[i])||p(t[i])))throw new _(`streams[${i}]`,e[i],"must be writable")}let i,m,g,I,E;const O=t[0],M=n(t,(function(t){const e=I;I=null,e?e(t):t?E.destroy(t):A||R||E.destroy()})),R=!!(l(O)||h(O)||p(O)),A=!!(a(M)||d(M)||p(M));if(E=new s({writableObjectMode:!(null==O||!O.writableObjectMode),readableObjectMode:!(null==M||!M.readableObjectMode),writable:R,readable:A}),R){if(o(O))E._write=function(t,e,n){O.write(t,e)?n():i=n},E._final=function(t){O.end(),m=t},O.on("drain",(function(){if(i){const t=i;i=null,t()}}));else if(u(O)){const t=(p(O)?O.writable:O).getWriter();E._write=async function(e,i,n){try{await t.ready,t.write(e).catch((()=>{})),n()}catch(t){n(t)}},E._final=async function(e){try{await t.ready,t.close().catch((()=>{})),m=e}catch(t){e(t)}}}const t=p(M)?M.readable:M;T(t,(()=>{if(m){const t=m;m=null,t()}}))}if(A)if(o(M))M.on("readable",(function(){if(g){const t=g;g=null,t()}})),M.on("end",(function(){E.push(null)})),E._read=function(){for(;;){const t=M.read();if(null===t)return void(g=E._read);if(!E.push(t))return}};else if(u(M)){const t=(p(M)?M.readable:M).getReader();E._read=async function(){for(;;)try{const{value:e,done:i}=await t.read();if(!E.push(e))return;if(i)return void E.push(null)}catch{return}}}return E._destroy=function(t,e){t||null===I||(t=new c),g=null,i=null,m=null,null===I?e(t):(I=e,o(M)&&r(M,t))},E}},2430:(t,e,i)=>{"use strict";const n=i(5606),{aggregateTwoErrors:s,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:o}=i(6605),{Symbol:a}=i(4184),{kIsDestroyed:l,isDestroyed:u,isFinished:p,isServerRequest:h}=i(6569),d=a("kDestroy"),c=a("kConstruct");function _(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}function f(t,e,i){let s=!1;function r(e){if(s)return;s=!0;const r=t._readableState,o=t._writableState;_(e,o,r),o&&(o.closed=!0),r&&(r.closed=!0),"function"==typeof i&&i(e),e?n.nextTick(T,t,e):n.nextTick(m,t)}try{t._destroy(e||null,r)}catch(e){r(e)}}function T(t,e){g(t,e),m(t)}function m(t){const e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(null!=i&&i.emitClose||null!=e&&e.emitClose)&&t.emit("close")}function g(t,e){const i=t._readableState,n=t._writableState;null!=n&&n.errorEmitted||null!=i&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}function I(t,e,i){const s=t._readableState,r=t._writableState;if(null!=r&&r.destroyed||null!=s&&s.destroyed)return this;null!=s&&s.autoDestroy||null!=r&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),s&&!s.errored&&(s.errored=e),i?n.nextTick(g,t,e):g(t,e))}function E(t){let e=!1;function i(i){if(e)return void I(t,null!=i?i:new r);e=!0;const s=t._readableState,o=t._writableState,a=o||s;s&&(s.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(d,i):i?I(t,i,!0):n.nextTick(O,t)}try{t._construct((t=>{n.nextTick(i,t)}))}catch(t){n.nextTick(i,t)}}function O(t){t.emit(c)}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),n.nextTick(R,t)}t.exports={construct:function(t,e){if("function"!=typeof t._construct)return;const i=t._readableState,s=t._writableState;i&&(i.constructed=!1),s&&(s.constructed=!1),t.once(c,e),t.listenerCount(c)>1||n.nextTick(E,t)},destroyer:function(t,e){t&&!u(t)&&(e||p(t)||(e=new o),h(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?n.nextTick(A,t,e):n.nextTick(R,t),t.destroyed||(t[l]=!0))},destroy:function(t,e){const i=this._readableState,n=this._writableState,r=n||i;return null!=n&&n.destroyed||null!=i&&i.destroyed?("function"==typeof e&&e(),this):(_(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?f(this,t,e):this.once(d,(function(i){f(this,s(i,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:I}},4992:(t,e,i)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:s,ObjectKeys:r,ObjectSetPrototypeOf:o}=i(4184);t.exports=u;const a=i(6566),l=i(394);o(u.prototype,a.prototype),o(u,a);{const t=r(l.prototype);for(let e=0;e<t.length;e++){const i=t[e];u.prototype[i]||(u.prototype[i]=l.prototype[i])}}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),l.call(this,t),t?(this.allowHalfOpen=!1!==t.allowHalfOpen,!1===t.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===t.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let p,h;function d(){return void 0===p&&(p={}),p}n(u.prototype,{writable:{__proto__:null,...s(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...s(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...s(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...s(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...s(l.prototype,"writableLength")},writableFinished:{__proto__:null,...s(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...s(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...s(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...s(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}}),u.fromWeb=function(t,e){return d().newStreamDuplexFromReadableWritablePair(t,e)},u.toWeb=function(t){return d().newReadableWritablePairFromDuplex(t)},u.from=function(t){return h||(h=i(4512)),h(t,"body")}},4512:(t,e,i)=>{const n=i(5606),s=i(8287),{isReadable:r,isWritable:o,isIterable:a,isNodeStream:l,isReadableNodeStream:u,isWritableNodeStream:p,isDuplexNodeStream:h,isReadableStream:d,isWritableStream:c}=i(6569),_=i(9700),{AbortError:f,codes:{ERR_INVALID_ARG_TYPE:T,ERR_INVALID_RETURN_VALUE:m}}=i(6605),{destroyer:g}=i(2430),I=i(4992),E=i(6566),O=i(394),{createDeferredPromise:M}=i(798),R=i(3182),A=globalThis.Blob||s.Blob,y=void 0!==A?function(t){return t instanceof A}:function(t){return!1},S=globalThis.AbortController||i(5568).AbortController,{FunctionPrototypeCall:v}=i(4184);class C extends I{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 L(t){const e=t.readable&&"function"!=typeof t.readable.read?E.wrap(t.readable):t.readable,i=t.writable;let n,s,a,l,u,p=!!r(e),h=!!o(i);function d(t){const e=l;l=null,e?e(t):t&&u.destroy(t)}return u=new C({readableObjectMode:!(null==e||!e.readableObjectMode),writableObjectMode:!(null==i||!i.writableObjectMode),readable:p,writable:h}),h&&(_(i,(t=>{h=!1,t&&g(e,t),d(t)})),u._write=function(t,e,s){i.write(t,e)?s():n=s},u._final=function(t){i.end(),s=t},i.on("drain",(function(){if(n){const t=n;n=null,t()}})),i.on("finish",(function(){if(s){const t=s;s=null,t()}}))),p&&(_(e,(t=>{p=!1,t&&g(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,r){t||null===l||(t=new f),a=null,n=null,s=null,null===l?r(t):(l=r,g(i,t),g(e,t))},u}t.exports=function t(e,i){if(h(e))return e;if(u(e))return L({readable:e});if(p(e))return L({writable:e});if(l(e))return L({writable:!1,readable:!1});if(d(e))return L({readable:E.fromWeb(e)});if(c(e))return L({writable:O.fromWeb(e)});if("function"==typeof e){const{value:t,write:s,final:r,destroy:o}=function(t){let{promise:e,resolve:i}=M();const s=new S,r=s.signal,o=t(async function*(){for(;;){const t=e;e=null;const{chunk:s,done:o,cb:a}=await t;if(n.nextTick(a),o)return;if(r.aborted)throw new f(void 0,{cause:r.reason});({promise:e,resolve:i}=M()),yield s}}(),{signal:r});return{value:o,write(t,e,n){const s=i;i=null,s({chunk:t,done:!1,cb:n})},final(t){const e=i;i=null,e({done:!0,cb:t})},destroy(t,e){s.abort(),e(t)}}}(e);if(a(t))return R(C,t,{objectMode:!0,write:s,final:r,destroy:o});const l=null==t?void 0:t.then;if("function"==typeof l){let e;const i=v(l,t,(t=>{if(null!=t)throw new m("nully","body",t)}),(t=>{g(e,t)}));return e=new C({objectMode:!0,readable:!1,write:s,final(t){r((async()=>{try{await i,n.nextTick(t,null)}catch(e){n.nextTick(t,e)}}))},destroy:o})}throw new m("Iterable, AsyncIterable or AsyncFunction",i,t)}if(y(e))return t(e.arrayBuffer());if(a(e))return R(C,e,{objectMode:!0,writable:!1});if(d(null==e?void 0:e.readable)&&c(null==e?void 0:e.writable))return C.fromWeb(e);if("object"==typeof(null==e?void 0:e.writable)||"object"==typeof(null==e?void 0:e.readable)){return L({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 v(s,e,(e=>{null!=e&&t.push(e),t.push(null)}),(e=>{g(t,e)})),t=new C({objectMode:!0,writable:!1,read(){}})}throw new T(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)}},9700:(t,e,i)=>{const n=i(5606),{AbortError:s,codes:r}=i(6605),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:a}=r,{kEmptyObject:l,once:u}=i(798),{validateAbortSignal:p,validateFunction:h,validateObject:d,validateBoolean:c}=i(6283),{Promise:_,PromisePrototypeThen:f,SymbolDispose:T}=i(4184),{isClosed:m,isReadable:g,isReadableNodeStream:I,isReadableStream:E,isReadableFinished:O,isReadableErrored:M,isWritable:R,isWritableNodeStream:A,isWritableStream:y,isWritableFinished:S,isWritableErrored:v,isNodeStream:C,willEmitClose:L,kIsClosedPromise:b}=i(6569);let D;const w=()=>{};function N(t,e,r){var c,_;if(2===arguments.length?(r=e,e=l):null==e?e=l:d(e,"options"),h(r,"callback"),p(e.signal,"options.signal"),r=u(r),E(t)||y(t))return function(t,e,r){let o=!1,a=w;if(e.signal)if(a=()=>{o=!0,r.call(t,new s(void 0,{cause:e.signal.reason}))},e.signal.aborted)n.nextTick(a);else{D=D||i(798).addAbortListener;const n=D(e.signal,a),s=r;r=u(((...e)=>{n[T](),s.apply(t,e)}))}const l=(...e)=>{o||n.nextTick((()=>r.apply(t,e)))};return f(t[b].promise,l,l),w}(t,e,r);if(!C(t))throw new o("stream",["ReadableStream","WritableStream","Stream"],t);const N=null!==(c=e.readable)&&void 0!==c?c:I(t),F=null!==(_=e.writable)&&void 0!==_?_:A(t),P=t._writableState,x=t._readableState,k=()=>{t.writable||B()};let V=L(t)&&I(t)===N&&A(t)===F,Y=S(t,!1);const B=()=>{Y=!0,t.destroyed&&(V=!1),(!V||t.readable&&!N)&&(N&&!U||r.call(t))};let U=O(t,!1);const X=()=>{U=!0,t.destroyed&&(V=!1),(!V||t.writable&&!F)&&(F&&!Y||r.call(t))},G=e=>{r.call(t,e)};let H=m(t);const W=()=>{H=!0;const e=v(t)||M(t);return e&&"boolean"!=typeof e?r.call(t,e):N&&!U&&I(t,!0)&&!O(t,!1)?r.call(t,new a):!F||Y||S(t,!1)?void r.call(t):r.call(t,new a)},j=()=>{H=!0;const e=v(t)||M(t);if(e&&"boolean"!=typeof e)return r.call(t,e);r.call(t)},q=()=>{t.req.on("finish",B)};!function(t){return t.setHeader&&"function"==typeof t.abort}(t)?F&&!P&&(t.on("end",k),t.on("close",k)):(t.on("complete",B),V||t.on("abort",W),t.req?q():t.on("request",q)),V||"boolean"!=typeof t.aborted||t.on("aborted",W),t.on("end",X),t.on("finish",B),!1!==e.error&&t.on("error",G),t.on("close",W),H?n.nextTick(W):null!=P&&P.errorEmitted||null!=x&&x.errorEmitted?V||n.nextTick(j):(N||V&&!g(t)||!Y&&!1!==R(t))&&(F||V&&!R(t)||!U&&!1!==g(t))?x&&t.req&&t.aborted&&n.nextTick(j):n.nextTick(j);const K=()=>{r=w,t.removeListener("aborted",W),t.removeListener("complete",B),t.removeListener("abort",W),t.removeListener("request",q),t.req&&t.req.removeListener("finish",B),t.removeListener("end",k),t.removeListener("close",k),t.removeListener("finish",B),t.removeListener("end",X),t.removeListener("error",G),t.removeListener("close",W)};if(e.signal&&!H){const o=()=>{const i=r;K(),i.call(t,new s(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)n.nextTick(o);else{D=D||i(798).addAbortListener;const n=D(e.signal,o),s=r;r=u(((...e)=>{n[T](),s.apply(t,e)}))}}return K}t.exports=N,t.exports.finished=function(t,e){var i;let n=!1;return null===e&&(e=l),null!==(i=e)&&void 0!==i&&i.cleanup&&(c(e.cleanup,"cleanup"),n=e.cleanup),new _(((i,s)=>{const r=N(t,e,(t=>{n&&r(),t?s(t):i()}))}))}},3182:(t,e,i)=>{"use strict";const n=i(5606),{PromisePrototypeThen:s,SymbolAsyncIterator:r,SymbolIterator:o}=i(4184),{Buffer:a}=i(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:u}=i(6605).codes;t.exports=function(t,e,i){let p,h;if("string"==typeof e||e instanceof a)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});if(e&&e[r])h=!0,p=e[r]();else{if(!e||!e[o])throw new l("iterable",["Iterable"],e);h=!1,p=e[o]()}const d=new t({objectMode:!0,highWaterMark:1,...i});let c=!1;return d._read=function(){c||(c=!0,async function(){for(;;){try{const{value:t,done:e}=h?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 c=!1,new u;if(d.push(e))continue;c=!1}}catch(t){d.destroy(t)}break}}())},d._destroy=function(t,e){s(async function(t){const e=null!=t,i="function"==typeof p.throw;if(e&&i){const{value:e,done:i}=await p.throw(t);if(await e,i)return}if("function"==typeof p.return){const{value:t}=await p.return();await t}}(t),(()=>n.nextTick(e,t)),(i=>n.nextTick(e,i||t)))},d}},2913:(t,e,i)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:s}=i(4184),{EventEmitter:r}=i(7007);function o(t){r.call(this,t)}function a(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?n(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}s(o.prototype,r.prototype),s(o,r),o.prototype.pipe=function(t,e){const i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function s(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",s),t._isStdio||e&&!1===e.end||(i.on("end",l),i.on("close",u));let o=!1;function l(){o||(o=!0,t.end())}function u(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function p(t){h(),0===r.listenerCount(this,"error")&&this.emit("error",t)}function h(){i.removeListener("data",n),t.removeListener("drain",s),i.removeListener("end",l),i.removeListener("close",u),i.removeListener("error",p),t.removeListener("error",p),i.removeListener("end",h),i.removeListener("close",h),t.removeListener("close",h)}return a(i,"error",p),a(t,"error",p),i.on("end",h),i.on("close",h),t.on("close",h),t.emit("pipe",i),t},t.exports={Stream:o,prependListener:a}},5589:(t,e,i)=>{"use strict";const n=globalThis.AbortController||i(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:s,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:a},AbortError:l}=i(6605),{validateAbortSignal:u,validateInteger:p,validateObject:h}=i(6283),d=i(4184).Symbol("kWeak"),c=i(4184).Symbol("kResistStopPropagation"),{finished:_}=i(9700),f=i(6864),{addAbortSignalNoValidate:T}=i(153),{isWritable:m,isNodeStream:g}=i(6569),{deprecate:I}=i(798),{ArrayPrototypePush:E,Boolean:O,MathFloor:M,Number:R,NumberIsNaN:A,Promise:y,PromiseReject:S,PromiseResolve:v,PromisePrototypeThen:C,Symbol:L}=i(4184),b=L("kEmpty"),D=L("kEof");function w(t,e){if("function"!=typeof t)throw new r("fn",["Function","AsyncFunction"],t);null!=e&&h(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");let n=1;null!=(null==e?void 0:e.concurrency)&&(n=M(e.concurrency));let s=n-1;return null!=(null==e?void 0:e.highWaterMark)&&(s=M(e.highWaterMark)),p(n,"options.concurrency",1),p(s,"options.highWaterMark",0),s+=n,async function*(){const r=i(798).AbortSignalAny([null==e?void 0:e.signal].filter(O)),o=this,a=[],u={signal:r};let p,h,d=!1,c=0;function _(){d=!0,f()}function f(){c-=1,T()}function T(){h&&!d&&c<n&&a.length<s&&(h(),h=null)}!async function(){try{for await(let e of o){if(d)return;if(r.aborted)throw new l;try{if(e=t(e,u),e===b)continue;e=v(e)}catch(t){e=S(t)}c+=1,C(e,f,_),a.push(e),p&&(p(),p=null),!d&&(a.length>=s||c>=n)&&await new y((t=>{h=t}))}a.push(D)}catch(t){const e=S(t);C(e,f,_),a.push(e)}finally{d=!0,p&&(p(),p=null)}}();try{for(;;){for(;a.length>0;){const t=await a[0];if(t===D)return;if(r.aborted)throw new l;t!==b&&(yield t),a.shift(),T()}await new y((t=>{p=t}))}}finally{d=!0,h&&(h(),h=null)}}.call(this)}async function N(t,e=void 0){for await(const i of F.call(this,t,e))return!0;return!1}function F(t,e){if("function"!=typeof t)throw new r("fn",["Function","AsyncFunction"],t);return w.call(this,(async function(e,i){return await t(e,i)?e:b}),e)}class P extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function x(t){if(t=R(t),A(t))return 0;if(t<0)throw new a("number",">= 0",t);return t}t.exports.streamReturningOperators={asIndexedPairs:I((function(t=void 0){return null!=t&&h(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),async function*(){let e=0;for await(const n of this){var i;if(null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l({cause:t.signal.reason});yield[e++,n]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(t,e=void 0){return null!=e&&h(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),t=x(t),async function*(){var i;if(null!=e&&null!==(i=e.signal)&&void 0!==i&&i.aborted)throw new l;for await(const i of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l;t--<=0&&(yield i)}}.call(this)},filter:F,flatMap:function(t,e){const i=w.call(this,t,e);return async function*(){for await(const t of i)yield*t}.call(this)},map:w,take:function(t,e=void 0){return null!=e&&h(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),t=x(t),async function*(){var i;if(null!=e&&null!==(i=e.signal)&&void 0!==i&&i.aborted)throw new l;for await(const i of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l;if(t-- >0&&(yield i),t<=0)return}}.call(this)},compose:function(t,e){if(null!=e&&h(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),g(t)&&!m(t))throw new s("stream",t,"must be writable");const i=f(this,t);return null!=e&&e.signal&&T(e.signal,i),i}},t.exports.promiseReturningOperators={every:async function(t,e=void 0){if("function"!=typeof t)throw new r("fn",["Function","AsyncFunction"],t);return!await N.call(this,(async(...e)=>!await t(...e)),e)},forEach:async function(t,e){if("function"!=typeof t)throw new r("fn",["Function","AsyncFunction"],t);for await(const i of w.call(this,(async function(e,i){return await t(e,i),b}),e));},reduce:async function(t,e,i){var s;if("function"!=typeof t)throw new r("reducer",["Function","AsyncFunction"],t);null!=i&&h(i,"options"),null!=(null==i?void 0:i.signal)&&u(i.signal,"options.signal");let o=arguments.length>1;if(null!=i&&null!==(s=i.signal)&&void 0!==s&&s.aborted){const t=new l(void 0,{cause:i.signal.reason});throw this.once("error",(()=>{})),await _(this.destroy(t)),t}const a=new n,p=a.signal;if(null!=i&&i.signal){const t={once:!0,[d]:this,[c]:!0};i.signal.addEventListener("abort",(()=>a.abort()),t)}let f=!1;try{for await(const n of this){var T;if(f=!0,null!=i&&null!==(T=i.signal)&&void 0!==T&&T.aborted)throw new l;o?e=await t(e,n,{signal:p}):(e=n,o=!0)}if(!f&&!o)throw new P}finally{a.abort()}return e},toArray:async function(t){null!=t&&h(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");const e=[];for await(const n of this){var i;if(null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l(void 0,{cause:t.signal.reason});E(e,n)}return e},some:N,find:async function(t,e){for await(const i of F.call(this,t,e))return i}}},6898:(t,e,i)=>{"use strict";const{ObjectSetPrototypeOf:n}=i(4184);t.exports=r;const s=i(208);function r(t){if(!(this instanceof r))return new r(t);s.call(this,t)}n(r.prototype,s.prototype),n(r,s),r.prototype._transform=function(t,e,i){i(null,t)}},872:(t,e,i)=>{const n=i(5606),{ArrayIsArray:s,Promise:r,SymbolAsyncIterator:o,SymbolDispose:a}=i(4184),l=i(9700),{once:u}=i(798),p=i(2430),h=i(4992),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:c,ERR_INVALID_RETURN_VALUE:_,ERR_MISSING_ARGS:f,ERR_STREAM_DESTROYED:T,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:g}=i(6605),{validateFunction:I,validateAbortSignal:E}=i(6283),{isIterable:O,isReadable:M,isReadableNodeStream:R,isNodeStream:A,isTransformStream:y,isWebStream:S,isReadableStream:v,isReadableFinished:C}=i(6569),L=globalThis.AbortController||i(5568).AbortController;let b,D,w;function N(t,e,i){let n=!1;t.on("close",(()=>{n=!0}));return{destroy:e=>{n||(n=!0,p.destroyer(t,e||new T("pipe")))},cleanup:l(t,{readable:e,writable:i},(t=>{n=!t}))}}function F(t){if(O(t))return t;if(R(t))return async function*(t){D||(D=i(6566));yield*D.prototype[o].call(t)}(t);throw new c("val",["Readable","Iterable","AsyncIterable"],t)}async function P(t,e,i,{end:n}){let s,o=null;const a=t=>{if(t&&(s=t),o){const t=o;o=null,t()}},u=()=>new r(((t,e)=>{s?e(s):o=()=>{s?e(s):t()}}));e.on("drain",a);const p=l(e,{readable:!1},a);try{e.writableNeedDrain&&await u();for await(const i of t)e.write(i)||await u();n&&(e.end(),await u()),i()}catch(t){i(s!==t?d(s,t):t)}finally{p(),e.off("drain",a)}}async function x(t,e,i,{end:n}){y(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,n&&await s.close(),i()}catch(t){try{await s.abort(t),i(t)}catch(t){i(t)}}}function k(t,e,r){if(1===t.length&&s(t[0])&&(t=t[0]),t.length<2)throw new f("streams");const o=new L,l=o.signal,u=null==r?void 0:r.signal,p=[];function d(){B(new g)}let T,m,I;E(u,"options.signal"),w=w||i(798).addAbortListener,u&&(T=w(u,d));const C=[];let D,k=0;function Y(t){B(t,0==--k)}function B(t,i){var s;if(!t||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=t),m||i){for(;C.length;)C.shift()(m);null===(s=T)||void 0===s||s[a](),o.abort(),i&&(m||p.forEach((t=>t())),n.nextTick(e,m,I))}}for(let H=0;H<t.length;H++){const W=t[H],j=H<t.length-1,q=H>0,K=j||!1!==(null==r?void 0:r.end),z=H===t.length-1;if(A(W)){if(K){const{destroy:$,cleanup:Q}=N(W,j,q);C.push($),M(W)&&z&&p.push(Q)}function U(t){t&&"AbortError"!==t.name&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code&&Y(t)}W.on("error",U),M(W)&&z&&p.push((()=>{W.removeListener("error",U)}))}if(0===H)if("function"==typeof W){if(D=W({signal:l}),!O(D))throw new _("Iterable, AsyncIterable or Stream","source",D)}else D=O(W)||R(W)||y(W)?W:h.from(W);else if("function"==typeof W){var X;if(y(D))D=F(null===(X=D)||void 0===X?void 0:X.readable);else D=F(D);if(D=W(D,{signal:l}),j){if(!O(D,!0))throw new _("AsyncIterable",`transform[${H-1}]`,D)}else{var G;b||(b=i(6898));const J=new b({objectMode:!0}),Z=null===(G=D)||void 0===G?void 0:G.then;if("function"==typeof Z)k++,Z.call(D,(t=>{I=t,null!=t&&J.write(t),K&&J.end(),n.nextTick(Y)}),(t=>{J.destroy(t),n.nextTick(Y,t)}));else if(O(D,!0))k++,P(D,J,Y,{end:K});else{if(!v(D)&&!y(D))throw new _("AsyncIterable or Promise","destination",D);{const it=D.readable||D;k++,P(it,J,Y,{end:K})}}D=J;const{destroy:tt,cleanup:et}=N(D,!1,!0);C.push(tt),z&&p.push(et)}}else if(A(W)){if(R(D)){k+=2;const nt=V(D,W,Y,{end:K});M(W)&&z&&p.push(nt)}else if(y(D)||v(D)){const st=D.readable||D;k++,P(st,W,Y,{end:K})}else{if(!O(D))throw new c("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],D);k++,P(D,W,Y,{end:K})}D=W}else if(S(W)){if(R(D))k++,x(F(D),W,Y,{end:K});else if(v(D)||O(D))k++,x(D,W,Y,{end:K});else{if(!y(D))throw new c("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],D);k++,x(D.readable,W,Y,{end:K})}D=W}else D=h.from(W)}return(null!=l&&l.aborted||null!=u&&u.aborted)&&n.nextTick(d),D}function V(t,e,i,{end:s}){let r=!1;if(e.on("close",(()=>{r||i(new m)})),t.pipe(e,{end:!1}),s){function o(){r=!0,e.end()}C(t)?n.nextTick(o):t.once("end",o)}else i();return l(t,{readable:!0,writable:!1},(e=>{const n=t._readableState;e&&"ERR_STREAM_PREMATURE_CLOSE"===e.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?t.once("end",i).once("error",i):i(e)})),l(e,{readable:!1,writable:!0},i)}t.exports={pipelineImpl:k,pipeline:function(...t){return k(t,u(function(t){return I(t[t.length-1],"streams[stream.length - 1]"),t.pop()}(t)))}}},6566:(t,e,i)=>{const n=i(5606),{ArrayPrototypeIndexOf:s,NumberIsInteger:r,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:p,Promise:h,SafeSet:d,SymbolAsyncDispose:c,SymbolAsyncIterator:_,Symbol:f}=i(4184);t.exports=z,z.ReadableState=K;const{EventEmitter:T}=i(7007),{Stream:m,prependListener:g}=i(2913),{Buffer:I}=i(8287),{addAbortSignal:E}=i(153),O=i(9700);let M=i(798).debuglog("stream",(t=>{M=t}));const R=i(1515),A=i(2430),{getHighWaterMark:y,getDefaultHighWaterMark:S}=i(9153),{aggregateTwoErrors:v,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_OUT_OF_RANGE:b,ERR_STREAM_PUSH_AFTER_EOF:D,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:w},AbortError:N}=i(6605),{validateObject:F}=i(6283),P=f("kPaused"),{StringDecoder:x}=i(8707),k=i(3182);p(z.prototype,m.prototype),p(z,m);const V=()=>{},{errorOrDestroy:Y}=A,B=1,U=16,X=32,G=64,H=2048,W=4096,j=65536;function q(t){return{enumerable:!1,get(){return!!(this.state&t)},set(e){e?this.state|=t:this.state&=~t}}}function K(t,e,n){"boolean"!=typeof n&&(n=e instanceof i(4992)),this.state=H|W|U|X,t&&t.objectMode&&(this.state|=B),n&&t&&t.readableObjectMode&&(this.state|=B),this.highWaterMark=t?y(this,t,"readableHighWaterMark",n):S(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[P]=null,t&&!1===t.emitClose&&(this.state&=~H),t&&!1===t.autoDestroy&&(this.state&=~W),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new x(t.encoding),this.encoding=t.encoding)}function z(t){if(!(this instanceof z))return new z(t);const e=this instanceof i(4992);this._readableState=new K(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&&E(t.signal,this)),m.call(this,t),A.construct(this,(()=>{this._readableState.needReadable&&et(this,this._readableState)}))}function $(t,e,i,n){M("readableAddChunk",e);const s=t._readableState;let r;if(s.state&B||("string"==typeof e?(i=i||s.defaultEncoding,s.encoding!==i&&(n&&s.encoding?e=I.from(e,i).toString(s.encoding):(e=I.from(e,i),i=""))):e instanceof I?i="":m._isUint8Array(e)?(e=m._uint8ArrayToBuffer(e),i=""):null!=e&&(r=new C("chunk",["string","Buffer","Uint8Array"],e))),r)Y(t,r);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?Z(t):(e.needReadable=!1,e.emittedReadable=!0,tt(t))}(t,s);else if(s.state&B||e&&e.length>0)if(n)if(4&s.state)Y(t,new w);else{if(s.destroyed||s.errored)return!1;Q(t,s,e,!0)}else if(s.ended)Y(t,new D);else{if(s.destroyed||s.errored)return!1;s.state&=-9,s.decoder&&!i?(e=s.decoder.write(e),s.objectMode||0!==e.length?Q(t,s,e,!1):et(t,s)):Q(t,s,e,!1)}else n||(s.state&=-9,et(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function Q(t,e,i,n){e.flowing&&0===e.length&&!e.sync&&t.listenerCount("data")>0?(e.state&j?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&G&&Z(t)),et(t,e)}l(K.prototype,{objectMode:q(B),ended:q(2),endEmitted:q(4),reading:q(8),constructed:q(U),sync:q(X),needReadable:q(G),emittedReadable:q(128),readableListening:q(256),resumeScheduled:q(512),errorEmitted:q(1024),emitClose:q(H),autoDestroy:q(W),destroyed:q(8192),closed:q(16384),closeEmitted:q(32768),multiAwaitDrain:q(j),readingMore:q(1<<17),dataEmitted:q(1<<18)}),z.prototype.destroy=A.destroy,z.prototype._undestroy=A.undestroy,z.prototype._destroy=function(t,e){e(t)},z.prototype[T.captureRejectionSymbol]=function(t){this.destroy(t)},z.prototype[c]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new N,this.destroy(t)),new h(((e,i)=>O(this,(n=>n&&n!==t?i(n):e(null)))))},z.prototype.push=function(t,e){return $(this,t,e,!1)},z.prototype.unshift=function(t,e){return $(this,t,e,!0)},z.prototype.isPaused=function(){const t=this._readableState;return!0===t[P]||!1===t.flowing},z.prototype.setEncoding=function(t){const e=new x(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;const i=this._readableState.buffer;let n="";for(const t of i)n+=e.write(t);return i.clear(),""!==n&&i.push(n),this._readableState.length=n.length,this};function J(t,e){return t<=0||0===e.length&&e.ended?0:e.state&B?1:o(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}function Z(t){const e=t._readableState;M("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(tt,t))}function tt(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,ot(t)}function et(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,n.nextTick(it,t,e))}function it(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){const i=e.length;if(M("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function nt(t){const e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!1===e[P]?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function st(t){M("readable nexttick read 0"),t.read(0)}function rt(t,e){M("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),ot(t),e.flowing&&!e.reading&&t.read(0)}function ot(t){const e=t._readableState;for(M("flow",e.flowing);e.flowing&&null!==t.read(););}function at(t,e){"function"!=typeof t.read&&(t=z.wrap(t,{objectMode:!0}));const i=async function*(t,e){let i,n=V;function s(e){this===t?(n(),n=V):n=e}t.on("readable",s);const r=O(t,{writable:!1},(t=>{i=t?v(i,t):null,n(),n=V}));try{for(;;){const e=t.destroyed?null:t.read();if(null!==e)yield e;else{if(i)throw i;if(null===i)return;await new h(s)}}}catch(t){throw i=v(i,t),i}finally{!i&&!1===(null==e?void 0:e.destroyOnReturn)||void 0!==i&&!t._readableState.autoDestroy?(t.off("readable",s),r()):A.destroyer(t,null)}}(t,e);return i.stream=t,i}function lt(t,e){if(0===e.length)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}function ut(t){const e=t._readableState;M("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(pt,e,t))}function pt(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)n.nextTick(ht,e);else if(t.autoDestroy){const t=e._writableState;(!t||t.autoDestroy&&(t.finished||!1===t.writable))&&e.destroy()}}function ht(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}let dt;function ct(){return void 0===dt&&(dt={}),dt}z.prototype.read=function(t){M("read",t),void 0===t?t=NaN:r(t)||(t=a(t,10));const e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=function(t){if(t>1073741824)throw new b("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?ut(this):Z(this),null;if(0===(t=J(t,e))&&e.ended)return 0===e.length&&ut(this),null;let n,s=!!(e.state&G);if(M("need readable",s),(0===e.length||e.length-t<e.highWaterMark)&&(s=!0,M("length less than watermark",s)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)s=!1,M("reading, ended or constructing",s);else if(s){M("do read"),e.state|=8|X,0===e.length&&(e.state|=G);try{this._read(e.highWaterMark)}catch(t){Y(this,t)}e.state&=~X,e.reading||(t=J(i,e))}return n=t>0?lt(t,e):null,null===n?(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),i!==t&&e.ended&&ut(this)),null===n||e.errorEmitted||e.closeEmitted||(e.dataEmitted=!0,this.emit("data",n)),n},z.prototype._read=function(t){throw new L("_read()")},z.prototype.pipe=function(t,e){const i=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 r=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?a:T;function o(e,n){M("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,function(){M("cleanup"),t.removeListener("close",_),t.removeListener("finish",f),l&&t.removeListener("drain",l);t.removeListener("error",c),t.removeListener("unpipe",o),i.removeListener("end",a),i.removeListener("end",T),i.removeListener("data",h),u=!0,l&&s.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}())}function a(){M("onend"),t.end()}let l;s.endEmitted?n.nextTick(r):i.once("end",r),t.on("unpipe",o);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)),i.pause()),l||(l=function(t,e){return function(){const i=t._readableState;i.awaitDrainWriters===e?(M("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(M("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),i.awaitDrainWriters&&0!==i.awaitDrainWriters.size||!t.listenerCount("data")||t.resume()}}(i,t),t.on("drain",l))}function h(e){M("ondata");const i=t.write(e);M("dest.write",i),!1===i&&p()}function c(e){if(M("onerror",e),T(),t.removeListener("error",c),0===t.listenerCount("error")){const i=t._writableState||t._readableState;i&&!i.errorEmitted?Y(t,e):t.emit("error",e)}}function _(){t.removeListener("finish",f),T()}function f(){M("onfinish"),t.removeListener("close",_),T()}function T(){M("unpipe"),i.unpipe(t)}return i.on("data",h),g(t,"error",c),t.once("close",_),t.once("finish",f),t.emit("pipe",i),!0===t.writableNeedDrain?p():s.flowing||(M("pipe resume"),i.resume()),t},z.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;e<t.length;e++)t[e].emit("unpipe",this,{hasUnpiped:!1});return this}const i=s(e.pipes,t);return-1===i||(e.pipes.splice(i,1),0===e.pipes.length&&this.pause(),t.emit("unpipe",this,{hasUnpiped:!1})),this},z.prototype.on=function(t,e){const i=m.prototype.on.call(this,t,e),s=this._readableState;return"data"===t?(s.readableListening=this.listenerCount("readable")>0,!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?Z(this):s.reading||n.nextTick(st,this))),i},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(t,e){const i=m.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(nt,this),i},z.prototype.off=z.prototype.removeListener,z.prototype.removeAllListeners=function(t){const e=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(nt,this),e},z.prototype.resume=function(){const t=this._readableState;return t.flowing||(M("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(rt,t,e))}(this,t)),t[P]=!1,this},z.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},z.prototype.wrap=function(t){let e=!1;t.on("data",(i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())})),t.on("end",(()=>{this.push(null)})),t.on("error",(t=>{Y(this,t)})),t.on("close",(()=>{this.destroy()})),t.on("destroy",(()=>{this.destroy()})),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};const i=u(t);for(let e=1;e<i.length;e++){const n=i[e];void 0===this[n]&&"function"==typeof t[n]&&(this[n]=t[n].bind(t))}return this},z.prototype[_]=function(){return at(this)},z.prototype.iterator=function(t){return void 0!==t&&F(t,"options"),at(this,t)},l(z.prototype,{readable:{__proto__:null,get(){const t=this._readableState;return!(!t||!1===t.readable||t.destroyed||t.errorEmitted||t.endEmitted)},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(K.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[P]},set(t){this[P]=!!t}}}),z._fromList=lt,z.from=function(t,e){return k(z,t,e)},z.fromWeb=function(t,e){return ct().newStreamReadableFromReadableStream(t,e)},z.toWeb=function(t,e){return ct().newReadableStreamFromStreamReadable(t,e)},z.wrap=function(t,e){var i,n;return new z({objectMode:null===(i=null!==(n=t.readableObjectMode)&&void 0!==n?n:t.objectMode)||void 0===i||i,...e,destroy(e,i){A.destroyer(t,e),i(e)}}).wrap(t)}},9153:(t,e,i)=>{"use strict";const{MathFloor:n,NumberIsInteger:s}=i(4184),{validateInteger:r}=i(6283),{ERR_INVALID_ARG_VALUE:o}=i(6605).codes;let a=16384,l=16;function u(t){return t?l:a}t.exports={getHighWaterMark:function(t,e,i,r){const a=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,r,i);if(null!=a){if(!s(a)||a<0){throw new o(r?`options.${i}`:"options.highWaterMark",a)}return n(a)}return u(t.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(t,e){r(e,"value",0),t?l=e:a=e}}},208:(t,e,i)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:s}=i(4184);t.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:r}=i(6605).codes,o=i(4992),{getHighWaterMark:a}=i(9153);n(u.prototype,o.prototype),n(u,o);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}),o.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",h)}function p(t){"function"!=typeof this._flush||this.destroyed?(this.push(null),t&&t()):this._flush(((e,i)=>{e?t?t(e):this.destroy(e):(null!=i&&this.push(i),this.push(null),t&&t())}))}function h(){this._final!==p&&p.call(this)}u.prototype._final=p,u.prototype._transform=function(t,e,i){throw new r("_transform()")},u.prototype._write=function(t,e,i){const n=this._readableState,s=this._writableState,r=n.length;this._transform(t,e,((t,e)=>{t?i(t):(null!=e&&this.push(e),s.ended||r===n.length||n.length<n.highWaterMark?i():this[l]=i)}))},u.prototype._read=function(){if(this[l]){const t=this[l];this[l]=null,t()}}},6569:(t,e,i)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:s,SymbolFor:r}=i(4184),o=r("nodejs.stream.destroyed"),a=r("nodejs.stream.errored"),l=r("nodejs.stream.readable"),u=r("nodejs.stream.writable"),p=r("nodejs.stream.disturbed"),h=r("nodejs.webstream.isClosedPromise"),d=r("nodejs.webstream.controllerErrorFunction");function c(t,e=!1){var i;return!(!t||"function"!=typeof t.pipe||"function"!=typeof t.on||e&&("function"!=typeof t.pause||"function"!=typeof t.resume)||t._writableState&&!1===(null===(i=t._readableState)||void 0===i?void 0:i.readable)||t._writableState&&!t._readableState)}function _(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 f(t){return t&&(t._readableState||t._writableState||"function"==typeof t.write&&"function"==typeof t.on||"function"==typeof t.pipe&&"function"==typeof t.on)}function T(t){return!(!t||f(t)||"function"!=typeof t.pipeThrough||"function"!=typeof t.getReader||"function"!=typeof t.cancel)}function m(t){return!(!t||f(t)||"function"!=typeof t.getWriter||"function"!=typeof t.abort)}function g(t){return!(!t||f(t)||"object"!=typeof t.readable||"object"!=typeof t.writable)}function I(t){if(!f(t))return null;const e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[o]||null!=n&&n.destroyed)}function E(t){if(!_(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(!c(t))return null;const i=t._readableState;return(null==i||!i.errored)&&("boolean"!=typeof(null==i?void 0:i.endEmitted)?null:!!(i.endEmitted||!1===e&&!0===i.ended&&0===i.length))}function M(t){return t&&null!=t[l]?t[l]:"boolean"!=typeof(null==t?void 0:t.readable)?null:!I(t)&&(c(t)&&t.readable&&!O(t))}function R(t){return t&&null!=t[u]?t[u]:"boolean"!=typeof(null==t?void 0:t.writable)?null:!I(t)&&(_(t)&&t.writable&&!E(t))}function A(t){return"boolean"==typeof t._closed&&"boolean"==typeof t._defaultKeepAlive&&"boolean"==typeof t._removedConnection&&"boolean"==typeof t._removedContLen}function y(t){return"boolean"==typeof t._sent100&&A(t)}t.exports={isDestroyed:I,kIsDestroyed:o,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,i,n,s,r,o,l,u,p,h;return!(!t||!(null!==(e=null!==(i=null!==(n=null!==(s=null!==(r=null!==(o=t[a])&&void 0!==o?o:t.readableErrored)&&void 0!==r?r:t.writableErrored)&&void 0!==s?s:null===(l=t._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(u=t._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==i?i:null===(p=t._readableState)||void 0===p?void 0:p.errored)&&void 0!==e?e:null===(h=t._writableState)||void 0===h?void 0:h.errored))},kIsErrored:a,isReadable:M,kIsReadable:l,kIsClosedPromise:h,kControllerErrorFunction:d,kIsWritable:u,isClosed:function(t){if(!f(t))return null;if("boolean"==typeof t.closed)return t.closed;const e=t._writableState,i=t._readableState;return"boolean"==typeof(null==e?void 0:e.closed)||"boolean"==typeof(null==i?void 0:i.closed)?(null==e?void 0:e.closed)||(null==i?void 0:i.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 f(t)?!!I(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[n]:!1===e?"function"==typeof t[s]:"function"==typeof t[n]||"function"==typeof t[s])},isReadableNodeStream:c,isReadableStream:T,isReadableEnded:function(t){if(!c(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,i;return f(t)?t.readableErrored?t.readableErrored:null!==(e=null===(i=t._readableState)||void 0===i?void 0:i.errored)&&void 0!==e?e:null:null},isNodeStream:f,isWebStream:function(t){return T(t)||m(t)||g(t)},isWritable:R,isWritableNodeStream:_,isWritableStream:m,isWritableEnded:E,isWritableFinished:function(t,e){if(!_(t))return null;if(!0===t.writableFinished)return!0;const i=t._writableState;return(null==i||!i.errored)&&("boolean"!=typeof(null==i?void 0:i.finished)?null:!!(i.finished||!1===e&&!0===i.ended&&0===i.length))},isWritableErrored:function(t){var e,i;return f(t)?t.writableErrored?t.writableErrored:null!==(e=null===(i=t._writableState)||void 0===i?void 0:i.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:y,willEmitClose:function(t){if(!f(t))return null;const e=t._writableState,i=t._readableState,n=e||i;return!n&&y(t)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:g}},394:(t,e,i)=>{const n=i(5606),{ArrayPrototypeSlice:s,Error:r,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:p,Symbol:h,SymbolHasInstance:d}=i(4184);t.exports=F,F.WritableState=w;const{EventEmitter:c}=i(7007),_=i(2913).Stream,{Buffer:f}=i(8287),T=i(2430),{addAbortSignal:m}=i(153),{getHighWaterMark:g,getDefaultHighWaterMark:I}=i(9153),{ERR_INVALID_ARG_TYPE:E,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:y,ERR_STREAM_NULL_VALUES:S,ERR_STREAM_WRITE_AFTER_END:v,ERR_UNKNOWN_ENCODING:C}=i(6605).codes,{errorOrDestroy:L}=T;function b(){}u(F.prototype,_.prototype),u(F,_);const D=h("kOnFinished");function w(t,e,n){"boolean"!=typeof n&&(n=e instanceof i(4992)),this.objectMode=!(!t||!t.objectMode),n&&(this.objectMode=this.objectMode||!(!t||!t.writableObjectMode)),this.highWaterMark=t?g(this,t,"writableHighWaterMark",n):I(!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=V.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(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[D]=[]}function N(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}function F(t){const e=this instanceof i(4992);if(!e&&!o(F,this))return new F(t);this._writableState=new w(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)),_.call(this,t),T.construct(this,(()=>{const t=this._writableState;t.writing||X(this,t),W(this,t)}))}function P(t,e,i,s){const r=t._writableState;if("function"==typeof i)s=i,i=r.defaultEncoding;else{if(i){if("buffer"!==i&&!f.isEncoding(i))throw new C(i)}else i=r.defaultEncoding;"function"!=typeof s&&(s=b)}if(null===e)throw new S;if(!r.objectMode)if("string"==typeof e)!1!==r.decodeStrings&&(e=f.from(e,i),i="buffer");else if(e instanceof f)i="buffer";else{if(!_._isUint8Array(e))throw new E("chunk",["string","Buffer","Uint8Array"],e);e=_._uint8ArrayToBuffer(e),i="buffer"}let o;return r.ending?o=new v:r.destroyed&&(o=new A("write")),o?(n.nextTick(s,o),L(t,o,!0),o):(r.pendingcb++,function(t,e,i,n,s){const r=e.objectMode?1:i.length;e.length+=r;const o=e.length<e.highWaterMark;o||(e.needDrain=!0);e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:n,callback:s}),e.allBuffers&&"buffer"!==n&&(e.allBuffers=!1),e.allNoop&&s!==b&&(e.allNoop=!1)):(e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1);return o&&!e.errored&&!e.destroyed}(t,r,e,i,s))}function x(t,e,i,n,s,r,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new A("write")):i?t._writev(s,e.onwrite):t._write(s,r,e.onwrite),e.sync=!1}function k(t,e,i,n){--e.pendingcb,n(i),U(e),L(t,i)}function V(t,e){const i=t._writableState,s=i.sync,r=i.writecb;"function"==typeof r?(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),s?n.nextTick(k,t,i,e,r):k(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&X(t,i),s?null!==i.afterWriteTickInfo&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},n.nextTick(Y,i.afterWriteTickInfo)):B(t,i,1,r))):L(t,new M)}function Y({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,B(t,e,i,n)}function B(t,e,i,n){for(!e.ending&&!t.destroyed&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&U(e),W(t,e)}function U(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;const{chunk:n,callback:s}=t.buffered[i],r=t.objectMode?1:n.length;t.length-=r,s(null!==(e=t.errored)&&void 0!==e?e:new A("write"))}const i=t[D].splice(0);for(let e=0;e<i.length;e++){var n;i[e](null!==(n=t.errored)&&void 0!==n?n:new A("end"))}N(t)}function X(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;const{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;const n=e.allNoop?b:t=>{for(let e=a;e<i.length;++e)i[e].callback(t)},r=e.allNoop&&0===a?i:s(i,a);r.allBuffers=e.allBuffers,x(t,e,!0,e.length,r,"",n),N(e)}else{do{const{chunk:n,encoding:s,callback:o}=i[a];i[a++]=null;x(t,e,!1,r?1:n.length,n,s,o)}while(a<i.length&&!e.writing);a===i.length?N(e):a>256?(i.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 i=!1;function s(s){if(i)L(t,null!=s?s:M());else if(i=!0,e.pendingcb--,s){const i=e[D].splice(0);for(let t=0;t<i.length;t++)i[t](s);L(t,s,e.sync)}else G(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,n.nextTick(j,t,e))}e.sync=!0,e.pendingcb++;try{t._final(s)}catch(t){s(t)}e.sync=!1}(t,e)))}function W(t,e,i){G(e)&&(H(t,e),0===e.pendingcb&&(i?(e.pendingcb++,n.nextTick(((t,e)=>{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 i=e[D].splice(0);for(let t=0;t<i.length;t++)i[t]();if(t.emit("finish"),e.autoDestroy){const e=t._readableState;(!e||e.autoDestroy&&(e.endEmitted||!1===e.readable))&&t.destroy()}}w.prototype.getBuffer=function(){return s(this.buffered,this.bufferedIndex)},a(w.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(F,d,{__proto__:null,value:function(t){return!!o(this,t)||this===F&&(t&&t._writableState instanceof w)}}),F.prototype.pipe=function(){L(this,new R)},F.prototype.write=function(t,e,i){return!0===P(this,t,e,i)},F.prototype.cork=function(){this._writableState.corked++},F.prototype.uncork=function(){const t=this._writableState;t.corked&&(t.corked--,t.writing||X(this,t))},F.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=p(t)),!f.isEncoding(t))throw new C(t);return this._writableState.defaultEncoding=t,this},F.prototype._write=function(t,e,i){if(!this._writev)throw new O("_write()");this._writev([{chunk:t,encoding:e}],i)},F.prototype._writev=null,F.prototype.end=function(t,e,i){const s=this._writableState;let o;if("function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t){const i=P(this,t,e);i instanceof r&&(o=i)}return s.corked&&(s.corked=1,this.uncork()),o||(s.errored||s.ending?s.finished?o=new y("end"):s.destroyed&&(o=new A("end")):(s.ending=!0,W(this,s,!0),s.ended=!0)),"function"==typeof i&&(o||s.finished?n.nextTick(i,o):s[D].push(i)),this},l(F.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){const t=this._writableState;return!(!t||!1===t.writable||t.destroyed||t.errored||t.ending||t.ended)},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const t=this._writableState;return!!t&&(!t.destroyed&&!t.ending&&t.needDrain)}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const q=T.destroy;let K;function z(){return void 0===K&&(K={}),K}F.prototype.destroy=function(t,e){const i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[D].length)&&n.nextTick(U,i),q.call(this,t,e),this},F.prototype._undestroy=T.undestroy,F.prototype._destroy=function(t,e){e(t)},F.prototype[c.captureRejectionSymbol]=function(t){this.destroy(t)},F.fromWeb=function(t,e){return z().newStreamWritableFromWritableStream(t,e)},F.toWeb=function(t){return z().newWritableStreamFromStreamWritable(t)}},6283:(t,e,i)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:s,ArrayPrototypeJoin:r,ArrayPrototypeMap:o,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:p,NumberParseInt:h,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:c,String:_,StringPrototypeToUpperCase:f,StringPrototypeTrim:T}=i(4184),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:g,ERR_INVALID_ARG_TYPE:I,ERR_INVALID_ARG_VALUE:E,ERR_OUT_OF_RANGE:O,ERR_UNKNOWN_SIGNAL:M}}=i(6605),{normalizeEncoding:R}=i(798),{isAsyncFunction:A,isArrayBufferView:y}=i(798).types,S={};const v=/^[0-7]+$/;const C=m(((t,e,i=p,n=u)=>{if("number"!=typeof t)throw new I(e,"number",t);if(!a(t))throw new O(e,"an integer",t);if(t<i||t>n)throw new O(e,`>= ${i} && <= ${n}`,t)})),L=m(((t,e,i=-2147483648,n=2147483647)=>{if("number"!=typeof t)throw new I(e,"number",t);if(!a(t))throw new O(e,"an integer",t);if(t<i||t>n)throw new O(e,`>= ${i} && <= ${n}`,t)})),b=m(((t,e,i=!1)=>{if("number"!=typeof t)throw new I(e,"number",t);if(!a(t))throw new O(e,"an integer",t);const n=i?1:0,s=4294967295;if(t<n||t>s)throw new O(e,`>= ${n} && <= ${s}`,t)}));function D(t,e){if("string"!=typeof t)throw new I(e,"string",t)}const w=m(((t,e,i)=>{if(!s(i,t)){const n=r(o(i,(t=>"string"==typeof t?`'${t}'`:_(t))),", ");throw new E(e,t,"must be one of: "+n)}}));function N(t,e){if("boolean"!=typeof t)throw new I(e,"boolean",t)}function F(t,e,i){return null!=t&&d(t,e)?t[e]:i}const P=m(((t,e,i=null)=>{const s=F(i,"allowArray",!1),r=F(i,"allowFunction",!1);if(!F(i,"nullable",!1)&&null===t||!s&&n(t)||"object"!=typeof t&&(!r||"function"!=typeof t))throw new I(e,"Object",t)})),x=m(((t,e)=>{if(null!=t&&"object"!=typeof t&&"function"!=typeof t)throw new I(e,"a dictionary",t)})),k=m(((t,e,i=0)=>{if(!n(t))throw new I(e,"Array",t);if(t.length<i){throw new E(e,t,`must be longer than ${i}`)}}));const V=m(((t,e="buffer")=>{if(!y(t))throw new I(e,["Buffer","TypedArray","DataView"],t)}));const Y=m(((t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new I(e,"AbortSignal",t)})),B=m(((t,e)=>{if("function"!=typeof t)throw new I(e,"Function",t)})),U=m(((t,e)=>{if("function"!=typeof t||A(t))throw new I(e,"Function",t)})),X=m(((t,e)=>{if(void 0!==t)throw new I(e,"undefined",t)}));const G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(t,e){if(void 0===t||!c(G,t))throw new E(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(t){return t===(0|t)},isUint32:function(t){return t===t>>>0},parseFileMode:function(t,e,i){if(void 0===t&&(t=i),"string"==typeof t){if(null===c(v,t))throw new E(e,t,"must be a 32-bit unsigned integer or an octal string");t=h(t,8)}return b(t,e),t},validateArray:k,validateStringArray:function(t,e){k(t,e);for(let i=0;i<t.length;i++)D(t[i],`${e}[${i}]`)},validateBooleanArray:function(t,e){k(t,e);for(let i=0;i<t.length;i++)N(t[i],`${e}[${i}]`)},validateAbortSignalArray:function(t,e){k(t,e);for(let i=0;i<t.length;i++){const n=t[i],s=`${e}[${i}]`;if(null==n)throw new I(s,"AbortSignal",n);Y(n,s)}},validateBoolean:N,validateBuffer:V,validateDictionary:x,validateEncoding:function(t,e){const i=R(e),n=t.length;if("hex"===i&&n%2!=0)throw new E("encoding",e,`is invalid for data of length ${n}`)},validateFunction:B,validateInt32:L,validateInteger:C,validateNumber:function(t,e,i=void 0,n){if("number"!=typeof t)throw new I(e,"number",t);if(null!=i&&t<i||null!=n&&t>n||(null!=i||null!=n)&&l(t))throw new O(e,`${null!=i?`>= ${i}`:""}${null!=i&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,t)},validateObject:P,validateOneOf:w,validatePlainFunction:U,validatePort:function(t,e="Port",i=!0){if("number"!=typeof t&&"string"!=typeof t||"string"==typeof t&&0===T(t).length||+t!=+t>>>0||t>65535||0===t&&!i)throw new g(e,t,i);return 0|t},validateSignalName:function(t,e="signal"){if(D(t,e),void 0===S[t]){if(void 0!==S[f(t)])throw new M(t+" (signals must use all capital letters)");throw new M(t)}},validateString:D,validateUint32:b,validateUndefined:X,validateUnion:function(t,e,i){if(!s(i,t))throw new I(e,`('${r(i,"|")}')`,t)},validateAbortSignal:Y,validateLinkHeaderValue:function(t){if("string"==typeof t)return H(t,"hints"),t;if(n(t)){const e=t.length;let i="";if(0===e)return i;for(let n=0;n<e;n++){const s=t[n];H(s,"hints"),i+=s,n!==e-1&&(i+=", ")}return i}throw new E("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},6248:(t,e,i)=>{"use strict";const n=i(4612),s=i(105),r=n.Readable.destroy;t.exports=n.Readable,t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.destroy=r,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>s}),t.exports.Stream=n.Stream,t.exports.default=t.exports},6605:(t,e,i)=>{"use strict";const{format:n,inspect:s,AggregateError:r}=i(798),o=globalThis.AggregateError||r,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,p={};function h(t,e){if(!t)throw new p.ERR_INTERNAL_ASSERTION(e)}function d(t){let e="",i=t.length;const n="-"===t[0]?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function c(t,e,i){i||(i=Error);class s extends i{constructor(...i){super(function(t,e,i){if("function"==typeof e)return h(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);const s=(e.match(/%[dfijoOs]/g)||[]).length;return h(s===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${s}).`),0===i.length?e:n(e,...i)}(t,e,i))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(s.prototype,{name:{value:i.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 _(t){const e="__node_internal_"+t.name;return Object.defineProperty(t,"name",{value:e}),t}class f 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"}}c("ERR_ASSERTION","%s",Error),c("ERR_INVALID_ARG_TYPE",((t,e,i)=>{h("string"==typeof t,"'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";const r=[],o=[],a=[];for(const t of e)h("string"==typeof t,"All expected entries have to be of type string"),l.includes(t)?r.push(t.toLowerCase()):u.test(t)?o.push(t):(h("object"!==t,'The value "object" should be written as "Object"'),a.push(t));if(o.length>0){const t=r.indexOf("object");-1!==t&&(r.splice(r,t,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{const t=r.pop();n+=`one of type ${r.join(", ")}, or ${t}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const t=o.pop();n+=`an instance of ${o.join(", ")}, or ${t}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const t=a.pop();n+=`one of ${a.join(", ")}, or ${t}`}}if(null==i)n+=`. Received ${i}`;else if("function"==typeof i&&i.name)n+=`. Received function ${i.name}`;else if("object"==typeof i){var p;if(null!==(p=i.constructor)&&void 0!==p&&p.name)n+=`. Received an instance of ${i.constructor.name}`;else{n+=`. Received ${s(i,{depth:-1})}`}}else{let t=s(i,{colors:!1});t.length>25&&(t=`${t.slice(0,25)}...`),n+=`. Received type ${typeof i} (${t})`}return n}),TypeError),c("ERR_INVALID_ARG_VALUE",((t,e,i="is invalid")=>{let n=s(e);n.length>128&&(n=n.slice(0,128)+"...");return`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`}),TypeError),c("ERR_INVALID_RETURN_VALUE",((t,e,i)=>{var n;return`Expected ${t} to be returned from the "${e}" function but got ${null!=i&&null!==(n=i.constructor)&&void 0!==n&&n.name?`instance of ${i.constructor.name}`:"type "+typeof i}.`}),TypeError),c("ERR_MISSING_ARGS",((...t)=>{let e;h(t.length>0,"At least one arg needs to be specified");const i=t.length;switch(t=(Array.isArray(t)?t:[t]).map((t=>`"${t}"`)).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{const i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}}return`${e} must be specified`}),TypeError),c("ERR_OUT_OF_RANGE",((t,e,i)=>{let n;return h(e,'Missing "range" argument'),Number.isInteger(i)&&Math.abs(i)>2**32?n=d(String(i)):"bigint"==typeof i?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=d(n)),n+="n"):n=s(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`}),RangeError),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),c("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),c("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),c("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),c("ERR_STREAM_WRITE_AFTER_END","write after end",Error),c("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:f,aggregateTwoErrors:_((function(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;const i=new o([e,t],e.message);return i.code=e.code,i}return t||e})),hideStackFrames:_,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,i)=>t.slice(e,i),Error,FunctionPrototypeCall:(t,e,...i)=>t.call(e,...i),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,i)=>Object.defineProperty(t,e,i),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,i)=>t.then(e,i),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,i)=>t.slice(e,i),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,i)=>t.set(e,i),Boolean,Uint8Array}},798:(t,e,i)=>{"use strict";const n=i(8287),{kResistStopPropagation:s,SymbolDispose:r}=i(4184),o=globalThis.AbortSignal||i(5568).AbortSignal,a=globalThis.AbortController||i(5568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,u=globalThis.Blob||n.Blob,p=void 0!==u?function(t){return t instanceof u}:function(t){return!1},h=(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 i=0;i<t.length;i++)e+=` ${t[i].stack}\n`;super(e),this.name="AggregateError",this.errors=t}}t.exports={AggregateError:d,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise(((i,n)=>{t=i,e=n})),resolve:t,reject:e}},promisify:t=>new Promise(((e,i)=>{t(((t,...n)=>t?i(t):e(...n)))})),debuglog:()=>function(){},format:(t,...e)=>t.replace(/%([sdifj])/g,(function(...[t,i]){const n=e.shift();if("f"===i)return n.toFixed(6);if("j"===i)return JSON.stringify(n);if("s"===i&&"object"==typeof n){return`${n.constructor!==Object?n.constructor.name:""} {}`.trim()}return n.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:i(7007).addAbortListener||function(t,e){if(void 0===t)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);let i;return h(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}),i=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[r](){var t;null===(t=i)||void 0===t||t()}}},AbortSignalAny:o.any||function(t){if(1===t.length)return t[0];const e=new a,i=()=>e.abort();return t.forEach((t=>{h(t,"signals"),t.addEventListener("abort",i,{once:!0})})),e.signal.addEventListener("abort",(()=>{t.forEach((t=>t.removeEventListener("abort",i)))}),{once:!0}),e.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},4612:(t,e,i)=>{const{Buffer:n}=i(8287),{ObjectDefineProperty:s,ObjectKeys:r,ReflectApply:o}=i(4184),{promisify:{custom:a}}=i(798),{streamReturningOperators:l,promiseReturningOperators:u}=i(5589),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=i(6605),h=i(6864),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:c}=i(9153),{pipeline:_}=i(872),{destroyer:f}=i(2430),T=i(9700),m=i(105),g=i(6569),I=t.exports=i(2913).Stream;I.isDestroyed=g.isDestroyed,I.isDisturbed=g.isDisturbed,I.isErrored=g.isErrored,I.isReadable=g.isReadable,I.isWritable=g.isWritable,I.Readable=i(6566);for(const M of r(l)){const R=l[M];function E(...t){if(new.target)throw p();return I.Readable.from(o(R,this,t))}s(E,"name",{__proto__:null,value:R.name}),s(E,"length",{__proto__:null,value:R.length}),s(I.Readable.prototype,M,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of r(u)){const y=u[A];function E(...t){if(new.target)throw p();return o(y,this,t)}s(E,"name",{__proto__:null,value:y.name}),s(E,"length",{__proto__:null,value:y.length}),s(I.Readable.prototype,A,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}I.Writable=i(394),I.Duplex=i(4992),I.Transform=i(208),I.PassThrough=i(6898),I.pipeline=_;const{addAbortSignal:O}=i(153);I.addAbortSignal=O,I.finished=T,I.destroy=f,I.compose=h,I.setDefaultHighWaterMark=d,I.getDefaultHighWaterMark=c,s(I,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),s(_,a,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),s(T,a,{__proto__:null,enumerable:!0,get:()=>m.finished}),I.Stream=I,I._isUint8Array=function(t){return t instanceof Uint8Array},I._uint8ArrayToBuffer=function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)}},105:(t,e,i)=>{"use strict";const{ArrayPrototypePop:n,Promise:s}=i(4184),{isIterable:r,isNodeStream:o,isWebStream:a}=i(6569),{pipelineImpl:l}=i(872),{finished:u}=i(9700);i(4612),t.exports={finished:u,pipeline:function(...t){return new s(((e,i)=>{let s,u;const p=t[t.length-1];if(p&&"object"==typeof p&&!o(p)&&!r(p)&&!a(p)){const e=n(t);s=e.signal,u=e.end}l(t,((t,n)=>{t?i(t):e(n)}),{signal:s,end:u})}))}}},8707:(t,e,i)=>{"use strict";var n=i(5242).Buffer,s=n.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 r(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&&(n.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=h,e=3;break;default:return this.write=d,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(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,i=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(this,t);return void 0!==i?i: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 i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}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 i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function p(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?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-i))}function h(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 c(t){return t&&t.length?this.write(t):""}e.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e},r.prototype.text=function(t,e){var i=function(t,e,i){var n=e.length-1;if(n<i)return 0;var s=o(e[n]);if(s>=0)return s>0&&(t.lastNeed=s-1),s;if(--n<i||-2===s)return 0;if(s=o(e[n]),s>=0)return s>0&&(t.lastNeed=s-2),s;if(--n<i||-2===s)return 0;if(s=o(e[n]),s>=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=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},r.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:i}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;t.exports=e,t.exports.AbortSignal=i,t.exports.default=e},4083:(t,e,i)=>{var n;
/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/!function(){var s,r={};function o(){}function a(t){return t}function l(t){return!!t}function u(t){return!t}var p="object"==typeof self&&self.self===self&&self||"object"==typeof i.g&&i.g.global===i.g&&i.g||this;function h(t){return function(){if(null===t)throw new Error("Callback was already called.");t.apply(this,arguments),t=null}}function d(t){return function(){null!==t&&(t.apply(this,arguments),t=null)}}null!=p&&(s=p.async),r.noConflict=function(){return p.async=s,r};var c=Object.prototype.toString,_=Array.isArray||function(t){return"[object Array]"===c.call(t)};function f(t){return _(t)||"number"==typeof t.length&&t.length>=0&&t.length%1==0}function T(t,e){for(var i=-1,n=t.length;++i<n;)e(t[i],i,t)}function m(t,e){for(var i=-1,n=t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s}function g(t){return m(Array(t),(function(t,e){return e}))}function I(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var E=Object.keys||function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e};function O(t){var e,i,n=-1;return f(t)?(e=t.length,function(){return++n<e?n:null}):(i=E(t),e=i.length,function(){return++n<e?i[n]:null})}function M(t,e){return e=null==e?t.length-1:+e,function(){for(var i=Math.max(arguments.length-e,0),n=Array(i),s=0;s<i;s++)n[s]=arguments[s+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n)}}}function R(t){return function(e,i,n){return t(e,n)}}var A="function"==typeof setImmediate&&setImmediate,y=A?function(t){A(t)}:function(t){setTimeout(t,0)};function S(t){return function(e,i,n){n=d(n||o);var s=O(e=e||[]);if(t<=0)return n(null);var r=!1,a=0,l=!1;!function o(){if(r&&a<=0)return n(null);for(;a<t&&!l;){var u=s();if(null===u)return r=!0,void(a<=0&&n(null));a+=1,i(e[u],u,h((function(t){a-=1,t?(n(t),l=!0):o()})))}}()}}function v(t){return function(e,i,n){return t(r.eachOf,e,i,n)}}function C(t){return function(e,i,n,s){return t(S(i),e,n,s)}}function L(t){return function(e,i,n){return t(r.eachOfSeries,e,i,n)}}function b(t,e,i,n){n=d(n||o);var s=f(e=e||[])?[]:{};t(e,(function(t,e,n){i(t,(function(t,i){s[e]=i,n(t)}))}),(function(t){n(t,s)}))}function D(t,e,i,n){var s=[];t(e,(function(t,e,n){i(t,(function(i){i&&s.push({index:e,value:t}),n()}))}),(function(){n(m(s.sort((function(t,e){return t.index-e.index})),(function(t){return t.value})))}))}function w(t,e,i,n){D(t,e,(function(t,e){i(t,(function(t){e(!t)}))}),n)}function N(t,e,i){return function(n,s,r,o){function a(){o&&o(i(!1,void 0))}function l(t,n,s){if(!o)return s();r(t,(function(n){o&&e(n)&&(o(i(!0,t)),o=r=!1),s()}))}arguments.length>3?t(n,s,l,a):(o=r,r=s,t(n,l,a))}}function F(t,e){return e}function P(t,e,i){i=i||o;var n=f(e)?[]:{};t(e,(function(t,e,i){t(M((function(t,s){s.length<=1&&(s=s[0]),n[e]=s,i(t)})))}),(function(t){i(t,n)}))}function x(t,e,i,n){var s=[];t(e,(function(t,e,n){i(t,(function(t,e){s=s.concat(e||[]),n(t)}))}),(function(t){n(t,s)}))}function k(t,e,i){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");function n(t,e,i,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");if(t.started=!0,_(e)||(e=[e]),0===e.length&&t.idle())return r.setImmediate((function(){t.drain()}));T(e,(function(e){var s={data:e,callback:n||o};i?t.tasks.unshift(s):t.tasks.push(s),t.tasks.length===t.concurrency&&t.saturated()})),r.setImmediate(t.process)}function s(t,e){return function(){a-=1;var i=!1,n=arguments;T(e,(function(t){T(l,(function(e,n){e!==t||i||(l.splice(n,1),i=!0)})),t.callback.apply(t,n)})),t.tasks.length+a===0&&t.drain(),t.process()}}var a=0,l=[],u={tasks:[],concurrency:e,payload:i,saturated:o,empty:o,drain:o,started:!1,paused:!1,push:function(t,e){n(u,t,!1,e)},kill:function(){u.drain=o,u.tasks=[]},unshift:function(t,e){n(u,t,!0,e)},process:function(){for(;!u.paused&&a<u.concurrency&&u.tasks.length;){var e=u.payload?u.tasks.splice(0,u.payload):u.tasks.splice(0,u.tasks.length),i=m(e,(function(t){return t.data}));0===u.tasks.length&&u.empty(),a+=1,l.push(e[0]);var n=h(s(u,e));t(i,n)}},length:function(){return u.tasks.length},running:function(){return a},workersList:function(){return l},idle:function(){return u.tasks.length+a===0},pause:function(){u.paused=!0},resume:function(){if(!1!==u.paused){u.paused=!1;for(var t=Math.min(u.concurrency,u.tasks.length),e=1;e<=t;e++)r.setImmediate(u.process)}}};return u}function V(t){return M((function(e,i){e.apply(null,i.concat([M((function(e,i){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&T(i,(function(e){console[t](e)})))}))]))}))}function Y(t){return function(e,i,n){t(g(e),i,n)}}function B(t){return M((function(e,i){var n=M((function(i){var n=this,s=i.pop();return t(e,(function(t,e,s){t.apply(n,i.concat([s]))}),s)}));return i.length?n.apply(this,i):n}))}function U(t){return M((function(e){var i=e.pop();e.push((function(){var t=arguments;n?r.setImmediate((function(){i.apply(null,t)})):i.apply(null,t)}));var n=!0;t.apply(this,e),n=!1}))}"object"==typeof process&&"function"==typeof process.nextTick?r.nextTick=process.nextTick:r.nextTick=y,r.setImmediate=A?y:r.nextTick,r.forEach=r.each=function(t,e,i){return r.eachOf(t,R(e),i)},r.forEachSeries=r.eachSeries=function(t,e,i){return r.eachOfSeries(t,R(e),i)},r.forEachLimit=r.eachLimit=function(t,e,i,n){return S(e)(t,R(i),n)},r.forEachOf=r.eachOf=function(t,e,i){i=d(i||o);for(var n,s=O(t=t||[]),r=0;null!=(n=s());)r+=1,e(t[n],n,h(a));function a(t){r--,t?i(t):null===n&&r<=0&&i(null)}0===r&&i(null)},r.forEachOfSeries=r.eachOfSeries=function(t,e,i){i=d(i||o);var n=O(t=t||[]),s=n();!function o(){var a=!0;if(null===s)return i(null);e(t[s],s,h((function(t){if(t)i(t);else{if(null===(s=n()))return i(null);a?r.setImmediate(o):o()}}))),a=!1}()},r.forEachOfLimit=r.eachOfLimit=function(t,e,i,n){S(e)(t,i,n)},r.map=v(b),r.mapSeries=L(b),r.mapLimit=C(b),r.inject=r.foldl=r.reduce=function(t,e,i,n){r.eachOfSeries(t,(function(t,n,s){i(e,t,(function(t,i){e=i,s(t)}))}),(function(t){n(t,e)}))},r.foldr=r.reduceRight=function(t,e,i,n){var s=m(t,a).reverse();r.reduce(s,e,i,n)},r.transform=function(t,e,i,n){3===arguments.length&&(n=i,i=e,e=_(t)?[]:{}),r.eachOf(t,(function(t,n,s){i(e,t,n,s)}),(function(t){n(t,e)}))},r.select=r.filter=v(D),r.selectLimit=r.filterLimit=C(D),r.selectSeries=r.filterSeries=L(D),r.reject=v(w),r.rejectLimit=C(w),r.rejectSeries=L(w),r.any=r.some=N(r.eachOf,l,a),r.someLimit=N(r.eachOfLimit,l,a),r.all=r.every=N(r.eachOf,u,u),r.everyLimit=N(r.eachOfLimit,u,u),r.detect=N(r.eachOf,a,F),r.detectSeries=N(r.eachOfSeries,a,F),r.detectLimit=N(r.eachOfLimit,a,F),r.sortBy=function(t,e,i){function n(t,e){var i=t.criteria,n=e.criteria;return i<n?-1:i>n?1:0}r.map(t,(function(t,i){e(t,(function(e,n){e?i(e):i(null,{value:t,criteria:n})}))}),(function(t,e){if(t)return i(t);i(null,m(e.sort(n),(function(t){return t.value})))}))},r.auto=function(t,e,i){"function"==typeof arguments[1]&&(i=e,e=null),i=d(i||o);var n=E(t),s=n.length;if(!s)return i(null);e||(e=s);var a={},l=0,u=!1,p=[];function h(t){p.unshift(t)}function c(){s--,T(p.slice(0),(function(t){t()}))}h((function(){s||i(null,a)})),T(n,(function(n){if(!u){for(var s,o=_(t[n])?t[n]:[t[n]],d=M((function(t,e){if(l--,e.length<=1&&(e=e[0]),t){var s={};p=function(t,e){s[e]=t},T(E(o=a),(function(t){p(o[t],t)})),s[n]=e,u=!0,i(t,s)}else a[n]=e,r.setImmediate(c);var o,p})),f=o.slice(0,o.length-1),m=f.length;m--;){if(!(s=t[f[m]]))throw new Error("Has nonexistent dependency in "+f.join(", "));if(_(s)&&I(s,n)>=0)throw new Error("Has cyclic dependencies")}g()?(l++,o[o.length-1](d,a)):h((function t(){g()&&(l++,(e=I(p,t))>=0&&p.splice(e,1),o[o.length-1](d,a));var e}))}function g(){return l<e&&(t=function(t,e){return t&&a.hasOwnProperty(e)},i=!0,T(f,(function(e,n,s){i=t(i,e,n,s)})),i)&&!a.hasOwnProperty(n);var t,i}}))},r.retry=function(t,e,i){var n=[],s={times:5,interval:0};var o=arguments.length;if(o<1||o>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");function a(t,e){function i(t,i){return function(n){t((function(t,e){n(!t||i,{err:t,result:e})}),e)}}function o(t){return function(e){setTimeout((function(){e(null)}),t)}}for(;s.times;){var a=!(s.times-=1);n.push(i(s.task,a)),!a&&s.interval>0&&n.push(o(s.interval))}r.series(n,(function(e,i){i=i[i.length-1],(t||s.callback)(i.err,i.result)}))}return o<=2&&"function"==typeof t&&(i=e,e=t),"function"!=typeof t&&function(t,e){if("number"==typeof e)t.times=parseInt(e,10)||5;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||5,t.interval=parseInt(e.interval,10)||0}}(s,t),s.callback=i,s.task=e,s.callback?a():a},r.waterfall=function(t,e){if(e=d(e||o),!_(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}if(!t.length)return e();!function t(i){return M((function(n,s){if(n)e.apply(null,[n].concat(s));else{var r=i.next();r?s.push(t(r)):s.push(e),U(i).apply(null,s)}}))}(r.iterator(t))()},r.parallel=function(t,e){P(r.eachOf,t,e)},r.parallelLimit=function(t,e,i){P(S(e),t,i)},r.series=function(t,e){P(r.eachOfSeries,t,e)},r.iterator=function(t){return function e(i){function n(){return t.length&&t[i].apply(null,arguments),n.next()}return n.next=function(){return i<t.length-1?e(i+1):null},n}(0)},r.apply=M((function(t,e){return M((function(i){return t.apply(null,e.concat(i))}))})),r.concat=v(x),r.concatSeries=L(x),r.whilst=function(t,e,i){if(i=i||o,t()){var n=M((function(s,r){s?i(s):t.apply(this,r)?e(n):i.apply(null,[null].concat(r))}));e(n)}else i(null)},r.doWhilst=function(t,e,i){var n=0;return r.whilst((function(){return++n<=1||e.apply(this,arguments)}),t,i)},r.until=function(t,e,i){return r.whilst((function(){return!t.apply(this,arguments)}),e,i)},r.doUntil=function(t,e,i){return r.doWhilst(t,(function(){return!e.apply(this,arguments)}),i)},r.during=function(t,e,i){i=i||o;var n=M((function(e,n){e?i(e):(n.push(s),t.apply(this,n))})),s=function(t,s){t?i(t):s?e(n):i(null)};t(s)},r.doDuring=function(t,e,i){var n=0;r.during((function(t){n++<1?t(null,!0):e.apply(this,arguments)}),t,i)},r.queue=function(t,e){return k((function(e,i){t(e[0],i)}),e,1)},r.priorityQueue=function(t,e){function i(t,e){return t.priority-e.priority}var n=r.queue(t,e);return n.push=function(t,e,s){!function(t,e,n,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");if(t.started=!0,_(e)||(e=[e]),0===e.length)return r.setImmediate((function(){t.drain()}));T(e,(function(e){var a={data:e,priority:n,callback:"function"==typeof s?s:o};t.tasks.splice(function(t,e,i){for(var n=-1,s=t.length-1;n<s;){var r=n+(s-n+1>>>1);i(e,t[r])>=0?n=r:s=r-1}return n}(t.tasks,a,i)+1,0,a),t.tasks.length===t.concurrency&&t.saturated(),r.setImmediate(t.process)}))}(n,t,e,s)},delete n.unshift,n},r.cargo=function(t,e){return k(t,1,e)},r.log=V("log"),r.dir=V("dir"),r.memoize=function(t,e){var i={},n={},s=Object.prototype.hasOwnProperty;e=e||a;var o=M((function(o){var a=o.pop(),l=e.apply(null,o);s.call(i,l)?r.setImmediate((function(){a.apply(null,i[l])})):s.call(n,l)?n[l].push(a):(n[l]=[a],t.apply(null,o.concat([M((function(t){i[l]=t;var e=n[l];delete n[l];for(var s=0,r=e.length;s<r;s++)e[s].apply(null,t)}))])))}));return o.memo=i,o.unmemoized=t,o},r.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},r.times=Y(r.map),r.timesSeries=Y(r.mapSeries),r.timesLimit=function(t,e,i,n){return r.mapLimit(g(t),e,i,n)},r.seq=function(){var t=arguments;return M((function(e){var i=this,n=e[e.length-1];"function"==typeof n?e.pop():n=o,r.reduce(t,e,(function(t,e,n){e.apply(i,t.concat([M((function(t,e){n(t,e)}))]))}),(function(t,e){n.apply(i,[t].concat(e))}))}))},r.compose=function(){return r.seq.apply(null,Array.prototype.reverse.call(arguments))},r.applyEach=B(r.eachOf),r.applyEachSeries=B(r.eachOfSeries),r.forever=function(t,e){var i=h(e||o),n=U(t);!function t(e){if(e)return i(e);n(t)}()},r.ensureAsync=U,r.constant=M((function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}})),r.wrapSync=r.asyncify=function(t){return M((function(e){var i,n,s,r=e.pop();try{i=t.apply(this,e)}catch(t){return r(t)}("function"===(s=typeof(n=i))||"object"===s&&n)&&"function"==typeof i.then?i.then((function(t){r(null,t)})).catch((function(t){r(t.message?t:new Error(t))})):r(null,i)}))},t.exports?t.exports=r:void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n)}()},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,r=a(t),o=r[0],l=r[1],u=new s(function(t,e,i){return 3*(e+i)/4-i}(0,o,l)),p=0,h=l>0?o-4:o;for(i=0;i<h;i+=4)e=n[t.charCodeAt(i)]<<18|n[t.charCodeAt(i+1)]<<12|n[t.charCodeAt(i+2)]<<6|n[t.charCodeAt(i+3)],u[p++]=e>>16&255,u[p++]=e>>8&255,u[p++]=255&e;2===l&&(e=n[t.charCodeAt(i)]<<2|n[t.charCodeAt(i+1)]>>4,u[p++]=255&e);1===l&&(e=n[t.charCodeAt(i)]<<10|n[t.charCodeAt(i+1)]<<4|n[t.charCodeAt(i+2)]>>2,u[p++]=e>>8&255,u[p++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,s=n%3,r=[],o=16383,a=0,u=n-s;a<u;a+=o)r.push(l(t,a,a+o>u?u:a+o));1===s?(e=t[n-1],r.push(i[e>>2]+i[e<<4&63]+"==")):2===s&&(e=(t[n-2]<<8)+t[n-1],r.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return r.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)i[o]=r[o],n[r.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function l(t,e,n){for(var s,r,o=[],a=e;a<n;a+=3)s=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(i[(r=s)>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287:(t,e,i)=>{"use strict";
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/const n=i(7526),s=i(251),r="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 o=2147483647;function a(t){if(t>o)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,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,i)}function u(t,e,i){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 i=0|f(t,e);let n=a(i);const s=n.write(t,e);s!==i&&(n=n.slice(0,s));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(z(t,Uint8Array)){const e=new Uint8Array(t);return c(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(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return c(t,e,i);if("undefined"!=typeof SharedArrayBuffer&&(z(t,SharedArrayBuffer)||t&&z(t.buffer,SharedArrayBuffer)))return c(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return l.from(n,e,i);const s=function(t){if(l.isBuffer(t)){const e=0|_(t.length),i=a(e);return 0===i.length||t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||$(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,i);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 h(t){return p(t),a(t<0?0:0|_(t))}function d(t){const e=t.length<0?0:0|_(t.length),i=a(e);for(let n=0;n<e;n+=1)i[n]=255&t[n];return i}function c(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i),Object.setPrototypeOf(n,l.prototype),n}function _(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(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 i=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(t).length;default:if(s)return n?-1:j(t).length;e=(""+e).toLowerCase(),s=!0}}function T(t,e,i){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return b(this,e,i);case"utf8":case"utf-8":return S(this,e,i);case"ascii":return C(this,e,i);case"latin1":case"binary":return L(this,e,i);case"base64":return y(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function g(t,e,i,n,s){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),$(i=+i)&&(i=s?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(s)return-1;i=t.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:I(t,e,i,n,s);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):I(t,[e],i,n,s);throw new TypeError("val must be string, number or Buffer")}function I(t,e,i,n,s){let r,o=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(s){let n=-1;for(r=i;r<a;r++)if(u(t,r)===u(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===l)return n*o}else-1!==n&&(r-=r-n),n=-1}else for(i+l>a&&(i=a-l),r=i;r>=0;r--){let i=!0;for(let n=0;n<l;n++)if(u(t,r+n)!==u(e,n)){i=!1;break}if(i)return r}return-1}function E(t,e,i,n){i=Number(i)||0;const s=t.length-i;n?(n=Number(n))>s&&(n=s):n=s;const r=e.length;let o;for(n>r/2&&(n=r/2),o=0;o<n;++o){const n=parseInt(e.substr(2*o,2),16);if($(n))return o;t[i+o]=n}return o}function O(t,e,i,n){return K(j(e,t.length-i),t,i,n)}function M(t,e,i,n){return K(function(t){const e=[];for(let i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function R(t,e,i,n){return K(q(e),t,i,n)}function A(t,e,i,n){return K(function(t,e){let i,n,s;const r=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)i=t.charCodeAt(o),n=i>>8,s=i%256,r.push(s),r.push(n);return r}(e,t.length-i),t,i,n)}function y(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function S(t,e,i){i=Math.min(t.length,i);const n=[];let s=e;for(;s<i;){const e=t[s];let r=null,o=e>239?4:e>223?3:e>191?2:1;if(s+o<=i){let i,n,a,l;switch(o){case 1:e<128&&(r=e);break;case 2:i=t[s+1],128==(192&i)&&(l=(31&e)<<6|63&i,l>127&&(r=l));break;case 3:i=t[s+1],n=t[s+2],128==(192&i)&&128==(192&n)&&(l=(15&e)<<12|(63&i)<<6|63&n,l>2047&&(l<55296||l>57343)&&(r=l));break;case 4:i=t[s+1],n=t[s+2],a=t[s+3],128==(192&i)&&128==(192&n)&&128==(192&a)&&(l=(15&e)<<18|(63&i)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(r=l))}}null===r?(r=65533,o=1):r>65535&&(r-=65536,n.push(r>>>10&1023|55296),r=56320|1023&r),n.push(r),s+=o}return function(t){const e=t.length;if(e<=v)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=v));return i}(n)}e.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,i){return u(t,e,i)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,i){return function(t,e,i){return p(t),t<=0?a(t):void 0!==e?"string"==typeof i?a(t).fill(e,i):a(t).fill(e):a(t)}(t,e,i)},l.allocUnsafe=function(t){return h(t)},l.allocUnsafeSlow=function(t){return h(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(z(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),z(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let i=t.length,n=e.length;for(let s=0,r=Math.min(i,n);s<r;++s)if(t[s]!==e[s]){i=t[s],n=e[s];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);let i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;const n=l.allocUnsafe(e);let s=0;for(i=0;i<t.length;++i){let e=t[i];if(z(e,Uint8Array))s+e.length>n.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(n,s)):Uint8Array.prototype.set.call(n,e,s);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,s)}s+=e.length}return n},l.byteLength=f,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;e<t;e+=2)m(this,e,e+1);return this},l.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},l.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},l.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):T.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){let t="";const i=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(t,e,i,n,s){if(z(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===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),e<0||i>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&e>=i)return 0;if(n>=s)return-1;if(e>=i)return 1;if(this===t)return 0;let r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(e>>>=0);const a=Math.min(r,o),u=this.slice(n,s),p=t.slice(e,i);for(let t=0;t<a;++t)if(u[t]!==p[t]){r=u[t],o=p[t];break}return r<o?-1:o<r?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return g(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return g(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}const s=this.length-e;if((void 0===i||i>s)&&(i=s),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let r=!1;for(;;)switch(n){case"hex":return E(this,t,e,i);case"utf8":case"utf-8":return O(this,t,e,i);case"ascii":case"latin1":case"binary":return M(this,t,e,i);case"base64":return R(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),r=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const v=4096;function C(t,e,i){let n="";i=Math.min(t.length,i);for(let s=e;s<i;++s)n+=String.fromCharCode(127&t[s]);return n}function L(t,e,i){let n="";i=Math.min(t.length,i);for(let s=e;s<i;++s)n+=String.fromCharCode(t[s]);return n}function b(t,e,i){const n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let s="";for(let n=e;n<i;++n)s+=Q[t[n]];return s}function D(t,e,i){const n=t.slice(e,i);let s="";for(let t=0;t<n.length-1;t+=2)s+=String.fromCharCode(n[t]+256*n[t+1]);return s}function w(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,i,n,s,r){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<r)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function F(t,e,i,n,s){X(e,n,s,t,i,7);let r=Number(e&BigInt(4294967295));t[i++]=r,r>>=8,t[i++]=r,r>>=8,t[i++]=r,r>>=8,t[i++]=r;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,i}function P(t,e,i,n,s){X(e,n,s,t,i,7);let r=Number(e&BigInt(4294967295));t[i+7]=r,r>>=8,t[i+6]=r,r>>=8,t[i+5]=r,r>>=8,t[i+4]=r;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=o,o>>=8,t[i+2]=o,o>>=8,t[i+1]=o,o>>=8,t[i]=o,i+8}function x(t,e,i,n,s,r){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function k(t,e,i,n,r){return e=+e,i>>>=0,r||x(t,0,i,4),s.write(t,e,i,n,23,4),i+4}function V(t,e,i,n,r){return e=+e,i>>>=0,r||x(t,0,i,8),s.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){const i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||w(t,e,this.length);let n=this[t],s=1,r=0;for(;++r<e&&(s*=256);)n+=this[t+r]*s;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||w(t,e,this.length);let n=this[t+--e],s=1;for(;e>0&&(s*=256);)n+=this[t+--e]*s;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(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||w(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],i=this[t+7];void 0!==e&&void 0!==i||H(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,s=this[++t]+256*this[++t]+65536*this[++t]+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))})),l.prototype.readBigUInt64BE=J((function(t){G(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||H(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],s=this[++t]*2**24+65536*this[++t]+256*this[++t]+i;return(BigInt(n)<<BigInt(32))+BigInt(s)})),l.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||w(t,e,this.length);let n=this[t],s=1,r=0;for(;++r<e&&(s*=256);)n+=this[t+r]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||w(t,e,this.length);let n=e,s=1,r=this[t+--n];for(;n>0&&(s*=256);)r+=this[t+--n]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*e)),r},l.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);const i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);const i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(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||w(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],i=this[t+7];void 0!==e&&void 0!==i||H(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),l.prototype.readBigInt64BE=J((function(t){G(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||H(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+i)})),l.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),s.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),s.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),s.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),s.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e>>>=0,i>>>=0,!n){N(this,t,e,i,Math.pow(2,8*i)-1,0)}let s=1,r=0;for(this[e]=255&t;++r<i&&(s*=256);)this[e+r]=t/s&255;return e+i},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,i,n){if(t=+t,e>>>=0,i>>>=0,!n){N(this,t,e,i,Math.pow(2,8*i)-1,0)}let s=i-1,r=1;for(this[e+s]=255&t;--s>=0&&(r*=256);)this[e+s]=t/r&255;return e+i},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||N(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||N(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,i){return t=+t,e>>>=0,i||N(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,i){return t=+t,e>>>=0,i||N(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,i){return t=+t,e>>>=0,i||N(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,i,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*i-1);N(this,t,e,i,n-1,-n)}let s=0,r=1,o=0;for(this[e]=255&t;++s<i&&(r*=256);)t<0&&0===o&&0!==this[e+s-1]&&(o=1),this[e+s]=(t/r|0)-o&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*i-1);N(this,t,e,i,n-1,-n)}let s=i-1,r=1,o=0;for(this[e+s]=255&t;--s>=0&&(r*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/r|0)-o&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||N(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,i){return t=+t,e>>>=0,i||N(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,i){return k(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return k(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return V(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return V(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);const s=n-i;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,i,n):Uint8Array.prototype.set.call(t,this.subarray(i,n),e),s},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;let s;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=e;s<i;++s)this[s]=t;else{const r=l.isBuffer(t)?t:l.from(t,n),o=r.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<i-e;++s)this[s+e]=r[s%o]}return this};const Y={};function B(t,e,i){Y[t]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function U(t){let e="",i=t.length;const n="-"===t[0]?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function X(t,e,i,n,s,r){if(t>i||t<e){const n="bigint"==typeof e?"n":"";let s;throw s=r>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(r+1)}${n}`:`>= -(2${n} ** ${8*(r+1)-1}${n}) and < 2 ** ${8*(r+1)-1}${n}`:`>= ${e}${n} and <= ${i}${n}`,new Y.ERR_OUT_OF_RANGE("value",s,t)}!function(t,e,i){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+i]||H(e,t.length-(i+1))}(n,s,r)}function G(t,e){if("number"!=typeof t)throw new Y.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,i){if(Math.floor(t)!==t)throw G(t,i),new Y.ERR_OUT_OF_RANGE(i||"offset","an integer",t);if(e<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,i){let n=`The value of "${t}" is out of range.`,s=i;return Number.isInteger(i)&&Math.abs(i)>2**32?s=U(String(i)):"bigint"==typeof i&&(s=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(s=U(s)),s+="n"),n+=` It must be ${e}. Received ${s}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function j(t,e){let i;e=e||1/0;const n=t.length;let s=null;const r=[];for(let o=0;o<n;++o){if(i=t.charCodeAt(o),i>55295&&i<57344){if(!s){if(i>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&r.push(239,191,189);continue}s=i;continue}if(i<56320){(e-=3)>-1&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(e-=3)>-1&&r.push(239,191,189);if(s=null,i<128){if((e-=1)<0)break;r.push(i)}else if(i<2048){if((e-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function q(t){return n.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 K(t,e,i,n){let s;for(s=0;s<n&&!(s+i>=e.length||s>=t.length);++s)e[s+i]=t[s];return s}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const Q=function(){const t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){const n=16*i;for(let s=0;s<16;++s)e[n+s]=t[i]+t[s]}return e}();function J(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},6570:t=>{"use strict";function e(t,e,n){n=n||2;var r,o,a,l,h,d,_,f=e&&e.length,T=f?e[0]*n:t.length,m=i(t,0,T,n,!0),g=[];if(!m||m.next===m.prev)return g;if(f&&(m=function(t,e,n,s){var r,o,a,l=[];for(r=0,o=e.length;r<o;r++)(a=i(t,e[r]*s,r<o-1?e[r+1]*s:t.length,s,!1))===a.next&&(a.steiner=!0),l.push(c(a));for(l.sort(u),r=0;r<l.length;r++)n=p(l[r],n);return n}(t,e,m,n)),t.length>80*n){r=a=t[0],o=l=t[1];for(var I=n;I<T;I+=n)(h=t[I])<r&&(r=h),(d=t[I+1])<o&&(o=d),h>a&&(a=h),d>l&&(l=d);_=0!==(_=Math.max(a-r,l-o))?32767/_:0}return s(m,g,n,r,o,_,0),g}function i(t,e,i,n,s){var r,o;if(s===S(t,e,i,n)>0)for(r=e;r<i;r+=n)o=R(r,t[r],t[r+1],o);else for(r=i-n;r>=e;r-=n)o=R(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(A(o),o=o.next),o}function n(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==T(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function s(t,e,i,u,p,h,c){if(t){!c&&h&&function(t,e,i,n){var s=t;do{0===s.z&&(s.z=d(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,l,u=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e<u&&(a++,n=n.nextZ);e++);for(l=u;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,l--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,u*=2}while(o>1)}(s)}(t,u,p,h);for(var _,f,T=t;t.prev!==t.next;)if(_=t.prev,f=t.next,h?o(t,u,p,h):r(t))e.push(_.i/i|0),e.push(t.i/i|0),e.push(f.i/i|0),A(t),t=f.next,T=f.next;else if((t=f)===T){c?1===c?s(t=a(n(t),e,i),e,i,u,p,h,2):2===c&&l(t,e,i,u,p,h):s(n(t),e,i,u,p,h,1);break}}}function r(t){var e=t.prev,i=t,n=t.next;if(T(e,i,n)>=0)return!1;for(var s=e.x,r=i.x,o=n.x,a=e.y,l=i.y,u=n.y,p=s<r?s<o?s:o:r<o?r:o,h=a<l?a<u?a:u:l<u?l:u,d=s>r?s>o?s:o:r>o?r:o,c=a>l?a>u?a:u:l>u?l:u,f=n.next;f!==e;){if(f.x>=p&&f.x<=d&&f.y>=h&&f.y<=c&&_(s,a,r,l,o,u,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function o(t,e,i,n){var s=t.prev,r=t,o=t.next;if(T(s,r,o)>=0)return!1;for(var a=s.x,l=r.x,u=o.x,p=s.y,h=r.y,c=o.y,f=a<l?a<u?a:u:l<u?l:u,m=p<h?p<c?p:c:h<c?h:c,g=a>l?a>u?a:u:l>u?l:u,I=p>h?p>c?p:c:h>c?h:c,E=d(f,m,e,i,n),O=d(g,I,e,i,n),M=t.prevZ,R=t.nextZ;M&&M.z>=E&&R&&R.z<=O;){if(M.x>=f&&M.x<=g&&M.y>=m&&M.y<=I&&M!==s&&M!==o&&_(a,p,l,h,u,c,M.x,M.y)&&T(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,R.x>=f&&R.x<=g&&R.y>=m&&R.y<=I&&R!==s&&R!==o&&_(a,p,l,h,u,c,R.x,R.y)&&T(R.prev,R,R.next)>=0)return!1;R=R.nextZ}for(;M&&M.z>=E;){if(M.x>=f&&M.x<=g&&M.y>=m&&M.y<=I&&M!==s&&M!==o&&_(a,p,l,h,u,c,M.x,M.y)&&T(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;R&&R.z<=O;){if(R.x>=f&&R.x<=g&&R.y>=m&&R.y<=I&&R!==s&&R!==o&&_(a,p,l,h,u,c,R.x,R.y)&&T(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function a(t,e,i){var s=t;do{var r=s.prev,o=s.next.next;!m(r,o)&&g(r,s,s.next,o)&&O(r,o)&&O(o,r)&&(e.push(r.i/i|0),e.push(s.i/i|0),e.push(o.i/i|0),A(s),A(s.next),s=t=o),s=s.next}while(s!==t);return n(s)}function l(t,e,i,r,o,a){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&f(l,u)){var p=M(l,u);return l=n(l,l.next),p=n(p,p.next),s(l,e,i,r,o,a,0),void s(p,e,i,r,o,a,0)}u=u.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function p(t,e){var i=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o&&(o=a,i=n.x<n.next.x?n:n.next,a===s))return i}n=n.next}while(n!==e);if(!i)return null;var l,u=i,p=i.x,d=i.y,c=1/0;n=i;do{s>=n.x&&n.x>=p&&s!==n.x&&_(r<d?s:o,r,p,d,r<d?o:s,r,n.x,n.y)&&(l=Math.abs(r-n.y)/(s-n.x),O(n,t)&&(l<c||l===c&&(n.x>i.x||n.x===i.x&&h(i,n)))&&(i=n,c=l)),n=n.next}while(n!==u);return i}(t,e);if(!i)return e;var s=M(i,t);return n(s,s.next),n(i,i.next)}function h(t,e){return T(t.prev,t,e.prev)<0&&T(e.next,t,t.next)<0}function d(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function c(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function _(t,e,i,n,s,r,o,a){return(s-o)*(e-a)>=(t-o)*(r-a)&&(t-o)*(n-a)>=(i-o)*(e-a)&&(i-o)*(r-a)>=(s-o)*(n-a)}function f(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&g(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(O(t,e)&&O(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(T(t.prev,t,e.prev)||T(t,e.prev,e))||m(t,e)&&T(t.prev,t,t.next)>0&&T(e.prev,e,e.next)>0)}function T(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function g(t,e,i,n){var s=E(T(t,e,i)),r=E(T(t,e,n)),o=E(T(i,n,t)),a=E(T(i,n,e));return s!==r&&o!==a||(!(0!==s||!I(t,i,e))||(!(0!==r||!I(t,n,e))||(!(0!==o||!I(i,t,n))||!(0!==a||!I(i,e,n)))))}function I(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function E(t){return t>0?1:t<0?-1:0}function O(t,e){return T(t.prev,t,t.next)<0?T(t,e,t.next)>=0&&T(t,t.prev,e)>=0:T(t,e,t.prev)<0||T(t,t.next,e)<0}function M(t,e){var i=new y(t.i,t.x,t.y),n=new y(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function R(t,e,i,n){var s=new y(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function y(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,i,n){for(var s=0,r=e,o=i-n;r<i;r+=n)s+=(t[o]-t[r])*(t[r+1]+t[o+1]),o=r;return s}t.exports=e,t.exports.default=e,e.deviation=function(t,e,i,n){var s=e&&e.length,r=s?e[0]*i:t.length,o=Math.abs(S(t,0,r,i));if(s)for(var a=0,l=e.length;a<l;a++){var u=e[a]*i,p=a<l-1?e[a+1]*i:t.length;o-=Math.abs(S(t,u,p,i))}var h=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,c=n[a+1]*i,_=n[a+2]*i;h+=Math.abs((t[d]-t[_])*(t[c+1]-t[d+1])-(t[d]-t[c])*(t[_+1]-t[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var r=0;r<t[s].length;r++)for(var o=0;o<e;o++)i.vertices.push(t[s][r][o]);s>0&&(n+=t[s-1].length,i.holes.push(n))}return i}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,o),l=i?i+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 o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,s,r,o){var a=i?i+t:t;if(!this._events[a])return!1;var l,u,p=this._events[a],h=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),h){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,n),!0;case 4:return p.fn.call(p.context,e,n,s),!0;case 5:return p.fn.call(p.context,e,n,s,r),!0;case 6:return p.fn.call(p.context,e,n,s,r,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];p.fn.apply(p.context,l)}else{var d,c=p.length;for(u=0;u<c;u++)switch(p[u].once&&this.removeListener(t,p[u].fn,void 0,!0),h){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,e);break;case 3:p[u].fn.call(p[u].context,e,n);break;case 4:p[u].fn.call(p[u].context,e,n,s);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];p[u].fn.apply(p[u].context,l)}}return!0},a.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var l=0,u=[],p=a.length;l<p;l++)(a[l].fn!==e||s&&!a[l].once||n&&a[l].context!==n)&&u.push(a[l]);u.length?this._events[r]=1===u.length?u[0]:u:o(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a},7007:t=>{"use strict";var e,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};e=i&&"function"==typeof i.ownKeys?i.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 r(){r.init.call(this)}t.exports=r,t.exports.once=function(t,e){return new Promise((function(i,n){function s(i){t.removeListener(e,r),n(i)}function r(){"function"==typeof t.removeListener&&t.removeListener("error",s),i([].slice.call(arguments))}f(t,e,r,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&f(t,"error",e,i)}(t,s,{once:!0})}))},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var o=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?r.defaultMaxListeners:t._maxListeners}function u(t,e,i,n){var s,r,o,u;if(a(i),void 0===(r=t._events)?(r=t._events=Object.create(null),t._eventsCount=0):(void 0!==r.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),r=t._events),o=r[e]),void 0===o)o=r[e]=i,++t._eventsCount;else if("function"==typeof o?o=r[e]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(s=l(t))>0&&o.length>s&&!o.warned){o.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=e,p.count=o.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 h(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},s=p.bind(n);return s.listener=i,n.wrapFn=s,s}function d(t,e,i){var n=t._events;if(void 0===n)return[];var s=n[e];return void 0===s?[]:"function"==typeof s?i?[s.listener||s]:[s]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(s):_(s,s.length)}function c(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function _(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function f(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function s(r){n.once&&t.removeEventListener(e,s),i(r)}))}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},r.prototype.getMaxListeners=function(){return l(this)},r.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var s="error"===t,r=this._events;if(void 0!==r)s=s&&void 0===r.error;else if(!s)return!1;if(s){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var u=l.length,p=_(l,u);for(i=0;i<u;++i)n(p[i],this,e)}return!0},r.prototype.addListener=function(t,e){return u(this,t,e,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(t,e){return u(this,t,e,!0)},r.prototype.once=function(t,e){return a(e),this.on(t,h(this,t,e)),this},r.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,h(this,t,e)),this},r.prototype.removeListener=function(t,e){var i,n,s,r,o;if(a(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(s=-1,r=i.length-1;r>=0;r--)if(i[r]===e||i[r].listener===e){o=i[r].listener,s=r;break}if(s<0)return this;0===s?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,s),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var s,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(s=r[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},r.prototype.listeners=function(t){return d(this,t,!0)},r.prototype.rawListeners=function(t){return d(this,t,!1)},r.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):c.call(t,e)},r.prototype.listenerCount=c,r.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},251:(t,e)=>{
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,i,n,s){var r,o,a=8*s-n-1,l=(1<<a)-1,u=l>>1,p=-7,h=i?s-1:0,d=i?-1:1,c=t[e+h];for(h+=d,r=c&(1<<-p)-1,c>>=-p,p+=a;p>0;r=256*r+t[e+h],h+=d,p-=8);for(o=r&(1<<-p)-1,r>>=-p,p+=n;p>0;o=256*o+t[e+h],h+=d,p-=8);if(0===r)r=1-u;else{if(r===l)return o?NaN:1/0*(c?-1:1);o+=Math.pow(2,n),r-=u}return(c?-1:1)*o*Math.pow(2,r-n)},e.write=function(t,e,i,n,s,r){var o,a,l,u=8*r-s-1,p=(1<<u)-1,h=p>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,c=n?0:r-1,_=n?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=p?(a=0,o=p):o+h>=1?(a=(e*l-1)*Math.pow(2,s),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;t[i+c]=255&a,c+=_,a/=256,s-=8);for(o=o<<s|a,u+=s;u>0;t[i+c]=255&o,c+=_,o/=256,u-=8);t[i+c-_]|=128*f}},5228:t=>{"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,s){for(var r,o,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l<arguments.length;l++){for(var u in r=Object(arguments[l]))i.call(r,u)&&(a[u]=r[u]);if(e){o=e(r);for(var p=0;p<o.length;p++)n.call(r,o[p])&&(a[o[p]]=r[o[p]])}}return a}},4678:t=>{"use strict";t.exports=(t,e={})=>{if(!t)return;const i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,loose:/^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?:\/\/)?([^/?#]*)([^?#]*)(?:\?([^#]*))?(?:#(.*))?/}},n=(e.strictMode?i.parser.strict:i.parser.loose).exec(t);if(!n)return;const s={};if(s[i.key[0]]=t,s[i.key[1]]=n[1]||"",s[i.key[2]]=n[2]||"",s[i.key[8]]=n[3]||"",s[i.key[12]]=n[4]||"",s[i.key[13]]=n[5]||"",s[i.key[2]]){const t=/^(?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?/.exec(s[i.key[2]]);t&&(s[i.key[3]]=t[1]||"",s[i.key[4]]=t[2]||"",s[i.key[5]]=t[3]||"",s[i.key[6]]=t[4]||"",s[i.key[7]]=t[5]||"")}return s[i.q.name]={},s[i.key[12]].replace(i.q.parser,(function(t,e,n){e&&(s[i.q.name][e]=n)})),s}},5585:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="function"!=typeof Object.create&&"~";function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(){}s.prototype._events=void 0,s.prototype.eventNames=function(){var t,n=this._events,s=[];if(!n)return s;for(t in n)e.call(n,t)&&s.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(n)):s},s.prototype.listeners=function(t,e){var n=i?i+t:t,s=this._events&&this._events[n];if(e)return!!s;if(!s)return[];if(s.fn)return[s.fn];for(var r=0,o=s.length,a=new Array(o);r<o;r++)a[r]=s[r].fn;return a},s.prototype.emit=function(t,e,n,s,r,o){var a=i?i+t:t;if(!this._events||!this._events[a])return!1;var l,u,p=this._events[a],h=arguments.length;if("function"==typeof p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),h){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,n),!0;case 4:return p.fn.call(p.context,e,n,s),!0;case 5:return p.fn.call(p.context,e,n,s,r),!0;case 6:return p.fn.call(p.context,e,n,s,r,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];p.fn.apply(p.context,l)}else{var d,c=p.length;for(u=0;u<c;u++)switch(p[u].once&&this.removeListener(t,p[u].fn,void 0,!0),h){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,e);break;case 3:p[u].fn.call(p[u].context,e,n);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];p[u].fn.apply(p[u].context,l)}}return!0},s.prototype.on=function(t,e,s){var r=new n(e,s||this),o=i?i+t:t;return this._events||(this._events=i?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):this._events[o]=r,this},s.prototype.once=function(t,e,s){var r=new n(e,s||this,!0),o=i?i+t:t;return this._events||(this._events=i?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):this._events[o]=r,this},s.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events||!this._events[r])return this;var o=this._events[r],a=[];if(e)if(o.fn)(o.fn!==e||s&&!o.once||n&&o.context!==n)&&a.push(o);else for(var l=0,u=o.length;l<u;l++)(o[l].fn!==e||s&&!o[l].once||n&&o[l].context!==n)&&a.push(o[l]);return a.length?this._events[r]=1===a.length?a[0]:a:delete this._events[r],this},s.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[i?i+t:t]:this._events=i?{}:Object.create(null),this):this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=i,t.exports=s},6192:(t,e,i)=>{var n={VERSION:i(1045).rE,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};t.exports=n},7673:(t,e,i)=>{var n=i(4650),s=i(2295),r=i(7443),o=new n.Matrix;function a(){s.call(this),this.children=[]}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,t.exports=a,Object.defineProperties(a.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}}),a.prototype.onChildrenChange=function(){},a.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},a.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this.onChildrenChange(e),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},a.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),n=this.getChildIndex(e);if(i<0||n<0)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[i]=e,this.children[n]=t,this.onChildrenChange(i<n?i:n)}},a.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},a.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The supplied index is out of bounds");var i=this.getChildIndex(t);this.children.splice(i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},a.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},a.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1!==e)return this.removeChildAt(e)},a.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),this.onChildrenChange(t),e.emit("removed",this),e},a.prototype.removeChildren=function(t,e){var i,n,s=t||0,r="number"==typeof e?e:this.children.length,o=r-s;if(o>0&&o<=r){for(i=this.children.splice(s,o),n=0;n<i.length;++n)i[n].parent=null;for(this.onChildrenChange(t),n=0;n<i.length;++n)i[n].emit("removed",this);return i}if(0===o&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},a.prototype.generateTexture=function(t,e,i){var n=this.getLocalBounds(),s=new r(t,0|n.width,0|n.height,i,e);return o.tx=-n.x,o.ty=-n.y,s.render(this,o),s},a.prototype.updateTransform=function(){if(this.visible){this.displayObjectUpdateTransform();for(var t=0,e=this.children.length;t<e;++t)this.children[t].updateTransform()}},a.prototype.containerUpdateTransform=a.prototype.updateTransform,a.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,i,s=1/0,r=1/0,o=-1/0,a=-1/0,l=!1,u=0,p=this.children.length;u<p;++u){this.children[u].visible&&(l=!0,s=s<(t=this.children[u].getBounds()).x?s:t.x,r=r<t.y?r:t.y,o=o>(e=t.width+t.x)?o:e,a=a>(i=t.height+t.y)?a:i)}if(!l)return n.Rectangle.EMPTY;var h=this._bounds;h.x=s,h.y=r,h.width=o-s,h.height=a-r,this._currentBounds=h}return this._currentBounds},a.prototype.containerGetBounds=a.prototype.getBounds,a.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=n.Matrix.IDENTITY;for(var e=0,i=this.children.length;e<i;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(n.Matrix.IDENTITY)},a.prototype.renderWebGL=function(t){var e,i;if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&this._filters.length&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,i=this.children.length;e<i;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,i=this.children.length;e<i;++e)this.children[e].renderWebGL(t)},a.prototype._renderWebGL=function(t){},a.prototype._renderCanvas=function(t){},a.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},a.prototype.destroy=function(t){if(s.prototype.destroy.call(this),t)for(var e=0,i=this.children.length;e<i;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},2295:(t,e,i)=>{var n=i(4650),s=i(7443),r=i(5585),o=i(6192),a=new n.Matrix,l={worldTransform:new n.Matrix,worldAlpha:1,children:[]};function u(){r.call(this),this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new n.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}u.prototype=Object.create(r.prototype),u.prototype.constructor=u,t.exports=u,Object.defineProperties(u.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),u.prototype.updateTransform=function(){var t,e,i,n,s,r,a=this.parent.worldTransform,l=this.worldTransform;this.rotation%o.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,i=-this._sr*this.scale.y,n=this._cr*this.scale.y,s=this.position.x,r=this.position.y,(this.pivot.x||this.pivot.y)&&(s-=this.pivot.x*t+this.pivot.y*i,r-=this.pivot.x*e+this.pivot.y*n),l.a=t*a.a+e*a.c,l.b=t*a.b+e*a.d,l.c=i*a.a+n*a.c,l.d=i*a.b+n*a.d,l.tx=s*a.a+r*a.c+a.tx,l.ty=s*a.b+r*a.d+a.ty):(t=this.scale.x,n=this.scale.y,s=this.position.x-this.pivot.x*t,r=this.position.y-this.pivot.y*n,l.a=t*a.a,l.b=t*a.b,l.c=n*a.c,l.d=n*a.d,l.tx=s*a.a+r*a.c+a.tx,l.ty=s*a.b+r*a.d+a.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},u.prototype.displayObjectUpdateTransform=u.prototype.updateTransform,u.prototype.getBounds=function(t){return n.Rectangle.EMPTY},u.prototype.getLocalBounds=function(){return this.getBounds(n.Matrix.IDENTITY)},u.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=l,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(t)},u.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=l,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(t)},u.prototype.renderWebGL=function(t){},u.prototype.renderCanvas=function(t){},u.prototype.generateTexture=function(t,e,i){var n=this.getLocalBounds(),r=new s(t,0|n.width,0|n.height,e,i);return a.tx=-n.x,a.ty=-n.y,r.render(this,a),r},u.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},u.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},6720:(t,e,i)=>{var n=i(7673),s=i(2699),r=i(1549),o=i(4694),a=i(7240),l=i(4650),u=i(6192),p=new l.Point;function h(){n.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}h.prototype=Object.create(n.prototype),h.prototype.constructor=h,t.exports=h,h.prototype.clone=function(){var t=new h;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=!0,t.glDirty=!0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e<this.graphicsData.length;++e)t.graphicsData.push(this.graphicsData[e].clone());return t.currentPath=t.graphicsData[t.graphicsData.length-1],t.updateLocalBounds(),t},h.prototype.lineStyle=function(t,e,i){if(this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0===i?1:i,this.currentPath)if(this.currentPath.shape.points.length){var n=new l.Polygon(this.currentPath.shape.points.slice(-2));n.closed=!1,this.drawShape(n)}else this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha;return this},h.prototype.moveTo=function(t,e){var i=new l.Polygon([t,e]);return i.closed=!1,this.drawShape(i),this},h.prototype.lineTo=function(t,e){return this.currentPath.shape.points.push(t,e),this.dirty=!0,this},h.prototype.quadraticCurveTo=function(t,e,i,n){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s,r,o=this.currentPath.shape.points;0===o.length&&this.moveTo(0,0);for(var a=o[o.length-2],l=o[o.length-1],u=0,p=1;p<=20;++p)s=a+(t-a)*(u=p/20),r=l+(e-l)*u,o.push(s+(t+(i-t)*u-s)*u,r+(e+(n-e)*u-r)*u);return this.dirty=this.boundsDirty=!0,this},h.prototype.bezierCurveTo=function(t,e,i,n,s,r){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var o,a,l,u,p,h=this.currentPath.shape.points,d=h[h.length-2],c=h[h.length-1],_=0,f=1;f<=20;++f)l=(a=(o=1-(_=f/20))*o)*o,p=(u=_*_)*_,h.push(l*d+3*a*_*t+3*o*u*i+p*s,l*c+3*a*_*e+3*o*u*n+p*r);return this.dirty=this.boundsDirty=!0,this},h.prototype.arcTo=function(t,e,i,n,s){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var r=this.currentPath.shape.points,o=r[r.length-2],a=r[r.length-1]-e,l=o-t,u=n-e,p=i-t,h=Math.abs(a*p-l*u);if(h<1e-8||0===s)r[r.length-2]===t&&r[r.length-1]===e||r.push(t,e);else{var d=a*a+l*l,c=u*u+p*p,_=a*u+l*p,f=s*Math.sqrt(d)/h,T=s*Math.sqrt(c)/h,m=f*_/d,g=T*_/c,I=f*p+T*l,E=f*u+T*a,O=l*(T+m),M=a*(T+m),R=p*(f+g),A=u*(f+g),y=Math.atan2(M-E,O-I),S=Math.atan2(A-E,R-I);this.arc(I+t,E+e,s,y,S,l*u>p*a)}return this.dirty=this.boundsDirty=!0,this},h.prototype.arc=function(t,e,i,n,s,r){if(n===s)return this;!(r=r||!1)&&s<=n?s+=2*Math.PI:r&&n<=s&&(n+=2*Math.PI);var o=r?-1*(n-s):s-n,a=40*Math.ceil(Math.abs(o)/(2*Math.PI));if(0===o)return this;var l=t+Math.cos(n)*i,u=e+Math.sin(n)*i;this.currentPath?this.currentPath.shape.points.push(l,u):this.moveTo(l,u);for(var p=this.currentPath.shape.points,h=o/(2*a),d=2*h,c=Math.cos(h),_=Math.sin(h),f=a-1,T=f%1/f,m=0;m<=f;m++){var g=h+n+d*(m+T*m),I=Math.cos(g),E=-Math.sin(g);p.push((c*I+_*E)*i+t,(c*-E+_*I)*i+e)}return this.dirty=this.boundsDirty=!0,this},h.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},h.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},h.prototype.drawRect=function(t,e,i,n){return this.drawShape(new l.Rectangle(t,e,i,n)),this},h.prototype.drawRoundedRect=function(t,e,i,n,s){return this.drawShape(new l.RoundedRectangle(t,e,i,n,s)),this},h.prototype.drawCircle=function(t,e,i){return this.drawShape(new l.Circle(t,e,i)),this},h.prototype.drawEllipse=function(t,e,i,n){return this.drawShape(new l.Ellipse(t,e,i,n)),this},h.prototype.drawPolygon=function(t){var e=t,i=!0;if(e instanceof l.Polygon&&(i=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var n=0;n<e.length;++n)e[n]=arguments[n]}var s=new l.Polygon(e);return s.closed=i,this.drawShape(s),this},h.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},h.prototype.generateTexture=function(t,e,i){e=e||1;var n=this.getLocalBounds(),a=new r(n.width*e,n.height*e),l=s.fromCanvas(a.canvas,i);return l.baseTexture.resolution=e,a.context.scale(e,e),a.context.translate(-n.x,-n.y),o.renderGraphics(this,a.context),l},h.prototype._renderWebGL=function(t){this.glDirty&&(this.dirty=!0,this.glDirty=!1),t.setObjectRenderer(t.plugins.graphics),t.plugins.graphics.render(this)},h.prototype._renderCanvas=function(t){if(!0!==this.isMask){this._prevTint!==this.tint&&(this.dirty=!0);var e=t.context,i=this.worldTransform,n=t.blendModes[this.blendMode];n!==e.globalCompositeOperation&&(e.globalCompositeOperation=n);var s=t.resolution;e.setTransform(i.a*s,i.b*s,i.c*s,i.d*s,i.tx*s,i.ty*s),o.renderGraphics(this,e)}},h.prototype.getBounds=function(t){if(!this._currentBounds){if(!this.renderable)return l.Rectangle.EMPTY;this.boundsDirty&&(this.updateLocalBounds(),this.glDirty=!0,this.cachedSpriteDirty=!0,this.boundsDirty=!1);var e=this._localBounds,i=e.x,n=e.width+e.x,s=e.y,r=e.height+e.y,o=t||this.worldTransform,a=o.a,u=o.b,p=o.c,h=o.d,d=o.tx,c=o.ty,_=a*n+p*r+d,f=h*r+u*n+c,T=a*i+p*r+d,m=h*r+u*i+c,g=a*i+p*s+d,I=h*s+u*i+c,E=a*n+p*s+d,O=h*s+u*n+c,M=_,R=f,A=_,y=f;A=E<(A=g<(A=T<A?T:A)?g:A)?E:A,y=O<(y=I<(y=m<y?m:y)?I:y)?O:y,M=E>(M=g>(M=T>M?T:M)?g:M)?E:M,R=O>(R=I>(R=m>R?m:R)?I:R)?O:R,this._bounds.x=A,this._bounds.width=M-A,this._bounds.y=y,this._bounds.height=R-y,this._currentBounds=this._bounds}return this._currentBounds},h.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,p);for(var e=this.graphicsData,i=0;i<e.length;i++){var n=e[i];if(n.fill&&(n.shape&&n.shape.contains(p.x,p.y)))return!0}return!1},h.prototype.updateLocalBounds=function(){var t=1/0,e=-1/0,i=1/0,n=-1/0;if(this.graphicsData.length)for(var s,r,o,a,l,p,h=0;h<this.graphicsData.length;h++){var d=this.graphicsData[h],c=d.type,_=d.lineWidth;if(s=d.shape,c===u.SHAPES.RECT||c===u.SHAPES.RREC)o=s.x-_/2,a=s.y-_/2,t=o<t?o:t,e=o+(l=s.width+_)>e?o+l:e,i=a<i?a:i,n=a+(p=s.height+_)>n?a+p:n;else if(c===u.SHAPES.CIRC)o=s.x,a=s.y,t=o-(l=s.radius+_/2)<t?o-l:t,e=o+l>e?o+l:e,i=a-(p=s.radius+_/2)<i?a-p:i,n=a+p>n?a+p:n;else if(c===u.SHAPES.ELIP)o=s.x,a=s.y,t=o-(l=s.width+_/2)<t?o-l:t,e=o+l>e?o+l:e,i=a-(p=s.height+_/2)<i?a-p:i,n=a+p>n?a+p:n;else{r=s.points;for(var f=0;f<r.length;f+=2)t=(o=r[f])-_<t?o-_:t,e=o+_>e?o+_:e,i=(a=r[f+1])-_<i?a-_:i,n=a+_>n?a+_:n}}else t=0,e=0,i=0,n=0;var T=this.boundsPadding;this._localBounds.x=t-T,this._localBounds.width=e-t+2*T,this._localBounds.y=i-T,this._localBounds.height=n-i+2*T},h.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new a(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===u.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},h.prototype.destroy=function(){n.prototype.destroy.apply(this,arguments);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();for(var e in this._webgl)for(var i=0;i<this._webgl[e].data.length;++i)this._webgl[e].data[i].destroy();this.graphicsData=null,this.currentPath=null,this._webgl=null,this._localBounds=null}},7240:t=>{function e(t,e,i,n,s,r,o){this.lineWidth=t,this.lineColor=e,this.lineAlpha=i,this._lineTint=e,this.fillColor=n,this.fillAlpha=s,this._fillTint=n,this.fill=r,this.shape=o,this.type=o.type}e.prototype.constructor=e,t.exports=e,e.prototype.clone=function(){return new e(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.shape)},e.prototype.destroy=function(){this.shape=null}},4237:(t,e,i)=>{var n=i(501),s=i(4650),r=i(6192),o=i(1830),a=i(5092),l=i(5075),u=i(6570);function p(t){o.call(this,t),this.graphicsDataPool=[],this.primitiveShader=null,this.complexPrimitiveShader=null,this.maximumSimplePolySize=200}p.prototype=Object.create(o.prototype),p.prototype.constructor=p,t.exports=p,a.registerPlugin("graphics",p),p.prototype.onContextChange=function(){},p.prototype.destroy=function(){o.prototype.destroy.call(this);for(var t=0;t<this.graphicsDataPool.length;++t)this.graphicsDataPool[t].destroy();this.graphicsDataPool=null},p.prototype.render=function(t){var e,i=this.renderer,s=i.gl,r=i.shaderManager.plugins.primitiveShader;t.dirty&&this.updateGraphics(t);var o=t._webGL[s.id];i.blendModeManager.setBlendMode(t.blendMode);for(var a=0,l=o.data.length;a<l;a++)e=o.data[a],1===o.data[a].mode?(i.stencilManager.pushStencil(t,e),s.uniform1f(i.shaderManager.complexPrimitiveShader.uniforms.alpha._location,t.worldAlpha*e.alpha),s.drawElements(s.TRIANGLE_FAN,4,s.UNSIGNED_SHORT,2*(e.indices.length-4)),i.stencilManager.popStencil(t,e)):(r=i.shaderManager.primitiveShader,i.shaderManager.setShader(r),s.uniformMatrix3fv(r.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),s.uniformMatrix3fv(r.uniforms.projectionMatrix._location,!1,i.currentRenderTarget.projectionMatrix.toArray(!0)),s.uniform3fv(r.uniforms.tint._location,n.hex2rgb(t.tint)),s.uniform1f(r.uniforms.alpha._location,t.worldAlpha),s.bindBuffer(s.ARRAY_BUFFER,e.buffer),s.vertexAttribPointer(r.attributes.aVertexPosition,2,s.FLOAT,!1,24,0),s.vertexAttribPointer(r.attributes.aColor,4,s.FLOAT,!1,24,8),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.indexBuffer),s.drawElements(s.TRIANGLE_STRIP,e.indices.length,s.UNSIGNED_SHORT,0)),i.drawCount++},p.prototype.updateGraphics=function(t){var e,i,n=this.renderer.gl,s=t._webGL[n.id];if(s||(s=t._webGL[n.id]={lastIndex:0,data:[],gl:n}),t.dirty=!1,t.clearDirty){for(t.clearDirty=!1,e=0;e<s.data.length;e++){var o=s.data[e];o.reset(),this.graphicsDataPool.push(o)}s.data=[],s.lastIndex=0}for(e=s.lastIndex;e<t.graphicsData.length;e++){var a=t.graphicsData[e];if(a.type===r.SHAPES.POLY){if(a.points=a.shape.points.slice(),a.shape.closed&&(a.points[0]===a.points[a.points.length-2]&&a.points[1]===a.points[a.points.length-1]||a.points.push(a.points[0],a.points[1])),a.fill)if(a.points.length>=6)if(a.points.length<2*this.maximumSimplePolySize)i=this.switchMode(s,0),this.buildPoly(a,i)||(i=this.switchMode(s,1),this.buildComplexPoly(a,i));else i=this.switchMode(s,1),this.buildComplexPoly(a,i);a.lineWidth>0&&(i=this.switchMode(s,0),this.buildLine(a,i))}else i=this.switchMode(s,0),a.type===r.SHAPES.RECT?this.buildRectangle(a,i):a.type===r.SHAPES.CIRC||a.type===r.SHAPES.ELIP?this.buildCircle(a,i):a.type===r.SHAPES.RREC&&this.buildRoundedRectangle(a,i);s.lastIndex++}for(e=0;e<s.data.length;e++)(i=s.data[e]).dirty&&i.upload()},p.prototype.switchMode=function(t,e){var i;return t.data.length?((i=t.data[t.data.length-1]).points.length>32e4||i.mode!==e||1===e)&&((i=this.graphicsDataPool.pop()||new l(t.gl)).mode=e,t.data.push(i)):((i=this.graphicsDataPool.pop()||new l(t.gl)).mode=e,t.data.push(i)),i.dirty=!0,i},p.prototype.buildRectangle=function(t,e){var i=t.shape,s=i.x,r=i.y,o=i.width,a=i.height;if(t.fill){var l=n.hex2rgb(t.fillColor),u=t.fillAlpha,p=l[0]*u,h=l[1]*u,d=l[2]*u,c=e.points,_=e.indices,f=c.length/6;c.push(s,r),c.push(p,h,d,u),c.push(s+o,r),c.push(p,h,d,u),c.push(s,r+a),c.push(p,h,d,u),c.push(s+o,r+a),c.push(p,h,d,u),_.push(f,f,f+1,f+2,f+3,f+3)}if(t.lineWidth){var T=t.points;t.points=[s,r,s+o,r,s+o,r+a,s,r+a,s,r],this.buildLine(t,e),t.points=T}},p.prototype.buildRoundedRectangle=function(t,e){var i=t.shape,s=i.x,r=i.y,o=i.width,a=i.height,l=i.radius,p=[];if(p.push(s,r+l),this.quadraticBezierCurve(s,r+a-l,s,r+a,s+l,r+a,p),this.quadraticBezierCurve(s+o-l,r+a,s+o,r+a,s+o,r+a-l,p),this.quadraticBezierCurve(s+o,r+l,s+o,r,s+o-l,r,p),this.quadraticBezierCurve(s+l,r,s,r,s,r+l+1e-10,p),t.fill){var h=n.hex2rgb(t.fillColor),d=t.fillAlpha,c=h[0]*d,_=h[1]*d,f=h[2]*d,T=e.points,m=e.indices,g=T.length/6,I=u(p,null,2),E=0;for(E=0;E<I.length;E+=3)m.push(I[E]+g),m.push(I[E]+g),m.push(I[E+1]+g),m.push(I[E+2]+g),m.push(I[E+2]+g);for(E=0;E<p.length;E++)T.push(p[E],p[++E],c,_,f,d)}if(t.lineWidth){var O=t.points;t.points=p,this.buildLine(t,e),t.points=O}},p.prototype.quadraticBezierCurve=function(t,e,i,n,s,r,o){var a,l,u,p,h,d,c=o||[];function _(t,e,i){return t+(e-t)*i}for(var f=0,T=0;T<=20;T++)a=_(t,i,f=T/20),l=_(e,n,f),u=_(i,s,f),p=_(n,r,f),h=_(a,u,f),d=_(l,p,f),c.push(h,d);return c},p.prototype.buildCircle=function(t,e){var i,s,o=t.shape,a=o.x,l=o.y;t.type===r.SHAPES.CIRC?(i=o.radius,s=o.radius):(i=o.width,s=o.height);var u=Math.floor(30*Math.sqrt(o.radius))||Math.floor(15*Math.sqrt(o.width+o.height)),p=2*Math.PI/u,h=0;if(t.fill){var d=n.hex2rgb(t.fillColor),c=t.fillAlpha,_=d[0]*c,f=d[1]*c,T=d[2]*c,m=e.points,g=e.indices,I=m.length/6;for(g.push(I),h=0;h<u+1;h++)m.push(a,l,_,f,T,c),m.push(a+Math.sin(p*h)*i,l+Math.cos(p*h)*s,_,f,T,c),g.push(I++,I++);g.push(I-1)}if(t.lineWidth){var E=t.points;for(t.points=[],h=0;h<u+1;h++)t.points.push(a+Math.sin(p*h)*i,l+Math.cos(p*h)*s);this.buildLine(t,e),t.points=E}},p.prototype.buildLine=function(t,e){var i=0,r=t.points;if(0!==r.length){var o=new s.Point(r[0],r[1]),a=new s.Point(r[r.length-2],r[r.length-1]);if(o.x===a.x&&o.y===a.y){(r=r.slice()).pop(),r.pop();var l=(a=new s.Point(r[r.length-2],r[r.length-1])).x+.5*(o.x-a.x),u=a.y+.5*(o.y-a.y);r.unshift(l,u),r.push(l,u)}var p,h,d,c,_,f,T,m,g,I,E,O,M,R,A,y,S,v,C,L,b,D,w=e.points,N=e.indices,F=r.length/2,P=r.length,x=w.length/6,k=t.lineWidth/2,V=n.hex2rgb(t.lineColor),Y=t.lineAlpha,B=V[0]*Y,U=V[1]*Y,X=V[2]*Y;for(d=r[0],c=r[1],_=r[2],g=-(c-(f=r[3])),I=d-_,g/=D=Math.sqrt(g*g+I*I),I/=D,g*=k,I*=k,w.push(d-g,c-I,B,U,X,Y),w.push(d+g,c+I,B,U,X,Y),i=1;i<F-1;i++)d=r[2*(i-1)],c=r[2*(i-1)+1],_=r[2*i],f=r[2*i+1],T=r[2*(i+1)],m=r[2*(i+1)+1],g=-(c-f),I=d-_,g/=D=Math.sqrt(g*g+I*I),I/=D,g*=k,I*=k,E=-(f-m),O=_-T,E/=D=Math.sqrt(E*E+O*O),O/=D,S=(-g+d)*(-I+f)-(-g+_)*(-I+c),L=(-(E*=k)+T)*(-(O*=k)+f)-(-E+_)*(-O+m),b=(A=-I+c-(-I+f))*(C=-E+_-(-E+T))-(v=-O+m-(-O+f))*(y=-g+_-(-g+d)),Math.abs(b)<.1?(b+=10.1,w.push(_-g,f-I,B,U,X,Y),w.push(_+g,f+I,B,U,X,Y)):((p=(y*L-C*S)/b)-_)*(p-_)+((h=(v*S-A*L)/b)-f)+(h-f)>19600?(M=g-E,R=I-O,M/=D=Math.sqrt(M*M+R*R),R/=D,M*=k,R*=k,w.push(_-M,f-R),w.push(B,U,X,Y),w.push(_+M,f+R),w.push(B,U,X,Y),w.push(_-M,f-R),w.push(B,U,X,Y),P++):(w.push(p,h),w.push(B,U,X,Y),w.push(_-(p-_),f-(h-f)),w.push(B,U,X,Y));for(d=r[2*(F-2)],c=r[2*(F-2)+1],_=r[2*(F-1)],g=-(c-(f=r[2*(F-1)+1])),I=d-_,g/=D=Math.sqrt(g*g+I*I),I/=D,g*=k,I*=k,w.push(_-g,f-I),w.push(B,U,X,Y),w.push(_+g,f+I),w.push(B,U,X,Y),N.push(x),i=0;i<P;i++)N.push(x++);N.push(x-1)}},p.prototype.buildComplexPoly=function(t,e){var i=t.points.slice();if(!(i.length<6)){var s=e.indices;e.points=i,e.alpha=t.fillAlpha,e.color=n.hex2rgb(t.fillColor);for(var r,o,a=1/0,l=-1/0,u=1/0,p=-1/0,h=0;h<i.length;h+=2)a=(r=i[h])<a?r:a,l=r>l?r:l,u=(o=i[h+1])<u?o:u,p=o>p?o:p;i.push(a,u,l,u,l,p,a,p);var d=i.length/2;for(h=0;h<d;h++)s.push(h)}},p.prototype.buildPoly=function(t,e){var i=t.points;if(!(i.length<6)){var s=e.points,r=e.indices,o=i.length/2,a=n.hex2rgb(t.fillColor),l=t.fillAlpha,p=a[0]*l,h=a[1]*l,d=a[2]*l,c=u(i,null,2);if(!c)return!1;var _=s.length/6,f=0;for(f=0;f<c.length;f+=3)r.push(c[f]+_),r.push(c[f]+_),r.push(c[f+1]+_),r.push(c[f+2]+_),r.push(c[f+2]+_);for(f=0;f<o;f++)s.push(i[2*f],i[2*f+1],p,h,d,l);return!0}}},5075:t=>{function e(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}e.prototype.constructor=e,t.exports=e,e.prototype.reset=function(){this.points.length=0,this.indices.length=0},e.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},e.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},4651:(t,e,i)=>{
/**
* @file Main export of the PIXI core library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
var n=t.exports=Object.assign(i(6192),i(4650),{utils:i(501),ticker:i(2410),DisplayObject:i(2295),Container:i(7673),Sprite:i(2861),ParticleContainer:i(3326),SpriteRenderer:i(7920),ParticleRenderer:i(2952),Text:i(9252),Graphics:i(6720),GraphicsData:i(7240),GraphicsRenderer:i(4237),Texture:i(2699),BaseTexture:i(1936),RenderTexture:i(7443),VideoBaseTexture:i(3367),TextureUvs:i(1507),CanvasRenderer:i(8010),CanvasGraphics:i(4694),CanvasBuffer:i(1549),WebGLRenderer:i(5092),ShaderManager:i(3779),Shader:i(8306),ObjectRenderer:i(1830),RenderTarget:i(7955),AbstractFilter:i(580),FXAAFilter:i(1438),SpriteMaskFilter:i(5207),autoDetectRenderer:function(t,e,i,s){return t=t||800,e=e||600,!s&&n.utils.isWebGLSupported()?new n.WebGLRenderer(t,e,i):new n.CanvasRenderer(t,e,i)}})},2825:(t,e,i)=>{var n=i(8840);function s(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}s.prototype.constructor=s,t.exports=s,s.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},s.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},s.prototype.apply=function(t,e){e=e||new n;var i=t.x,s=t.y;return e.x=this.a*i+this.c*s+this.tx,e.y=this.b*i+this.d*s+this.ty,e},s.prototype.applyInverse=function(t,e){e=e||new n;var i=1/(this.a*this.d+this.c*-this.b),s=t.x,r=t.y;return e.x=this.d*i*s+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*r+-this.b*i*s+(-this.ty*this.a+this.tx*this.b)*i,e},s.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},s.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},s.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,r=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=r*e-this.ty*i,this.ty=r*i+this.ty*e,this},s.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this},s.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},s.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,r=t*n-e*i;return this.a=n/r,this.b=-e/r,this.c=-i/r,this.d=t/r,this.tx=(i*this.ty-n*s)/r,this.ty=-(t*this.ty-e*s)/r,this},s.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},s.prototype.clone=function(){var t=new s;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},s.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},s.IDENTITY=new s,s.TEMP_MATRIX=new s},8840:t=>{function e(t,e){this.x=t||0,this.y=e||0}e.prototype.constructor=e,t.exports=e,e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copy=function(t){this.set(t.x,t.y)},e.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},e.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},4650:(t,e,i)=>{t.exports={Point:i(8840),Matrix:i(2825),Circle:i(5385),Ellipse:i(8419),Polygon:i(3671),Rectangle:i(2068),RoundedRectangle:i(1347)}},5385:(t,e,i)=>{var n=i(2068),s=i(6192);function r(t,e,i){this.x=t||0,this.y=e||0,this.radius=i||0,this.type=s.SHAPES.CIRC}r.prototype.constructor=r,t.exports=r,r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=this.radius*this.radius},r.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},8419:(t,e,i)=>{var n=i(2068),s=i(6192);function r(t,e,i,n){this.x=t||0,this.y=e||0,this.width=i||0,this.height=n||0,this.type=s.SHAPES.ELIP}r.prototype.constructor=r,t.exports=r,r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,n=(e-this.y)/this.height;return(i*=i)+(n*=n)<=1},r.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},3671:(t,e,i)=>{var n=i(8840),s=i(6192);function r(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;i<e.length;++i)e[i]=arguments[i]}if(e[0]instanceof n){for(var r=[],o=0,a=e.length;o<a;o++)r.push(e[o].x,e[o].y);e=r}this.closed=!0,this.points=e,this.type=s.SHAPES.POLY}r.prototype.constructor=r,t.exports=r,r.prototype.clone=function(){return new r(this.points.slice())},r.prototype.contains=function(t,e){for(var i=!1,n=this.points.length/2,s=0,r=n-1;s<n;r=s++){var o=this.points[2*s],a=this.points[2*s+1],l=this.points[2*r],u=this.points[2*r+1];a>e!=u>e&&t<(l-o)*(e-a)/(u-a)+o&&(i=!i)}return i}},2068:(t,e,i)=>{var n=i(6192);function s(t,e,i,s){this.x=t||0,this.y=e||0,this.width=i||0,this.height=s||0,this.type=n.SHAPES.RECT}s.prototype.constructor=s,t.exports=s,s.EMPTY=new s(0,0,0,0),s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height)},s.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)}},1347:(t,e,i)=>{var n=i(6192);function s(t,e,i,s,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=s||0,this.radius=r||20,this.type=n.SHAPES.RREC}s.prototype.constructor=s,t.exports=s,s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.radius)},s.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height)}},3326:(t,e,i)=>{var n=i(7673),s=i(6192);function r(t,e,i){n.call(this);(i=i||15e3)>16384&&(i=16384),i>(t=t||15e3)&&(i=t),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=i,this._buffers=null,this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=s.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}r.prototype=Object.create(n.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){var e=Math.floor(t/this._batchSize);e<this._bufferToUpdate&&(this._bufferToUpdate=e)},r.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,i=this.worldTransform,n=!0,s=0,r=0,o=0,a=0;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var l=0;l<this.children.length;++l){var u=this.children[l];if(u.visible){var p=u.texture.frame;if(e.globalAlpha=this.worldAlpha*u.alpha,u.rotation%(2*Math.PI)==0)n&&(e.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),n=!1),s=u.anchor.x*(-p.width*u.scale.x)+u.position.x+.5,r=u.anchor.y*(-p.height*u.scale.y)+u.position.y+.5,o=p.width*u.scale.x,a=p.height*u.scale.y;else{n||(n=!0),u.displayObjectUpdateTransform();var h=u.worldTransform;t.roundPixels?e.setTransform(h.a,h.b,h.c,h.d,0|h.tx,0|h.ty):e.setTransform(h.a,h.b,h.c,h.d,h.tx,h.ty),s=u.anchor.x*-p.width+.5,r=u.anchor.y*-p.height+.5,o=p.width,a=p.height}e.drawImage(u.texture.baseTexture.source,p.x,p.y,p.width,p.height,s,r,o,a)}}}},r.prototype.destroy=function(){if(n.prototype.destroy.apply(this,arguments),this._buffers)for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._properties=null,this._buffers=null}},3361:t=>{function e(t,e,i,n){this.gl=t,this.vertSize=2,this.vertByteSize=4*this.vertSize,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var s=0;s<e.length;s++){var r=e[s];i[s]?this.dynamicProperties.push(r):this.staticProperties.push(r)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.initBuffers()}e.prototype.constructor=e,t.exports=e,e.prototype.initBuffers=function(){var t,e,i=this.gl,n=0;for(this.dynamicStride=0,t=0;t<this.dynamicProperties.length;t++)(e=this.dynamicProperties[t]).offset=n,n+=e.size,this.dynamicStride+=e.size;this.dynamicData=new Float32Array(this.size*this.dynamicStride*4),this.dynamicBuffer=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,this.dynamicBuffer),i.bufferData(i.ARRAY_BUFFER,this.dynamicData,i.DYNAMIC_DRAW);var s=0;for(this.staticStride=0,t=0;t<this.staticProperties.length;t++)(e=this.staticProperties[t]).offset=s,s+=e.size,this.staticStride+=e.size;this.staticData=new Float32Array(this.size*this.staticStride*4),this.staticBuffer=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,this.staticBuffer),i.bufferData(i.ARRAY_BUFFER,this.staticData,i.DYNAMIC_DRAW)},e.prototype.uploadDynamic=function(t,e,i){for(var n=this.gl,s=0;s<this.dynamicProperties.length;s++){var r=this.dynamicProperties[s];r.uploadFunction(t,e,i,this.dynamicData,this.dynamicStride,r.offset)}n.bindBuffer(n.ARRAY_BUFFER,this.dynamicBuffer),n.bufferSubData(n.ARRAY_BUFFER,0,this.dynamicData)},e.prototype.uploadStatic=function(t,e,i){for(var n=this.gl,s=0;s<this.staticProperties.length;s++){var r=this.staticProperties[s];r.uploadFunction(t,e,i,this.staticData,this.staticStride,r.offset)}n.bindBuffer(n.ARRAY_BUFFER,this.staticBuffer),n.bufferSubData(n.ARRAY_BUFFER,0,this.staticData)},e.prototype.bind=function(){var t,e,i=this.gl;for(i.bindBuffer(i.ARRAY_BUFFER,this.dynamicBuffer),t=0;t<this.dynamicProperties.length;t++)e=this.dynamicProperties[t],i.vertexAttribPointer(e.attribute,e.size,i.FLOAT,!1,4*this.dynamicStride,4*e.offset);for(i.bindBuffer(i.ARRAY_BUFFER,this.staticBuffer),t=0;t<this.staticProperties.length;t++)e=this.staticProperties[t],i.vertexAttribPointer(e.attribute,e.size,i.FLOAT,!1,4*this.staticStride,4*e.offset)},e.prototype.destroy=function(){this.dynamicProperties=null,this.dynamicData=null,this.gl.deleteBuffer(this.dynamicBuffer),this.staticProperties=null,this.staticData=null,this.gl.deleteBuffer(this.staticBuffer)}},2952:(t,e,i)=>{var n=i(1830),s=i(5092),r=i(3646),o=i(3361),a=i(4650);function l(t){n.call(this,t);this.indices=new Uint16Array(98304);for(var e=0,i=0;e<98304;e+=6,i+=4)this.indices[e+0]=i+0,this.indices[e+1]=i+1,this.indices[e+2]=i+2,this.indices[e+3]=i+0,this.indices[e+4]=i+2,this.indices[e+5]=i+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new a.Matrix}l.prototype=Object.create(n.prototype),l.prototype.constructor=l,t.exports=l,s.registerPlugin("particle",l),l.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new r(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,size:1,uploadFunction:this.uploadAlpha,offset:0}]},l.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},l.prototype.render=function(t){var e=t.children,i=e.length,n=t._maxSize,s=t._batchSize;if(0!==i){i>n&&(i=n),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var r=this.renderer.gl,o=t.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),r.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0)),r.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var a=e[0]._texture.baseTexture;if(a._glTextures[r.id])r.bindTexture(r.TEXTURE_2D,a._glTextures[r.id]);else{if(!this.renderer.updateTexture(a))return;t._properties[0]&&t._properties[3]||(t._bufferToUpdate=0)}for(var l=0,u=0;l<i;l+=s,u+=1){var p=i-l;p>s&&(p=s);var h=t._buffers[u];h.uploadDynamic(e,l,p),t._bufferToUpdate===u&&(h.uploadStatic(e,l,p),t._bufferToUpdate=u+1),h.bind(this.shader),r.drawElements(r.TRIANGLES,6*p,r.UNSIGNED_SHORT,0),this.renderer.drawCount++}}},l.prototype.generateBuffers=function(t){var e,i=this.renderer.gl,n=[],s=t._maxSize,r=t._batchSize,a=t._properties;for(e=0;e<s;e+=r)n.push(new o(i,this.properties,a,r));return n},l.prototype.uploadVertices=function(t,e,i,n,s,r){for(var o,a,l,u,p,h,d,c,_,f=0;f<i;f++)a=(o=t[e+f])._texture,u=o.scale.x,p=o.scale.y,a.trim?(h=(d=(l=a.trim).x-o.anchor.x*l.width)+a.crop.width,c=(_=l.y-o.anchor.y*l.height)+a.crop.height):(h=a._frame.width*(1-o.anchor.x),d=a._frame.width*-o.anchor.x,c=a._frame.height*(1-o.anchor.y),_=a._frame.height*-o.anchor.y),n[r]=d*u,n[r+1]=_*p,n[r+s]=h*u,n[r+s+1]=_*p,n[r+2*s]=h*u,n[r+2*s+1]=c*p,n[r+3*s]=d*u,n[r+3*s+1]=c*p,r+=4*s},l.prototype.uploadPosition=function(t,e,i,n,s,r){for(var o=0;o<i;o++){var a=t[e+o].position;n[r]=a.x,n[r+1]=a.y,n[r+s]=a.x,n[r+s+1]=a.y,n[r+2*s]=a.x,n[r+2*s+1]=a.y,n[r+3*s]=a.x,n[r+3*s+1]=a.y,r+=4*s}},l.prototype.uploadRotation=function(t,e,i,n,s,r){for(var o=0;o<i;o++){var a=t[e+o].rotation;n[r]=a,n[r+s]=a,n[r+2*s]=a,n[r+3*s]=a,r+=4*s}},l.prototype.uploadUvs=function(t,e,i,n,s,r){for(var o=0;o<i;o++){var a=t[e+o]._texture._uvs;a?(n[r]=a.x0,n[r+1]=a.y0,n[r+s]=a.x1,n[r+s+1]=a.y1,n[r+2*s]=a.x2,n[r+2*s+1]=a.y2,n[r+3*s]=a.x3,n[r+3*s+1]=a.y3,r+=4*s):(n[r]=0,n[r+1]=0,n[r+s]=0,n[r+s+1]=0,n[r+2*s]=0,n[r+2*s+1]=0,n[r+3*s]=0,n[r+3*s+1]=0,r+=4*s)}},l.prototype.uploadAlpha=function(t,e,i,n,s,r){for(var o=0;o<i;o++){var a=t[e+o].alpha;n[r]=a,n[r+s]=a,n[r+2*s]=a,n[r+3*s]=a,r+=4*s}},l.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),n.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},3646:(t,e,i)=>{var n=i(8297);function s(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s},6820:(t,e,i)=>{var n=i(501),s=i(4650),r=i(6192),o=i(5585);function a(t,e,i,a){if(o.call(this),n.sayHello(t),a)for(var l in r.DEFAULT_RENDER_OPTIONS)void 0===a[l]&&(a[l]=r.DEFAULT_RENDER_OPTIONS[l]);else a=r.DEFAULT_RENDER_OPTIONS;this.type=r.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=i||600,this.view=a.view||document.createElement("canvas"),this.resolution=a.resolution,this.transparent=a.transparent,this.autoResize=a.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=a.preserveDrawingBuffer,this.clearBeforeRender=a.clearBeforeRender,this.roundPixels=a.roundPixels,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=a.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new s.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,t.exports=a,Object.defineProperties(a.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=n.hex2string(t),n.hex2rgb(t,this._backgroundColorRgb)}}}),a.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},a.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=r.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},8010:(t,e,i)=>{var n=i(6820),s=i(6871),r=i(501),o=i(4650),a=i(6192);function l(t,e,i){i=i||{},n.call(this,"Canvas",t,e,i),this.type=a.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new s,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1},this.resize(t,e)}l.prototype=Object.create(n.prototype),l.prototype.constructor=l,t.exports=l,r.pluginTarget.mixin(l),l.prototype.render=function(t){var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.context.globalCompositeOperation=this.blendModes[a.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context)},l.prototype.destroy=function(t){this.destroyPlugins(),n.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},l.prototype.renderDisplayObject=function(t,e){var i=this.context;this.context=e,t.renderCanvas(this),this.context=i},l.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.smoothProperty&&(this.context[this.smoothProperty]=a.SCALE_MODES.DEFAULT===a.SCALE_MODES.LINEAR)},l.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},r.canUseNewCanvasBlendModes()?(this.blendModes[a.BLEND_MODES.NORMAL]="source-over",this.blendModes[a.BLEND_MODES.ADD]="lighter",this.blendModes[a.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[a.BLEND_MODES.SCREEN]="screen",this.blendModes[a.BLEND_MODES.OVERLAY]="overlay",this.blendModes[a.BLEND_MODES.DARKEN]="darken",this.blendModes[a.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[a.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[a.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[a.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[a.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[a.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[a.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[a.BLEND_MODES.HUE]="hue",this.blendModes[a.BLEND_MODES.SATURATION]="saturate",this.blendModes[a.BLEND_MODES.COLOR]="color",this.blendModes[a.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[a.BLEND_MODES.NORMAL]="source-over",this.blendModes[a.BLEND_MODES.ADD]="lighter",this.blendModes[a.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[a.BLEND_MODES.SCREEN]="source-over",this.blendModes[a.BLEND_MODES.OVERLAY]="source-over",this.blendModes[a.BLEND_MODES.DARKEN]="source-over",this.blendModes[a.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[a.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[a.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[a.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[a.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[a.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[a.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[a.BLEND_MODES.HUE]="source-over",this.blendModes[a.BLEND_MODES.SATURATION]="source-over",this.blendModes[a.BLEND_MODES.COLOR]="source-over",this.blendModes[a.BLEND_MODES.LUMINOSITY]="source-over"))}},1549:t=>{function e(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}e.prototype.constructor=e,t.exports=e,Object.defineProperties(e.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),e.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},e.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},e.prototype.destroy=function(){this.context=null,this.canvas=null}},4694:(t,e,i)=>{var n=i(6192),s={};t.exports=s,s.renderGraphics=function(t,e){var i=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var s=0;s<t.graphicsData.length;s++){var r=t.graphicsData[s],o=r.shape,a=r._fillTint,l=r._lineTint;if(e.lineWidth=r.lineWidth,r.type===n.SHAPES.POLY){e.beginPath();var u=o.points;e.moveTo(u[0],u[1]);for(var p=1;p<u.length/2;p++)e.lineTo(u[2*p],u[2*p+1]);o.closed&&e.lineTo(u[0],u[1]),u[0]===u[u.length-2]&&u[1]===u[u.length-1]&&e.closePath(),r.fill&&(e.globalAlpha=r.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),r.lineWidth&&(e.globalAlpha=r.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.stroke())}else if(r.type===n.SHAPES.RECT)(r.fillColor||0===r.fillColor)&&(e.globalAlpha=r.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fillRect(o.x,o.y,o.width,o.height)),r.lineWidth&&(e.globalAlpha=r.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.strokeRect(o.x,o.y,o.width,o.height));else if(r.type===n.SHAPES.CIRC)e.beginPath(),e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.closePath(),r.fill&&(e.globalAlpha=r.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),r.lineWidth&&(e.globalAlpha=r.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.stroke());else if(r.type===n.SHAPES.ELIP){var h=2*o.width,d=2*o.height,c=o.x-h/2,_=o.y-d/2;e.beginPath();var f=.5522848,T=h/2*f,m=d/2*f,g=c+h,I=_+d,E=c+h/2,O=_+d/2;e.moveTo(c,O),e.bezierCurveTo(c,O-m,E-T,_,E,_),e.bezierCurveTo(E+T,_,g,O-m,g,O),e.bezierCurveTo(g,O+m,E+T,I,E,I),e.bezierCurveTo(E-T,I,c,O+m,c,O),e.closePath(),r.fill&&(e.globalAlpha=r.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),r.lineWidth&&(e.globalAlpha=r.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.stroke())}else if(r.type===n.SHAPES.RREC){var M=o.x,R=o.y,A=o.width,y=o.height,S=o.radius,v=Math.min(A,y)/2|0;S=S>v?v:S,e.beginPath(),e.moveTo(M,R+S),e.lineTo(M,R+y-S),e.quadraticCurveTo(M,R+y,M+S,R+y),e.lineTo(M+A-S,R+y),e.quadraticCurveTo(M+A,R+y,M+A,R+y-S),e.lineTo(M+A,R+S),e.quadraticCurveTo(M+A,R,M+A-S,R),e.lineTo(M+S,R),e.quadraticCurveTo(M,R,M,R+S),e.closePath(),(r.fillColor||0===r.fillColor)&&(e.globalAlpha=r.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),r.lineWidth&&(e.globalAlpha=r.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.stroke())}}},s.renderGraphicsMask=function(t,e){var i=t.graphicsData.length;if(0!==i){e.beginPath();for(var s=0;s<i;s++){var r=t.graphicsData[s],o=r.shape;if(r.type===n.SHAPES.POLY){var a=o.points;e.moveTo(a[0],a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(a[2*l],a[2*l+1]);a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&e.closePath()}else if(r.type===n.SHAPES.RECT)e.rect(o.x,o.y,o.width,o.height),e.closePath();else if(r.type===n.SHAPES.CIRC)e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.closePath();else if(r.type===n.SHAPES.ELIP){var u=2*o.width,p=2*o.height,h=o.x-u/2,d=o.y-p/2,c=.5522848,_=u/2*c,f=p/2*c,T=h+u,m=d+p,g=h+u/2,I=d+p/2;e.moveTo(h,I),e.bezierCurveTo(h,I-f,g-_,d,g,d),e.bezierCurveTo(g+_,d,T,I-f,T,I),e.bezierCurveTo(T,I+f,g+_,m,g,m),e.bezierCurveTo(g-_,m,h,I+f,h,I),e.closePath()}else if(r.type===n.SHAPES.RREC){var E=o.x,O=o.y,M=o.width,R=o.height,A=o.radius,y=Math.min(M,R)/2|0;A=A>y?y:A,e.moveTo(E,O+A),e.lineTo(E,O+R-A),e.quadraticCurveTo(E,O+R,E+A,O+R),e.lineTo(E+M-A,O+R),e.quadraticCurveTo(E+M,O+R,E+M,O+R-A),e.lineTo(E+M,O+A),e.quadraticCurveTo(E+M,O,E+M-A,O),e.lineTo(E+A,O),e.quadraticCurveTo(E,O,E,O+A),e.closePath()}}}},s.updateGraphicsTint=function(t){if(16777215!==t.tint||t._prevTint!==t.tint){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,i=(t.tint>>8&255)/255,n=(255&t.tint)/255,s=0;s<t.graphicsData.length;s++){var r=t.graphicsData[s],o=0|r.fillColor,a=0|r.lineColor;r._fillTint=((o>>16&255)/255*e*255<<16)+((o>>8&255)/255*i*255<<8)+(255&o)/255*n*255,r._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*i*255<<8)+(255&a)/255*n*255}}}},6871:(t,e,i)=>{var n=i(4694);function s(){}s.prototype.constructor=s,t.exports=s,s.prototype.pushMask=function(t,e){e.context.save();var i=t.alpha,s=t.worldTransform,r=e.resolution;e.context.setTransform(s.a*r,s.b*r,s.c*r,s.d*r,s.tx*r,s.ty*r),t.texture||(n.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=i},s.prototype.popMask=function(t){t.context.restore()},s.prototype.destroy=function(){}},7809:(t,e,i)=>{var n=i(501),s={};t.exports=s,s.getTintedTexture=function(t,e){var i=t.texture,n="#"+("00000"+(0|(e=s.roundColor(e))).toString(16)).substr(-6);if(i.tintCache=i.tintCache||{},i.tintCache[n])return i.tintCache[n];var r=s.canvas||document.createElement("canvas");if(s.tintMethod(i,e,r),s.convertTintToImage){var o=new Image;o.src=r.toDataURL(),i.tintCache[n]=o}else i.tintCache[n]=r,s.canvas=null;return r},s.tintWithMultiply=function(t,e,i){var n=i.getContext("2d"),s=t.baseTexture.resolution,r=t.crop.clone();r.x*=s,r.y*=s,r.width*=s,r.height*=s,i.width=r.width,i.height=r.height,n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,r.width,r.height),n.globalCompositeOperation="multiply",n.drawImage(t.baseTexture.source,r.x,r.y,r.width,r.height,0,0,r.width,r.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,r.x,r.y,r.width,r.height,0,0,r.width,r.height)},s.tintWithOverlay=function(t,e,i){var n=i.getContext("2d"),s=t.baseTexture.resolution,r=t.crop.clone();r.x*=s,r.y*=s,r.width*=s,r.height*=s,i.width=r.width,i.height=r.height,n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,r.width,r.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,r.x,r.y,r.width,r.height,0,0,r.width,r.height)},s.tintWithPerPixel=function(t,e,i){var s=i.getContext("2d"),r=t.baseTexture.resolution,o=t.crop.clone();o.x*=r,o.y*=r,o.width*=r,o.height*=r,i.width=o.width,i.height=o.height,s.globalCompositeOperation="copy",s.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var a=n.hex2rgb(e),l=a[0],u=a[1],p=a[2],h=s.getImageData(0,0,o.width,o.height),d=h.data,c=0;c<d.length;c+=4)d[c+0]*=l,d[c+1]*=u,d[c+2]*=p;s.putImageData(h,0,0)},s.roundColor=function(t){var e=s.cacheStepsPerColorChannel,i=n.hex2rgb(t);return i[0]=Math.min(255,i[0]/e*e),i[1]=Math.min(255,i[1]/e*e),i[2]=Math.min(255,i[2]/e*e),n.rgb2hex(i)},s.cacheStepsPerColorChannel=8,s.convertTintToImage=!1,s.canUseMultiply=n.canUseNewCanvasBlendModes(),s.tintMethod=s.canUseMultiply?s.tintWithMultiply:s.tintWithPerPixel},5092:(t,e,i)=>{var n=i(6820),s=i(3779),r=i(9240),o=i(5468),a=i(4598),l=i(5396),u=i(7955),p=i(1830),h=i(1438),d=i(501),c=i(6192);function _(t,e,i){i=i||{},n.call(this,"WebGL",t,e,i),this.type=c.RENDERER_TYPE.WEBGL,this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.handleContextLost,!1),this.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1),this._useFXAA=!!i.forceFXAA&&i.antialias,this._FXAAFilter=null,this._contextOptions={alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer},this.drawCount=0,this.shaderManager=new s(this),this.maskManager=new r(this),this.stencilManager=new o(this),this.filterManager=new a(this),this.blendModeManager=new l(this),this.currentRenderTarget=null,this.currentRenderer=new p(this),this.initPlugins(),this._createContext(),this._initContext(),this._mapGlModes(),this._renderTargetStack=[]}_.prototype=Object.create(n.prototype),_.prototype.constructor=_,t.exports=_,d.pluginTarget.mixin(_),_.glContextId=0,_.prototype._createContext=function(){var t=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=t,!t)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=_.glContextId++,t.id=this.glContextId,t.renderer=this},_.prototype._initContext=function(){var t=this.gl;t.disable(t.DEPTH_TEST),t.disable(t.CULL_FACE),t.enable(t.BLEND),this.renderTarget=new u(t,this.width,this.height,null,this.resolution,!0),this.setRenderTarget(this.renderTarget),this.emit("context",t),this.resize(this.width,this.height),this._useFXAA||(this._useFXAA=this._contextOptions.antialias&&!t.getContextAttributes().antialias),this._useFXAA&&(window.console.warn("FXAA antialiasing being used instead of native antialiasing"),this._FXAAFilter=[new h])},_.prototype.render=function(t){if(!this.gl.isContextLost()){this.drawCount=0,this._lastObjectRendered=t,this._useFXAA&&(this._FXAAFilter[0].uniforms.resolution.value.x=this.width,this._FXAAFilter[0].uniforms.resolution.value.y=this.height,t.filterArea=this.renderTarget.size,t.filters=this._FXAAFilter);var e=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e;var i=this.gl;this.setRenderTarget(this.renderTarget),this.clearBeforeRender&&(this.transparent?i.clearColor(0,0,0,0):i.clearColor(this._backgroundColorRgb[0],this._backgroundColorRgb[1],this._backgroundColorRgb[2],1),i.clear(i.COLOR_BUFFER_BIT)),this.renderDisplayObject(t,this.renderTarget)}},_.prototype.renderDisplayObject=function(t,e,i){this.setRenderTarget(e),i&&e.clear(),this.filterManager.setFilterStack(e.filterStack),t.renderWebGL(this),this.currentRenderer.flush()},_.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},_.prototype.setRenderTarget=function(t){this.currentRenderTarget!==t&&(this.currentRenderTarget=t,this.currentRenderTarget.activate(),this.stencilManager.setMaskStack(t.stencilMaskStack))},_.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.filterManager.resize(t,e),this.renderTarget.resize(t,e),this.currentRenderTarget===this.renderTarget&&(this.renderTarget.activate(),this.gl.viewport(0,0,this.width,this.height))},_.prototype.updateTexture=function(t){if((t=t.baseTexture||t).hasLoaded){var e=this.gl;return t._glTextures[e.id]||(t._glTextures[e.id]=e.createTexture(),t.on("update",this.updateTexture,this),t.on("dispose",this.destroyTexture,this)),e.bindTexture(e.TEXTURE_2D,t._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t.scaleMode===c.SCALE_MODES.LINEAR?e.LINEAR:e.NEAREST),t.mipmap&&t.isPowerOfTwo?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===c.SCALE_MODES.LINEAR?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST),e.generateMipmap(e.TEXTURE_2D)):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===c.SCALE_MODES.LINEAR?e.LINEAR:e.NEAREST),t.isPowerOfTwo?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),t._glTextures[e.id]}},_.prototype.destroyTexture=function(t){(t=t.baseTexture||t).hasLoaded&&t._glTextures[this.gl.id]&&this.gl.deleteTexture(t._glTextures[this.gl.id])},_.prototype.handleContextLost=function(t){t.preventDefault()},_.prototype.handleContextRestored=function(){for(var t in this._initContext(),d.BaseTextureCache)d.BaseTextureCache[t]._glTextures.length=0},_.prototype.destroy=function(t){for(var e in this.destroyPlugins(),this.view.removeEventListener("webglcontextlost",this.handleContextLost),this.view.removeEventListener("webglcontextrestored",this.handleContextRestored),d.BaseTextureCache){var i=d.BaseTextureCache[e];i.off("update",this.updateTexture,this),i.off("dispose",this.destroyTexture,this)}n.prototype.destroy.call(this,t),this.uid=0,this.shaderManager.destroy(),this.maskManager.destroy(),this.stencilManager.destroy(),this.filterManager.destroy(),this.blendModeManager.destroy(),this.shaderManager=null,this.maskManager=null,this.filterManager=null,this.blendModeManager=null,this.currentRenderer=null,this.handleContextLost=null,this.handleContextRestored=null,this._contextOptions=null,this.drawCount=0,this.gl.useProgram(null),this.gl=null},_.prototype._mapGlModes=function(){var t=this.gl;this.blendModes||(this.blendModes={},this.blendModes[c.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.ADD]=[t.SRC_ALPHA,t.DST_ALPHA],this.blendModes[c.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.SCREEN]=[t.SRC_ALPHA,t.ONE],this.blendModes[c.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[c.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA]),this.drawModes||(this.drawModes={},this.drawModes[c.DRAW_MODES.POINTS]=t.POINTS,this.drawModes[c.DRAW_MODES.LINES]=t.LINES,this.drawModes[c.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,this.drawModes[c.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,this.drawModes[c.DRAW_MODES.TRIANGLES]=t.TRIANGLES,this.drawModes[c.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,this.drawModes[c.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN)}},580:(t,e,i)=>{var n=i(8297);function s(t,e,i){this.shaders=[],this.padding=0,this.uniforms=i||{},this.vertexSrc=t||n.defaultVertexSrc,this.fragmentSrc=e||n.defaultFragmentSrc}s.prototype.constructor=s,t.exports=s,s.prototype.getShader=function(t){var e=t.gl,i=this.shaders[e.id];return i||(i=new n(t.shaderManager,this.vertexSrc,this.fragmentSrc,this.uniforms,this.attributes),this.shaders[e.id]=i),i},s.prototype.applyFilter=function(t,e,i,n){var s=this.getShader(t);t.filterManager.applyFilter(s,e,i,n)},s.prototype.syncUniform=function(t){for(var e=0,i=this.shaders.length;e<i;++e)this.shaders[e].syncUniform(t)}},1438:(t,e,i)=>{var n=i(580),s=i(7425);function r(){n.call(this,s.readFileSync("//FXAA.vert","utf8"),s.readFileSync("//FXAA.frag","utf8"),{resolution:{type:"v2",value:{x:1,y:1}}})}r.prototype=Object.create(n.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.applyFilter=function(t,e,i){var n=t.filterManager,s=this.getShader(t);n.applyFilter(s,e,i)}},5207:(t,e,i)=>{var n=i(580),s=i(4650),r=i(7425);function o(t){var e=new s.Matrix;n.call(this,r.readFileSync("//spriteMaskFilter.vert","utf8"),r.readFileSync("//spriteMaskFilter.frag","utf8"),{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}o.prototype=Object.create(n.prototype),o.prototype.constructor=o,t.exports=o,o.prototype.applyFilter=function(t,e,i){var n=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var s=this.getShader(t);n.applyFilter(s,e,i)},Object.defineProperties(o.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},5396:(t,e,i)=>{var n=i(1103);function s(t){n.call(this,t),this.currentBlendMode=99999}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s,s.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},4598:(t,e,i)=>{var n=i(1103),s=i(7955),r=i(6192),o=i(3885),a=i(4650);function l(t){n.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new a.Rectangle(0,0,t.width,t.height),this.currentFrame=null}l.prototype=Object.create(n.prototype),l.prototype.constructor=l,t.exports=l,l.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new o(t)},l.prototype.setFilterStack=function(t){this.filterStack=t},l.prototype.pushFilter=function(t,e){var i=t.filterArea?t.filterArea.clone():t.getBounds();i.x=0|i.x,i.y=0|i.y,i.width=0|i.width,i.height=0|i.height;var n=0|e[0].padding;if(i.x-=n,i.y-=n,i.width+=2*n,i.height+=2*n,this.renderer.currentRenderTarget.transform){var s=this.renderer.currentRenderTarget.transform;i.x+=s.tx,i.y+=s.ty,this.capFilterArea(i),i.x-=s.tx,i.y-=s.ty}else this.capFilterArea(i);if(i.width>0&&i.height>0){this.currentFrame=i;var r=this.getRenderTarget();this.renderer.setRenderTarget(r),r.clear(),this.filterStack.push({renderTarget:r,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},l.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],i=t.renderTarget;if(t.renderTarget){var n=e.renderTarget,s=this.renderer.gl;this.currentFrame=i.frame,this.quad.map(this.textureSize,i.frame),s.bindBuffer(s.ARRAY_BUFFER,this.quad.vertexBuffer),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(s.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,s.FLOAT,!1,0,0),s.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,s.FLOAT,!1,0,32),s.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,s.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(r.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,i,n),this.returnRenderTarget(i);else{for(var a=i,l=this.getRenderTarget(!0),u=0;u<o.length-1;u++){var p=o[u];p.uniforms.dimensions&&(p.uniforms.dimensions.value[0]=this.renderer.width,p.uniforms.dimensions.value[1]=this.renderer.height,p.uniforms.dimensions.value[2]=this.quad.vertices[0],p.uniforms.dimensions.value[3]=this.quad.vertices[5]),p.applyFilter(this.renderer,a,l);var h=a;a=l,l=h}o[o.length-1].applyFilter(this.renderer,a,n),this.returnRenderTarget(a),this.returnRenderTarget(l)}return t.filter}},l.prototype.getRenderTarget=function(t){var e=this.texturePool.pop()||new s(this.renderer.gl,this.textureSize.width,this.textureSize.height,r.SCALE_MODES.LINEAR,this.renderer.resolution*r.FILTER_RESOLUTION);return e.frame=this.currentFrame,t&&e.clear(!0),e},l.prototype.returnRenderTarget=function(t){this.texturePool.push(t)},l.prototype.applyFilter=function(t,e,i,n){var s=this.renderer.gl;this.renderer.setRenderTarget(i),n&&i.clear(),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,e.texture),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0),this.renderer.drawCount++},l.prototype.calculateMappedMatrix=function(t,e,i){var n=e.worldTransform.copy(a.Matrix.TEMP_MATRIX),s=e._texture.baseTexture,r=i.identity(),o=this.textureSize.height/this.textureSize.width;r.translate(t.x/this.textureSize.width,t.y/this.textureSize.height),r.scale(1,o);var l=this.textureSize.width/s.width,u=this.textureSize.height/s.height;return n.tx/=s.width*l,n.ty/=s.width*l,n.invert(),r.prepend(n),r.scale(1,1/o),r.scale(l,u),r.translate(e.anchor.x,e.anchor.y),r},l.prototype.capFilterArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},l.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var i=0;i<this.texturePool.length;i++)this.texturePool[i].resize(t,e)},l.prototype.destroy=function(){this.quad.destroy(),n.prototype.destroy.call(this),this.filterStack=null,this.offsetY=0;for(var t=0;t<this.texturePool.length;t++)this.texturePool[t].destroy();this.texturePool=null}},9240:(t,e,i)=>{var n=i(1103),s=i(5207);function r(t){n.call(this,t),this.stencilStack=[],this.reverse=!0,this.count=0,this.alphaMaskPool=[]}r.prototype=Object.create(n.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.pushMask=function(t,e){e.texture?this.pushSpriteMask(t,e):this.pushStencilMask(t,e)},r.prototype.popMask=function(t,e){e.texture?this.popSpriteMask(t,e):this.popStencilMask(t,e)},r.prototype.pushSpriteMask=function(t,e){var i=this.alphaMaskPool.pop();i||(i=[new s(e)]),i[0].maskSprite=e,this.renderer.filterManager.pushFilter(t,i)},r.prototype.popSpriteMask=function(){var t=this.renderer.filterManager.popFilter();this.alphaMaskPool.push(t)},r.prototype.pushStencilMask=function(t,e){this.renderer.stencilManager.pushMask(e)},r.prototype.popStencilMask=function(t,e){this.renderer.stencilManager.popMask(e)}},3779:(t,e,i)=>{var n=i(1103),s=i(8297),r=i(7151),o=i(9691),a=i(501);function l(t){n.call(this,t),this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var e=0;e<this.maxAttibs;e++)this.attribState[e]=!1;this.stack=[],this._currentId=-1,this.currentShader=null}l.prototype=Object.create(n.prototype),l.prototype.constructor=l,a.pluginTarget.mixin(l),t.exports=l,l.prototype.onContextChange=function(){this.initPlugins();var t=this.renderer.gl;this.maxAttibs=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.attribState=[];for(var e=0;e<this.maxAttibs;e++)this.attribState[e]=!1;this.defaultShader=new s(this),this.primitiveShader=new o(this),this.complexPrimitiveShader=new r(this)},l.prototype.setAttribs=function(t){var e;for(e=0;e<this.tempAttribState.length;e++)this.tempAttribState[e]=!1;for(var i in t)this.tempAttribState[t[i]]=!0;var n=this.renderer.gl;for(e=0;e<this.attribState.length;e++)this.attribState[e]!==this.tempAttribState[e]&&(this.attribState[e]=this.tempAttribState[e],this.attribState[e]?n.enableVertexAttribArray(e):n.disableVertexAttribArray(e))},l.prototype.setShader=function(t){return this._currentId!==t.uid&&(this._currentId=t.uid,this.currentShader=t,this.renderer.gl.useProgram(t.program),this.setAttribs(t.attributes),!0)},l.prototype.destroy=function(){this.primitiveShader.destroy(),this.complexPrimitiveShader.destroy(),n.prototype.destroy.call(this),this.destroyPlugins(),this.attribState=null,this.tempAttribState=null}},5468:(t,e,i)=>{var n=i(1103),s=i(501);function r(t){n.call(this,t),this.stencilMaskStack=null}r.prototype=Object.create(n.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.setMaskStack=function(t){this.stencilMaskStack=t;var e=this.renderer.gl;0===t.stencilStack.length?e.disable(e.STENCIL_TEST):e.enable(e.STENCIL_TEST)},r.prototype.pushStencil=function(t,e){this.renderer.currentRenderTarget.attachStencilBuffer();var i=this.renderer.gl,n=this.stencilMaskStack;this.bindGraphics(t,e),0===n.stencilStack.length&&(i.enable(i.STENCIL_TEST),i.clear(i.STENCIL_BUFFER_BIT),n.reverse=!0,n.count=0),n.stencilStack.push(e);var s=n.count;i.colorMask(!1,!1,!1,!1),i.stencilFunc(i.ALWAYS,0,255),i.stencilOp(i.KEEP,i.KEEP,i.INVERT),1===e.mode?(i.drawElements(i.TRIANGLE_FAN,e.indices.length-4,i.UNSIGNED_SHORT,0),n.reverse?(i.stencilFunc(i.EQUAL,255-s,255),i.stencilOp(i.KEEP,i.KEEP,i.DECR)):(i.stencilFunc(i.EQUAL,s,255),i.stencilOp(i.KEEP,i.KEEP,i.INCR)),i.drawElements(i.TRIANGLE_FAN,4,i.UNSIGNED_SHORT,2*(e.indices.length-4)),n.reverse?i.stencilFunc(i.EQUAL,255-(s+1),255):i.stencilFunc(i.EQUAL,s+1,255),n.reverse=!n.reverse):(n.reverse?(i.stencilFunc(i.EQUAL,s,255),i.stencilOp(i.KEEP,i.KEEP,i.INCR)):(i.stencilFunc(i.EQUAL,255-s,255),i.stencilOp(i.KEEP,i.KEEP,i.DECR)),i.drawElements(i.TRIANGLE_STRIP,e.indices.length,i.UNSIGNED_SHORT,0),n.reverse?i.stencilFunc(i.EQUAL,s+1,255):i.stencilFunc(i.EQUAL,255-(s+1),255)),i.colorMask(!0,!0,!0,!0),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),n.count++},r.prototype.bindGraphics=function(t,e){var i,n=this.renderer.gl;1===e.mode?(i=this.renderer.shaderManager.complexPrimitiveShader,this.renderer.shaderManager.setShader(i),n.uniformMatrix3fv(i.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),n.uniformMatrix3fv(i.uniforms.projectionMatrix._location,!1,this.renderer.currentRenderTarget.projectionMatrix.toArray(!0)),n.uniform3fv(i.uniforms.tint._location,s.hex2rgb(t.tint)),n.uniform3fv(i.uniforms.color._location,e.color),n.uniform1f(i.uniforms.alpha._location,t.worldAlpha),n.bindBuffer(n.ARRAY_BUFFER,e.buffer),n.vertexAttribPointer(i.attributes.aVertexPosition,2,n.FLOAT,!1,8,0),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.indexBuffer)):(i=this.renderer.shaderManager.primitiveShader,this.renderer.shaderManager.setShader(i),n.uniformMatrix3fv(i.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),n.uniformMatrix3fv(i.uniforms.projectionMatrix._location,!1,this.renderer.currentRenderTarget.projectionMatrix.toArray(!0)),n.uniform3fv(i.uniforms.tint._location,s.hex2rgb(t.tint)),n.uniform1f(i.uniforms.alpha._location,t.worldAlpha),n.bindBuffer(n.ARRAY_BUFFER,e.buffer),n.vertexAttribPointer(i.attributes.aVertexPosition,2,n.FLOAT,!1,24,0),n.vertexAttribPointer(i.attributes.aColor,4,n.FLOAT,!1,24,8),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.indexBuffer))},r.prototype.popStencil=function(t,e){var i=this.renderer.gl,n=this.stencilMaskStack;if(n.stencilStack.pop(),n.count--,0===n.stencilStack.length)i.disable(i.STENCIL_TEST);else{var s=n.count;this.bindGraphics(t,e),i.colorMask(!1,!1,!1,!1),1===e.mode?(n.reverse=!n.reverse,n.reverse?(i.stencilFunc(i.EQUAL,255-(s+1),255),i.stencilOp(i.KEEP,i.KEEP,i.INCR)):(i.stencilFunc(i.EQUAL,s+1,255),i.stencilOp(i.KEEP,i.KEEP,i.DECR)),i.drawElements(i.TRIANGLE_FAN,4,i.UNSIGNED_SHORT,2*(e.indices.length-4)),i.stencilFunc(i.ALWAYS,0,255),i.stencilOp(i.KEEP,i.KEEP,i.INVERT),i.drawElements(i.TRIANGLE_FAN,e.indices.length-4,i.UNSIGNED_SHORT,0),this.renderer.drawCount+=2,n.reverse?i.stencilFunc(i.EQUAL,s,255):i.stencilFunc(i.EQUAL,255-s,255)):(n.reverse?(i.stencilFunc(i.EQUAL,s+1,255),i.stencilOp(i.KEEP,i.KEEP,i.DECR)):(i.stencilFunc(i.EQUAL,255-(s+1),255),i.stencilOp(i.KEEP,i.KEEP,i.INCR)),i.drawElements(i.TRIANGLE_STRIP,e.indices.length,i.UNSIGNED_SHORT,0),this.renderer.drawCount++,n.reverse?i.stencilFunc(i.EQUAL,s,255):i.stencilFunc(i.EQUAL,255-s,255)),i.colorMask(!0,!0,!0,!0),i.stencilOp(i.KEEP,i.KEEP,i.KEEP)}},r.prototype.destroy=function(){n.prototype.destroy.call(this),this.stencilMaskStack.stencilStack=null},r.prototype.pushMask=function(t){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),t.dirty&&this.renderer.plugins.graphics.updateGraphics(t,this.renderer.gl),t._webGL[this.renderer.gl.id].data.length&&this.pushStencil(t,t._webGL[this.renderer.gl.id].data[0])},r.prototype.popMask=function(t){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),this.popStencil(t,t._webGL[this.renderer.gl.id].data[0])}},1103:t=>{function e(t){this.renderer=t,this.renderer.on("context",this.onContextChange,this)}e.prototype.constructor=e,t.exports=e,e.prototype.onContextChange=function(){},e.prototype.destroy=function(){this.renderer.off("context",this.onContextChange,this),this.renderer=null}},7151:(t,e,i)=>{var n=i(8306);function s(t){n.call(this,t,["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"),{tint:{type:"3f",value:[0,0,0]},alpha:{type:"1f",value:0},color:{type:"3f",value:[0,0,0]},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0})}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s},9691:(t,e,i)=>{var n=i(8306);function s(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"),{tint:{type:"3f",value:[0,0,0]},alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aColor:0})}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s},8306:(t,e,i)=>{var n=i(501);function s(t,e,i,s,r){if(!e||!i)throw new Error("Pixi.js Error. Shader requires vertexSrc and fragmentSrc");this.uid=n.uid(),this.gl=t.renderer.gl,this.shaderManager=t,this.program=null,this.uniforms=s||{},this.attributes=r||{},this.textureCount=1,this.vertexSrc=e,this.fragmentSrc=i,this.init()}s.prototype.constructor=s,t.exports=s,s.prototype.init=function(){this.compile(),this.gl.useProgram(this.program),this.cacheUniformLocations(Object.keys(this.uniforms)),this.cacheAttributeLocations(Object.keys(this.attributes))},s.prototype.cacheUniformLocations=function(t){for(var e=0;e<t.length;++e)this.uniforms[t[e]]._location=this.gl.getUniformLocation(this.program,t[e])},s.prototype.cacheAttributeLocations=function(t){for(var e=0;e<t.length;++e)this.attributes[t[e]]=this.gl.getAttribLocation(this.program,t[e])},s.prototype.compile=function(){var t=this.gl,e=this._glCompile(t.VERTEX_SHADER,this.vertexSrc),i=this._glCompile(t.FRAGMENT_SHADER,this.fragmentSrc),n=t.createProgram();return t.attachShader(n,e),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(n,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(n)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(n)),t.deleteProgram(n),n=null),t.deleteShader(e),t.deleteShader(i),this.program=n},s.prototype.syncUniform=function(t){var e,i,s=t._location,r=t.value,o=this.gl;switch(t.type){case"b":case"bool":case"boolean":o.uniform1i(s,r?1:0);break;case"i":case"1i":o.uniform1i(s,r);break;case"f":case"1f":o.uniform1f(s,r);break;case"2f":o.uniform2f(s,r[0],r[1]);break;case"3f":o.uniform3f(s,r[0],r[1],r[2]);break;case"4f":o.uniform4f(s,r[0],r[1],r[2],r[3]);break;case"v2":o.uniform2f(s,r.x,r.y);break;case"v3":o.uniform3f(s,r.x,r.y,r.z);break;case"v4":o.uniform4f(s,r.x,r.y,r.z,r.w);break;case"1iv":case"iv1":o.uniform1iv(s,r);break;case"2iv":o.uniform2iv(s,r);break;case"3iv":case"iv":o.uniform3iv(s,r);break;case"4iv":o.uniform4iv(s,r);break;case"1fv":case"fv1":o.uniform1fv(s,r);break;case"2fv":o.uniform2fv(s,r);break;case"3fv":case"fv":o.uniform3fv(s,r);break;case"4fv":o.uniform4fv(s,r);break;case"m2":case"mat2":case"Matrix2fv":o.uniformMatrix2fv(s,t.transpose,r);break;case"m3":case"mat3":case"Matrix3fv":o.uniformMatrix3fv(s,t.transpose,r);break;case"m4":case"mat4":case"Matrix4fv":o.uniformMatrix4fv(s,t.transpose,r);break;case"c":"number"==typeof r&&(r=n.hex2rgb(r)),o.uniform3f(s,r[0],r[1],r[2]);break;case"v2v":for(t._array||(t._array=new Float32Array(2*r.length)),e=0,i=r.length;e<i;++e)t._array[2*e]=r[e].x,t._array[2*e+1]=r[e].y;o.uniform2fv(s,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*r.length)),e=0,i=r.length;e<i;++e)t._array[3*e]=r[e].x,t._array[3*e+1]=r[e].y,t._array[3*e+2]=r[e].z;o.uniform3fv(s,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*r.length)),e=0,i=r.length;e<i;++e)t._array[4*e]=r[e].x,t._array[4*e+1]=r[e].y,t._array[4*e+2]=r[e].z,t._array[4*e+3]=r[e].w;o.uniform4fv(s,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;o.activeTexture(o["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[o.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[o.id]),o.bindTexture(o.TEXTURE_2D,a),o.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},s.prototype.syncUniforms=function(){for(var t in this.textureCount=1,this.uniforms)this.syncUniform(this.uniforms[t])},s.prototype.initSampler2D=function(t){var e=this.gl,i=t.value.baseTexture;if(i.hasLoaded)if(t.textureData){var n=t.textureData;i._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,i._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,n.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n.magFilter?n.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n.wrapT?n.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(i)},s.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},s.prototype._glCompile=function(t,e){var i=this.gl.createShader(t);return this.gl.shaderSource(i,e),this.gl.compileShader(i),this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS)?i:(console.log(this.gl.getShaderInfoLog(i)),null)}},8297:(t,e,i)=>{var n=i(8306);function s(t,e,i,r,o){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(r)for(var l in r)a[l]=r[l];var u={aVertexPosition:0,aTextureCoord:0,aColor:0};if(o)for(var p in o)u[p]=o[p];e=e||s.defaultVertexSrc,i=i||s.defaultFragmentSrc,n.call(this,t,e,i,a,u)}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s,s.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),s.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},1830:(t,e,i)=>{var n=i(1103);function s(t){n.call(this,t)}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s,s.prototype.start=function(){},s.prototype.stop=function(){this.flush()},s.prototype.flush=function(){},s.prototype.render=function(t){}},3885:t=>{function e(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}e.prototype.constructor=e,e.prototype.map=function(t,e){var i=0,n=0;this.uvs[0]=i,this.uvs[1]=n,this.uvs[2]=i+e.width/t.width,this.uvs[3]=n,this.uvs[4]=i+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=i,this.uvs[7]=n+e.height/t.height,i=e.x,n=e.y,this.vertices[0]=i,this.vertices[1]=n,this.vertices[2]=i+e.width,this.vertices[3]=n,this.vertices[4]=i+e.width,this.vertices[5]=n+e.height,this.vertices[6]=i,this.vertices[7]=n+e.height,this.upload()},e.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},e.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},t.exports=e},7955:(t,e,i)=>{var n=i(4650),s=i(501),r=i(6192),o=i(8614),a=function(t,e,i,a,l,u){(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new n.Rectangle(0,0,1,1),this.resolution=l||r.RESOLUTION,this.projectionMatrix=new n.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new o,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||r.SCALE_MODES.DEFAULT,this.root=u,this.root)||(this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===r.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===r.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),s.isPowerOfTwo(e,i)?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0));this.resize(e,i)};a.prototype.constructor=a,t.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t|=0,e|=0,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var i=this.gl;i.bindTexture(i.TEXTURE_2D,this.texture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t*this.resolution,e*this.resolution,0,i.RGBA,i.UNSIGNED_BYTE,null),this.stencilBuffer&&(i.bindRenderbuffer(i.RENDERBUFFER,this.stencilBuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var n=this.frame||this.size;this.calculateProjection(n)}},a.prototype.destroy=function(){var t=this.gl;t.deleteRenderbuffer(this.stencilBuffer),t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},8614:t=>{function e(){this.stencilStack=[],this.reverse=!0,this.count=0}e.prototype.constructor=e,t.exports=e},2861:(t,e,i)=>{var n=i(4650),s=i(2699),r=i(7673),o=i(7809),a=i(501),l=i(6192),u=new n.Point;function p(t){r.call(this),this.anchor=new n.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=l.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||s.EMPTY}p.prototype=Object.create(r.prototype),p.prototype.constructor=p,t.exports=p,Object.defineProperties(p.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this.texture._frame.width},set:function(t){this.scale.x=a.sign(this.scale.x)*t/this.texture._frame.width,this._width=t}},height:{get:function(){return Math.abs(this.scale.y)*this.texture._frame.height},set:function(t){this.scale.y=a.sign(this.scale.y)*t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),p.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=a.sign(this.scale.x)*this._width/this.texture.frame.width),this._height&&(this.scale.y=a.sign(this.scale.y)*this._height/this.texture.frame.height)},p.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},p.prototype.getBounds=function(t){if(!this._currentBounds){var e,i,n,s,r=this._texture._frame.width,o=this._texture._frame.height,a=r*(1-this.anchor.x),l=r*-this.anchor.x,u=o*(1-this.anchor.y),p=o*-this.anchor.y,h=t||this.worldTransform,d=h.a,c=h.b,_=h.c,f=h.d,T=h.tx,m=h.ty;if(0===c&&0===_)d<0&&(d*=-1),f<0&&(f*=-1),e=d*l+T,i=d*a+T,n=f*p+m,s=f*u+m;else{var g=d*l+_*p+T,I=f*p+c*l+m,E=d*a+_*p+T,O=f*p+c*a+m,M=d*a+_*u+T,R=f*u+c*a+m,A=d*l+_*u+T,y=f*u+c*l+m;e=A<(e=M<(e=E<(e=g)?E:e)?M:e)?A:e,n=y<(n=R<(n=O<(n=I)?O:n)?R:n)?y:n,i=A>(i=M>(i=E>(i=g)?E:i)?M:i)?A:i,s=y>(s=R>(s=O>(s=I)?O:s)?R:s)?y:s}if(this.children.length){var S=this.containerGetBounds();a=S.x,l=S.x+S.width,e=e<a?e:a,n=n<(u=S.y)?n:u,i=i>l?i:l,s=s>(p=S.y+S.height)?s:p}var v=this._bounds;v.x=e,v.width=i-e,v.y=n,v.height=s-n,this._currentBounds=v}return this._currentBounds},p.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},p.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e,i=this._texture._frame.width,n=this._texture._frame.height,s=-i*this.anchor.x;return u.x>s&&u.x<s+i&&(e=-n*this.anchor.y,u.y>e&&u.y<e+n)},p.prototype._renderCanvas=function(t){if(!(this.texture.crop.width<=0||this.texture.crop.height<=0)){var e=t.blendModes[this.blendMode];if(e!==t.context.globalCompositeOperation&&(t.context.globalCompositeOperation=e),this.texture.valid){var i,n,s,r,a=this._texture,u=this.worldTransform;t.context.globalAlpha=this.worldAlpha;var p=a.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;if(t.smoothProperty&&t.context[t.smoothProperty]!==p&&(t.context[t.smoothProperty]=p),a.rotate){var h=u.a,d=u.b;u.a=-u.c,u.b=-u.d,u.c=h,u.d=d,s=a.crop.height,r=a.crop.width,i=a.trim?a.trim.y-this.anchor.y*a.trim.height:this.anchor.y*-a._frame.height,n=a.trim?a.trim.x-this.anchor.x*a.trim.width:this.anchor.x*-a._frame.width}else s=a.crop.width,r=a.crop.height,i=a.trim?a.trim.x-this.anchor.x*a.trim.width:this.anchor.x*-a._frame.width,n=a.trim?a.trim.y-this.anchor.y*a.trim.height:this.anchor.y*-a._frame.height;t.roundPixels?(t.context.setTransform(u.a,u.b,u.c,u.d,u.tx*t.resolution|0,u.ty*t.resolution|0),i|=0,n|=0):t.context.setTransform(u.a,u.b,u.c,u.d,u.tx*t.resolution,u.ty*t.resolution);var c=a.baseTexture.resolution;16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=o.getTintedTexture(this,this.tint)),t.context.drawImage(this.tintedTexture,0,0,s*c,r*c,i*t.resolution,n*t.resolution,s*t.resolution,r*t.resolution)):t.context.drawImage(a.baseTexture.source,a.crop.x*c,a.crop.y*c,s*c,r*c,i*t.resolution,n*t.resolution,s*t.resolution,r*t.resolution)}}},p.prototype.destroy=function(t,e){r.prototype.destroy.call(this),this.anchor=null,t&&this._texture.destroy(e),this._texture=null,this.shader=null},p.fromFrame=function(t){var e=a.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return new p(e)},p.fromImage=function(t,e,i){return new p(s.fromImage(t,e,i))}},7920:(t,e,i)=>{var n=i(1830),s=i(5092),r=i(6192);function o(t){n.call(this,t),this.vertSize=5,this.vertByteSize=4*this.vertSize,this.size=r.SPRITE_BATCH_SIZE;var e=4*this.size*this.vertByteSize,i=6*this.size;this.vertices=new ArrayBuffer(e),this.positions=new Float32Array(this.vertices),this.colors=new Uint32Array(this.vertices),this.indices=new Uint16Array(i);for(var s=0,o=0;s<i;s+=6,o+=4)this.indices[s+0]=o+0,this.indices[s+1]=o+1,this.indices[s+2]=o+2,this.indices[s+3]=o+0,this.indices[s+4]=o+2,this.indices[s+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}o.prototype=Object.create(n.prototype),o.prototype.constructor=o,t.exports=o,s.registerPlugin("sprite",o),o.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},o.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var i=e._uvs;if(i){var n,s,r,o,a=t.anchor.x,l=t.anchor.y;if(e.trim&&void 0===t.tileScale){var u=e.trim;n=(s=u.x-a*u.width)+e.crop.width,r=(o=u.y-l*u.height)+e.crop.height}else n=e._frame.width*(1-a),s=e._frame.width*-a,r=e._frame.height*(1-l),o=e._frame.height*-l;var p=this.currentBatchSize*this.vertByteSize,h=t.worldTransform,d=h.a,c=h.b,_=h.c,f=h.d,T=h.tx,m=h.ty,g=this.colors,I=this.positions;this.renderer.roundPixels?(I[p]=d*s+_*o+T|0,I[p+1]=f*o+c*s+m|0,I[p+5]=d*n+_*o+T|0,I[p+6]=f*o+c*n+m|0,I[p+10]=d*n+_*r+T|0,I[p+11]=f*r+c*n+m|0,I[p+15]=d*s+_*r+T|0,I[p+16]=f*r+c*s+m|0):(I[p]=d*s+_*o+T,I[p+1]=f*o+c*s+m,I[p+5]=d*n+_*o+T,I[p+6]=f*o+c*n+m,I[p+10]=d*n+_*r+T,I[p+11]=f*r+c*n+m,I[p+15]=d*s+_*r+T,I[p+16]=f*r+c*s+m),I[p+2]=i.x0,I[p+3]=i.y0,I[p+7]=i.x1,I[p+8]=i.y1,I[p+12]=i.x2,I[p+13]=i.y2,I[p+17]=i.x3,I[p+18]=i.y3;var E=t.tint;g[p+4]=g[p+9]=g[p+14]=g[p+19]=(E>>16)+(65280&E)+((255&E)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},o.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e,i,n,s=this.renderer.gl;if(this.currentBatchSize>.5*this.size)s.bufferSubData(s.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);s.bufferSubData(s.ARRAY_BUFFER,0,r)}for(var o,a=0,l=0,u=null,p=this.renderer.blendModeManager.currentBlendMode,h=null,d=!1,c=!1,_=0,f=this.currentBatchSize;_<f;_++)e=(o=this.sprites[_])._texture.baseTexture,d=p!==(i=o.blendMode),c=h!==(n=o.shader||this.shader),(u!==e||d||c)&&(this.renderBatch(u,a,l),l=_,a=0,u=e,d&&(p=i,this.renderer.blendModeManager.setBlendMode(p)),c&&((t=(h=n).shaders?h.shaders[s.id]:h)||(t=h.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),s.activeTexture(s.TEXTURE0))),a++;this.renderBatch(u,a,l),this.currentBatchSize=0}},o.prototype.renderBatch=function(t,e,i){if(0!==e){var n=this.renderer.gl;t._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,t._glTextures[n.id]):this.renderer.updateTexture(t),n.drawElements(n.TRIANGLES,6*e,n.UNSIGNED_SHORT,6*i*2),this.renderer.drawCount++}},o.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},o.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),n.prototype.destroy.call(this),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},9252:(t,e,i)=>{var n=i(2861),s=i(2699),r=i(4650),o=i(501),a=i(6192);function l(t,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||a.RESOLUTION,this._text=null,this._style=null;var o=s.fromCanvas(this.canvas);o.trim=new r.Rectangle,n.call(this,o),this.text=t,this.style=e}l.prototype=Object.create(n.prototype),l.prototype.constructor=l,t.exports=l,l.fontPropertiesCache={},l.fontPropertiesCanvas=document.createElement("canvas"),l.fontPropertiesContext=l.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(l.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){"number"==typeof(t=t||{}).fill&&(t.fill=o.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=o.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=o.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=t.dropShadowAngle||Math.PI/6,t.dropShadowDistance=t.dropShadowDistance||5,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),l.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=(t.wordWrap?this.wordWrap(this._text):this._text).split(/(?:\r\n|\r|\n)/),i=new Array(e.length),n=0,s=this.determineFontProperties(t.font),r=0;r<e.length;r++){var o=this.context.measureText(e[r]).width;i[r]=o,n=Math.max(n,o)}var a=n+t.strokeThickness;t.dropShadow&&(a+=t.dropShadowDistance),this.canvas.width=(a+this.context.lineWidth)*this.resolution;var l,u,p=this.style.lineHeight||s.fontSize+t.strokeThickness,h=p*e.length;if(t.dropShadow&&(h+=t.dropShadowDistance),this.canvas.height=(h+2*this._style.padding)*this.resolution,this.context.scale(this.resolution,this.resolution),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.font=t.font,this.context.strokeStyle=t.stroke,this.context.lineWidth=t.strokeThickness,this.context.textBaseline=t.textBaseline,this.context.lineJoin=t.lineJoin,this.context.miterLimit=t.miterLimit,t.dropShadow){this.context.fillStyle=t.dropShadowColor;var d=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,c=Math.sin(t.dropShadowAngle)*t.dropShadowDistance;for(r=0;r<e.length;r++)l=t.strokeThickness/2,u=t.strokeThickness/2+r*p+s.ascent,"right"===t.align?l+=n-i[r]:"center"===t.align&&(l+=(n-i[r])/2),t.fill&&this.context.fillText(e[r],l+d,u+c+this._style.padding)}for(this.context.fillStyle=t.fill,r=0;r<e.length;r++)l=t.strokeThickness/2,u=t.strokeThickness/2+r*p+s.ascent,"right"===t.align?l+=n-i[r]:"center"===t.align&&(l+=(n-i[r])/2),t.stroke&&t.strokeThickness&&this.context.strokeText(e[r],l,u+this._style.padding),t.fill&&this.context.fillText(e[r],l,u+this._style.padding);this.updateTexture()},l.prototype.updateTexture=function(){var t=this._texture;t.baseTexture.hasLoaded=!0,t.baseTexture.resolution=this.resolution,t.baseTexture.width=this.canvas.width/this.resolution,t.baseTexture.height=this.canvas.height/this.resolution,t.crop.width=t._frame.width=this.canvas.width/this.resolution,t.crop.height=t._frame.height=this.canvas.height/this.resolution,t.trim.x=0,t.trim.y=-this._style.padding,t.trim.width=t._frame.width,t.trim.height=t._frame.height-2*this._style.padding,this._width=this.canvas.width/this.resolution,this._height=this.canvas.height/this.resolution,t.baseTexture.emit("update",t.baseTexture),this.dirty=!1},l.prototype.renderWebGL=function(t){this.dirty&&this.updateText(),n.prototype.renderWebGL.call(this,t)},l.prototype._renderCanvas=function(t){this.dirty&&this.updateText(),n.prototype._renderCanvas.call(this,t)},l.prototype.determineFontProperties=function(t){var e=l.fontPropertiesCache[t];if(!e){e={};var i=l.fontPropertiesCanvas,n=l.fontPropertiesContext;n.font=t;var s=Math.ceil(n.measureText("|MÉq").width),r=Math.ceil(n.measureText("M").width),o=2*r;r=1.4*r|0,i.width=s,i.height=o,n.fillStyle="#f00",n.fillRect(0,0,s,o),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText("|MÉq",0,r);var a,u,p=n.getImageData(0,0,s,o).data,h=p.length,d=4*s,c=0,_=!1;for(a=0;a<r;a++){for(u=0;u<d;u+=4)if(255!==p[c+u]){_=!0;break}if(_)break;c+=d}for(e.ascent=r-a,c=h-d,_=!1,a=o;a>r;a--){for(u=0;u<d;u+=4)if(255!==p[c+u]){_=!0;break}if(_)break;c-=d}e.descent=a-r,e.fontSize=e.ascent+e.descent,l.fontPropertiesCache[t]=e}return e},l.prototype.wordWrap=function(t){for(var e="",i=t.split("\n"),n=this._style.wordWrapWidth,s=0;s<i.length;s++){for(var r=n,o=i[s].split(" "),a=0;a<o.length;a++){var l=this.context.measureText(o[a]).width,u=l+this.context.measureText(" ").width;0===a||u>r?(a>0&&(e+="\n"),e+=o[a],r=n-l):(r-=u,e+=" "+o[a])}s<i.length-1&&(e+="\n")}return e},l.prototype.getBounds=function(t){return this.dirty&&this.updateText(),n.prototype.getBounds.call(this,t)},l.prototype.destroy=function(t){this.context=null,this.canvas=null,this._style=null,this._texture.destroy(void 0===t||t)}},1936:(t,e,i)=>{var n=i(501),s=i(6192),r=i(5585);function o(t,e,i){r.call(this),this.uid=n.uid(),this.resolution=i||1,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=e||s.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=!1,this._glTextures=[],t&&this.loadSource(t)}o.prototype=Object.create(r.prototype),o.prototype.constructor=o,t.exports=o,o.prototype.update=function(){this.realWidth=this.source.naturalWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=n.isPowerOfTwo(this.realWidth,this.realHeight),this.emit("update",this)},o.prototype.loadSource=function(t){var e=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=t,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!t.getContext){this.isLoading=!0;var i=this;t.onload=function(){t.onload=null,t.onerror=null,i.isLoading&&(i.isLoading=!1,i._sourceLoaded(),i.emit("loaded",i))},t.onerror=function(){t.onload=null,t.onerror=null,i.isLoading&&(i.isLoading=!1,i.emit("error",i))},t.complete&&t.src&&(this.isLoading=!1,t.onload=null,t.onerror=null,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this))}},o.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},o.prototype.destroy=function(){this.imageUrl?(delete n.BaseTextureCache[this.imageUrl],delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete n.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},o.prototype.dispose=function(){this.emit("dispose",this),this._glTextures.length=0},o.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},o.fromImage=function(t,e,i){var s=n.BaseTextureCache[t];if(void 0===e&&0!==t.indexOf("data:")&&(e=!0),!s){var r=new Image;e&&(r.crossOrigin=""),(s=new o(r,i)).imageUrl=t,r.src=t,n.BaseTextureCache[t]=s,s.resolution=n.getResolutionOfUrl(t)}return s},o.fromCanvas=function(t,e){t._pixiId||(t._pixiId="canvas_"+n.uid());var i=n.BaseTextureCache[t._pixiId];return i||(i=new o(t,e),n.BaseTextureCache[t._pixiId]=i),i}},7443:(t,e,i)=>{var n=i(1936),s=i(2699),r=i(7955),o=i(4598),a=i(1549),l=i(4650),u=i(6192),p=new l.Matrix;function h(t,e,i,p,h){if(!t)throw new Error("Unable to create RenderTexture, you must pass a renderer into the constructor.");e=e||100,i=i||100,h=h||u.RESOLUTION;var d=new n;if(d.width=e,d.height=i,d.resolution=h,d.scaleMode=p||u.SCALE_MODES.DEFAULT,d.hasLoaded=!0,s.call(this,d,new l.Rectangle(0,0,e,i)),this.width=e,this.height=i,this.resolution=h,this.render=null,this.renderer=t,this.renderer.type===u.RENDERER_TYPE.WEBGL){var c=this.renderer.gl;this.textureBuffer=new r(c,this.width,this.height,d.scaleMode,this.resolution),this.baseTexture._glTextures[c.id]=this.textureBuffer.texture,this.filterManager=new o(this.renderer),this.filterManager.onContextChange(),this.filterManager.resize(e,i),this.render=this.renderWebGL,this.renderer.currentRenderer.start(),this.renderer.currentRenderTarget.activate()}else this.render=this.renderCanvas,this.textureBuffer=new a(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()}h.prototype=Object.create(s.prototype),h.prototype.constructor=h,t.exports=h,h.prototype.resize=function(t,e,i){t===this.width&&e===this.height||(this.valid=t>0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,i&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},h.prototype.clear=function(){this.valid&&(this.renderer.type===u.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},h.prototype.renderWebGL=function(t,e,i,n){if(this.valid){if(n=void 0===n||n,//!updateTransform;
this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,n){t.worldTransform.identity(),t.currentBounds=null;var s,r,o=t.children;for(s=0,r=o.length;s<r;++s)o[s].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,i),this.renderer.filterManager=a}},h.prototype.renderCanvas=function(t,e,i,n){if(this.valid){n=!!n;var s=p;s.identity(),e&&s.append(e),t.worldTransform=s;var r=t.worldTransform;t.worldAlpha=1;var o,a,l=t.children;for(o=0,a=l.length;o<a;++o)l[o].updateTransform();i&&this.textureBuffer.clear();var u=this.textureBuffer.context,h=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,u),this.renderer.resolution=h,t.worldTransform=r}},h.prototype.destroy=function(){s.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},h.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},h.prototype.getBase64=function(){return this.getCanvas().toDataURL()},h.prototype.getCanvas=function(){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,i=this.textureBuffer.size.height,n=new Uint8Array(4*e*i);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,i,t.RGBA,t.UNSIGNED_BYTE,n),t.bindFramebuffer(t.FRAMEBUFFER,null);var s=new a(e,i),r=s.context.getImageData(0,0,e,i);return r.data.set(n),s.context.putImageData(r,0,0),s.canvas}return this.textureBuffer.canvas},h.prototype.getPixels=function(){var t,e;if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var i=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var n=new Uint8Array(4*t*e);return i.bindFramebuffer(i.FRAMEBUFFER,this.textureBuffer.frameBuffer),i.readPixels(0,0,t,e,i.RGBA,i.UNSIGNED_BYTE,n),i.bindFramebuffer(i.FRAMEBUFFER,null),n}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},h.prototype.getPixel=function(t,e){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var i=this.renderer.gl,n=new Uint8Array(4);return i.bindFramebuffer(i.FRAMEBUFFER,this.textureBuffer.frameBuffer),i.readPixels(t,e,1,1,i.RGBA,i.UNSIGNED_BYTE,n),i.bindFramebuffer(i.FRAMEBUFFER,null),n}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},2699:(t,e,i)=>{var n=i(1936),s=i(3367),r=i(1507),o=i(5585),a=i(4650),l=i(501);function u(t,e,i,n,s){o.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new a.Rectangle(0,0,1,1)),t instanceof u&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=i||e,this.rotate=!!s,t.hasLoaded?(this.noFrame&&(e=new a.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}u.prototype=Object.create(o.prototype),u.prototype.constructor=u,t.exports=u,Object.defineProperties(u.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),u.prototype.update=function(){this.baseTexture.update()},u.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new a.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.emit("update",this)},u.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},u.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},u.prototype.clone=function(){return new u(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},u.prototype._updateUvs=function(){this._uvs||(this._uvs=new r),this._uvs.set(this.crop,this.baseTexture,this.rotate)},u.fromImage=function(t,e,i){var s=l.TextureCache[t];return s||(s=new u(n.fromImage(t,e,i)),l.TextureCache[t]=s),s},u.fromFrame=function(t){var e=l.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},u.fromCanvas=function(t,e){return new u(n.fromCanvas(t,e))},u.fromVideo=function(t,e){return"string"==typeof t?u.fromVideoUrl(t,e):new u(s.fromVideo(t,e))},u.fromVideoUrl=function(t,e){return new u(s.fromUrl(t,e))},u.addTextureToCache=function(t,e){l.TextureCache[e]=t},u.removeTextureFromCache=function(t){var e=l.TextureCache[t];return delete l.TextureCache[t],delete l.BaseTextureCache[t],e},u.EMPTY=new u(new n)},1507:t=>{function e(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}t.exports=e,e.prototype.set=function(t,e,i){var n=e.width,s=e.height;i?(this.x0=(t.x+t.height)/n,this.y0=t.y/s,this.x1=(t.x+t.height)/n,this.y1=(t.y+t.width)/s,this.x2=t.x/n,this.y2=(t.y+t.width)/s,this.x3=t.x/n,this.y3=t.y/s):(this.x0=t.x/n,this.y0=t.y/s,this.x1=(t.x+t.width)/n,this.y1=t.y/s,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/s,this.x3=t.x/n,this.y3=(t.y+t.height)/s)}},3367:(t,e,i)=>{var n=i(1936),s=i(501);function r(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),n.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function o(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var i=document.createElement("source");return i.src=t,i.type=e,i}r.prototype=Object.create(n.prototype),r.prototype.constructor=r,t.exports=r,r.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},r.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},r.prototype._onPlayStop=function(){this.autoUpdate=!1},r.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},r.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),n.prototype.destroy.call(this)},r.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var i=s.BaseTextureCache[t._pixiId];return i||(i=new r(t,e),s.BaseTextureCache[t._pixiId]=i),i},r.fromUrl=function(t,e){var i=document.createElement("video");if(Array.isArray(t))for(var n=0;n<t.length;++n)i.appendChild(o(t[n].src||t[n],t[n].mime));else i.appendChild(o(t.src||t,t.mime));return i.load(),i.play(),r.fromVideo(i,e)},r.fromUrls=r.fromUrl},7974:(t,e,i)=>{var n=i(6192),s=i(5585),r="tick";function o(){var t=this;this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._emitter.listeners(r,!0)&&(t._requestId=requestAnimationFrame(t._tick)))},this._emitter=new s,this._requestId=null,this._maxElapsedMS=100,this.autoStart=!1,this.deltaTime=1,this.elapsedMS=1/n.TARGET_FPMS,this.lastTime=0,this.speed=1,this.started=!1}Object.defineProperties(o.prototype,{FPS:{get:function(){return 1e3/this.elapsedMS}},minFPS:{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,n.TARGET_FPMS);this._maxElapsedMS=1/e}}}),o.prototype._requestIfNeeded=function(){null===this._requestId&&this._emitter.listeners(r,!0)&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},o.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},o.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},o.prototype.add=function(t,e){return this._emitter.on(r,t,e),this._startIfPossible(),this},o.prototype.addOnce=function(t,e){return this._emitter.once(r,t,e),this._startIfPossible(),this},o.prototype.remove=function(t,e){return this._emitter.off(r,t,e),this._emitter.listeners(r,!0)||this._cancelIfNeeded(),this},o.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},o.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},o.prototype.update=function(t){var e;t=t||performance.now(),(e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(r,this.deltaTime),this.lastTime=t},t.exports=o},2410:(t,e,i)=>{var n=i(7974),s=new n;s.autoStart=!0,t.exports={shared:s,Ticker:n}},501:(t,e,i)=>{var n=i(6192),s=t.exports={_uid:0,_saidHello:!1,EventEmitter:i(5585),pluginTarget:i(7987),async:i(4083),uid:function(){return++s._uid},hex2rgb:function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",i=new Image;i.src=t+"AP804Oa6"+e;var n=new Image;n.src=t+"/wCKxvRF"+e;var s=document.createElement("canvas");s.width=6,s.height=1;var r=s.getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(i,0,0),r.drawImage(n,2,0);var o=r.getImageData(2,0,1,1).data;return 255===o[0]&&0===o[1]&&0===o[2]},getNextPowerOfTwo:function(t){if(t>0&&!(t&t-1))return t;for(var e=1;e<t;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&!(t&t-1)&&e>0&&!(e&e-1)},getResolutionOfUrl:function(t){var e=n.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!s._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+n.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+n.VERSION+" - "+t+" - http://www.pixijs.com/");s._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!i||!i.getContextAttributes().stencil)}catch(t){return!1}},sign:function(t){return t?t<0?-1:1:0},TextureCache:{},BaseTextureCache:{}}},7987:t=>{t.exports={mixin:function(t){!function(t){t.__plugins={},t.registerPlugin=function(e,i){t.__plugins[e]=i},t.prototype.initPlugins=function(){for(var e in this.plugins=this.plugins||{},t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}(t)}}},9513:(t,e,i)=>{var n=i(4651),s=i(8653),r=i(3323),o=i(8319);n.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},n.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(n,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),n.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),n.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),s.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),s.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),r.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),r.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),r.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),n.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),n.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),n.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),n.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),n}}}),n.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},r.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},n.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},n.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(o,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),n.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),n.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),n.SpriteMaskFilter}}}),n.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),n.utils.uid()}},3635:(t,e,i)=>{var n=i(4651);function s(t,e){n.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.maxLineHeight=0,this.dirty=!1,this.updateText()}s.prototype=Object.create(n.Container.prototype),s.prototype.constructor=s,t.exports=s,Object.defineProperties(s.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):s.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),s.prototype.updateText=function(){for(var t=s.fonts[this._font.name],e=new n.Point,i=null,r=[],o=0,a=0,l=[],u=0,p=this._font.size/t.size,h=-1,d=0,c=0;c<this.text.length;c++){var _=this.text.charCodeAt(c);if(h=/(\s)/.test(this.text.charAt(c))?c:h,/(?:\r\n|\r|\n)/.test(this.text.charAt(c)))l.push(o),a=Math.max(a,o),u++,e.x=0,e.y+=t.lineHeight,i=null;else if(-1!==h&&this.maxWidth>0&&e.x*p>this.maxWidth)r.splice(h,c-h),c=h,h=-1,l.push(o),a=Math.max(a,o),u++,e.x=0,e.y+=t.lineHeight,i=null;else{var f=t.chars[_];f&&(i&&f.kerning[i]&&(e.x+=f.kerning[i]),r.push({texture:f.texture,line:u,charCode:_,position:new n.Point(e.x+f.xOffset,e.y+f.yOffset)}),o=e.x+(f.texture.width+f.xOffset),e.x+=f.xAdvance,d=Math.max(d,f.yOffset+f.texture.height),i=_)}}l.push(o),a=Math.max(a,o);var T=[];for(c=0;c<=u;c++){var m=0;"right"===this._font.align?m=a-l[c]:"center"===this._font.align&&(m=(a-l[c])/2),T.push(m)}var g=r.length,I=this.tint;for(c=0;c<g;c++){var E=this._glyphs[c];E?E.texture=r[c].texture:(E=new n.Sprite(r[c].texture),this._glyphs.push(E)),E.position.x=(r[c].position.x+T[r[c].line])*p,E.position.y=r[c].position.y*p,E.scale.x=E.scale.y=p,E.tint=I,E.parent||this.addChild(E)}for(c=g;c<this._glyphs.length;++c)this.removeChild(this._glyphs[c]);this.textWidth=a*p,this.textHeight=(e.y+t.lineHeight)*p,this.maxLineHeight=d*p},s.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},s.prototype.getLocalBounds=function(){return this.validate(),n.Container.prototype.getLocalBounds.call(this)},s.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},s.fonts={}},7901:(t,e,i)=>{var n=i(4651);function s(t){n.Sprite.call(this,t[0]instanceof n.Texture?t[0]:t[0].texture),this._textures=null,this._durations=null,this.textures=t,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this._currentTime=0,this.playing=!1}s.prototype=Object.create(n.Sprite.prototype),s.prototype.constructor=s,t.exports=s,Object.defineProperties(s.prototype,{totalFrames:{get:function(){return this._textures.length}},textures:{get:function(){return this._textures},set:function(t){if(t[0]instanceof n.Texture)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}}},currentFrame:{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}}}),s.prototype.stop=function(){this.playing&&(this.playing=!1,n.ticker.shared.remove(this.update,this))},s.prototype.play=function(){this.playing||(this.playing=!0,n.ticker.shared.add(this.update,this))},s.prototype.gotoAndStop=function(t){this.stop(),this._currentTime=t,this._texture=this._textures[this.currentFrame]},s.prototype.gotoAndPlay=function(t){this._currentTime=t,this.play()},s.prototype.update=function(t){var e=this.animationSpeed*t;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this._texture=this._textures[this.currentFrame]},s.prototype.destroy=function(){this.stop(),n.Sprite.prototype.destroy.call(this)},s.fromFrames=function(t){for(var e=[],i=0;i<t.length;++i)e.push(new n.Texture.fromFrame(t[i]));return new s(e)},s.fromImages=function(t){for(var e=[],i=0;i<t.length;++i)e.push(new n.Texture.fromImage(t[i]));return new s(e)}},7377:(t,e,i)=>{var n=i(4651),s=new n.Point,r=i(7809);function o(t,e,i){n.Sprite.call(this,t),this.tileScale=new n.Point(1,1),this.tilePosition=new n.Point(0,0),this._width=e||100,this._height=i||100,this._uvs=new n.TextureUvs,this._canvasPattern=null,this.shader=new n.AbstractFilter(["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","uniform vec4 uFrame;","uniform vec4 uTransform;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vec2 coord = aTextureCoord;"," coord -= uTransform.xy;"," coord /= uTransform.zw;"," vTextureCoord = coord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform vec4 uFrame;","uniform vec2 uPixelSize;","void main(void){"," vec2 coord = mod(vTextureCoord, uFrame.zw);"," coord = clamp(coord, uPixelSize, uFrame.zw - uPixelSize);"," coord += uFrame.xy;"," gl_FragColor = texture2D(uSampler, coord) * vColor ;","}"].join("\n"),{uFrame:{type:"4fv",value:[0,0,1,1]},uTransform:{type:"4fv",value:[0,0,1,1]},uPixelSize:{type:"2fv",value:[1,1]}})}o.prototype=Object.create(n.Sprite.prototype),o.prototype.constructor=o,t.exports=o,Object.defineProperties(o.prototype,{width:{get:function(){return this._width},set:function(t){this._width=t}},height:{get:function(){return this._height},set:function(t){this._height=t}}}),o.prototype._onTextureUpdate=function(){},o.prototype._renderWebGL=function(t){var e=this._texture;if(e&&e._uvs){var i=e._uvs,n=e._frame.width,s=e._frame.height,r=e.baseTexture.width,o=e.baseTexture.height;e._uvs=this._uvs,e._frame.width=this.width,e._frame.height=this.height,this.shader.uniforms.uPixelSize.value[0]=1/r,this.shader.uniforms.uPixelSize.value[1]=1/o,this.shader.uniforms.uFrame.value[0]=i.x0,this.shader.uniforms.uFrame.value[1]=i.y0,this.shader.uniforms.uFrame.value[2]=i.x1-i.x0,this.shader.uniforms.uFrame.value[3]=i.y2-i.y0,this.shader.uniforms.uTransform.value[0]=this.tilePosition.x%(n*this.tileScale.x)/this._width,this.shader.uniforms.uTransform.value[1]=this.tilePosition.y%(s*this.tileScale.y)/this._height,this.shader.uniforms.uTransform.value[2]=r/this._width*this.tileScale.x,this.shader.uniforms.uTransform.value[3]=o/this._height*this.tileScale.y,t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this),e._uvs=i,e._frame.width=n,e._frame.height=s}},o.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.hasLoaded){var i=t.context,s=this.worldTransform,o=t.resolution,a=e.baseTexture,l=this.tilePosition.x/this.tileScale.x%e._frame.width,u=this.tilePosition.y/this.tileScale.y%e._frame.height;if(!this._canvasPattern){var p=new n.CanvasBuffer(e._frame.width,e._frame.height);16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=r.getTintedTexture(this,this.tint)),p.context.drawImage(this.tintedTexture,0,0)):p.context.drawImage(a.source,-e._frame.x,-e._frame.y),this._canvasPattern=p.context.createPattern(p.canvas,"repeat")}i.globalAlpha=this.worldAlpha,i.setTransform(s.a*o,s.b*o,s.c*o,s.d*o,s.tx*o,s.ty*o),i.scale(this.tileScale.x,this.tileScale.y),i.translate(l+this.anchor.x*-this._width,u+this.anchor.y*-this._height);var h=t.blendModes[this.blendMode];h!==t.context.globalCompositeOperation&&(i.globalCompositeOperation=h),i.fillStyle=this._canvasPattern,i.fillRect(-l,-u,this._width/this.tileScale.x,this._height/this.tileScale.y)}},o.prototype.getBounds=function(){var t,e,i,n,s=this._width,r=this._height,o=s*(1-this.anchor.x),a=s*-this.anchor.x,l=r*(1-this.anchor.y),u=r*-this.anchor.y,p=this.worldTransform,h=p.a,d=p.b,c=p.c,_=p.d,f=p.tx,T=p.ty,m=h*a+c*u+f,g=_*u+d*a+T,I=h*o+c*u+f,E=_*u+d*o+T,O=h*o+c*l+f,M=_*l+d*o+T,R=h*a+c*l+f,A=_*l+d*a+T;t=R<(t=O<(t=I<(t=m)?I:t)?O:t)?R:t,i=A<(i=M<(i=E<(i=g)?E:i)?M:i)?A:i,e=R>(e=O>(e=I>(e=m)?I:e)?O:e)?R:e,n=A>(n=M>(n=E>(n=g)?E:n)?M:n)?A:n;var y=this._bounds;return y.x=t,y.width=e-t,y.y=i,y.height=n-i,this._currentBounds=y,y},o.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,s);var e,i=this._width,n=this._height,r=-i*this.anchor.x;return s.x>r&&s.x<r+i&&(e=-n*this.anchor.y,s.y>e&&s.y<e+n)},o.prototype.destroy=function(){n.Sprite.prototype.destroy.call(this),this.tileScale=null,this._tileScaleOffset=null,this.tilePosition=null,this._uvs=null},o.fromFrame=function(t,e,i){var s=n.utils.TextureCache[t];if(!s)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new o(s,e,i)},o.fromImage=function(t,e,i,s,r){return new o(n.Texture.fromImage(t,s,r),e,i)}},4262:(t,e,i)=>{var n=i(4651),s=n.DisplayObject,r=new n.Matrix;s.prototype._cacheAsBitmap=!1,s.prototype._originalRenderWebGL=null,s.prototype._originalRenderCanvas=null,s.prototype._originalUpdateTransform=null,s.prototype._originalHitTest=null,s.prototype._originalDestroy=null,s.prototype._cachedSprite=null,Object.defineProperties(s.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._originalRenderWebGL=this.renderWebGL,this._originalRenderCanvas=this.renderCanvas,this._originalUpdateTransform=this.updateTransform,this._originalGetBounds=this.getBounds,this._originalDestroy=this.destroy,this._originalContainsPoint=this.containsPoint,this.renderWebGL=this._renderCachedWebGL,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(this._cachedSprite&&this._destroyCachedDisplayObject(),this.renderWebGL=this._originalRenderWebGL,this.renderCanvas=this._originalRenderCanvas,this.getBounds=this._originalGetBounds,this.destroy=this._originalDestroy,this.updateTransform=this._originalUpdateTransform,this.containsPoint=this._originalContainsPoint))}}}),s.prototype._renderCachedWebGL=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cachedSprite.worldAlpha=this.worldAlpha,t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this._cachedSprite))},s.prototype._initCachedDisplayObject=function(t){if(!this._cachedSprite){t.currentRenderer.flush();var e=this.getLocalBounds().clone();if(this._filters){var i=this._filters[0].padding;e.x-=i,e.y-=i,e.width+=2*i,e.height+=2*i}var s=t.currentRenderTarget,o=t.filterManager.filterStack,a=new n.RenderTexture(t,0|e.width,0|e.height),l=r;l.tx=-e.x,l.ty=-e.y,this.renderWebGL=this._originalRenderWebGL,a.render(this,l,!0,!0),t.setRenderTarget(s),t.filterManager.filterStack=o,this.renderWebGL=this._renderCachedWebGL,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new n.Sprite(a),this._cachedSprite.worldTransform=this.worldTransform,this._cachedSprite.anchor.x=-e.x/e.width,this._cachedSprite.anchor.y=-e.y/e.height,this.updateTransform(),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite)}},s.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cachedSprite.worldAlpha=this.worldAlpha,this._cachedSprite.renderCanvas(t))},s.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cachedSprite){var e=this.getLocalBounds(),i=t.context,s=new n.RenderTexture(t,0|e.width,0|e.height),o=r;o.tx=-e.x,o.ty=-e.y,this.renderCanvas=this._originalRenderCanvas,s.render(this,o,!0),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new n.Sprite(s),this._cachedSprite.worldTransform=this.worldTransform,this._cachedSprite.anchor.x=-e.x/e.width,this._cachedSprite.anchor.y=-e.y/e.height,this.updateTransform(),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite)}},s.prototype._getCachedBounds=function(){return this._cachedSprite._currentBounds=null,this._cachedSprite.getBounds()},s.prototype._destroyCachedDisplayObject=function(){this._cachedSprite._texture.destroy(),this._cachedSprite=null},s.prototype._cacheAsBitmapDestroy=function(){this.cacheAsBitmap=!1,this._originalDestroy()}},7231:(t,e,i)=>{var n=i(4651);n.DisplayObject.prototype.name=null,n.Container.prototype.getChildByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null}},4247:(t,e,i)=>{var n=i(4651);n.DisplayObject.prototype.getGlobalPosition=function(t){return t=t||new n.Point,this.parent?(this.displayObjectUpdateTransform(),t.x=this.worldTransform.tx,t.y=this.worldTransform.ty):(t.x=this.position.x,t.y=this.position.y),t}},3323:(t,e,i)=>{
/**
* @file Main export of the PIXI extras library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
i(4262),i(7231),i(4247),t.exports={MovieClip:i(7901),TilingSprite:i(7377),BitmapText:i(3635)}},4350:(t,e,i)=>{var n=i(4651),s=i(9496);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//ascii.frag","utf8"),{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},5966:(t,e,i)=>{var n=i(4651),s=i(4356),r=i(6160);function o(){n.AbstractFilter.call(this),this.blurXFilter=new s,this.blurYFilter=new r,this.defaultFilter=new n.AbstractFilter}o.prototype=Object.create(n.AbstractFilter.prototype),o.prototype.constructor=o,t.exports=o,o.prototype.applyFilter=function(t,e,i){var s=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,i),this.blurXFilter.applyFilter(t,e,s),t.blendModeManager.setBlendMode(n.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,s,i),t.blendModeManager.setBlendMode(n.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(s)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},415:(t,e,i)=>{var n=i(4651),s=i(6786);function r(t,e){n.AbstractFilter.call(this,s.readFileSync("//blurDir.vert","utf8"),s.readFileSync("//blurDir.frag","utf8"),{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new n.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.applyFilter=function(t,e,i,n){var s=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(s,e,i,n);else{var r=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(s,e,r,n);for(var o=0;o<this.passes-2;o++)t.filterManager.applyFilter(s,r,r,n);t.filterManager.applyFilter(s,r,i,n),t.filterManager.returnRenderTarget(r)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*t,this.strength=t}},dirX:{get:function(){return this.dirX},set:function(t){this.uniforms.dirX.value=t}},dirY:{get:function(){return this.dirY},set:function(t){this.uniforms.dirY.value=t}}})},6762:(t,e,i)=>{var n=i(4651),s=i(4356),r=i(6160);function o(){n.AbstractFilter.call(this),this.blurXFilter=new s,this.blurYFilter=new r}o.prototype=Object.create(n.AbstractFilter.prototype),o.prototype.constructor=o,t.exports=o,o.prototype.applyFilter=function(t,e,i){var n=t.filterManager.getRenderTarget(!0);this.blurXFilter.applyFilter(t,e,n),this.blurYFilter.applyFilter(t,n,i),t.filterManager.returnRenderTarget(n)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.padding=.5*Math.abs(t),this.blurXFilter.blur=this.blurYFilter.blur=t}},passes:{get:function(){return this.blurXFilter.passes},set:function(t){this.blurXFilter.passes=this.blurYFilter.passes=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},4356:(t,e,i)=>{var n=i(4651),s=i(6786);function r(){n.AbstractFilter.call(this,s.readFileSync("//blurX.vert","utf8"),s.readFileSync("//blur.frag","utf8"),{strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.applyFilter=function(t,e,i,n){var s=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(s,e,i,n);else{for(var r=t.filterManager.getRenderTarget(!0),o=e,a=r,l=0;l<this.passes-1;l++){t.filterManager.applyFilter(s,o,a,!0);var u=a;a=o,o=u}t.filterManager.applyFilter(s,o,i,n),t.filterManager.returnRenderTarget(r)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*Math.abs(t),this.strength=t}}})},6160:(t,e,i)=>{var n=i(4651),s=i(6786);function r(){n.AbstractFilter.call(this,s.readFileSync("//blurY.vert","utf8"),s.readFileSync("//blur.frag","utf8"),{strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.applyFilter=function(t,e,i,n){var s=this.getShader(t);if(this.uniforms.strength.value=Math.abs(this.strength)/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(s,e,i,n);else{for(var r=t.filterManager.getRenderTarget(!0),o=e,a=r,l=0;l<this.passes-1;l++){t.filterManager.applyFilter(s,o,a,!0);var u=a;a=o,o=u}t.filterManager.applyFilter(s,o,i,n),t.filterManager.returnRenderTarget(r)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*Math.abs(t),this.strength=t}}})},1327:(t,e,i)=>{var n=i(4651),s=i(6786);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//smartBlur.frag","utf8"),{delta:{type:"v2",value:{x:.1,y:0}}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r},9375:(t,e,i)=>{var n=i(4651),s=i(8884);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//colorMatrix.frag","utf8"),{m:{type:"1fv",value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype._loadMatrix=function(t,e){var i=t;(e=!!e)&&(this._multiply(i,this.uniforms.m.value,t),i=this._colorMatrix(i)),this.uniforms.m.value=i},r.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19],t},r.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},r.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.grayscale=r.prototype.greyscale,r.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},r.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),s=.213,r=.715,o=.072,a=[s+.787*i+n*-s,r+i*-r+n*-r,o+i*-o+.928*n,0,0,s+i*-s+.143*n,r+i*(1-r)+.14*n,o+i*-o+-.283*n,0,0,s+i*-s+-.787*n,r+i*-r+n*r,o+.928*i+n*o,0,0,0,0,0,1,0];this._loadMatrix(a,e)},r.prototype.contrast=function(t,e){var i=(t||0)+1,n=-128*(i-1),s=[i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0];this._loadMatrix(s,e)},r.prototype.saturate=function(t,e){var i=2*(t||0)/3+1,n=-.5*(i-1),s=[i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0];this._loadMatrix(s,e)},r.prototype.desaturate=function(t){this.saturate(-1)},r.prototype.negative=function(t){this._loadMatrix([0,1,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0],t)},r.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},r.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},r.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},r.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},r.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},r.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},r.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},r.prototype.colorTone=function(t,e,i,n,s){var r=((i=i||16770432)>>16&255)/255,o=(i>>8&255)/255,a=(255&i)/255,l=((n=n||3375104)>>16&255)/255,u=(n>>8&255)/255,p=(255&n)/255,h=[.3,.59,.11,0,0,r,o,a,t=t||.2,0,l,u,p,e=e||.15,0,r-l,o-u,a-p,0,0];this._loadMatrix(h,s)},r.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},r.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperties(r.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},3640:(t,e,i)=>{var n=i(4651),s=i(8884);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//colorStep.frag","utf8"),{step:{type:"1f",value:5}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},6982:(t,e,i)=>{var n=i(4651),s=i(8001);function r(t,e,i){n.AbstractFilter.call(this,null,s.readFileSync("//convolution.frag","utf8"),{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/i}}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},6280:(t,e,i)=>{var n=i(4651),s=i(1613);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//crosshatch.frag","utf8"))}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r},8286:(t,e,i)=>{var n=i(4651),s=i(5312);function r(t,e){var i=new n.Matrix;t.renderable=!1,n.AbstractFilter.call(this,s.readFileSync("//displacement.vert","utf8"),s.readFileSync("//displacement.frag","utf8"),{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:i.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=i,null==e&&(e=20),this.scale=new n.Point(e,e)}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.applyFilter=function(t,e,i){var n=t.filterManager;n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var s=this.getShader(t);n.applyFilter(s,e,i)},Object.defineProperties(r.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},3466:(t,e,i)=>{var n=i(4651),s=i(9032);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//dotScreen.frag","utf8"),{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},5038:(t,e,i)=>{var n=i(4651),s=i(574);function r(){n.AbstractFilter.call(this,s.readFileSync("//blurYTint.vert","utf8"),s.readFileSync("//blurYTint.frag","utf8"),{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.applyFilter=function(t,e,i,n){var s=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(s,e,i,n);else{for(var r=t.filterManager.getRenderTarget(!0),o=e,a=r,l=0;l<this.passes-1;l++){t.filterManager.applyFilter(s,o,a,n);var u=a;a=o,o=u}t.filterManager.applyFilter(s,o,i,n),t.filterManager.returnRenderTarget(r)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*t,this.strength=t}}})},1726:(t,e,i)=>{var n=i(4651),s=i(4356),r=i(5038);function o(){n.AbstractFilter.call(this),this.blurXFilter=new s,this.blurYTintFilter=new r,this.defaultFilter=new n.AbstractFilter,this.padding=30,this._dirtyPosition=!0,this._angle=45*Math.PI/180,this._distance=10,this.alpha=.75,this.hideObject=!1,this.blendMode=n.BLEND_MODES.MULTIPLY}o.prototype=Object.create(n.AbstractFilter.prototype),o.prototype.constructor=o,t.exports=o,o.prototype.applyFilter=function(t,e,i){var s=t.filterManager.getRenderTarget(!0);this._dirtyPosition&&(this._dirtyPosition=!1,this.blurYTintFilter.uniforms.offset.value[0]=Math.sin(this._angle)*this._distance,this.blurYTintFilter.uniforms.offset.value[1]=Math.cos(this._angle)*this._distance),this.blurXFilter.applyFilter(t,e,s),t.blendModeManager.setBlendMode(this.blendMode),this.blurYTintFilter.applyFilter(t,s,i),t.blendModeManager.setBlendMode(n.BLEND_MODES.NORMAL),this.hideObject||this.defaultFilter.applyFilter(t,e,i),t.filterManager.returnRenderTarget(s)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYTintFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYTintFilter.blur},set:function(t){this.blurYTintFilter.blur=t}},color:{get:function(){return n.utils.rgb2hex(this.blurYTintFilter.uniforms.color.value)},set:function(t){this.blurYTintFilter.uniforms.color.value=n.utils.hex2rgb(t)}},alpha:{get:function(){return this.blurYTintFilter.uniforms.alpha.value},set:function(t){this.blurYTintFilter.uniforms.alpha.value=t}},distance:{get:function(){return this._distance},set:function(t){this._dirtyPosition=!0,this._distance=t}},angle:{get:function(){return this._angle},set:function(t){this._dirtyPosition=!0,this._angle=t}}})},5518:(t,e,i)=>{var n=i(4651),s=i(2672);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//gray.frag","utf8"),{gray:{type:"1f",value:1}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{gray:{get:function(){return this.uniforms.gray.value},set:function(t){this.uniforms.gray.value=t}}})},8319:(t,e,i)=>{
/**
* @file Main export of the PIXI filters library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
t.exports={AsciiFilter:i(4350),BloomFilter:i(5966),BlurFilter:i(6762),BlurXFilter:i(4356),BlurYFilter:i(6160),BlurDirFilter:i(415),ColorMatrixFilter:i(9375),ColorStepFilter:i(3640),ConvolutionFilter:i(6982),CrossHatchFilter:i(6280),DisplacementFilter:i(8286),DotScreenFilter:i(3466),GrayFilter:i(5518),DropShadowFilter:i(1726),InvertFilter:i(5976),NoiseFilter:i(7898),PixelateFilter:i(240),RGBSplitFilter:i(1952),ShockwaveFilter:i(2942),SepiaFilter:i(3578),SmartBlurFilter:i(1327),TiltShiftFilter:i(6422),TiltShiftXFilter:i(3080),TiltShiftYFilter:i(4407),TwistFilter:i(7326)}},5976:(t,e,i)=>{var n=i(4651),s=i(8215);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//invert.frag","utf8"),{invert:{type:"1f",value:1}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{invert:{get:function(){return this.uniforms.invert.value},set:function(t){this.uniforms.invert.value=t}}})},7898:(t,e,i)=>{var n=i(4651),s=i(1417);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//noise.frag","utf8"),{noise:{type:"1f",value:.5}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{noise:{get:function(){return this.uniforms.noise.value},set:function(t){this.uniforms.noise.value=t}}})},240:(t,e,i)=>{var n=i(4651),s=i(9391);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//pixelate.frag","utf8"),{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"v2",value:{x:10,y:10}}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},1952:(t,e,i)=>{var n=i(4651),s=i(3220);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//rgbSplit.frag","utf8"),{red:{type:"v2",value:{x:20,y:20}},green:{type:"v2",value:{x:-20,y:20}},blue:{type:"v2",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{red:{get:function(){return this.uniforms.red.value},set:function(t){this.uniforms.red.value=t}},green:{get:function(){return this.uniforms.green.value},set:function(t){this.uniforms.green.value=t}},blue:{get:function(){return this.uniforms.blue.value},set:function(t){this.uniforms.blue.value=t}}})},3578:(t,e,i)=>{var n=i(4651),s=i(3985);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//sepia.frag","utf8"),{sepia:{type:"1f",value:1}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{sepia:{get:function(){return this.uniforms.sepia.value},set:function(t){this.uniforms.sepia.value=t}}})},2942:(t,e,i)=>{var n=i(4651),s=i(32);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//shockwave.frag","utf8"),{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},1519:(t,e,i)=>{var n=i(4651),s=i(5650);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//tiltShift.frag","utf8"),{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(r.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},6422:(t,e,i)=>{var n=i(4651),s=i(3080),r=i(4407);function o(){n.AbstractFilter.call(this),this.tiltShiftXFilter=new s,this.tiltShiftYFilter=new r}o.prototype=Object.create(n.AbstractFilter.prototype),o.prototype.constructor=o,t.exports=o,o.prototype.applyFilter=function(t,e,i){var n=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,n),this.tiltShiftYFilter.applyFilter(t,n,i),t.filterManager.returnRenderTarget(n)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},3080:(t,e,i)=>{var n=i(1519);function s(){n.call(this)}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s,s.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,i=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/i,this.uniforms.delta.value.y=e/i}},4407:(t,e,i)=>{var n=i(1519);function s(){n.call(this)}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,t.exports=s,s.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,i=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/i,this.uniforms.delta.value.y=t/i}},7326:(t,e,i)=>{var n=i(4651),s=i(6644);function r(){n.AbstractFilter.call(this,null,s.readFileSync("//twist.frag","utf8"),{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}r.prototype=Object.create(n.AbstractFilter.prototype),r.prototype.constructor=r,t.exports=r,Object.defineProperties(r.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},6619:(t,e,i)=>{i(255);var n=t.exports=i(4651);n.extras=i(3323),n.filters=i(8319),n.interaction=i(4816),n.loaders=i(5296),n.mesh=i(8653),n.loader=new n.loaders.Loader,Object.assign(n,i(9513)),i.g.PIXI=n},9440:(t,e,i)=>{var n=i(4651);function s(){this.global=new n.Point,this.target=null,this.originalEvent=null}s.prototype.constructor=s,t.exports=s,s.prototype.getLocalPosition=function(t,e,i){return t.toLocal(i||this.global,e)}},509:(t,e,i)=>{var n=i(4651),s=i(9440);function r(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0===e.autoPreventDefault||e.autoPreventDefault,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new s,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new n.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}Object.assign(n.DisplayObject.prototype,i(4241)),r.prototype.constructor=r,t.exports=r,r.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},r.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},r.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},r.prototype.update=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.interactionDOMElement&&(this.didMove?this.didMove=!1:(this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor))))},r.prototype.dispatchEvent=function(t,e,i){i.stopped||(i.target=t,i.type=e,t.emit(e,i),t[e]&&t[e](i))},r.prototype.mapPositionToPoint=function(t,e,i){var n=this.interactionDOMElement.getBoundingClientRect();t.x=(e-n.left)*(this.interactionDOMElement.width/n.width)/this.resolution,t.y=(i-n.top)*(this.interactionDOMElement.height/n.height)/this.resolution},r.prototype.processInteractive=function(t,e,i,n,s){if(!e||!e.visible)return!1;var r=e.children,o=!1;if(s=s||e.interactive,e.interactiveChildren)for(var a=r.length-1;a>=0;a--)!o&&n?o=this.processInteractive(t,r[a],i,!0,s):this.processInteractive(t,r[a],i,!1,!1);return s&&(n&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),o=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(o=e.containsPoint(t))),e.interactive&&i(e,o)),o},r.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},r.prototype.processMouseDown=function(t,e){var i=this.mouse.originalEvent,n=2===i.button||3===i.which;e&&(t[n?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,n?"rightdown":"mousedown",this.eventData))},r.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},r.prototype.processMouseUp=function(t,e){var i=this.mouse.originalEvent,n=2===i.button||3===i.which,s=n?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,n?"rightup":"mouseup",this.eventData),t[s]&&(t[s]=!1,this.dispatchEvent(t,n?"rightclick":"click",this.eventData))):t[s]&&(t[s]=!1,this.dispatchEvent(t,n?"rightupoutside":"mouseupoutside",this.eventData))},r.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},r.prototype.processMouseMove=function(t,e){this.dispatchEvent(t,"mousemove",this.eventData),this.processMouseOverOut(t,e)},r.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},r.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},r.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,i=e.length,n=0;n<i;n++){var s=e[n],r=this.getTouchData(s);r.originalEvent=t,this.eventData.data=r,this.eventData.stopped=!1,this.processInteractive(r.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(r)}},r.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},r.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,i=e.length,n=0;n<i;n++){var s=e[n],r=this.getTouchData(s);r.originalEvent=t,this.eventData.data=r,this.eventData.stopped=!1,this.processInteractive(r.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(r)}},r.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},r.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,i=e.length,n=0;n<i;n++){var s=e[n],r=this.getTouchData(s);r.originalEvent=t,this.eventData.data=r,this.eventData.stopped=!1,this.processInteractive(r.global,this.renderer._lastObjectRendered,this.processTouchMove,!0),this.returnTouchData(r)}},r.prototype.processTouchMove=function(t,e){this.dispatchEvent(t,"touchmove",this.eventData)},r.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new s),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},r.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},r.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},n.WebGLRenderer.registerPlugin("interaction",r),n.CanvasRenderer.registerPlugin("interaction",r)},4816:(t,e,i)=>{
/**
* @file Main export of the PIXI interactions library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
t.exports={InteractionData:i(9440),InteractionManager:i(509),interactiveTarget:i(4241)}},4241:t=>{t.exports={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1}},4095:(t,e,i)=>{var n=i(542).Resource,s=i(4651),r=i(3323),o=i(6944);function a(t,e){var i={},n=t.data.getElementsByTagName("info")[0],o=t.data.getElementsByTagName("common")[0];i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10),i.chars={};for(var a=t.data.getElementsByTagName("char"),l=0;l<a.length;l++){var u=parseInt(a[l].getAttribute("id"),10),p=new s.Rectangle(parseInt(a[l].getAttribute("x"),10)+e.frame.x,parseInt(a[l].getAttribute("y"),10)+e.frame.y,parseInt(a[l].getAttribute("width"),10),parseInt(a[l].getAttribute("height"),10));i.chars[u]={xOffset:parseInt(a[l].getAttribute("xoffset"),10),yOffset:parseInt(a[l].getAttribute("yoffset"),10),xAdvance:parseInt(a[l].getAttribute("xadvance"),10),kerning:{},texture:new s.Texture(e.baseTexture,p)}}var h=t.data.getElementsByTagName("kerning");for(l=0;l<h.length;l++){var d=parseInt(h[l].getAttribute("first"),10),c=parseInt(h[l].getAttribute("second"),10),_=parseInt(h[l].getAttribute("amount"),10);i.chars[c].kerning[d]=_}t.bitmapFont=i,r.BitmapText.fonts[i.font]=i}t.exports=function(){return function(t,e){if(!t.data||!t.isXml)return e();if(0===t.data.getElementsByTagName("page").length||0===t.data.getElementsByTagName("info").length||null===t.data.getElementsByTagName("info")[0].getAttribute("face"))return e();var i=o.dirname(t.url);"."===i&&(i=""),this.baseUrl&&i&&("/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(i+="/"),i=i.replace(this.baseUrl,"")),i&&"/"!==i.charAt(i.length-1)&&(i+="/");var r=i+t.data.getElementsByTagName("page")[0].getAttribute("file");if(s.utils.TextureCache[r])a(t,s.utils.TextureCache[r]),e();else{var l={crossOrigin:t.crossOrigin,loadType:n.LOAD_TYPE.IMAGE};this.add(t.name+"_image",r,l,(function(i){a(t,i.texture),e()}))}}}},5296:(t,e,i)=>{
/**
* @file Main export of the PIXI loaders library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
t.exports={Loader:i(7397),bitmapFontParser:i(4095),spritesheetParser:i(6695),textureParser:i(3968),Resource:i(542).Resource}},7397:(t,e,i)=>{var n=i(542),s=i(3968),r=i(6695),o=i(4095);function a(t,e){n.call(this,t,e);for(var i=0;i<a._pixiMiddleware.length;++i)this.use(a._pixiMiddleware[i]())}a.prototype=Object.create(n.prototype),a.prototype.constructor=a,t.exports=a,a._pixiMiddleware=[n.middleware.parsing.blob,s,r,o],a.addPixiMiddleware=function(t){a._pixiMiddleware.push(t)};var l=n.Resource;l.setExtensionXhrType("fnt",l.XHR_RESPONSE_TYPE.DOCUMENT)},6695:(t,e,i)=>{var n=i(542).Resource,s=i(6944),r=i(4651);t.exports=function(){return function(t,e){if(!t.data||!t.isJson||!t.data.frames)return e();var i={crossOrigin:t.crossOrigin,loadType:n.LOAD_TYPE.IMAGE},o=s.dirname(t.url.replace(this.baseUrl,"")),a=r.utils.getResolutionOfUrl(t.url);this.add(t.name+"_image",o+"/"+t.data.meta.image,i,(function(i){t.textures={};var n=t.data.frames;for(var s in n){var o=n[s].frame;if(o){var l=null,u=null;if(l=n[s].rotated?new r.Rectangle(o.x,o.y,o.h,o.w):new r.Rectangle(o.x,o.y,o.w,o.h),n[s].trimmed&&(u=new r.Rectangle(n[s].spriteSourceSize.x/a,n[s].spriteSourceSize.y/a,n[s].sourceSize.w/a,n[s].sourceSize.h/a)),n[s].rotated){var p=l.width;l.width=l.height,l.height=p}l.x/=a,l.y/=a,l.width/=a,l.height/=a,t.textures[s]=new r.Texture(i.texture.baseTexture,l,l.clone(),u,n[s].rotated),r.utils.TextureCache[s]=t.textures[s]}}e()}))}}},3968:(t,e,i)=>{var n=i(4651);t.exports=function(){return function(t,e){if(t.data&&t.isImage){var i=new n.BaseTexture(t.data,null,n.utils.getResolutionOfUrl(t.url));i.imageUrl=t.url,t.texture=new n.Texture(i),n.utils.BaseTextureCache[t.url]=i,n.utils.TextureCache[t.url]=t.texture}e()}}},2876:(t,e,i)=>{var n=i(4651),s=new n.Point,r=new n.Polygon;function o(t,e,i,s,r){n.Container.call(this),this._texture=null,this.uvs=i||new Float32Array([0,1,1,1,1,0,0,1]),this.vertices=e||new Float32Array([0,0,100,0,100,100,0,100]),this.indices=s||new Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=n.BLEND_MODES.NORMAL,this.canvasPadding=0,this.drawMode=r||o.DRAW_MODES.TRIANGLE_MESH,this.texture=t}o.prototype=Object.create(n.Container.prototype),o.prototype.constructor=o,t.exports=o,Object.defineProperties(o.prototype,{texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),o.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.mesh),t.plugins.mesh.render(this)},o.prototype._renderCanvas=function(t){var e=t.context,i=this.worldTransform;t.roundPixels?e.setTransform(i.a,i.b,i.c,i.d,0|i.tx,0|i.ty):e.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),this.drawMode===o.DRAW_MODES.TRIANGLE_MESH?this._renderCanvasTriangleMesh(e):this._renderCanvasTriangles(e)},o.prototype._renderCanvasTriangleMesh=function(t){for(var e=this.vertices,i=this.uvs,n=e.length/2,s=0;s<n-2;s++){var r=2*s;this._renderCanvasDrawTriangle(t,e,i,r,r+2,r+4)}},o.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,i=this.uvs,n=this.indices,s=n.length,r=0;r<s;r+=3){var o=2*n[r],a=2*n[r+1],l=2*n[r+2];this._renderCanvasDrawTriangle(t,e,i,o,a,l)}},o.prototype._renderCanvasDrawTriangle=function(t,e,i,n,s,r){var o=this._texture.baseTexture.source,a=this._texture.baseTexture.width,l=this._texture.baseTexture.height,u=e[n],p=e[s],h=e[r],d=e[n+1],c=e[s+1],_=e[r+1],f=i[n]*a,T=i[s]*a,m=i[r]*a,g=i[n+1]*l,I=i[s+1]*l,E=i[r+1]*l;if(this.canvasPadding>0){var O=this.canvasPadding/this.worldTransform.a,M=this.canvasPadding/this.worldTransform.d,R=(u+p+h)/3,A=(d+c+_)/3,y=u-R,S=d-A,v=Math.sqrt(y*y+S*S);u=R+y/v*(v+O),d=A+S/v*(v+M),S=c-A,p=R+(y=p-R)/(v=Math.sqrt(y*y+S*S))*(v+O),c=A+S/v*(v+M),S=_-A,h=R+(y=h-R)/(v=Math.sqrt(y*y+S*S))*(v+O),_=A+S/v*(v+M)}t.save(),t.beginPath(),t.moveTo(u,d),t.lineTo(p,c),t.lineTo(h,_),t.closePath(),t.clip();var C=f*I+g*m+T*E-I*m-g*T-f*E,L=u*I+g*h+p*E-I*h-g*p-u*E,b=f*p+u*m+T*h-p*m-u*T-f*h,D=f*I*h+g*p*m+u*T*E-u*I*m-g*T*h-f*p*E,w=d*I+g*_+c*E-I*_-g*c-d*E,N=f*c+d*m+T*_-c*m-d*T-f*_,F=f*I*_+g*c*m+d*T*E-d*I*m-g*T*_-f*c*E;t.transform(L/C,w/C,b/C,N/C,D/C,F/C),t.drawImage(o,0,0),t.restore()},o.prototype.renderMeshFlat=function(t){var e=this.context,i=t.vertices,n=i.length/2;e.beginPath();for(var s=1;s<n-2;s++){var r=2*s,o=i[r],a=i[r+2],l=i[r+4],u=i[r+1],p=i[r+3],h=i[r+5];e.moveTo(o,u),e.lineTo(a,p),e.lineTo(l,h)}e.fillStyle="#FF0000",e.fill(),e.closePath()},o.prototype._onTextureUpdate=function(){this.updateFrame=!0},o.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,i=e.a,s=e.b,r=e.c,o=e.d,a=e.tx,l=e.ty,u=-1/0,p=-1/0,h=1/0,d=1/0,c=this.vertices,_=0,f=c.length;_<f;_+=2){var T=c[_],m=c[_+1],g=i*T+r*m+a,I=o*m+s*T+l;h=g<h?g:h,d=I<d?I:d,u=g>u?g:u,p=I>p?I:p}if(h===-1/0||p===1/0)return n.Rectangle.EMPTY;var E=this._bounds;E.x=h,E.width=u-h,E.y=d,E.height=p-d,this._currentBounds=E}return this._currentBounds},o.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,s);var e,i,n=this.vertices,a=r.points;if(this.drawMode===o.DRAW_MODES.TRIANGLES){var l=this.indices;for(i=this.indices.length,e=0;e<i;e+=3){var u=2*l[e],p=2*l[e+1],h=2*l[e+2];if(a[0]=n[u],a[1]=n[u+1],a[2]=n[p],a[3]=n[p+1],a[4]=n[h],a[5]=n[h+1],r.contains(s.x,s.y))return!0}}else for(i=n.length,e=0;e<i;e+=6)if(a[0]=n[e],a[1]=n[e+1],a[2]=n[e+2],a[3]=n[e+3],a[4]=n[e+4],a[5]=n[e+5],r.contains(s.x,s.y))return!0;return!1},o.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},7005:(t,e,i)=>{var n=i(2876),s=i(4651);function r(t,e){n.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}r.prototype=Object.create(n.prototype),r.prototype.constructor=r,t.exports=r,r.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,i=this.indices,n=this.colors,r=this._texture._uvs,o=new s.Point(r.x0,r.y0),a=new s.Point(r.x2-r.x0,r.y2-r.y0);e[0]=0+o.x,e[1]=0+o.y,e[2]=0+o.x,e[3]=1*a.y+o.y,n[0]=1,n[1]=1,i[0]=0,i[1]=1;for(var l,u,p=t.length,h=1;h<p;h++)t[h],u=h/(p-1),e[l=4*h]=u*a.x+o.x,e[l+1]=0+o.y,e[l+2]=u*a.x+o.x,e[l+3]=1*a.y+o.y,n[l=2*h]=1,n[l+1]=1,i[l=2*h]=l,i[l+1]=l+1;this.dirty=!0}},r.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},r.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,i,n,s,r,o=t[0],a=0,l=0,u=this.vertices,p=t.length,h=0;h<p;h++)i=t[h],n=4*h,l=-((e=h<t.length-1?t[h+1]:i).x-o.x),a=e.y-o.y,10*(1-h/(p-1))>1&&1,a/=s=Math.sqrt(a*a+l*l),l/=s,a*=r=this._texture.height/2,l*=r,u[n]=i.x+a,u[n+1]=i.y+l,u[n+2]=i.x-a,u[n+3]=i.y-l,o=i;this.containerUpdateTransform()}}},8653:(t,e,i)=>{
/**
* @file Main export of the PIXI extras library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
t.exports={Mesh:i(2876),Rope:i(7005),MeshRenderer:i(6709),MeshShader:i(2003)}},6709:(t,e,i)=>{var n=i(4651),s=i(2876);function r(t){n.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,i=0;e<15e3;e+=6,i+=4)this.indices[e+0]=i+0,this.indices[e+1]=i+1,this.indices[e+2]=i+2,this.indices[e+3]=i+0,this.indices[e+4]=i+2,this.indices[e+5]=i+3}r.prototype=Object.create(n.ObjectRenderer.prototype),r.prototype.constructor=r,t.exports=r,n.WebGLRenderer.registerPlugin("mesh",r),r.prototype.onContextChange=function(){},r.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,i=e.gl,n=t._texture.baseTexture,r=e.shaderManager.plugins.meshShader,o=t.drawMode===s.DRAW_MODES.TRIANGLE_MESH?i.TRIANGLE_STRIP:i.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),i.uniformMatrix3fv(r.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),i.uniformMatrix3fv(r.uniforms.projectionMatrix._location,!1,e.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform1f(r.uniforms.alpha._location,t.worldAlpha),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.vertices,i.STATIC_DRAW),i.vertexAttribPointer(r.attributes.aVertexPosition,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.attributes.aTextureCoord,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),n._glTextures[i.id]?i.bindTexture(i.TEXTURE_2D,n._glTextures[i.id]):this.renderer.updateTexture(n),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.vertices),i.vertexAttribPointer(r.attributes.aVertexPosition,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(r.attributes.aTextureCoord,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),n._glTextures[i.id]?i.bindTexture(i.TEXTURE_2D,n._glTextures[i.id]):this.renderer.updateTexture(n),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,0,t.indices)),i.drawElements(o,t.indices.length,i.UNSIGNED_SHORT,0)},r.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},r.prototype.flush=function(){},r.prototype.start=function(){var t=this.renderer.shaderManager.plugins.meshShader;this.renderer.shaderManager.setShader(t)},r.prototype.destroy=function(){n.ObjectRenderer.prototype.destroy.call(this)}},2003:(t,e,i)=>{var n=i(4651);function s(t){n.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}s.prototype=Object.create(n.Shader.prototype),s.prototype.constructor=s,t.exports=s,n.ShaderManager.registerPlugin("meshShader",s)},9206:()=>{Math.sign||(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1})},7537:(t,e,i)=>{Object.assign||(Object.assign=i(5228))},255:(t,e,i)=>{i(7537),i(4377),i(9206)},4377:(t,e,i)=>{if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!i.g.performance||!i.g.performance.now){var n=Date.now();i.g.performance||(i.g.performance={}),i.g.performance.now=function(){return Date.now()-n}}for(var s=Date.now(),r=["ms","moz","webkit","o"],o=0;o<r.length&&!i.g.requestAnimationFrame;++o)i.g.requestAnimationFrame=i.g[r[o]+"RequestAnimationFrame"],i.g.cancelAnimationFrame=i.g[r[o]+"CancelAnimationFrame"]||i.g[r[o]+"CancelRequestAnimationFrame"];i.g.requestAnimationFrame||(i.g.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+s-e;return i<0&&(i=0),s=e,setTimeout((function(){s=Date.now(),t(performance.now())}),i)}),i.g.cancelAnimationFrame||(i.g.cancelAnimationFrame=function(t){clearTimeout(t)})},5606:t=>{var e,i,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(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(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:s}catch(t){e=s}try{i="function"==typeof clearTimeout?clearTimeout:r}catch(t){i=r}}();var a,l=[],u=!1,p=-1;function h(){u&&a&&(u=!1,a.length?l=a.concat(l):p=-1,l.length&&d())}function d(){if(!u){var t=o(h);u=!0;for(var e=l.length;e;){for(a=l,l=[];++p<e;)a&&a[p].run();p=-1,e=l.length}a=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===r||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function c(t,e){this.fun=t,this.array=e}function _(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new c(t,e)),1!==l.length||u||o(d)},c.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=_,n.addListener=_,n.once=_,n.off=_,n.removeListener=_,n.removeAllListeners=_,n.emit=_,n.prependListener=_,n.prependOnceListener=_,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},9610:(t,e,i)=>{"use strict";i.d(e,{D:()=>n});var n=function(){function t(t){var e=this;void 0===t&&(t=!1),this.ignoreMultipleSettles=t,this.isSettled=!1,this.promise=new Promise((function(t,i){e.resolveCallback=t,e.rejectCallback=i}))}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}()},5006:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),r.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},r.prototype.listeners=function(t,e){var n=i?i+t:t,s=this._events[n];if(e)return!!s;if(!s)return[];if(s.fn)return[s.fn];for(var r=0,o=s.length,a=new Array(o);r<o;r++)a[r]=s[r].fn;return a},r.prototype.emit=function(t,e,n,s,r,o){var a=i?i+t:t;if(!this._events[a])return!1;var l,u,p=this._events[a],h=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),h){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,n),!0;case 4:return p.fn.call(p.context,e,n,s),!0;case 5:return p.fn.call(p.context,e,n,s,r),!0;case 6:return p.fn.call(p.context,e,n,s,r,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];p.fn.apply(p.context,l)}else{var d,c=p.length;for(u=0;u<c;u++)switch(p[u].once&&this.removeListener(t,p[u].fn,void 0,!0),h){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,e);break;case 3:p[u].fn.call(p[u].context,e,n);break;case 4:p[u].fn.call(p[u].context,e,n,s);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];p[u].fn.apply(p[u].context,l)}}return!0},r.prototype.on=function(t,e,n){var r=new s(e,n||this),o=i?i+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},r.prototype.once=function(t,e,n){var r=new s(e,n||this,!0),o=i?i+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},r.prototype.removeListener=function(t,e,s,r){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return 0==--this._eventsCount?this._events=new n:delete this._events[o],this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||s&&a.context!==s||(0==--this._eventsCount?this._events=new n:delete this._events[o]);else{for(var l=0,u=[],p=a.length;l<p;l++)(a[l].fn!==e||r&&!a[l].once||s&&a[l].context!==s)&&u.push(a[l]);u.length?this._events[o]=1===u.length?u[0]:u:0==--this._eventsCount?this._events=new n:delete this._events[o]}return this},r.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&(0==--this._eventsCount?this._events=new n:delete this._events[e])):(this._events=new n,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=i,r.EventEmitter=r,t.exports=r},3723:(t,e,i)=>{"use strict";var n=i(4678),s=i(978),r=i(8664),o=i(5006);function a(t,e){o.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._buffer=[],this._numToLoad=0,this._queue=s.queue(this._boundLoadResource,e),this.resources={}}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,t.exports=a,a.prototype.add=a.prototype.enqueue=function(t,e,i,n){if(Array.isArray(t)){for(var s=0;s<t.length;++s)this.add(t[s]);return this}if("object"==typeof t&&(n=e||t.callback||t.onComplete,i=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(n=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof i&&(n=i,i=null),this.resources[t])throw new Error('Resource with name "'+t+'" already exists.');return e=this._prepareUrl(e),this.resources[t]=new r(t,e,i),"function"==typeof n&&this.resources[t].once("afterMiddleware",n),this._numToLoad++,this._queue.started?(this._queue.push(this.resources[t]),this._progressChunk=(100-this.progress)/(this._queue.length()+this._queue.running())):(this._buffer.push(this.resources[t]),this._progressChunk=100/this._buffer.length),this},a.prototype.before=a.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},a.prototype.after=a.prototype.use=function(t){return this._afterMiddleware.push(t),this},a.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._progressChunk=0,this._buffer.length=0,this._numToLoad=0,this._queue.kill(),this._queue.started=!1,this.resources){var e=this.resources[t];e.off("complete",this._onLoad,this),e.isLoading&&e.abort()}return this.resources={},this},a.prototype.load=function(t){if("function"==typeof t&&this.once("complete",t),this._queue.started)return this;this.emit("start",this),this.loading=!0;for(var e=0;e<this._buffer.length;++e)this._queue.push(this._buffer[e]);return this._buffer.length=0,this},a.prototype._prepareUrl=function(t){var e=n(t,{strictMode:!0});return e.protocol||!e.path||0===e.path.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t},a.prototype._loadResource=function(t,e){var i=this;t._dequeue=e,s.eachSeries(this._beforeMiddleware,(function(e,n){e.call(i,t,(function(){n(t.isComplete?{}:null)}))}),(function(){t.isComplete?i._onLoad(t):(t.once("complete",i._onLoad,i),t.load())}))},a.prototype._onComplete=function(){this.loading=!1,this.emit("complete",this,this.resources)},a.prototype._onLoad=function(t){var e=this;s.eachSeries(this._afterMiddleware,(function(i,n){i.call(e,t,n)}),(function(){t.emit("afterMiddleware",t),e._numToLoad--,e.progress+=e._progressChunk,e.emit("progress",e,t),t.error?e.emit("error",t.error,e,t):e.emit("load",e,t),0===e._numToLoad&&(e.progress=100,e._onComplete())})),t._dequeue()},a.LOAD_TYPE=r.LOAD_TYPE,a.XHR_RESPONSE_TYPE=r.XHR_RESPONSE_TYPE},8664:(t,e,i)=>{"use strict";var n=i(5006),s=i(4678),r=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),o=null;function a(t,e,i){if(n.call(this),i=i||{},"string"!=typeof t||"string"!=typeof e)throw new Error("Both name and url are required for constructing a resource.");this.name=t,this.url=e,this.isDataUrl=0===this.url.indexOf("data:"),this.data=null,this.crossOrigin=!0===i.crossOrigin?"anonymous":i.crossOrigin,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.isJson=!1,this.isXml=!1,this.isImage=!1,this.isAudio=!1,this.isVideo=!1,this.isComplete=!1,this.isLoading=!1,this._dequeue=null,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this._boundXdrOnTimeout=this._xdrOnTimeout.bind(this)}function l(t){return t.toString().replace("object ","")}function u(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}a.prototype=Object.create(n.prototype),a.prototype.constructor=a,t.exports=a,a.prototype.complete=function(){if(this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null)),this.isComplete)throw new Error("Complete called again for an already completed resource.");this.isComplete=!0,this.isLoading=!1,this.emit("complete",this)},a.prototype.abort=function(t){if(!this.error){if(this.error=new Error(t),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(void 0!==this.data.src)this.data.src="";else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this.complete()}},a.prototype.load=function(t){if(!this.isLoading)if(this.isComplete){if(t){var e=this;setTimeout((function(){t(e)}),1)}}else switch(t&&this.once("complete",t),this.isLoading=!0,this.emit("start",this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case a.LOAD_TYPE.IMAGE:this._loadElement("image");break;case a.LOAD_TYPE.AUDIO:this._loadSourceElement("audio");break;case a.LOAD_TYPE.VIDEO:this._loadSourceElement("video");break;case a.LOAD_TYPE.XHR:default:r&&this.crossOrigin?this._loadXdr():this._loadXhr()}},a.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url);var e="is"+t[0].toUpperCase()+t.substring(1);!1===this[e]&&(this[e]=!0),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1)},a.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=0;e<this.url.length;++e)this.data.appendChild(this._createSource(t,this.url[e]));else this.data.appendChild(this._createSource(t,this.url));this["is"+t[0].toUpperCase()+t.substring(1)]=!0,this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load()}else this.abort("Unsupported element "+t)},a.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;t.open("GET",this.url,!0),this.xhrType===a.XHR_RESPONSE_TYPE.JSON||this.xhrType===a.XHR_RESPONSE_TYPE.DOCUMENT?t.responseType=a.XHR_RESPONSE_TYPE.TEXT:t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},a.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXdrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){t.send()}),0)},a.prototype._createSource=function(t,e,i){i||(i=t+"/"+e.substr(e.lastIndexOf(".")+1));var n=document.createElement("source");return n.src=e,n.type=i,n},a.prototype._onError=function(t){this.abort("Failed to load element using "+t.target.nodeName)},a.prototype._onProgress=function(t){t&&t.lengthComputable&&this.emit("progress",this,t.loaded/t.total)},a.prototype._xhrOnError=function(){var t=this.xhr;this.abort(l(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},a.prototype._xhrOnAbort=function(){this.abort(l(this.xhr)+" Request was aborted by the user.")},a.prototype._xdrOnTimeout=function(){this.abort(l(this.xhr)+" Request timed out.")},a.prototype._xhrOnLoad=function(){var t=this.xhr,e=void 0===t.status?t.status:200;if(200===e||204===e||0===e&&t.responseText.length>0){if(this.xhrType===a.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===a.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(t){return void this.abort("Error trying to parse loaded json:",t)}else if(this.xhrType===a.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t.responseText,"text/xml")}else{var n=document.createElement("div");n.innerHTML=t.responseText,this.data=n}this.isXml=!0}catch(t){return void this.abort("Error trying to parse loaded xml:",t)}else this.data=t.response||t.responseText;this.complete()}else this.abort("["+t.status+"]"+t.statusText+":"+t.responseURL)},a.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,o||(o=document.createElement("a")),o.href=t;var i=!(t=s(o.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},a.prototype._determineXhrType=function(){return a._xhrTypeMap[this._getExtension()]||a.XHR_RESPONSE_TYPE.TEXT},a.prototype._determineLoadType=function(){return a._loadTypeMap[this._getExtension()]||a.LOAD_TYPE.XHR},a.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var n=t.indexOf("?");-1!==n&&(t=t.substring(0,n)),e=t.substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},a.prototype._getMimeFromXhrType=function(t){switch(t){case a.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case a.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case a.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case a.XHR_RESPONSE_TYPE.JSON:return"application/json";case a.XHR_RESPONSE_TYPE.DEFAULT:case a.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},a.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},a.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},a._loadTypeMap={gif:a.LOAD_TYPE.IMAGE,png:a.LOAD_TYPE.IMAGE,bmp:a.LOAD_TYPE.IMAGE,jpg:a.LOAD_TYPE.IMAGE,jpeg:a.LOAD_TYPE.IMAGE,tif:a.LOAD_TYPE.IMAGE,tiff:a.LOAD_TYPE.IMAGE,webp:a.LOAD_TYPE.IMAGE,tga:a.LOAD_TYPE.IMAGE,"svg+xml":a.LOAD_TYPE.IMAGE},a._xhrTypeMap={xhtml:a.XHR_RESPONSE_TYPE.DOCUMENT,html:a.XHR_RESPONSE_TYPE.DOCUMENT,htm:a.XHR_RESPONSE_TYPE.DOCUMENT,xml:a.XHR_RESPONSE_TYPE.DOCUMENT,tmx:a.XHR_RESPONSE_TYPE.DOCUMENT,tsx:a.XHR_RESPONSE_TYPE.DOCUMENT,svg:a.XHR_RESPONSE_TYPE.DOCUMENT,gif:a.XHR_RESPONSE_TYPE.BLOB,png:a.XHR_RESPONSE_TYPE.BLOB,bmp:a.XHR_RESPONSE_TYPE.BLOB,jpg:a.XHR_RESPONSE_TYPE.BLOB,jpeg:a.XHR_RESPONSE_TYPE.BLOB,tif:a.XHR_RESPONSE_TYPE.BLOB,tiff:a.XHR_RESPONSE_TYPE.BLOB,webp:a.XHR_RESPONSE_TYPE.BLOB,tga:a.XHR_RESPONSE_TYPE.BLOB,json:a.XHR_RESPONSE_TYPE.JSON,text:a.XHR_RESPONSE_TYPE.TEXT,txt:a.XHR_RESPONSE_TYPE.TEXT},a.setExtensionLoadType=function(t,e){u(a._loadTypeMap,t,e)},a.setExtensionXhrType=function(t,e){u(a._xhrTypeMap,t,e)}},978:t=>{"use strict";function e(){}function i(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}t.exports={eachSeries:function(t,e,i){var n=0,s=t.length;!function r(o){o||n===s?i&&i(o):e(t[n++],r)}()},queue:function(t,n){if(null==n)n=1;else if(0===n)throw new Error("Concurrency must not be zero");var s=0,r={_tasks:[],concurrency:n,saturated:e,unsaturated:e,buffer:n/4,empty:e,drain:e,error:e,started:!1,paused:!1,push:function(t,e){o(t,!1,e)},kill:function(){r.drain=e,r._tasks=[]},unshift:function(t,e){o(t,!0,e)},process:function(){for(;!r.paused&&s<r.concurrency&&r._tasks.length;){var e=r._tasks.shift();0===r._tasks.length&&r.empty(),(s+=1)===r.concurrency&&r.saturated(),t(e.data,i(a(e)))}},length:function(){return r._tasks.length},running:function(){return s},idle:function(){return r._tasks.length+s===0},pause:function(){!0!==r.paused&&(r.paused=!0)},resume:function(){if(!1!==r.paused){r.paused=!1;for(var t=1;t<=r.concurrency;t++)r.process()}}};function o(t,i,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout((function(){r.drain()}),1);else{var s={data:t,callback:"function"==typeof n?n:e};i?r._tasks.unshift(s):r._tasks.push(s),setTimeout((function(){r.process()}),1)}}function a(t){return function(){s-=1,t.callback.apply(t,arguments),null!=arguments[0]&&r.error(arguments[0],t.data),s<=r.concurrency-r.buffer&&r.unsaturated(),r.idle()&&r.drain(),r.process()}}return r}}},9350:t=>{"use strict";t.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,i="",n=new Array(4),s=0,r=0;s<t.length;){for(e=new Array(3),r=0;r<e.length;r++)s<t.length?e[r]=255&t.charCodeAt(s++):e[r]=0;switch(n[0]=e[0]>>2,n[1]=(3&e[0])<<4|e[1]>>4,n[2]=(15&e[1])<<2|e[2]>>6,n[3]=63&e[2],s-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(r=0;r<n.length;r++)i+=this._keyStr.charAt(n[r])}return i}}},542:(t,e,i)=>{"use strict";t.exports=i(3723),t.exports.Resource=i(8664),t.exports.middleware={caching:{memory:i(9911)},parsing:{blob:i(2796)}},t.exports.async=i(978)},9911:t=>{"use strict";var e={};t.exports=function(){return function(t,i){e[t.url]?(t.data=e[t.url],t.complete()):t.once("complete",(function(){e[this.url]=this.data})),i()}}},2796:(t,e,i)=>{"use strict";var n=i(8664),s=i(9350),r=window.URL||window.webkitURL;t.exports=function(){return function(t,e){if(t.data){if(t.xhr&&t.xhrType===n.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=r.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.isImage=!0,void(t.data.onload=function(){r.revokeObjectURL(i),t.data.onload=null,e()})}}else{var o=t.xhr.getResponseHeader("content-type");if(o&&0===o.indexOf("image"))return t.data=new Image,t.data.src="data:"+o+";base64,"+s.encodeBinary(t.xhr.responseText),t.isImage=!0,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}}},5242:(t,e,i)=>{
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=i(8287),s=n.Buffer;function r(t,e){for(var i in t)e[i]=t[i]}function o(t,e,i){return s(t,e,i)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=n:(r(n,e),e.Buffer=o),o.prototype=Object.create(s.prototype),r(s,o),o.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,i)},o.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=s(t);return void 0!==e?"string"==typeof i?n.fill(e,i):n.fill(e):n.fill(0),n},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},6944:t=>{"use strict";t.exports=path},7425:()=>{},9496:()=>{},6786:()=>{},8884:()=>{},8001:()=>{},1613:()=>{},5312:()=>{},9032:()=>{},574:()=>{},2672:()=>{},8215:()=>{},1417:()=>{},9391:()=>{},3220:()=>{},3985:()=>{},32:()=>{},5650:()=>{},6644:()=>{},1045:t=>{"use strict";t.exports={rE:"3.0.8"}}},__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 i=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.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 i=Object.create(null);__webpack_require__.r(i);var n={};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=>n[e]=()=>t[e]));return n.default=()=>t,__webpack_require__.d(i,n),i},__webpack_require__.d=(t,e)=>{for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},__webpack_require__.f={},__webpack_require__.e=t=>Promise.all(Object.keys(__webpack_require__.f).reduce(((e,i)=>(__webpack_require__.f[i](t,e),e)),[])),__webpack_require__.u=t=>t+".bundle."+{38:"8f8d27e0",97:"2c190343",195:"9cae47ea",211:"788652b1",317:"a52389ac",837:"202ac045",950:"f4a05602",960:"35ce71c3",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,i,n)=>{if(inProgress[t])inProgress[t].push(e);else{var s,r;if(void 0!==i)for(var o=document.getElementsByTagName("script"),a=0;a<o.length;a++){var l=o[a];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==dataWebpackPrefix+i){s=l;break}}s||(r=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,__webpack_require__.nc&&s.setAttribute("nonce",__webpack_require__.nc),s.setAttribute("data-webpack",dataWebpackPrefix+i),s.src=t),inProgress[t]=[e];var u=(e,i)=>{s.onerror=s.onload=null,clearTimeout(p);var n=inProgress[t];if(delete inProgress[t],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((t=>t(i))),e)return e(i)},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),r&&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&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=i[n--].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,i)=>{var n=__webpack_require__.miniCssF(t),s=__webpack_require__.p+n;if(((t,e)=>{for(var i=document.getElementsByTagName("link"),n=0;n<i.length;n++){var s=(o=i[n]).getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(s===t||s===e))return o}var r=document.getElementsByTagName("style");for(n=0;n<r.length;n++){var o;if((s=(o=r[n]).getAttribute("data-href"))===t||s===e)return o}})(n,s))return e();((t,e,i,n,s)=>{var r=document.createElement("link");r.rel="stylesheet",r.type="text/css",__webpack_require__.nc&&(r.nonce=__webpack_require__.nc),r.onerror=r.onload=i=>{if(r.onerror=r.onload=null,"load"===i.type)n();else{var o=i&&i.type,a=i&&i.target&&i.target.href||e,l=new Error("Loading CSS chunk "+t+" failed.\n("+o+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=a,r.parentNode&&r.parentNode.removeChild(r),s(l)}},r.href=e,i?i.parentNode.insertBefore(r,i.nextSibling):document.head.appendChild(r)})(t,s,null,e,i)})),e={792:0};__webpack_require__.f.miniCss=(i,n)=>{e[i]?n.push(e[i]):0!==e[i]&&{317:1}[i]&&n.push(e[i]=t(i).then((()=>{e[i]=0}),(t=>{throw delete e[i],t})))}}})(),(()=>{var t={792:0};__webpack_require__.f.j=(e,i)=>{var n=__webpack_require__.o(t,e)?t[e]:void 0;if(0!==n)if(n)i.push(n[2]);else{var s=new Promise(((i,s)=>n=t[e]=[i,s]));i.push(n[2]=s);var r=__webpack_require__.p+__webpack_require__.u(e),o=new Error;__webpack_require__.l(r,(i=>{if(__webpack_require__.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var s=i&&("load"===i.type?"missing":i.type),r=i&&i.target&&i.target.src;o.message="Loading chunk "+e+" failed.\n("+s+": "+r+")",o.name="ChunkLoadError",o.type=s,o.request=r,n[1](o)}}),"chunk-"+e,e)}};var e=(e,i)=>{var n,s,[r,o,a]=i,l=0;if(r.some((e=>0!==t[e]))){for(n in o)__webpack_require__.o(o,n)&&(__webpack_require__.m[n]=o[n]);if(a)a(__webpack_require__)}for(e&&e(i);l<r.length;l++)s=r[l],__webpack_require__.o(t,s)&&t[s]&&t[s][0](),t[s]=0},i=self.webpackChunk_mixly_python_pyodide=self.webpackChunk_mixly_python_pyodide||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var __webpack_exports__={};(()=>{"use strict";var t={};__webpack_require__.r(t),__webpack_require__.d(t,{controls_type:()=>Tt,controls_typeLists:()=>mt,lists_zip:()=>gt,lists_zip_container:()=>It,lists_zip_item:()=>Et,unpack_iterable_object:()=>Ot,variables_change:()=>_t,variables_get:()=>dt,variables_global:()=>ft,variables_set:()=>ct});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{base_setup:()=>At,controls_delay:()=>yt,controls_end_program:()=>St,controls_except:()=>Yt,controls_finally:()=>Bt,controls_flow_statements:()=>wt,controls_for:()=>Nt,controls_forEach:()=>Lt,controls_for_range:()=>Ft,controls_if:()=>vt,controls_if_else:()=>kt,controls_if_elseif:()=>xt,controls_if_if:()=>Pt,controls_lambda:()=>Xt,controls_main:()=>Rt,controls_pass:()=>Gt,controls_range:()=>Ct,controls_repeat_ext:()=>Ut,controls_thread:()=>Ht,controls_try:()=>Vt,controls_try_finally:()=>Dt,controls_whileUntil:()=>bt,datetime_fromtimestamp:()=>$t,do_while:()=>Wt,garbage_collection:()=>jt,gene_unique_identifier:()=>Qt,get_mem_alloc:()=>qt,get_mem_free:()=>Kt,get_unique_identifier:()=>zt});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{base_map:()=>ge,generate_cartesian_product:()=>Ee,math_arithmetic:()=>ie,math_bit:()=>se,math_constant:()=>te,math_constant_mp:()=>ee,math_constrain:()=>he,math_dec:()=>oe,math_degree_to_radian:()=>Me,math_indexer_number:()=>ce,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:()=>_e,math_round:()=>fe,math_selfcalcu:()=>ne,math_to_int:()=>ae,math_trig:()=>re,text_to_number:()=>Te,text_to_number_skulpt:()=>me,turn_to_int:()=>Ie});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{ascii_to_char:()=>Ce,char_to_ascii:()=>Le,number_to_text:()=>be,os_system:()=>ei,text:()=>Ae,text_capital:()=>Ye,text_center:()=>Be,text_char:()=>Se,text_char_at:()=>Ne,text_char_at2:()=>we,text_char_at3:()=>Qe,text_compareTo:()=>$e,text_compare_to:()=>Ve,text_create_with_container:()=>qe,text_create_with_item:()=>Ke,text_encode:()=>Ze,text_equals_starts_ends:()=>ke,text_eval:()=>ti,text_find:()=>Ue,text_format:()=>je,text_format_noreturn:()=>Je,text_join:()=>ve,text_join_seq:()=>Xe,text_length:()=>De,text_random_char:()=>Fe,text_replace:()=>Ge,text_split:()=>He,text_strip:()=>We,text_substring:()=>xe,text_substring2:()=>Pe,text_substring3:()=>ze,text_textarea:()=>ye});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{ENUMERATE:()=>ki,content_in_lists:()=>Yi,enumerate:()=>Vi,list_many_input:()=>Ai,list_tolist:()=>Ci,list_tolist2:()=>xi,list_trig:()=>Oi,lists_2d_get_col_row_data:()=>oi,lists_2d_get_data_with_col_row:()=>ri,lists_append_extend:()=>di,lists_change_to:()=>Ri,lists_change_to_general:()=>Si,lists_clear:()=>mi,lists_create_with:()=>ai,lists_create_with2:()=>Li,lists_create_with_container:()=>ui,lists_create_with_item:()=>pi,lists_create_with_noreturn:()=>yi,lists_create_with_text:()=>li,lists_create_with_text2:()=>bi,lists_del_general:()=>vi,lists_find:()=>Ei,lists_getIndex3:()=>Di,lists_getSublist3:()=>wi,lists_get_index:()=>ni,lists_get_random_item:()=>ci,lists_get_random_sublist:()=>_i,lists_get_sublist:()=>si,lists_insert_value:()=>fi,lists_insert_value2:()=>Fi,lists_pop:()=>Ii,lists_remove_at:()=>gi,lists_remove_at2:()=>Pi,lists_reverse:()=>Ti,lists_setIndex3:()=>Ni,lists_set_index:()=>hi,lists_sort:()=>Mi});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{dicts_add_change_del:()=>en,dicts_add_or_change:()=>qi,dicts_clear:()=>$i,dicts_create_with:()=>Ui,dicts_create_with_container:()=>Xi,dicts_create_with_item:()=>Gi,dicts_create_with_noreturn:()=>rn,dicts_deldict:()=>tn,dicts_delete:()=>Ki,dicts_get:()=>Wi,dicts_get_default:()=>ji,dicts_items:()=>Qi,dicts_keys:()=>Hi,dicts_length:()=>Zi,dicts_pop:()=>nn,dicts_setdefault:()=>sn,dicts_to_json:()=>an,dicts_to_json2:()=>pn,dicts_to_to:()=>un,dicts_todict:()=>on,dicts_update:()=>zi,dicts_values:()=>Ji,json_to_dicts:()=>ln});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{logic_boolean:()=>Tn,logic_compare:()=>dn,logic_compare_continous:()=>cn,logic_is:()=>En,logic_is_in:()=>In,logic_negate:()=>fn,logic_null:()=>mn,logic_operation:()=>_n,logic_tobool:()=>On,logic_true_or_false:()=>gn});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{sdcard_mount:()=>Hn,sdcard_use_spi_init:()=>Gn,storage_can_write_ornot:()=>bn,storage_change_dir:()=>Un,storage_close_file:()=>wn,storage_delete_file:()=>Fn,storage_file_seek:()=>kn,storage_file_tell:()=>xn,storage_file_write:()=>Sn,storage_fileopen:()=>Rn,storage_fileopen_new:()=>An,storage_fileopen_new_encoding:()=>yn,storage_get_a_line:()=>Ln,storage_get_contents:()=>Cn,storage_get_contents_without_para:()=>vn,storage_get_current_dir:()=>Vn,storage_get_file_size:()=>Pn,storage_get_filename:()=>Dn,storage_is_file:()=>Xn,storage_list_all_files:()=>Nn,storage_make_dir:()=>Yn,storage_open_file_with_os:()=>Mn,storage_rename:()=>Bn});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{procedures_callnoreturn:()=>zn,procedures_callreturn:()=>$n,procedures_defnoreturn:()=>Wn,procedures_defreturn:()=>jn,procedures_ifreturn:()=>Qn,procedures_mutatorarg:()=>Kn,procedures_mutatorcontainer:()=>qn,procedures_return:()=>Jn});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:()=>is,tuple_create_with_noreturn:()=>_s,tuple_create_with_text2:()=>ns,tuple_create_with_text_return:()=>ss,tuple_del:()=>as,tuple_find:()=>hs,tuple_getIndex:()=>rs,tuple_getSublist:()=>cs,tuple_get_random_item:()=>Ts,tuple_get_sublist:()=>fs,tuple_input:()=>gs,tuple_join:()=>ls,tuple_length:()=>os,tuple_max:()=>us,tuple_totuple:()=>ms,tuple_trig:()=>ds});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{set_add_discard:()=>Cs,set_clear:()=>ys,set_create_with:()=>Es,set_create_with_container:()=>Os,set_create_with_item:()=>Ms,set_create_with_text_return:()=>Ds,set_length:()=>Rs,set_operate:()=>Ss,set_operate_update:()=>vs,set_pop:()=>As,set_sub:()=>Ls,set_toset:()=>ws,set_update:()=>bs});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{html_content:()=>ks,html_content_more:()=>Vs,html_document:()=>Fs,html_form:()=>Bs,html_head_body:()=>xs,html_style:()=>Ys,html_style_color:()=>Xs,html_style_content:()=>Us,html_text:()=>Gs,html_title:()=>Ps});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{attribute_access:()=>nr,function_call:()=>tr,function_call_container:()=>er,function_call_item:()=>ir,raw_block:()=>js,raw_empty:()=>Ks,raw_expression:()=>qs,raw_table:()=>Ws,text_comment:()=>zs,text_print_multiple:()=>Qs,text_print_multiple_container:()=>Js,text_print_multiple_item:()=>Zs,type_check:()=>$s});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{controls_type:()=>lr,controls_typeLists:()=>ur,lists_zip:()=>pr,unpack_iterable_object:()=>hr,variables_change:()=>or,variables_get:()=>sr,variables_global:()=>ar,variables_set:()=>rr});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{Panic_with_status_code:()=>Or,base_setup:()=>cr,controls_delay:()=>Er,controls_flow_statements:()=>Ir,controls_for:()=>Tr,controls_forEach:()=>Sr,controls_for_range:()=>mr,controls_if:()=>_r,controls_interrupts:()=>Ar,controls_lambda:()=>Cr,controls_main:()=>dr,controls_millis:()=>Mr,controls_nointerrupts:()=>yr,controls_pass:()=>br,controls_range:()=>vr,controls_repeat:()=>Vr,controls_repeat_ext:()=>Nr,controls_thread:()=>Dr,controls_try_finally:()=>fr,controls_whileUntil:()=>gr,datetime_fromtimestamp:()=>Yr,do_while:()=>wr,garbage_collection:()=>Fr,gene_unique_identifier:()=>Br,get_mem_alloc:()=>Pr,get_mem_free:()=>xr,get_unique_identifier:()=>kr,reset:()=>Rr,time_sleep:()=>Lr});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{base_map:()=>ao,generate_cartesian_product:()=>uo,math_arithmetic:()=>Wr,math_bit:()=>Hr,math_constant:()=>Xr,math_constant_mp:()=>Gr,math_constrain:()=>to,math_dec:()=>zr,math_degree_to_radian:()=>ho,math_indexer_number:()=>no,math_map:()=>Zr,math_max_min:()=>Qr,math_number:()=>Ur,math_number_base_conversion:()=>eo,math_radian_to_degree:()=>po,math_random:()=>Jr,math_random_seed:()=>io,math_round:()=>so,math_selfcalcu:()=>jr,math_single:()=>qr,math_to_int:()=>$r,math_trig:()=>Kr,text_to_number:()=>ro,text_to_number_skulpt:()=>oo,turn_to_int:()=>lo});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{ascii_to_char:()=>mo,char_to_ascii:()=>go,number_to_text:()=>Io,os_system:()=>Xo,text:()=>co,text_capital:()=>Co,text_center:()=>Lo,text_char:()=>fo,text_char_at:()=>Mo,text_char_at2:()=>Oo,text_char_at3:()=>Yo,text_compareTo:()=>Vo,text_compare_to:()=>yo,text_encode:()=>Bo,text_equals_starts_ends:()=>Ao,text_eval:()=>Uo,text_find:()=>bo,text_format:()=>Po,text_format_noreturn:()=>xo,text_join:()=>To,text_join_seq:()=>Do,text_length:()=>Eo,text_random_char:()=>Ro,text_replace:()=>wo,text_split:()=>No,text_strip:()=>Fo,text_substring:()=>vo,text_substring2:()=>So,text_substring3:()=>ko,text_textarea:()=>_o});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{content_in_lists:()=>Ma,enumerate:()=>Oa,list_many_input:()=>la,list_tolist:()=>Ia,list_tolist2:()=>Ea,list_trig:()=>ra,lists_2d_get_col_row_data:()=>Wo,lists_2d_get_data_with_col_row:()=>Ho,lists_append_extend:()=>$o,lists_change_to:()=>aa,lists_change_to_general:()=>pa,lists_clear:()=>ea,lists_create_with:()=>jo,lists_create_with2:()=>da,lists_create_with_noreturn:()=>ua,lists_create_with_text:()=>qo,lists_create_with_text2:()=>ca,lists_del_general:()=>ha,lists_find:()=>ia,lists_getIndex3:()=>_a,lists_getSublist3:()=>fa,lists_get_index:()=>Ko,lists_get_random_item:()=>Qo,lists_get_random_sublist:()=>Jo,lists_get_sublist:()=>Go,lists_insert_value:()=>Zo,lists_insert_value2:()=>ma,lists_pop:()=>sa,lists_remove_at:()=>na,lists_remove_at2:()=>ga,lists_reverse:()=>ta,lists_setIndex3:()=>Ta,lists_set_index:()=>zo,lists_sort:()=>oa});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{dicts_add_change_del:()=>Pa,dicts_add_or_change:()=>va,dicts_clear:()=>ba,dicts_create_with:()=>Ra,dicts_create_with_noreturn:()=>Va,dicts_deldict:()=>Fa,dicts_delete:()=>Ca,dicts_get:()=>ya,dicts_get_default:()=>Sa,dicts_items:()=>Da,dicts_keys:()=>Aa,dicts_length:()=>Na,dicts_pop:()=>xa,dicts_setdefault:()=>ka,dicts_to_json:()=>Ba,dicts_to_json2:()=>Ga,dicts_to_to:()=>Xa,dicts_todict:()=>Ya,dicts_update:()=>La,dicts_values:()=>wa,json_to_dicts:()=>Ua});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{logic_boolean:()=>Ka,logic_compare:()=>Ha,logic_compare_continous:()=>Wa,logic_is:()=>Ja,logic_is_in:()=>Qa,logic_negate:()=>qa,logic_null:()=>za,logic_operation:()=>ja,logic_tobool:()=>Za,logic_true_or_false:()=>$a});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{sdcard_mount:()=>Ml,sdcard_use_spi_init:()=>Ol,storage_can_write_ornot:()=>ll,storage_change_dir:()=>Tl,storage_close_file:()=>pl,storage_delete_file:()=>dl,storage_file_seek:()=>fl,storage_file_tell:()=>_l,storage_file_write:()=>sl,storage_fileopen:()=>el,storage_fileopen_new:()=>il,storage_fileopen_new_encoding:()=>nl,storage_get_a_line:()=>al,storage_get_contents:()=>ol,storage_get_contents_without_para:()=>rl,storage_get_current_dir:()=>ml,storage_get_file_size:()=>cl,storage_get_filename:()=>ul,storage_is_file:()=>El,storage_list_all_files:()=>hl,storage_make_dir:()=>gl,storage_open_file_with_os:()=>tl,storage_rename:()=>Il});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{procedures_callnoreturn:()=>Sl,procedures_callreturn:()=>yl,procedures_defnoreturn:()=>Al,procedures_defreturn:()=>Rl,procedures_ifreturn:()=>vl,procedures_return:()=>Cl});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{tuple_change_to:()=>kl,tuple_create_with:()=>Ll,tuple_create_with_noreturn:()=>Ul,tuple_create_with_text2:()=>bl,tuple_create_with_text_return:()=>Dl,tuple_del:()=>Fl,tuple_find:()=>Vl,tuple_getIndex:()=>wl,tuple_getSublist:()=>Bl,tuple_get_random_item:()=>Gl,tuple_get_sublist:()=>Xl,tuple_input:()=>Wl,tuple_join:()=>Pl,tuple_length:()=>Nl,tuple_max:()=>xl,tuple_totuple:()=>Hl,tuple_trig:()=>Yl});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{set_add_discard:()=>Jl,set_clear:()=>zl,set_create_with:()=>jl,set_create_with_text_return:()=>eu,set_length:()=>ql,set_operate:()=>$l,set_operate_update:()=>Ql,set_pop:()=>Kl,set_sub:()=>Zl,set_toset:()=>iu,set_update:()=>tu});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{html_content:()=>ou,html_content_more:()=>au,html_document:()=>nu,html_form:()=>uu,html_head_body:()=>ru,html_style:()=>lu,html_style_content:()=>pu,html_text:()=>hu,html_title:()=>su});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{attribute_access:()=>gu,function_call:()=>mu,raw_block:()=>du,raw_empty:()=>_u,raw_expression:()=>cu,raw_table:()=>fu,type_check:()=>Tu});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{AI_ChooseAndGet:()=>Ru,AI_Face_match:()=>Lu,AI_ImageClassify:()=>vu,AI_ImageClassify_Func:()=>Cu,AI_Nlp:()=>wu,AI_Nlp_Func:()=>Fu,AI_Nlp_Func_sim:()=>Pu,AI_Nlp_Sim:()=>Nu,AI_Nlp_Topic:()=>xu,AI_Nlp_newsSummary:()=>ku,AI_Ocr:()=>bu,AI_Ocr_Func:()=>Du,AI_Speech_asr:()=>Su,AI_Speech_synthesis:()=>yu,AI_audio:()=>Vu,AI_client:()=>Au,AI_photo:()=>Yu,AI_result:()=>Bu});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{algorithm_add_path:()=>qu,algorithm_add_school:()=>Gu,algorithm_all_books:()=>up,algorithm_all_books_sequence:()=>pp,algorithm_book_scale:()=>Mp,algorithm_check_feet:()=>Np,algorithm_chick_calculate:()=>wp,algorithm_color_seclet:()=>Qp,algorithm_current_school:()=>Zu,algorithm_del_path:()=>Ku,algorithm_delete_book:()=>gp,algorithm_delete_books:()=>Ip,algorithm_delete_books2:()=>Ep,algorithm_divide_books:()=>Tp,algorithm_find_path:()=>Hu,algorithm_first_book:()=>hp,algorithm_fz_calc:()=>kp,algorithm_fz_calc_first_min:()=>Vp,algorithm_fz_compare:()=>Yp,algorithm_fz_move:()=>Up,algorithm_fz_set_min:()=>Bp,algorithm_get_book_num:()=>Sp,algorithm_get_current_location:()=>zp,algorithm_get_half_books:()=>mp,algorithm_hxdb_add:()=>jp,algorithm_hxdb_init_soldier:()=>Gp,algorithm_hxdb_last_line:()=>Wp,algorithm_hxdb_result:()=>qp,algorithm_hxdb_stand_in_line:()=>Hp,algorithm_init_fzsf:()=>xp,algorithm_init_hxdb:()=>Xp,algorithm_init_jttl:()=>Lp,algorithm_move_recent:()=>np,algorithm_new_path:()=>Wu,algorithm_next_book:()=>_p,algorithm_no_left:()=>$u,algorithm_no_path:()=>tp,algorithm_no_ring2:()=>dp,algorithm_not_home:()=>sp,algorithm_not_school:()=>rp,algorithm_number_add:()=>Ap,algorithm_number_zero:()=>Rp,algorithm_prepare:()=>Xu,algorithm_prepare2:()=>Ju,algorithm_prepare_2_1:()=>ep,algorithm_prepare_2_2:()=>ip,algorithm_print_book2:()=>Op,algorithm_print_divide:()=>Cp,algorithm_print_jttl_answer:()=>Fp,algorithm_print_number:()=>yp,algorithm_print_path:()=>Qu,algorithm_print_path2:()=>op,algorithm_print_sequence:()=>vp,algorithm_rabbit_add:()=>Pp,algorithm_rabbit_number_in_range:()=>Dp,algorithm_rabbit_zero:()=>bp,algorithm_return_path:()=>zu,algorithm_set_path:()=>ju,algorithm_two_left:()=>fp,algorithm_void_path:()=>$p,algorithm_yes_ring2:()=>cp,hanoi_init:()=>ap,hanoi_init_offline:()=>Kp,hanoi_move:()=>lp});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{requests_attribute:()=>ih,requests_get:()=>th,requests_get_old:()=>Zp,requests_method:()=>nh,requests_post:()=>eh});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{cv_destroy_all:()=>uh,cv_face_classifier:()=>dh,cv_face_detect:()=>ch,cv_face_detect_all:()=>_h,cv_line_rect:()=>ph,cv_read_image:()=>rh,cv_show_image:()=>oh,cv_text:()=>hh,cv_waitkey:()=>lh,cv_write_image:()=>ah});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{array_create:()=>Dh,array_toarray:()=>Wh,dataframe_aggregate_func:()=>Bd,dataframe_create:()=>gh,dataframe_create_from_index:()=>Eh,dataframe_create_from_one_index:()=>Ih,dataframe_fillna:()=>Sd,dataframe_get:()=>Xh,dataframe_groupby:()=>Yd,dataframe_head_tail:()=>kd,dataframe_info:()=>vd,dataframe_median:()=>yd,dataframe_select:()=>Vd,dataframe_sort_values:()=>xd,matrix_multiplication:()=>Rd,matrix_transpose:()=>Md,numpy_argmin_template_match:()=>_d,numpy_astype:()=>hd,numpy_c_:()=>Ed,numpy_dot:()=>Dd,numpy_linalg_det:()=>Od,numpy_linalg_inv:()=>Ad,numpy_max:()=>Ld,numpy_mean:()=>fd,numpy_mean_digit:()=>cd,numpy_min:()=>Cd,numpy_ones:()=>Id,numpy_random_random:()=>Fd,numpy_reshape:()=>pd,numpy_shape:()=>ud,numpy_size:()=>bd,numpy_square:()=>wd,numpy_std:()=>Td,numpy_sum:()=>Nd,numpy_trig:()=>Yh,pandas_drop_columns:()=>gd,pandas_dropna:()=>md,pandas_readcsv:()=>Uh,pl_axes:()=>vh,pl_bar:()=>Ph,pl_hist:()=>kh,pl_label:()=>bh,pl_legend:()=>Ch,pl_pie:()=>xh,pl_plot:()=>yh,pl_plot_bar:()=>wh,pl_plot_easy:()=>Ah,pl_plot_scatter:()=>Nh,pl_plot_xy:()=>Fh,pl_savefig:()=>Gh,pl_show:()=>Sh,pl_subplot:()=>Bh,pl_text:()=>Hh,pl_ticks:()=>Vh,pl_title:()=>Lh,plot_axes:()=>zh,plot_bar:()=>id,plot_cla:()=>Ud,plot_hist:()=>sd,plot_label:()=>Jh,plot_legend:()=>$h,plot_pie:()=>nd,plot_plot:()=>qh,plot_plot_bar:()=>Zh,plot_plot_easy:()=>jh,plot_plot_scatter:()=>td,plot_plot_xy:()=>ed,plot_savefig:()=>ad,plot_show:()=>Kh,plot_subplot:()=>od,plot_text:()=>ld,plot_ticks:()=>rd,plot_title:()=>Qh,py_sum:()=>Pd,pylab_imshow:()=>dd,series_create:()=>Th,series_create_from_index:()=>mh,series_create_from_text:()=>Oh,series_get_num:()=>Rh,series_index_value:()=>Mh});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{ds_add_node_by_attr:()=>$d,ds_add_node_by_name:()=>zd,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:()=>qd,ds_reverse_linkedlist:()=>Zd,ds_set_node_attr:()=>Kd});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{factory_block:()=>pc,factory_block_return:()=>hc,factory_block_return_with_textarea:()=>cc,factory_block_with_textarea:()=>dc,factory_callMethod_noreturn:()=>lc,factory_callMethod_return:()=>uc,factory_create_with_container:()=>sc,factory_create_with_item:()=>rc,factory_declare:()=>ac,factory_from_import:()=>ec,factory_function_noreturn:()=>nc,factory_function_return:()=>oc,factory_import:()=>ic});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{hardware_arduino_analog_read:()=>Ec,hardware_arduino_analog_write:()=>Ic,hardware_arduino_digital_read:()=>gc,hardware_arduino_digital_write:()=>mc,hardware_arduino_start:()=>fc,inout_highlow:()=>Tc});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{inout_input:()=>Oc,inout_print:()=>Mc,inout_print_container:()=>Cc,inout_print_end:()=>Ac,inout_print_inline:()=>Rc,inout_print_item:()=>Lc,inout_print_many:()=>vc,inout_type_input:()=>yc,pyinout_type_input:()=>Sc});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Zc,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Jc,IOT_EMQX_PING:()=>$c,IOT_FORMATTING:()=>Kc,IOT_FORMAT_STRING:()=>zc,IOT_MIXIO_NTP:()=>Qc,IOT_MIXIO_PUBLISH:()=>Bc,IOT_MIXIO_SUBSCRIBE:()=>Uc,IOT_MIXIO_UNSUBSCRIBE:()=>Xc,iot_checkonenet:()=>u_,iot_client_onboard:()=>i_,iot_create_with_item:()=>Vc,iot_http_client:()=>n_,iot_http_data:()=>s_,iot_mixio_check:()=>Wc,iot_mixio_connect:()=>Yc,iot_mixio_connect_only:()=>Hc,iot_mixio_disconnect:()=>Gc,iot_mixio_format_msg:()=>qc,iot_mixio_format_topic:()=>jc,iot_mixly_key:()=>e_,iot_mixly_key_py:()=>t_,iot_mqtt_client:()=>r_,iot_mqtt_data:()=>o_,iot_onenet_check:()=>Nc,iot_onenet_connect:()=>Dc,iot_onenet_disconnect:()=>wc,iot_onenet_publish:()=>Pc,iot_onenet_publish_dict:()=>Fc,iot_onenetconnect:()=>a_,iot_onenetdisconnect:()=>l_,iot_publish:()=>p_,iot_publish_container:()=>xc,iot_publish_item:()=>kc});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{pins_analog_read:()=>f_,pins_analog_write:()=>__,pins_digital_read:()=>c_,pins_digital_write:()=>d_});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{serial_close:()=>I_,serial_open:()=>T_,serial_read_b:()=>g_,serial_write:()=>m_});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{sklearn_DecisionTreeClassifier_Regressor:()=>b_,sklearn_GaussianNB:()=>N_,sklearn_KMeans:()=>x_,sklearn_KMeans_fit:()=>k_,sklearn_KNeighborsClassifier_Regressor:()=>w_,sklearn_LinearRegression:()=>C_,sklearn_RandomForestClassifier_Regressor:()=>D_,sklearn_Ridge:()=>L_,sklearn_cluster_centers_labels_inertia:()=>H_,sklearn_coef_intercept:()=>G_,sklearn_data_target:()=>y_,sklearn_fit:()=>V_,sklearn_fit_no_target:()=>Y_,sklearn_load:()=>A_,sklearn_make_blobs:()=>R_,sklearn_make_classification:()=>O_,sklearn_make_regression:()=>M_,sklearn_pca:()=>F_,sklearn_pca_fit_transform:()=>P_,sklearn_predict:()=>B_,sklearn_save_load_model:()=>W_,sklearn_score:()=>U_,sklearn_score_no_target:()=>X_,sklearn_train_test_split:()=>S_,sklearn_train_test_split_no_target:()=>v_});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{Panic_with_status_code:()=>$_,base_delay:()=>q_,controls_millis:()=>K_,controls_mstimer2:()=>J_,controls_mstimer2_start:()=>Z_,controls_mstimer2_stop:()=>tf,reset:()=>Q_,time_localtime:()=>z_,time_sleep:()=>ef});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{turtle_bgcolor:()=>Rf,turtle_bgcolor_hex:()=>wf,turtle_bgcolor_hex_new:()=>vf,turtle_circle:()=>Ef,turtle_circle_advanced:()=>Of,turtle_clear:()=>_f,turtle_clone:()=>Sf,turtle_color:()=>bf,turtle_color_hex:()=>Df,turtle_color_seclet:()=>Xf,turtle_create:()=>sf,turtle_done:()=>rf,turtle_exitonclick:()=>of,turtle_fill:()=>Tf,turtle_fillcolor:()=>yf,turtle_fillcolor_hex:()=>Ff,turtle_fillcolor_hex_new:()=>Lf,turtle_getscreen:()=>Gf,turtle_goto:()=>hf,turtle_listen:()=>qf,turtle_move:()=>af,turtle_numinput:()=>kf,turtle_onclick:()=>Wf,turtle_onkey:()=>Hf,turtle_ontimer:()=>jf,turtle_pencolor:()=>Af,turtle_pencolor_hex:()=>Nf,turtle_pencolor_hex_new:()=>Cf,turtle_penup:()=>ff,turtle_pos_shape:()=>cf,turtle_rotate:()=>lf,turtle_screen_delay:()=>pf,turtle_screen_savefig:()=>Kf,turtle_setheading:()=>uf,turtle_setxy:()=>df,turtle_shape:()=>Pf,turtle_shapesize:()=>xf,turtle_size:()=>gf,turtle_size_speed:()=>mf,turtle_speed:()=>If,turtle_textinput:()=>Vf,turtle_visible:()=>Mf,turtle_write:()=>Yf,turtle_write_format:()=>Bf,turtle_write_format_skulpt:()=>Uf});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{AI_ChooseAndGet:()=>zf,AI_Face_match:()=>tT,AI_ImageClassify:()=>Zf,AI_ImageClassify_Func:()=>oT,AI_Nlp:()=>iT,AI_Nlp_Func:()=>lT,AI_Nlp_Func_sim:()=>uT,AI_Nlp_Sim:()=>nT,AI_Nlp_Topic:()=>sT,AI_Nlp_newsSummary:()=>rT,AI_Ocr:()=>eT,AI_Ocr_Func:()=>aT,AI_Speech_asr:()=>Jf,AI_Speech_synthesis:()=>Qf,AI_audio:()=>pT,AI_client:()=>$f,AI_photo:()=>hT,AI_result:()=>dT});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{algorithm_add_path:()=>gT,algorithm_add_school:()=>_T,algorithm_all_books:()=>PT,algorithm_all_books_sequence:()=>FT,algorithm_book_scale:()=>WT,algorithm_check_feet:()=>ZT,algorithm_chick_calculate:()=>JT,algorithm_color_seclet:()=>Tm,algorithm_current_school:()=>AT,algorithm_del_path:()=>IT,algorithm_delete_book:()=>GT,algorithm_divide_books:()=>UT,algorithm_find_path:()=>fT,algorithm_first_book:()=>xT,algorithm_fz_calc:()=>nm,algorithm_fz_compare:()=>sm,algorithm_fz_move:()=>om,algorithm_fz_set_min:()=>rm,algorithm_get_current_location:()=>_m,algorithm_get_half_books:()=>XT,algorithm_hxdb_add:()=>hm,algorithm_hxdb_init_soldier:()=>lm,algorithm_hxdb_last_line:()=>pm,algorithm_hxdb_result:()=>dm,algorithm_hxdb_stand_in_line:()=>um,algorithm_init_fzsf:()=>im,algorithm_init_hxdb:()=>am,algorithm_init_jttl:()=>zT,algorithm_move_recent:()=>CT,algorithm_new_path:()=>TT,algorithm_next_book:()=>YT,algorithm_no_left:()=>OT,algorithm_no_path:()=>yT,algorithm_no_ring2:()=>kT,algorithm_not_home:()=>LT,algorithm_not_school:()=>bT,algorithm_number_add:()=>qT,algorithm_number_zero:()=>jT,algorithm_prepare:()=>cT,algorithm_prepare2:()=>RT,algorithm_prepare_2_1:()=>ST,algorithm_prepare_2_2:()=>vT,algorithm_print_book2:()=>HT,algorithm_print_jttl_answer:()=>tm,algorithm_print_number:()=>KT,algorithm_print_path:()=>MT,algorithm_print_path2:()=>DT,algorithm_rabbit_add:()=>em,algorithm_rabbit_number_in_range:()=>QT,algorithm_rabbit_zero:()=>$T,algorithm_return_path:()=>ET,algorithm_set_path:()=>mT,algorithm_two_left:()=>BT,algorithm_void_path:()=>fm,algorithm_yes_ring2:()=>VT,hanoi_init:()=>wT,hanoi_init_offline:()=>cm,hanoi_move:()=>NT});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{requests_attribute:()=>Em,requests_get:()=>gm,requests_get_old:()=>mm,requests_method:()=>Om,requests_post:()=>Im});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{array_create:()=>Vm,array_toarray:()=>Jm,dataframe_aggregate_func:()=>qg,dataframe_create:()=>ym,dataframe_create_from_index:()=>Sm,dataframe_create_from_one_index:()=>vm,dataframe_fillna:()=>Ng,dataframe_get:()=>zm,dataframe_groupby:()=>jg,dataframe_head_tail:()=>Hg,dataframe_info:()=>Fg,dataframe_median:()=>wg,dataframe_select:()=>Wg,dataframe_sort_values:()=>Gg,matrix_multiplication:()=>bg,matrix_transpose:()=>Lg,numpy_argmin_template_match:()=>Og,numpy_astype:()=>gg,numpy_c_:()=>vg,numpy_dot:()=>Vg,numpy_linalg_det:()=>Cg,numpy_linalg_inv:()=>Dg,numpy_max:()=>xg,numpy_mean:()=>Mg,numpy_mean_digit:()=>Eg,numpy_min:()=>Pg,numpy_ones:()=>Sg,numpy_random_random:()=>Ug,numpy_reshape:()=>mg,numpy_shape:()=>Tg,numpy_size:()=>kg,numpy_square:()=>Yg,numpy_std:()=>Rg,numpy_sum:()=>Bg,numpy_trig:()=>jm,pandas_drop_columns:()=>yg,pandas_dropna:()=>Ag,pandas_readcsv:()=>Km,pl_axes:()=>wm,pl_bar:()=>Xm,pl_hist:()=>Hm,pl_label:()=>km,pl_legend:()=>Pm,pl_pie:()=>Gm,pl_plot:()=>Fm,pl_plot_bar:()=>Ym,pl_plot_easy:()=>Nm,pl_plot_scatter:()=>Bm,pl_plot_xy:()=>Um,pl_savefig:()=>$m,pl_show:()=>Dm,pl_subplot:()=>qm,pl_text:()=>Qm,pl_ticks:()=>Wm,pl_title:()=>xm,plot_axes:()=>tg,plot_bar:()=>ug,plot_cla:()=>Kg,plot_hist:()=>hg,plot_label:()=>rg,plot_legend:()=>ng,plot_pie:()=>pg,plot_plot:()=>ig,plot_plot_bar:()=>og,plot_plot_easy:()=>eg,plot_plot_scatter:()=>ag,plot_plot_xy:()=>lg,plot_savefig:()=>_g,plot_show:()=>Zm,plot_subplot:()=>cg,plot_text:()=>fg,plot_ticks:()=>dg,plot_title:()=>sg,py_sum:()=>Xg,pylab_imshow:()=>Ig,series_create:()=>Rm,series_create_from_index:()=>Am,series_create_from_text:()=>Cm,series_get_num:()=>bm,series_index_value:()=>Lm});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{ds_add_node_by_attr:()=>tI,ds_add_node_by_name:()=>Zg,ds_create_linkedlist:()=>zg,ds_create_node:()=>$g,ds_del_node_by_attr:()=>iI,ds_del_node_by_name:()=>eI,ds_get_node_attr:()=>Qg,ds_reverse_linkedlist:()=>nI,ds_set_node_attr:()=>Jg});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{factory_block:()=>hI,factory_block_return:()=>dI,factory_block_return_with_textarea:()=>_I,factory_block_with_textarea:()=>cI,factory_callMethod_noreturn:()=>uI,factory_callMethod_return:()=>pI,factory_declare:()=>lI,factory_from_import:()=>sI,factory_function_noreturn:()=>oI,factory_function_return:()=>aI,factory_import:()=>rI});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{hardware_arduino_analog_read:()=>II,hardware_arduino_analog_write:()=>EI,hardware_arduino_digital_read:()=>gI,hardware_arduino_digital_write:()=>mI,hardware_arduino_start:()=>fI,inout_highlow:()=>TI});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{inout_input:()=>OI,inout_print:()=>MI,inout_print_end:()=>AI,inout_print_inline:()=>RI,inout_print_many:()=>vI,inout_type_input:()=>yI,pyinout_type_input:()=>SI});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>YI,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>XI,IOT_EMQX_PING:()=>GI,IOT_FORMATTING:()=>kI,IOT_FORMAT_STRING:()=>VI,IOT_MIXIO_NTP:()=>HI,IOT_MIXIO_PUBLISH:()=>LI,IOT_MIXIO_SUBSCRIBE:()=>bI,IOT_MIXIO_UNSUBSCRIBE:()=>DI,iot_mixio_check:()=>FI,iot_mixio_connect:()=>CI,iot_mixio_connect_only:()=>NI,iot_mixio_disconnect:()=>wI,iot_mixio_format_msg:()=>xI,iot_mixio_format_topic:()=>PI,iot_mixly_key:()=>BI,iot_mixly_key_py:()=>UI});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{pins_analog_read:()=>zI,pins_analog_write:()=>KI,pins_digital:()=>WI,pins_digital_read:()=>qI,pins_digital_write:()=>jI});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{serial_close:()=>ZI,serial_open:()=>$I,serial_read_b:()=>JI,serial_write:()=>QI});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{sklearn_DecisionTreeClassifier_Regressor:()=>uE,sklearn_GaussianNB:()=>dE,sklearn_KMeans:()=>fE,sklearn_KMeans_fit:()=>TE,sklearn_KNeighborsClassifier_Regressor:()=>hE,sklearn_LinearRegression:()=>aE,sklearn_RandomForestClassifier_Regressor:()=>pE,sklearn_Ridge:()=>lE,sklearn_cluster_centers_labels_inertia:()=>RE,sklearn_coef_intercept:()=>ME,sklearn_data_target:()=>sE,sklearn_fit:()=>mE,sklearn_fit_no_target:()=>gE,sklearn_load:()=>nE,sklearn_make_blobs:()=>iE,sklearn_make_classification:()=>tE,sklearn_make_regression:()=>eE,sklearn_pca:()=>cE,sklearn_pca_fit_transform:()=>_E,sklearn_predict:()=>IE,sklearn_save_load_model:()=>AE,sklearn_score:()=>EE,sklearn_score_no_target:()=>OE,sklearn_train_test_split:()=>rE,sklearn_train_test_split_no_target:()=>oE});var tt={};__webpack_require__.r(tt),__webpack_require__.d(tt,{controls_end_program:()=>SE,controls_millis:()=>yE,time_localtime:()=>vE});var et={};__webpack_require__.r(et),__webpack_require__.d(et,{turtle_bgcolor:()=>qE,turtle_bgcolor_hex:()=>QE,turtle_bgcolor_hex_new:()=>tO,turtle_circle:()=>GE,turtle_circle_advanced:()=>WE,turtle_clear:()=>kE,turtle_clone:()=>$E,turtle_color:()=>sO,turtle_color_hex:()=>nO,turtle_color_seclet:()=>dO,turtle_create:()=>CE,turtle_done:()=>LE,turtle_exitonclick:()=>bE,turtle_fill:()=>YE,turtle_fillcolor:()=>zE,turtle_fillcolor_hex:()=>ZE,turtle_fillcolor_hex_new:()=>iO,turtle_getscreen:()=>cO,turtle_goto:()=>PE,turtle_listen:()=>mO,turtle_move:()=>DE,turtle_numinput:()=>lO,turtle_onclick:()=>fO,turtle_onkey:()=>_O,turtle_ontimer:()=>TO,turtle_pencolor:()=>KE,turtle_pencolor_hex:()=>JE,turtle_pencolor_hex_new:()=>eO,turtle_penup:()=>VE,turtle_pos_shape:()=>xE,turtle_rotate:()=>wE,turtle_screen_delay:()=>FE,turtle_screen_savefig:()=>gO,turtle_setheading:()=>NE,turtle_setxy:()=>HE,turtle_shape:()=>rO,turtle_shapesize:()=>oO,turtle_size:()=>UE,turtle_size_speed:()=>BE,turtle_speed:()=>XE,turtle_textinput:()=>aO,turtle_visible:()=>jE,turtle_write:()=>uO,turtle_write_format:()=>pO,turtle_write_format_skulpt:()=>hO});var it={};__webpack_require__.r(it),__webpack_require__.d(it,{COPYFILE_EXCL:()=>nM,COPYFILE_FICLONE:()=>sM,COPYFILE_FICLONE_FORCE:()=>rM,F_OK:()=>ZO,O_APPEND:()=>cM,O_CREAT:()=>uM,O_DIRECT:()=>EM,O_DIRECTORY:()=>_M,O_DSYNC:()=>gM,O_EXCL:()=>pM,O_NOATIME:()=>fM,O_NOCTTY:()=>hM,O_NOFOLLOW:()=>TM,O_NONBLOCK:()=>OM,O_RDONLY:()=>oM,O_RDWR:()=>lM,O_SYMLINK:()=>IM,O_SYNC:()=>mM,O_TRUNC:()=>dM,O_WRONLY:()=>aM,R_OK:()=>tM,S_IFBLK:()=>SM,S_IFCHR:()=>CM,S_IFDIR:()=>vM,S_IFIFO:()=>LM,S_IFLNK:()=>AM,S_IFMT:()=>MM,S_IFREG:()=>yM,S_IFSOCK:()=>RM,S_IRGRP:()=>VM,S_IROTH:()=>XM,S_IRUSR:()=>FM,S_IRWXG:()=>kM,S_IRWXO:()=>UM,S_IRWXU:()=>NM,S_ISGID:()=>DM,S_ISUID:()=>bM,S_ISVTX:()=>wM,S_IWGRP:()=>YM,S_IWOTH:()=>GM,S_IWUSR:()=>PM,S_IXGRP:()=>BM,S_IXOTH:()=>HM,S_IXUSR:()=>xM,UV_FS_O_FILEMAP:()=>WM,W_OK:()=>eM,X_OK:()=>iM,size_max:()=>jM});var nt={};__webpack_require__.r(nt),__webpack_require__.d(nt,{FileHandle:()=>cy,access:()=>Yy,appendFile:()=>Ay,chmod:()=>Ny,chown:()=>Dy,constants:()=>it,copyFile:()=>Xy,cp:()=>Hy,exists:()=>fy,lchmod:()=>Fy,lchown:()=>wy,link:()=>Cy,lstat:()=>my,lutimes:()=>xy,mkdir:()=>Sy,mkdtemp:()=>Uy,open:()=>Oy,opendir:()=>Gy,readFile:()=>My,readdir:()=>vy,readlink:()=>by,realpath:()=>ky,rename:()=>_y,rm:()=>By,rmdir:()=>yy,stat:()=>Ty,statfs:()=>Wy,symlink:()=>Ly,truncate:()=>gy,unlink:()=>Iy,utimes:()=>Py,watch:()=>Vy,writeFile:()=>Ry});var st={};__webpack_require__.r(st),__webpack_require__.d(st,{BigIntStatsFs:()=>ZM,Dir:()=>ay,Dirent:()=>oy,ReadStream:()=>uy,Stats:()=>$M,StatsFs:()=>JM,WriteStream:()=>py,_synced:()=>iA,access:()=>SS,accessSync:()=>QA,appendFile:()=>iS,appendFileSync:()=>vA,chmod:()=>OS,chmodSync:()=>jA,chown:()=>IS,chownSync:()=>HA,chroot:()=>aA,close:()=>sS,closeSync:()=>LA,constants:()=>it,copyFile:()=>PS,copyFileSync:()=>ty,cp:()=>YS,cpSync:()=>sy,createReadStream:()=>DS,createWriteStream:()=>wS,exists:()=>Ky,existsSync:()=>TA,fchmod:()=>hS,fchmodSync:()=>xA,fchown:()=>pS,fchownSync:()=>PA,fdatasync:()=>aS,fdatasyncSync:()=>wA,fstat:()=>nS,fstatSync:()=>CA,fsync:()=>oS,fsyncSync:()=>DA,ftruncate:()=>rS,ftruncateSync:()=>bA,futimes:()=>dS,futimesSync:()=>kA,lchmod:()=>MS,lchmodSync:()=>qA,lchown:()=>ES,lchownSync:()=>WA,link:()=>TS,linkSync:()=>UA,lopenSync:()=>RA,lstat:()=>$y,lstatSync:()=>gA,lutimes:()=>AS,lutimesSync:()=>zA,mkdir:()=>_S,mkdirSync:()=>YA,mkdtemp:()=>FS,mkdtempSync:()=>ZA,mount:()=>ZR,mountObject:()=>rA,mounts:()=>JR,open:()=>Zy,openAsBlob:()=>US,openSync:()=>MA,opendir:()=>VS,opendirSync:()=>ny,promises:()=>nt,read:()=>uS,readFile:()=>tS,readFileSync:()=>yA,readSync:()=>FA,readdir:()=>fS,readdirSync:()=>BA,readlink:()=>gS,readlinkSync:()=>GA,readv:()=>xS,readvSync:()=>ey,realpath:()=>yS,realpathSync:()=>$A,rename:()=>qy,renameSync:()=>fA,rm:()=>NS,rmSync:()=>JA,rmdir:()=>cS,rmdirSync:()=>VA,stat:()=>zy,statSync:()=>mA,statfs:()=>BS,statfsSync:()=>ry,symlink:()=>mS,symlinkSync:()=>XA,truncate:()=>Qy,truncateSync:()=>IA,umount:()=>tA,unlink:()=>Jy,unlinkSync:()=>EA,unwatchFile:()=>LS,utimes:()=>RS,utimesSync:()=>KA,watch:()=>bS,watchFile:()=>CS,write:()=>lS,writeFile:()=>eS,writeFileSync:()=>SA,writeSync:()=>NA,writev:()=>kS,writevSync:()=>iy});const rt=Blockly;Object.assign(rt.Lang.ZhHans,{PYTHON_PYODIDE_IMAGE:"图像",PYTHON_PYODIDE_LOADING:"Python3内核载入中...",PYTHON_PYODIDE_FILE_SYSTEM:"本地文件系统",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"载入本地文件夹"}),Object.assign(rt.Lang.ZhHant,{PYTHON_PYODIDE_IMAGE:"影像",PYTHON_PYODIDE_LOADING:"Python3核心載入...",PYTHON_PYODIDE_FILE_SYSTEM:"本機檔案系統",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"載入本機資料夾"}),Object.assign(rt.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(rt.Lang.ZhHans.MSG,{}),Object.assign(rt.Lang.ZhHant.MSG,{}),Object.assign(rt.Lang.En.MSG,{});const ot=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 i=Object.create(null),n=0;n<e.length;n++)for(var s=e[n].getVars(),r=0;r<s.length;r++){var o=s[r];o&&(i[o.toLowerCase()]=o)}var a=[];for(var l in i)a.push(i[l]);return a},renameVariable:function(t,e,i){rt.Events.setGroup(!0);for(var n=i.getAllBlocks(),s=0;s<n.length;s++)n[s].renameVar(t,e);rt.Events.setGroup(!1)},flyoutCategory:function(t){var e=at.allVariables(t),i=[];((o=rt.utils.xml.createElement("block")).setAttribute("type","variables_global"),i.push(o),rt.Blocks.variables_set)&&((o=rt.utils.xml.createElement("block")).setAttribute("type","variables_set"),i.push(o));rt.Blocks.variables_change&&((o=rt.utils.xml.createElement("block")).setAttribute("type","variables_change"),i.push(o));rt.Blocks.controls_type&&((o=rt.utils.xml.createElement("block")).setAttribute("type","controls_type"),i.push(o));rt.Blocks.controls_typeLists&&((o=rt.utils.xml.createElement("block")).setAttribute("type","controls_typeLists"),i.push(o));if(rt.Blocks.lists_zip){(o=rt.utils.xml.createElement("block")).setAttribute("type","lists_zip"),o.setAttribute("inline","false");var n=rt.utils.xml.createElement("mutation");n.setAttribute("items",2),o.appendChild(n);for(let t=0;t<2;t++){let e=rt.utils.xml.createElement("value");e.setAttribute("name",`ADD${t}`),o.appendChild(e)}i.push(o)}rt.Blocks.unpack_iterable_object&&((o=rt.utils.xml.createElement("block")).setAttribute("type","unpack_iterable_object"),i.push(o));for(var s=0;s<e.length;s++){if(rt.Blocks.variables_set){(o=rt.utils.xml.createElement("block")).setAttribute("type","variables_set"),rt.Blocks.variables_get&&o.setAttribute("gap",8),(a=rt.utils.xml.createElement("field",null,e[s])).setAttribute("name","VAR");var r=rt.utils.xml.createTextNode(e[s]);a.appendChild(r),o.appendChild(a),i.push(o)}if(rt.Blocks.variables_get){var o,a;(o=rt.utils.xml.createElement("block")).setAttribute("type","variables_get"),rt.Blocks.variables_set&&o.setAttribute("gap",24),(a=rt.utils.xml.createElement("field",null,e[s])).setAttribute("name","VAR");r=rt.utils.xml.createTextNode(e[s]);a.appendChild(r),o.appendChild(a),i.push(o)}}return i},generateUniqueName:function(t){var e=at.allVariables(t),i="";if(e.length)for(var n=1,s="ijkmnopqrstuvwxyzabcdefgh",r=0,o=s.charAt(r);!i;){for(var a=!1,l=0;l<e.length;l++)if(e[l].toLowerCase()==o){a=!0;break}a?(25==++r&&(r=0,n++),o=s.charAt(r),n>1&&(o+=n)):i=o}else i="i";return i}},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 i=t.split(","),n=0;n<i.length;n++)this.reservedDict_[i[n]]=!0;this.reset()}static equals(t,e){return t.toLowerCase()==e.toLowerCase()}reset(){this.db_=Object.create(null),this.dbReverse_=Object.create(null),this.variableMap_=null}setVariableMap(t){this.variableMap_=t}getNameForUserVariable_(t){if(!this.variableMap_)return null;var e=this.variableMap_.getVariableById(t);return e?e.name:null}getName(t,e){if(e==lt.NAME_TYPE){var i=this.getNameForUserVariable_(t);i&&(t=i)}var n=t.toLowerCase()+"_"+e,s=e==lt.NAME_TYPE||e==ut.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"";if(n in this.db_)return s+this.db_[n];var r=this.getDistinctName(t,e);return this.db_[n]=r.substr(s.length),r}getDistinctName(t,e){for(var i=this.safeName_(t),n="";this.dbReverse_[i+n]||i+n in this.reservedDict_;)n=n?n+1:2;return i+=n,this.dbReverse_[i]=!0,(e==lt.NAME_TYPE||e==ut.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"")+i}safeName_(t){return t?(t=encodeURI(t.replace(/ /g,"_")).replace(/[^,\w]/g,"_"),-1!="0123456789".indexOf(t[0])&&(t="my_"+t)):t="unnamed",t}}ut.DEVELOPER_VARIABLE_TYPE="DEVELOPER_VARIABLE";const pt=ut,ht=330,dt={init:function(){this.setColour(ht),this.appendDummyInput().appendField(new rt.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(rt.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){pt.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},ct={init:function(){this.setColour(ht),this.appendValueInput("VALUE").appendField(new rt.FieldTextInput(""),"VAR").appendField(rt.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){pt.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},_t={init:function(){this.setColour(ht);var t=[[rt.Msg.LANG_MATH_INT,"int"],[rt.Msg.LANG_MATH_FLOAT,"float"],[rt.Msg.LANG_MATH_BOOLEAN,"bool"],[rt.Msg.LANG_MATH_STRING,"str"],[rt.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[rt.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[rt.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[rt.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new rt.FieldDropdown(t),"OP"),this.setOutput(!0)}},ft={init:function(){this.setColour(ht),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(rt.Msg.TEXT_PRINT_TOOLTIP)}},Tt={init:function(){this.setColour(ht),this.appendValueInput("DATA").appendField(rt.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(rt.Msg.MICROBIT_PYTHON_TYPE)}},mt={init:function(){this.setColour(ht),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new rt.FieldDropdown([[rt.Msg.LANG_MATH_INT,"int"],[rt.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[rt.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[rt.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[rt.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[rt.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[rt.Msg.LANG_MATH_BYTE,"bytes"],[rt.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return rt.Msg.MICROBIT_controls_TypeLists+{int:rt.Msg.LANG_MATH_INT,float:rt.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:rt.Msg.MIXLY_MICROBIT_TYPE_STRING,list:rt.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:rt.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:rt.Msg.MIXLY_MICROBIT_TYPE_DICT,set:rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:rt.Msg.MIXLY_MICROBIT_IMAGE,bytes:rt.Msg.LANG_MATH_BYTE,NoneType:rt.Msg.LOGIC_NULL}[e]}))}},gt={init:function(){this.setColour(ht),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new rt.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(rt.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("lists_zip_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.MIXLY_PYTHON_LISTS_ZIP);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.MIXLY_PYTHON_LISTS_ZIP)}}},It={init:function(){this.setColour(ht),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_LISTS_ZIP),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},Et={init:function(){this.setColour(ht),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM_TOOLTIP),this.contextMenu=!1}},Ot={init:function(){this.setColour(ht),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_VARIABLE_UNPACK).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM,"*"],[rt.Msg.MIXLY_MICROBIT_TYPE_DICT,"**"]]),"TYPE"),this.setTooltip(""),this.setOutput(!0)}},Mt=120,Rt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},At={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},yt={init:function(){var t=[[rt.Msg.MIXLY_mSecond,"delay"],[rt.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour(Mt),this.appendValueInput("DELAY_TIME",Number).appendField(rt.Msg.MIXLY_DELAY).appendField(new rt.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},St={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(rt.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},vt={init:function(){this.setColour(Mt),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(rt.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(rt.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new rt.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?rt.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?rt.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?rt.Msg.CONTROLS_IF_TOOLTIP_4:"":rt.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(rt.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_if_else");r.initSvg(),i.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],r=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,r=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),r=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(rt.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(rt.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(rt.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},Ct={init:function(){this.setColour(Mt),this.appendValueInput("FROM").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.PYTHON_RANGE).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Lt={init:function(){this.setColour(Mt),this.appendValueInput("LIST").setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(rt.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return rt.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(rt.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new rt.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(rt.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:rt.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},Dt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(rt.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(rt.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_finally");r.initSvg(),i.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],r=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,r=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),r=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(rt.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(rt.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},wt={init:function(){this.setColour(Mt);var t=new rt.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:rt.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},Nt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return rt.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ft={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new rt.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(rt.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return rt.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};bt.OPERATORS=[[rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],wt.OPERATORS=[[rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[rt.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Pt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},xt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(rt.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Vt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Yt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(rt.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Bt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(rt.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Ut={init:function(){this.jsonInit({message0:rt.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Mt,tooltip:rt.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:rt.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Xt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(rt.Msg.MIXLY_STAT),this.setOutput(!0)}},Gt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ht={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Wt={init:function(){this.appendDummyInput().appendField(rt.Msg.CONTROLS_REPEAT_TITLE_REPEAT+rt.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(rt.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new rt.FieldDropdown([[rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[rt.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Mt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},jt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},zt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_GET+rt.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.PROCEDURES_DEFRETURN_RETURN+rt.Msg.MIXLY_GET_UNIQUE_IDEN)}},$t={init:function(){this.setColour(Mt),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(rt.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(rt.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},Jt=230;rt.FieldTextInput.math_number_validator=function(t){return String(t)},rt.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Zt={init:function(){this.setColour(Jt),this.appendDummyInput().appendField(new rt.FieldTextInput("0",rt.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MATH_NUMBER_TOOLTIP)}},te={init:function(){this.setColour(Jt);this.appendDummyInput("").appendField(rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},ee={init:function(){this.setColour(Jt);this.appendDummyInput("").appendField(rt.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new rt.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:rt.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ie={init:function(){this.setColour(Jt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new rt.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ne={init:function(){this.setColour(Jt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new rt.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:rt.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:rt.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:rt.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:rt.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:rt.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:rt.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},se={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new rt.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},re={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new rt.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:rt.Msg.MATH_TRIG_TOOLTIP_SIN,COS:rt.Msg.MATH_TRIG_TOOLTIP_COS,TAN:rt.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:rt.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:rt.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:rt.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:rt.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},oe={init:function(){var t=[[rt.Msg.MATH_BIN,"bin"],[rt.Msg.MATH_OCT,"oct"],[rt.Msg.MATH_HEX,"hex"]];this.setColour(Jt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new rt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:rt.Msg.MATH_DEC_TOOLTIP_BIN,oct:rt.Msg.MATH_DEC_TOOLTIP_OCT,hex:rt.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},ae={init:function(){var t=[[rt.Msg.LANG_MATH_TO_ROUND,"round"],[rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[rt.Msg.LANG_MATH_TO_FLOOR,"floor"],[rt.Msg.MATH_ABS,"fabs"],[rt.Msg.MATH_SQRT,"sqrt"]];this.setColour(Jt),this.appendValueInput("A").setCheck(Number).appendField(new rt.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:rt.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:rt.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:rt.Msg.MATH_SINGLE_TOOLTIP_SQ,round:rt.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:rt.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:rt.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},le={init:function(){var t=[[rt.Msg.MIXLY_MAX,"max"],[rt.Msg.MIXLY_MIN,"min"]];this.setColour(Jt),this.appendValueInput("A").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(rt.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:rt.Msg.MIXLY_TOOLTIP_MATH_MAX,min:rt.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},ue={init:function(){var t=[[rt.Msg.MATH_TWO,"two"],[rt.Msg.MATH_EIGHT,"eight"],[rt.Msg.MATH_TEN,"ten"],[rt.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Jt),this.appendDummyInput("").appendField(rt.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new rt.FieldDropdown(t),"OP").appendField(rt.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(rt.Msg.MATH_ZHW).appendField(new rt.FieldDropdown(t),"OP2").appendField(rt.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:rt.Msg.MATH_Before_two,eight:rt.Msg.MATH_Before_eight,ten:rt.Msg.MATH_Before_ten,sixteen:rt.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:rt.Msg.MATH_Behind_two,eight:rt.Msg.MATH_Behind_eight,ten:rt.Msg.MATH_Behind_ten,sixteen:rt.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},pe={init:function(){var t=[[rt.Msg.LANG_MATH_INT,"int"],[rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Jt),this.setOutput(!0,Number),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_RANDOM).appendField(new rt.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(rt.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:rt.Msg.LANG_MATH_INT,float:rt.Msg.LANG_MATH_FLOAT_RANDOM};return rt.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},he={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(rt.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(rt.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(rt.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(rt.Msg.MATH_CONSTRAIN_TOOLTIP)}},de={init:function(){this.setColour(Jt),this.appendValueInput("NUM",Number).appendField(rt.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(rt.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(rt.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_MATH_MAP)}},ce={init:function(){this.setColour(Jt),this.appendDummyInput().appendField(new rt.FieldTextInput("0",rt.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(rt.Msg.MATH_NUMBER_TOOLTIP)}},_e={init:function(){this.setColour(Jt),this.appendValueInput("NUM").setCheck(Number).appendField(rt.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},fe={init:function(){this.setColour(Jt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(rt.Msg.MATH_ROUND).appendField(rt.Msg.TEXT_KEEP),this.appendDummyInput().appendField(rt.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(rt.Msg.MATH_ROUND_NEW_TOOLTIP)}},Te={init:function(){var t=[[rt.Msg.MIXLY_TO_INT,"int"],[rt.Msg.MIXLY_TO_FLOAT,"float"],[rt.Msg.MIXLY_TO_BITES,"b"],[rt.Msg.LANG_MATH_BYTE+rt.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Jt),this.appendValueInput("VAR").appendField(new rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:rt.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:rt.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:rt.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},me={init:function(){var t=[[rt.Msg.MIXLY_TO_INT,"int"],[rt.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Jt),this.appendValueInput("VAR").appendField(new rt.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:rt.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:rt.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},ge=de,Ie={init:function(){this.setColour(Jt),this.appendValueInput("VAR").appendField(rt.Msg.LANG_MATH_BYTE+rt.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},Ee={init:function(){this.setColour(Jt),this.itemCount_=1,this.setMutator(new rt.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(rt.Msg.MIXLY_PRODUCT+rt.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(rt.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(rt.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(rt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("lists_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput(`ADD${n}`).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput(`ADD${i}`);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else{let t=0;for(;this.getInput(`ADD${t}`);)this.removeInput(`ADD${t}`),t++}if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.MIXLY_EMPTY_REMINDER);else for(let t=0;t<this.itemCount_;t++)this.appendValueInput(`ADD${t}`),this.moveInputBefore(`ADD${t}`,"REPEAT")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Oe={init:function(){this.setColour(Jt),this.setOutput(!0),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_SET_RADIAN),this.appendDummyInput().appendField(rt.Msg.MIXLY_TRANS_TO_ANGLE),this.setInputsInline(!0)}},Me={init:function(){this.setColour(Jt),this.setOutput(!0),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_SET_DEGREE),this.appendDummyInput().appendField(rt.Msg.MIXLY_TRANS_TO_RADIAN),this.setInputsInline(!0)}},Re=160,Ae={init:function(){this.setColour(Re),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new rt.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(rt.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new rt.FieldImage(e,12,12,'"')}},ye={init:function(){this.setColour(Re),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new rt.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(rt.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new rt.FieldImage(e,12,12,'"')}};rt.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Se={init:function(){this.setColour(Re),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new rt.FieldTextInput("",rt.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(rt.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new rt.FieldImage(e,7,12,'"')}},ve={init:function(){this.setColour(Re),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(rt.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Ce={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(Number).appendField(rt.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Le={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},be={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},De={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},we={init:function(){this.WHERE_OPTIONS=[[rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[rt.Msg.TEXT_GET_INDEX_RANDOM+1+rt.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(rt.Msg.LISTS_GET_INDEX_GET,"MODE"),rt.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(rt.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+rt.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",rt.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:rt.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:rt.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:rt.Msg.TEXT_GET_INDEX_RANDOM};return rt.Msg.PROCEDURES_DEFRETURN_RETURN+rt.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+rt.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==rt.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new rt.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),rt.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Ne={init:function(){this.setHelpUrl(rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(rt.Msg.LISTS_GET_INDEX_GET+" "+rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(rt.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(rt.Msg.PROCEDURES_DEFRETURN_RETURN+rt.Msg.MIXLY_MICROBIT_TYPE_STRING+rt.Msg.LISTS_GET_INDEX_FROM_START+"n"+rt.Msg.TEXT_CHARAT2)}},Fe={init:function(){this.setHelpUrl(rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(rt.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(rt.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},Pe={init:function(){this.WHERE_OPTIONS_1=[[rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[rt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[rt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[rt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[rt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==rt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==rt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),rt.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(rt.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new rt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},xe={init:function(){this.setHelpUrl(rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(rt.Msg.LISTS_GET_INDEX_GET+" "+rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(rt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(rt.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(rt.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ke={init:function(){var t=[[rt.Msg.MIXLY_EQUALS,"==="],[rt.Msg.MIXLY_STARTSWITH,"startswith"],[rt.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Re),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new rt.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Ve={init:function(){this.setColour(Re),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(rt.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_COMPARETO_HELP)}},Ye={init:function(){var t=[[rt.Msg.TEXT_UPPER,"upper"],[rt.Msg.TEXT_TITLE,"title"],[rt.Msg.TEXT_CAPITALIZE,"capitalize"],[rt.Msg.TEXT_SWAPCASE,"swapcase"],[rt.Msg.TEXT_LOWER,"lower"]];this.setColour(Re),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new rt.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:rt.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:rt.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:rt.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:rt.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:rt.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Be={init:function(){var t=[[rt.Msg.TEXT_LJUST,"ljust"],[rt.Msg.TEXT_CENTER,"center"],[rt.Msg.TEXT_RJUST,"rjust"]];this.setColour(Re),this.appendValueInput("VAR").appendField(new rt.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(rt.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(rt.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ue={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(rt.Msg.MIXLY_MID+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(rt.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Xe={init:function(){this.setColour(Re),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ge={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(rt.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(rt.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},He={init:function(){this.setColour(Re),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(rt.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(rt.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(rt.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},We={init:function(){var t=[[rt.Msg.TEXT_TRIM_BOTH,"strip"],[rt.Msg.TEXT_TRIM_LEFT,"lstrip"],[rt.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Re),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(rt.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new rt.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(rt.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:rt.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:rt.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:rt.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},je={init:function(){this.setColour(Re),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new rt.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new rt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("text_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.PROCEDURES_BEFORE_PARAMS)}},getVars:function(){if(null!=this.getFieldValue("VAR"))return-1==this.getFieldValue("VAR").indexOf("'")&&-1==this.getFieldValue("VAR").indexOf('"')?[this.getFieldValue("VAR")]:[]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},qe={init:function(){this.setColour(Re),this.appendDummyInput().appendField(rt.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ke={init:function(){this.setColour(Re),this.appendDummyInput().appendField(rt.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},ze=xe,$e=Ve,Qe=Ne,Je={init:function(){this.setColour(Re),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendValueInput("VAR").setCheck(String),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new rt.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("text_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.PROCEDURES_BEFORE_PARAMS)}}},Ze={init:function(){this.setColour(Re);var t=[[rt.Msg.MIXPY_TEXT_ENCODE,"encode"],[rt.Msg.MIXPY_TEXT_DECODE,"decode"]];this.appendDummyInput().appendField(new rt.FieldDropdown([["ASCII","ASCII"],["gb2312","gb2312"],["gbk","gbk"],["utf-8","utf-8"],["utf-16","utf-16"],["utf-32","utf-32"]]),"CODE").appendField(" "),this.appendValueInput("VAR").appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.Msg.LANG_MATH_STRING),this.setOutput(!0,String),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXPY_TEXT_ENCODE_DECODE_TOOLTIP)}},ti={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.MIXLY_PYTHON_TEXT_EVAL),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_TEXT_EVAL_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_TEXT_EVAL_TOOLTIP)}},ei={init:function(){this.setColour(Re),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.MIXLY_PYTHON_OS_SYSTEM),this.setInputsInline(!0),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_OS_SYSTEM_TOOLTIP)}},ii=260,ni={init:function(){this.setHelpUrl(rt.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ii),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(rt.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM)}},si={init:function(){this.setHelpUrl(rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ii),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(rt.Msg.TEXT_CHARAT_TAIL+" "+rt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(rt.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setTooltip(rt.Msg.PYTHON_LISTS_GET_SUBLIST_TOOLTIP)}},ri={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row").setCheck(null).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+rt.Msg.DATAFRAME_RAW),this.appendValueInput("col").setCheck(null).appendField(rt.Msg.DATAFRAME_COLUMN),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(ii),this.setTooltip(""),this.setHelpUrl("")}},oi={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row_start").setCheck(null).appendField(rt.Msg.MIXLY_GET+" "+rt.Msg.DATAFRAME_RAW+" ["),this.appendValueInput("row_end").setCheck(null).appendField(","),this.appendValueInput("col_start").setCheck(null).appendField(") "+rt.Msg.DATAFRAME_COLUMN+" ["),this.appendValueInput("col_end").setCheck(null).appendField(","),this.appendDummyInput().appendField(") "+rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setColour(ii),this.setTooltip(""),this.setHelpUrl("")}},ai={init:function(){this.setColour(ii),this.appendDummyInput("").appendField(new rt.FieldTextInput("mylist"),"VAR").appendField("[").appendField("]"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(rt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("lists_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},li={init:function(){this.setColour(ii),this.appendDummyInput("").appendField(new rt.FieldTextInput("mylist"),"VAR").appendField(" = [").appendField(new rt.FieldTextInput("0,0,0"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_LISTS_CREATE_WITH_TEXT2)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ui={init:function(){this.setColour(ii),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_TYPE_LIST),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},pi={init:function(){this.setColour(ii),this.appendDummyInput().appendField(rt.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},hi={init:function(){this.setColour(ii),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(rt.Msg.MIXLY_MICROBIT_LIST_ASSIGN_AT),this.appendValueInput("TO").appendField(rt.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.LANG_LISTS_SET_INDEX_TOOLTIP)}},di={init:function(){this.setColour(ii),this.TYPE=[[rt.Msg.MIXLY_blockpy_set_add,"append"],[rt.Msg.MIXLY_MICROBIT_LIST_EXTEND,"extend"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(new rt.FieldDropdown(this.TYPE),"OP").appendField(rt.Msg.MIXLY_MICROBIT_LIST_A_ITEM),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_JS_LIST_TO_END),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{append:rt.Msg.MIXLY_TOOLTIP_LIST_APPEND,extend:rt.Msg.LISTS_EXTEND_TOOLTIP}[e]}))}},ci={init:function(){this.setColour(ii),this.appendValueInput("LIST"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+rt.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},_i={init:function(){this.setColour(ii),this.appendValueInput("LIST"),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+rt.Msg.MIXLY_MICROBIT_RANDOM),this.appendDummyInput().appendField(rt.Msg.LANG_LISTS_GET_INDEX2+rt.Msg.LISTS_GET_RANDOM_SUBLIST),this.setTooltip(rt.Msg.LISTS_GET_RANDOM_SUBLIST_TOOLTIP),this.setOutput(!0,"List")}},fi={init:function(){this.setColour(ii),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(rt.Msg.MIXLY_MICROBIT_JS_LIST_INSERT_AT),this.appendValueInput("VALUE").appendField(rt.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.LANG_LISTS_SET_INDEX_TOOLTIP),this.setTooltip(rt.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT)}},Ti={init:function(){this.setColour(ii),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_JS_LIST_REVERSE),this.setTooltip(rt.Msg.LANG_LISTS_CLEAR_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mi={init:function(){this.setColour(ii),this.appendValueInput("VAR"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROPYTHON_CLEAR),this.setTooltip(rt.Msg.LANG_LISTS_REVERSE_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gi={init:function(){this.setColour(ii),this.TYPE=[[rt.Msg.SERIES_INDEX,"del"],[rt.Msg.MIXLY_MICROBIT_JS_I2C_VALUE,"remove"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(rt.Msg.MIXLY_MIXPY_LISTS_REMOVE).appendField(new rt.FieldDropdown(this.TYPE),"OP"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{del:rt.Msg.LISTS_SET_INDEX_TOOLTIP_DELETE,remove:rt.Msg.MIXLY_TOOLTIP_LIST_REMOVE}[e]}))}},Ii={init:function(){this.setColour(ii),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(rt.Msg.MIXLY_MICROBIT_LIST_POP),this.appendDummyInput().appendField(rt.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM)}},Ei={init:function(){var t=[[rt.Msg.MIXLY_LIST_INDEX,"INDEX"],[rt.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(ii),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(rt.Msg.HTML_VALUE),this.appendDummyInput().appendField(rt.Msg.MIXLY_DE).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{INDEX:rt.Msg.MIXLY_TOOLTIP_LIST_FIND_INDEX,COUNT:rt.Msg.MIXLY_TOOLTIP_LIST_FIND_COUNT}[t]}))}},Oi={init:function(){var t=[[rt.Msg.MIXLY_LIST_LEN,"LEN"],[rt.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[rt.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[rt.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[rt.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[rt.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[rt.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[rt.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(ii),this.setOutput(!0,Number),this.appendValueInput("data"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{LEN:rt.Msg.LISTS_LENGTH_TOOLTIP,SUM:rt.Msg.MATH_ONLIST_TOOLTIP_SUM,MAX:rt.Msg.MATH_ONLIST_TOOLTIP_MAX,MIN:rt.Msg.MATH_ONLIST_TOOLTIP_MIN,AVERAGE:rt.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:rt.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:rt.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:rt.Msg.MATH_ONLIST_TOOLTIP_STD_DEV}[t]}))}},Mi={init:function(){this.jsonInit({args0:[{type:"input_value",name:"LIST",check:"List"},{type:"field_dropdown",name:"TYPE",options:[[rt.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[rt.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[rt.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[rt.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[rt.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]}],message0:rt.Msg.LISTS_SORT_TITLE,inputsInline:!0,output:"List",colour:ii,tooltip:rt.Msg.LISTS_SORT_TOOLTIP,helpUrl:rt.Msg.LISTS_SORT_HELPURL})}},Ri={init:function(){var t=[[rt.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[rt.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD,"array"]];this.setColour(ii),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput("").appendField(rt.Msg.A_TO_B).appendField(new rt.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{tuple:rt.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_TUPLE,set:rt.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_SET,array:rt.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_ARRAY}[t]})),this.setInputsInline(!0),this.setOutput(!0)}},Ai={init:function(){this.setColour(ii),this.appendDummyInput("").appendField("[").appendField(new rt.FieldTextInput("0,0,0"),"CONTENT").appendField("]"),this.setInputsInline(!0),this.setOutput(!0)}},yi={init:function(){this.setColour(ii),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new rt.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(rt.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("lists_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Si={init:function(){var t=[[rt.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[rt.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(ii),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(rt.Msg.A_TO_B).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0)}},vi={init:function(){this.setColour(ii),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(rt.Msg.OBJECT_DELETE),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ci={init:function(){this.setColour(ii),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TOLIST),this.setOutput(!0,"List"),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOLIST)}},Li=ai,bi=li,Di=ni,wi=si,Ni=hi,Fi=fi,Pi=gi,xi=Ci,ki={init:function(){this.setColour(ii),this.appendValueInput("VAR").appendField(rt.Msg.blockpy_USE_LIST),this.appendDummyInput().appendField(rt.Msg.MIXLY_TO_INDEX_SEQUENCE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},Vi={init:function(){this.setColour(ii),this.appendDummyInput().appendField(rt.Msg.blockpy_USE_LIST),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(rt.Msg.MIXLY_TO_INDEX_SEQUENCE).appendField(rt.Msg.MIXLY_INDEX+rt.Msg.MIXLY_STARTSWITH),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},Yi={init:function(){this.setColour(ii),this.appendValueInput("CON"),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_MIXGO_MUSIC_SHOW_IN),this.appendValueInput("LIST"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MID),this.setInputsInline(!0),this.setOutput(!0)}},Bi=345,Ui={init:function(){this.setColour(Bi),this.appendDummyInput("").appendField(new rt.FieldTextInput("mydict"),"VAR").appendField(new rt.FieldLabel(rt.Msg.DICTS_CREATE_WITH_INPUT_WITH),"TIP"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("dicts_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.getField("TIP").setValue(rt.Msg.DICTS_CREATE_EMPTY_TITLE);else{this.getField("TIP").setValue(rt.Msg.DICTS_CREATE_WITH_INPUT_WITH);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldTextInput(t.length>e?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xi={init:function(){this.setColour(Bi),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Gi={init:function(){this.setColour(Bi),this.appendDummyInput().appendField(rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Hi={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.DICT_KEYS),this.setTooltip(rt.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Wi={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(rt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(rt.Msg.DICTS_GET_TOOLTIP)}},ji={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(rt.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(rt.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(rt.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(rt.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},qi={init:function(){this.setColour(Bi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(rt.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(rt.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ki={init:function(){this.setColour(Bi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(rt.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(rt.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DICTS_DELETE_TOOLTIP)}},zi={init:function(){this.setColour(Bi),this.appendValueInput("DICT2").setCheck("Dict").appendField(rt.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(rt.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MID),this.setTooltip(rt.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$i={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.DICT_CLEAR),this.setTooltip(rt.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qi={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.DICT_ITEMS),this.setTooltip(rt.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Ji={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.DICT_VALUES),this.setTooltip(rt.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Zi={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_LENGTH),this.setTooltip(rt.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},tn={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.DICT_DELDICT),this.setTooltip(rt.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},en={init:function(){this.MODE=[[rt.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[rt.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(rt.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=rt.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=rt.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==rt.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new rt.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},nn={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(rt.Msg.DICTS_ADD_VALUE),this.setTooltip(rt.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},sn={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(rt.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(rt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DICTS_SETDEFAULT_TOOLTIP)}},rn={init:function(){this.setColour(Bi),this.appendDummyInput("").appendField(new rt.FieldLabel(rt.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new rt.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("dicts_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.getField("TIP").setValue(rt.Msg.LOGIC_NULL+rt.Msg.MIXLY_MICROBIT_TYPE_DICT);else{this.getField("TIP").setValue(rt.Msg.MIXLY_MICROBIT_TYPE_DICT);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldTextInput(t.length>e?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},on={init:function(){this.setColour(Bi),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},an={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TO_JSON),this.setTooltip(rt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},ln={init:function(){this.setColour(Bi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},un={init:function(){this.setColour(Bi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},pn={init:function(){this.setColour(Bi),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TO_JSON),this.setTooltip(rt.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},hn=210,dn={init:function(){var t=rt.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(hn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:rt.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:rt.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:rt.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:rt.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:rt.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:rt.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},cn={init:function(){var t=rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=rt.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(hn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new rt.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new rt.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},_n={init:function(){var t=[[rt.Msg.LOGIC_OPERATION_AND,"AND"],[rt.Msg.LOGIC_OPERATION_OR,"OR"],[rt.Msg.LOGIC_OPERATION_NOR,"NOR"],[rt.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(hn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:rt.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:rt.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:rt.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:rt.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},fn={init:function(){this.setColour(hn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(rt.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(rt.Msg.LOGIC_NEGATE_TOOLTIP)}},Tn={init:function(){var t=[[rt.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[rt.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(hn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new rt.FieldDropdown(t),"BOOL"),this.setTooltip(rt.Msg.LOGIC_BOOLEAN_TOOLTIP)}},mn={init:function(){this.setColour(hn),this.setOutput(!0),this.appendDummyInput().appendField(rt.Msg.LOGIC_NULL),this.setTooltip(rt.Msg.LOGIC_NULL_TOOLTIP)}},gn={init:function(){this.setColour(hn),this.appendValueInput("A"),this.appendValueInput("B").appendField(rt.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(rt.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},In={init:function(){var t=[[rt.Msg.TEXT_APPEND_TO,"in"],[rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(hn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new rt.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(rt.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(rt.Msg.IN)}},En={init:function(){var t=[[rt.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[rt.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(hn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new rt.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},On={init:function(){this.setColour(hn),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Mn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(rt.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Rn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=rt.Msg.MIXLY_USE,n=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=rt.Msg.MIXLY_BELONG;return i+{r:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},An={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=rt.Msg.MIXLY_USE,n=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=rt.Msg.MIXLY_BELONG,o=rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+n+s+o}))}},yn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(rt.Msg.MIXPY_TEXT_ENCODE).appendField(new rt.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=rt.Msg.MIXLY_USE,n=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=rt.Msg.MIXLY_BELONG,o=rt.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+n+s+o}))}},Sn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+rt.Msg.MIXLY_MICROBIT_TYPE_STRING+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},vn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Cn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Ln={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(rt.Msg.MICROBIT_PYTHON_TYPE)}},bn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(rt.Msg.HTML_FILE),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Dn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},wn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},Nn={init:function(){this.setColour(0),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Fn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Pn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},kn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},Vn={init:function(){this.setColour(0),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Yn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return rt.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+rt.Msg.MIXLY_ESP32_SET+{mkdir:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Bn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(rt.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},Un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Xn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.HTML_FILE,"isfile"],[rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:rt.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Gn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(rt.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_SETUP+rt.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(rt.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(rt.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Wn={init:function(){var t=rt.Procedures.findLegalName("",this),e=new rt.FieldTextInput(t,rt.Procedures.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new rt.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&rt.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(rt.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(rt.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(rt.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(rt.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=rt.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),rt.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{rt.Events.enable()}},mutationToDom:function(t){var e=rt.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i<this.argumentVarModels_.length;i++){var n=rt.utils.xml.createElement("arg"),s=this.argumentVarModels_[i];n.setAttribute("name",s.name),n.setAttribute("varid",s.getId()),t&&this.paramIds_&&n.setAttribute("paramId",this.paramIds_[i]),e.appendChild(n)}return this.hasStatements_||e.setAttribute("statements","false"),e},domToMutation:function(t){this.arguments_=[],this.argumentVarModels_=[];for(var e,i=0;e=t.childNodes[i];i++)if("arg"==e.nodeName.toLowerCase()){var n=e.getAttribute("name"),s=e.getAttribute("varid")||e.getAttribute("varId");this.arguments_.push(n);var r=rt.Variables.getOrCreateVariablePackage(this.workspace,s,n,"");null!=r?this.argumentVarModels_.push(r):console.log("Failed to create a variable with name "+n+", ignoring.")}this.updateParams_(),rt.Procedures.mutateCallers(this),this.setStatements_("false"!==t.getAttribute("statements"))},saveExtraState:function(){if(!this.argumentVarModels_.length&&this.hasStatements_)return null;const t=Object.create(null);if(this.argumentVarModels_.length){t.params=[];for(let e=0;e<this.argumentVarModels_.length;e++)t.params.push({name:this.argumentVarModels_[e].name,id:this.argumentVarModels_[e].getId()})}return this.hasStatements_||(t.hasStatements=!1),t},loadExtraState:function(t){if(this.arguments_=[],this.argumentVarModels_=[],t.params)for(let e=0;e<t.params.length;e++){const i=t.params[e],n=rt.Variables.getOrCreateVariablePackage(this.workspace,i.id,i.name,"");this.arguments_.push(n.name),this.argumentVarModels_.push(n)}this.updateParams_(),rt.Procedures.mutateCallers(this),this.setStatements_(!1!==t.hasStatements)},decompose:function(t){var e=rt.utils.xml.createElement("block");e.setAttribute("type","procedures_mutatorcontainer");var i=rt.utils.xml.createElement("statement");i.setAttribute("name","STACK"),e.appendChild(i);for(var n=i,s=0;s<this.arguments_.length;s++){var r=rt.utils.xml.createElement("block");r.setAttribute("type","procedures_mutatorarg");var o=rt.utils.xml.createElement("field");o.setAttribute("name","NAME");var a=rt.utils.xml.createTextNode(this.arguments_[s]);o.appendChild(a),r.appendChild(o);var l=rt.utils.xml.createElement("next");r.appendChild(l),n.appendChild(r),n=l}var u=rt.Xml.domToBlock(e,t);return"procedures_defreturn"==this.type?u.setFieldValue(this.hasStatements_,"STATEMENTS"):u.removeInput("STATEMENT_INPUT"),rt.Procedures.mutateCallers(this),u},compose:function(t){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];for(var e=t.getInputTargetBlock("STACK");e&&!e.isInsertionMarker();){var i=e.getFieldValue("NAME");this.arguments_.push(i);var n=this.workspace.getVariable(i,"");this.argumentVarModels_.push(n),this.paramIds_.push(e.id),e=e.nextConnection&&e.nextConnection.targetBlock()}this.updateParams_(),rt.Procedures.mutateCallers(this);var s=t.getFieldValue("STATEMENTS");if(null!==s&&(s="TRUE"==s,this.hasStatements_!=s))if(s)this.setStatements_(!0),this.statementConnection_&&this.statementConnection_.reconnect(this,"STACK"),this.statementConnection_=null;else{var r=this.getInput("STACK").connection;if(this.statementConnection_=r.targetConnection,this.statementConnection_){var o=r.targetBlock();o.unplug(),o.bumpNeighbours()}this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(t,e){var i=this.workspace.getVariableById(t);if(""==i.type){for(var n=i.name,s=this.workspace.getVariableById(e),r=!1,o=0;o<this.argumentVarModels_.length;o++)this.argumentVarModels_[o].getId()==t&&(this.arguments_[o]=s.name,this.argumentVarModels_[o]=s,r=!0);r&&(this.displayRenamedVar_(n,s.name),rt.Procedures.mutateCallers(this))}},updateVarName:function(t){for(var e=t.name,i=!1,n=0;n<this.argumentVarModels_.length;n++)if(this.argumentVarModels_[n].getId()==t.getId()){var s=this.arguments_[n];this.arguments_[n]=e,i=!0}i&&(this.displayRenamedVar_(s,e),rt.Procedures.mutateCallers(this))},displayRenamedVar_:function(t,e){this.updateParams_();const i=this.getIcon(rt.icons.MutatorIcon.TYPE);if(i&&i.bubbleIsVisible())for(var n,s=i.getWorkspace().getAllBlocks(!1),r=0;n=s[r];r++)"procedures_mutatorarg"==n.type&&rt.Names.equals(t,n.getFieldValue("NAME"))&&n.setFieldValue(e,"NAME")},customContextMenu:function(t){if(!this.isInFlyout){var e={enabled:!0},i=this.getFieldValue("NAME");e.text=rt.Msg.PROCEDURES_CREATE_DO.replace("%1",i);var n=rt.utils.xml.createElement("mutation");n.setAttribute("name",i);for(var s=0;s<this.arguments_.length;s++){var r=rt.utils.xml.createElement("arg");r.setAttribute("name",this.arguments_[s]),n.appendChild(r)}var o=rt.utils.xml.createElement("block");if(o.setAttribute("type",this.callType_),o.appendChild(n),e.callback=rt.ContextMenu.callbackFactory(this,o),t.push(e),!this.isCollapsed())for(s=0;s<this.argumentVarModels_.length;s++){var a={enabled:!0},l=this.argumentVarModels_[s];a.text=rt.Msg.VARIABLES_SET_CREATE_GET.replace("%1",l.name);var u=rt.Variables.generateVariableFieldDom(l),p=rt.utils.xml.createElement("block");p.setAttribute("type","variables_get"),p.appendChild(u),a.callback=rt.ContextMenu.callbackFactory(this,p),t.push(a)}}},callType_:"procedures_callnoreturn"},jn={init:function(){var t=rt.Procedures.findLegalName("",this),e=new rt.FieldTextInput(t,rt.Procedures.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new rt.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&rt.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(rt.Msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(rt.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(rt.Msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:Wn.setStatements_,updateParams_:Wn.updateParams_,mutationToDom:Wn.mutationToDom,domToMutation:Wn.domToMutation,decompose:Wn.decompose,compose:Wn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Wn.getVars,getVarModels:Wn.getVarModels,renameVarById:Wn.renameVarById,updateVarName:Wn.updateVarName,displayRenamedVar_:Wn.displayRenamedVar_,customContextMenu:Wn.customContextMenu,callType_:"procedures_callreturn"},qn={init:function(){this.appendDummyInput().appendField(rt.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(rt.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new rt.FieldCheckbox("TRUE"),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(rt.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}},Kn={init:function(){var t=new rt.FieldTextInput(rt.Procedures.DEFAULT_ARG,this.validator_);t.oldShowEditorFn_=t.showEditor_;t.showEditor_=function(){this.createdVariables_=[],this.oldShowEditorFn_()},this.appendDummyInput().appendField(rt.Msg.PROCEDURES_BEFORE_PARAMS).appendField(t,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(rt.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,t.onFinishEditing_=this.deleteIntermediateVars_,t.createdVariables_=[],t.onFinishEditing_("x")},validator_:function(t){var e=this.getSourceBlock(),i=e.workspace.getRootWorkspace();if(!(t=t.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"")))return null;for(var n=(e.workspace.targetWorkspace||e.workspace).getAllBlocks(!1),s=t.toLowerCase(),r=0;r<n.length;r++)if(n[r].id!=this.getSourceBlock().id){var o=n[r].getFieldValue("NAME");if(o&&o.toLowerCase()==s)return null}if(e.isInFlyout)return t;var a=i.getVariable(t,"");return a&&a.name!=t&&i.renameVariableById(a.getId(),t),a||(a=i.createVariable(t,""))&&this.createdVariables_&&this.createdVariables_.push(a),t},deleteIntermediateVars_:function(t){var e=this.getSourceBlock().workspace.getRootWorkspace();if(e)for(var i=0;i<this.createdVariables_.length;i++){var n=this.createdVariables_[i];n.name!=t&&e.deleteVariableById(n.getId())}}},zn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(rt.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(t,e){if(rt.Names.equals(t,this.getProcedureCall())){this.setFieldValue(e,"NAME");var i=this.outputConnection?rt.Msg.PROCEDURES_CALLRETURN_TOOLTIP:rt.Msg.PROCEDURES_CALLNORETURN_TOOLTIP;this.setTooltip(i.replace("%1",e))}},setProcedureParameters_:function(t,e){const i=rt.Procedures.getDefinition(this.getProcedureCall(),this.workspace),n=i&&i.getIcon(rt.icons.MutatorIcon.TYPE),s=n&&n.bubbleIsVisible();if(s?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null),t.join("\n")!==this.arguments_.join("\n")){if(e.length!==t.length)throw Error("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);for(let t=0;t<this.arguments_.length;t++){const i=this.getInput("ARG"+t);if(i){const n=i?.connection?.targetConnection;this.quarkConnections_[this.quarkIds_[t]]=n,s&&n&&!e.includes(this.quarkIds_[t])&&(n.disconnect(),n.getSourceBlock().bumpNeighbours())}}this.arguments_=[].concat(t),this.argumentVarModels_=[];for(var r=0;r<this.arguments_.length;r++){var o=rt.Variables.getOrCreateVariablePackage(this.workspace,null,this.arguments_[r],"");this.argumentVarModels_.push(o)}if(this.updateShape_(),this.quarkIds_=e,this.quarkIds_)for(let t=0;t<this.arguments_.length;t++){const e=this.quarkIds_[t];if(e in this.quarkConnections_){const i=this.quarkConnections_[e];i?.reconnect(this,"ARG"+t)||delete this.quarkConnections_[e]}}}else this.quarkIds_=e},updateShape_:function(){for(var t=0;t<this.arguments_.length;t++){var e=this.getField("ARGNAME"+t);if(e){rt.Events.disable();try{e.setValue(this.arguments_[t])}finally{rt.Events.enable()}}else{e=new rt.FieldLabel(this.arguments_[t]),this.appendValueInput("ARG"+t).setAlign(rt.inputs.Align.RIGHT).appendField(e,"ARGNAME"+t).init()}}for(;this.getInput("ARG"+t);)this.removeInput("ARG"+t),t++;var i=this.getInput("TOPROW");i&&(this.arguments_.length?this.getField("WITH")||(i.appendField(rt.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),i.init()):this.getField("WITH")&&i.removeField("WITH"))},mutationToDom:function(){var t=rt.utils.xml.createElement("mutation");t.setAttribute("name",this.getProcedureCall());for(var e=0;e<this.arguments_.length;e++){var i=rt.utils.xml.createElement("arg");i.setAttribute("name",this.arguments_[e]),t.appendChild(i)}return t},domToMutation:function(t){var e=t.getAttribute("name");this.renameProcedure(this.getProcedureCall(),e);for(var i,n=[],s=[],r=0;i=t.childNodes[r];r++)"arg"==i.nodeName.toLowerCase()&&(n.push(i.getAttribute("name")),s.push(i.getAttribute("paramId")));this.setProcedureParameters_(n,s)},saveExtraState:function(){const t=Object.create(null);return t.name=this.getProcedureCall(),this.arguments_.length&&(t.params=this.arguments_),t},loadExtraState:function(t){this.renameProcedure(this.getProcedureCall(),t.name);const e=t.params;if(e){const t=[];t.length=e.length,t.fill(null),this.setProcedureParameters_(e,t)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(t){if(this.workspace&&!this.workspace.isFlyout&&t.recordUndo)if(t.type==rt.Events.BLOCK_CREATE&&-1!=t.ids.indexOf(this.id)){var e=this.getProcedureCall();if((c=rt.Procedures.getDefinition(e,this.workspace))&&c.type!=this.defType_&&(c=null),c){if(JSON.stringify(c.getVars())!=JSON.stringify(this.arguments_)){let t=c.arguments_,e=[];for(var i=0;i<this.arguments_.length;i++){var n=this.getInput("ARG"+i);if(n){var s=n.connection.targetConnection;s?e.push(s.sourceBlock_.id):e.push(null)}}this.setProcedureParameters_(t,e)}}else{rt.Events.setGroup(t.group);var r=rt.utils.xml.createElement("xml"),o=rt.utils.xml.createElement("block");o.setAttribute("type",this.defType_);var a=this.getRelativeToSurfaceXY(),l=a.x+rt.SNAP_RADIUS*(this.RTL?-1:1),u=a.y+2*rt.SNAP_RADIUS;o.setAttribute("x",l),o.setAttribute("y",u);var p=this.mutationToDom();o.appendChild(p);var h=rt.utils.xml.createElement("field");h.setAttribute("name","NAME");var d=this.getProcedureCall();d||(d=rt.Procedures.findLegalName("",this),this.renameProcedure("",d)),h.appendChild(rt.utils.xml.createTextNode(d)),o.appendChild(h),r.appendChild(o),rt.Xml.domToWorkspace(r,this.workspace),rt.Events.setGroup(!1)}}else if(t.type==rt.Events.BLOCK_DELETE){e=this.getProcedureCall();(c=rt.Procedures.getDefinition(e,this.workspace))||(rt.Events.setGroup(t.group),this.dispose(!0),rt.Events.setGroup(!1))}else if(t.type==rt.Events.CHANGE&&"disabled"==t.element){var c;e=this.getProcedureCall();if((c=rt.Procedures.getDefinition(e,this.workspace))&&c.id==t.blockId){var _=rt.Events.getGroup();_&&console.log("Saw an existing group while responding to a definition change"),rt.Events.setGroup(t.group),t.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),rt.Events.setGroup(_)}}},customContextMenu:function(t){if(this.workspace.isMovable()){var e={enabled:!0};e.text=rt.Msg.PROCEDURES_HIGHLIGHT_DEF;var i=this.getProcedureCall(),n=this.workspace;e.callback=function(){var t=rt.Procedures.getDefinition(i,n);t&&(n.centerOnBlock(t.id),t.select())},t.push(e)}},defType_:"procedures_defnoreturn"},$n={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(rt.Msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:zn.getProcedureCall,renameProcedure:zn.renameProcedure,setProcedureParameters_:zn.setProcedureParameters_,updateShape_:zn.updateShape_,mutationToDom:zn.mutationToDom,domToMutation:zn.domToMutation,getVars:zn.getVars,getVarModels:zn.getVarModels,onchange:zn.onchange,customContextMenu:zn.customContextMenu,defType_:"procedures_defreturn"},Qn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(rt.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(rt.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(rt.Msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var t=rt.utils.xml.createElement("mutation");return t.setAttribute("value",Number(this.hasReturnValue_)),t},domToMutation:function(t){var e=t.getAttribute("value");this.hasReturnValue_=1==e,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){if(this.workspace.isDragging&&!this.workspace.isDragging()){var t=!1,e=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(e.type)){t=!0;break}e=e.getSurroundParent()}while(e);t?("procedures_defnoreturn"==e.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=e.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(rt.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]},Jn={init:function(){this.setStyle("procedure_blocks"),this.appendValueInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.hasReturnValue_=!0},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("value",Number(this.hasReturnValue_)),t},domToMutation:function(t){var e=t.getAttribute("value");this.hasReturnValue_=1==e,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){var t=!1,e=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(e.type)){t=!0;break}e=e.getSurroundParent()}while(e);t?("procedures_defnoreturn"==e.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=e.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(rt.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(rt.Msg.PROCEDURES_IFRETURN_WARNING)},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn","method_procedures_defnoreturn","method_procedures_defreturn"]},Zn=195,ts={init:function(){this.setColour(Zn),this.appendDummyInput("").appendField(new rt.FieldTextInput("mytup"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(rt.Msg.TUPLE_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("tuple_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("tuple_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},es={init:function(){this.setColour(Zn),this.appendDummyInput().appendField(rt.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},is={init:function(){this.setColour(Zn),this.appendDummyInput().appendField(rt.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},ns={init:function(){this.setColour(Zn),this.appendDummyInput("").appendField(new rt.FieldTextInput("mytup"),"VAR").appendField(" = (").appendField(new rt.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ss={init:function(){this.setColour(Zn),this.appendDummyInput("").appendField("(").appendField(new rt.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)}},rs={init:function(){this.setColour(Zn),this.setOutput(!0),this.appendValueInput("TUP").setCheck("Tuple"),this.appendValueInput("AT").setCheck(Number).appendField(rt.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(rt.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(rt.Msg.TUPLE_GET_INDEX_TOOLTIP)}},os={init:function(){this.setColour(Zn),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_LENGTH),this.setTooltip(rt.Msg.TUPLE_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},as={init:function(){this.setColour(Zn),this.appendValueInput("TUP").setCheck("Tuple"),this.appendDummyInput("").appendField(rt.Msg.TUPLE_DEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TUPLE_DEL_TOOLTIP)}},ls={init:function(){this.setColour(Zn),this.appendValueInput("TUP1").setCheck("Tuple"),this.appendDummyInput("").appendField(rt.Msg.TUPLE_JOIN),this.appendValueInput("TUP2").setCheck("Tuple"),this.setInputsInline(!0),this.setTooltip(rt.Msg.TUPLE_JOIN_TOOLTIP),this.setOutput(!0,"Tuple")}},us={init:function(){this.appendValueInput("TUP").setCheck("Tuple");var t=[[rt.Msg.blockpy_TUPLE_MAX,"max"],[rt.Msg.blockpy_TUPLE_MIN,"min"],[rt.Msg.MATH_ONLIST_OPERATOR_SUM,"sum"]];this.setColour(Zn),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new rt.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{max:rt.Msg.MIXLY_TOOLTIP_TUPLE_MAX,min:rt.Msg.MIXLY_TOOLTIP_TUPLE_MIN,sum:rt.Msg.MIXLY_TOOLTIP_TUPLE_SUM}[t]}))}},ps={init:function(){var t=[[rt.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(Zn),this.appendValueInput("VAR").setCheck("Tuple"),this.appendDummyInput("").appendField(rt.Msg.A_TO_B).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{list:rt.Msg.TUPLE_TO_LISTS,set:rt.Msg.TUPLE_TO_SET}[t]}))}},hs={init:function(){var t=[[rt.Msg.MIXLY_LIST_INDEX,"INDEX"],[rt.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(Zn),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(rt.Msg.HTML_VALUE),this.appendDummyInput().appendField(rt.Msg.MIXLY_DE).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{INDEX:rt.Msg.MIXLY_TOOLTIP_TUPLE_FIND_INDEX,COUNT:rt.Msg.MIXLY_TOOLTIP_TUPLE_FIND_COUNT}[t]}))}},ds={init:function(){var t=[[rt.Msg.MIXLY_LIST_LEN,"LEN"],[rt.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[rt.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[rt.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[rt.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[rt.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[rt.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[rt.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(Zn),this.setOutput(!0,Number),this.appendValueInput("data").setCheck("List"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new rt.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{LEN:rt.Msg.TUPLE_LENGTH_TOOLTIP,SUM:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_SUM,MAX:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MAX,MIN:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MIN,AVERAGE:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_AVERAGE,MEDIAN:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MEDIAN,MODE:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MODE,STD_DEV:rt.Msg.MATH_ONLIST_TOOLTIP_TUPLE_STD_DEV}[t]}))}},cs={init:function(){this.WHERE_OPTIONS_1=[[rt.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[rt.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[rt.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[rt.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[rt.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[rt.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Zn),this.appendValueInput("LIST").setCheck("List"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(rt.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==rt.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==rt.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),rt.Msg.TEXT_CHARAT_TAIL&&this.appendDummyInput("ORDINAL"+t).appendField(rt.Msg.TEXT_CHARAT_TAIL)):this.appendDummyInput("AT"+t);var i=new rt.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},_s={init:function(){this.setColour(Zn),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"Tuple"),this.setMutator(new rt.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(rt.Msg.TUPLE_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("tuple_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("tuple_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fs={init:function(){this.setHelpUrl(rt.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Zn),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+rt.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(rt.Msg.TEXT_CHARAT_TAIL+" "+rt.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(rt.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Tuple"),this.setTooltip(rt.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)}},Ts={init:function(){this.setColour(Zn),this.appendValueInput("TUP"),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+rt.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(rt.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},ms={init:function(){this.setColour(Zn),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TOTUPLE),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOTUPLE)}};const gs={init:function(){var t;this.setColour(Zn),this.appendDummyInput("").appendField("(").appendField(new rt.FieldTextInput((t=new Date,t.getFullYear()+","+(t.getMonth()+1)+","+t.getDate()+","+t.getHours()+","+t.getMinutes()+","+t.getSeconds())),"CONTENT").appendField(")"),this.setOutput(!0)}},Is=100,Es={init:function(){this.setColour(Is),this.appendDummyInput("").appendField(new rt.FieldTextInput("s1"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["set_create_with_item"],this)),this.setTooltip(rt.Msg.blockpy_SET_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("set_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("set_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.blockpy_SET_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.blockpy_SET_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Os={init:function(){this.setColour(Is),this.appendDummyInput().appendField(rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ms={init:function(){this.setColour(Is),this.appendDummyInput().appendField(rt.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.blockpy_SET_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Rs={init:function(){this.setColour(Is),this.appendValueInput("SET"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_LENGTH),this.setInputsInline(!0),this.setTooltip(rt.Msg.SET_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},As={init:function(){this.setColour(Is),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(rt.Msg.blockpy_SET_GET_AND_REMOVE_LAST),this.setTooltip(rt.Msg.SET_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},ys={init:function(){this.setColour(Is),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(rt.Msg.SET_CLEAR),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[rt.Msg.blockpy_set_union,"union"],[rt.Msg.blockpy_set_intersection,"intersection"],[rt.Msg.blockpy_set_difference,"difference"]];this.setColour(Is),this.appendDummyInput("").appendField(rt.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(rt.Msg.blockpy_set_get_operate).appendField(new rt.FieldDropdown(t),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,"set");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{union:rt.Msg.MIXLY_TOOLTIP_SET_UNION,intersection:rt.Msg.MIXLY_TOOLTIP_SET_INTERSECTION,difference:rt.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE}[t]}))}},vs={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[rt.Msg.blockpy_set_union,"update"],[rt.Msg.blockpy_set_intersection,"intersection_update"],[rt.Msg.blockpy_set_difference,"difference_update"]];this.setColour(Is),this.appendDummyInput("").appendField(rt.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(rt.Msg.blockpy_set_get_operate).appendField(new rt.FieldDropdown(t),"OPERATE"),this.appendDummyInput("").appendField(rt.Msg.blockpy_set_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{update:rt.Msg.MIXLY_TOOLTIP_SET_UPDATE,intersection_update:rt.Msg.MIXLY_TOOLTIP_SET_INTERSECTION_UPDATE,difference_update:rt.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE_UPDATE}[t]}))}},Cs={init:function(){this.appendValueInput("SET").setCheck("Set");var t=[[rt.Msg.MIXLY_blockpy_set_add,"add"],[rt.Msg.MIXLY_blockpy_set_discard,"discard"]];this.setColour(Is),this.appendDummyInput("").appendField(new rt.FieldDropdown(t),"OPERATE"),this.appendValueInput("data").appendField(rt.Msg.blockpy_SET_VARIABLES_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{add:rt.Msg.SET_ADD_TOOLTIP,discard:rt.Msg.SET_DISCARD_TOOLTIP}[t]}))}},Ls={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[rt.Msg.blockpy_set_sub,"issubset"],[rt.Msg.blockpy_set_super,"issuperset"]];this.setColour(Is),this.appendDummyInput("").appendField(rt.Msg.blockpy_is_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(rt.Msg.blockpy_set_of).appendField(new rt.FieldDropdown(t),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,Boolean);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{issubset:rt.Msg.MIXLY_TOOLTIP_SET_SUB,issuperset:rt.Msg.MIXLY_TOOLTIP_SET_SUPER}[t]}))}},bs={init:function(){this.appendValueInput("SET").setCheck("Set"),this.setColour(Is),this.appendValueInput("VAR").setCheck([String,"List"]).appendField(rt.Msg.blockpy_set_add_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.SET_UPDATE_TOOLTIP)}},Ds={init:function(){this.setColour(Is),this.appendDummyInput("").appendField("{").appendField(new rt.FieldTextInput("0,0,0"),"TEXT").appendField("}"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXPY_TOOLTIP_SET_CREATE_WITH_TEXT)}},ws={init:function(){this.setColour(Is),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TOSET),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOSET)}},Ns="#1ec1e4",Fs={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(rt.Msg.HTML_DOCUMENT),this.appendStatementInput("HEAD").appendField(rt.Msg.HTML_HEAD),this.appendStatementInput("BODY").appendField(rt.Msg.HTML_BODY),this.setOutput(!0)}},Ps={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(rt.Msg.HTML_LEVEL).appendField(new rt.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.HTML_HEAD,"head"],[rt.Msg.HTML_BODY,"body"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.HTML_P,"p"],[rt.Msg.HTML_SPAN,"span"],[rt.Msg.HTML_FORM,"form"],[rt.Msg.HTML_TABLE,"table"],[rt.Msg.HTML_LINE,"tr"],[rt.Msg.HTML_CELL,"td"],[rt.Msg.HTML_OL,"ol"],[rt.Msg.HTML_UL,"ul"],[rt.Msg.HTML_LI,"li"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vs={init:function(){this.setColour(Ns),this.appendDummyInput().appendField("<").appendField(new rt.FieldTextInput("tag"),"LEVEL").appendField(">"),this.appendValueInput("style").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ys={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(rt.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},Bs={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(rt.Msg.HTML_FORM_CONTENT).appendField(new rt.FieldDropdown([[rt.Msg.HTML_TEXT,"text"],[rt.Msg.HTML_EMAIL,"email"],[rt.Msg.HTML_NUMBER,"number"],[rt.Msg.HTML_PASSWORD,"password"],[rt.Msg.HTML_CHECKBOX,"checkbox"],[rt.Msg.HTML_RADIOBUTTON,"radiobutton"],[rt.Msg.HTML_BUTTON,"button"],[rt.Msg.HTML_COLOUR,"colour"],[rt.Msg.HTML_DATE,"date"],[rt.Msg.HTML_LOCALTIME,"local time"],[rt.Msg.HTML_FILE,"file"],[rt.Msg.HTML_HIDDEN,"hidden"],[rt.Msg.HTML_IMAGE,"image"],[rt.Msg.HTML_MONTH,"month"],[rt.Msg.HTML_RANGE,"range"],[rt.Msg.HTML_RESET,"reset"],[rt.Msg.HTML_SEARCH,"search"],[rt.Msg.HTML_SUBMIT,"submit"],[rt.Msg.HTML_TELEPHONENUMBER,"telephone number"],[rt.Msg.HTML_TIME,"time"],[rt.Msg.HTML_URL,"url"],[rt.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(rt.Msg.HTML_NAME).appendField(new rt.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(rt.Msg.HTML_VALUE).appendField(new rt.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(new rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new rt.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(new rt.FieldTextInput("property"),"KEY").appendField(":").appendField(new rt.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gs={init:function(){this.setColour(Ns),this.appendDummyInput().appendField(rt.Msg.HTML_TEXT).appendField(new rt.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 rt.FieldTable(""),"TEXT")}},js={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new rt.FieldMultilineInput(""),"TEXT")}},qs={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new rt.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Ks={init:function(){this.setColour(Hs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},zs={init:function(){this.setColour(Hs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new rt.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},$s={init:function(){this.setColour(Hs),this.appendValueInput("VALUE").appendField(rt.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 rt.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(rt.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=rt.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("text_print_multiple_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("PRINT"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("PRINT"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("PRINT"+t);)this.removeInput("PRINT"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField("print");else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("PRINT"+t);0==t&&e.appendField("print")}}},Js={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("print"),this.appendStatementInput("STACK"),this.setTooltip(""),this.contextMenu=!1}},Zs={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("item"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},tr={init:function(){this.setColour(Hs),this.itemCount_=1,this.hasReturn_=!1,this.appendDummyInput().appendField(new rt.FieldTextInput("str"),"NAME"),this.updateShape_(),this.setMutator(new rt.icons.MutatorIcon(["function_call_item"],this)),this.setTooltip("Can be used to call any function")},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t.setAttribute("hasReturn",this.hasReturn_?"TRUE":"FALSE"),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.hasReturn_="TRUE"===t.getAttribute("hasReturn"),this.updateShape_()},decompose:function(t){var e=rt.Block.obtain(t,"function_call_container");e.initSvg(),e.setFieldValue(this.hasStatements_?"TRUE":"FALSE","RETURN");for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("function_call_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},setReturn:function(t){this.unplug(!0,!0),this.setOutput(t),this.setPreviousStatement(!t),this.setNextStatement(!t),this.rendered&&this.render()},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.hasReturn_="TRUE"===t.getFieldValue("RETURN"),this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ARGUMENT"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ARGUMENT"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ARGUMENT"+t);)this.removeInput("ARGUMENT"+t),t++;for(t=0;t<this.itemCount_;t++)this.appendValueInput("ARGUMENT"+t);this.setReturn(this.hasReturn_)}},er={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("Arguments"),this.appendStatementInput("STACK"),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField("has return").appendField(new rt.FieldCheckbox("TRUE"),"RETURN"),this.setTooltip(""),this.contextMenu=!1}},ir={init:function(){this.setColour(Hs),this.appendDummyInput().appendField("argument"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},nr={init:function(){this.appendValueInput("MODULE").setCheck(null),this.appendValueInput("NAME").setCheck(null).appendField("."),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(230),this.setTooltip(""),this.setHelpUrl("")}},sr=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE),e.ORDER_ATOMIC]},rr=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = "+i+"\n"},or=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},ar=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},lr=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},ur=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},pr=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"[]";return[i="zip("+i.join(", ")+")",e.ORDER_ATOMIC]},hr=function(t,e){const i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"[]";return[`${this.getFieldValue("TYPE")}(${i})`,e.ORDER_ATOMIC]},dr=function(t,e){var i=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},cr=function(t,e){var i=e.statementToCode(this,"DO");return(i=i.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=i:e.setups_.setup_setup=i+"\n",""},_r=function(t,e){var i=0,n="";do{n+=(0==i?"if ":"elif ")+(e.valueToCode(t,"IF"+i,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+i)||e.PASS),++i}while(t.getInput("IF"+i));return t.getInput("ELSE")&&(n+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),n},fr=function(t,e){var i=1,n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(i=1;i<=this.elseifCount_;i++)""!==(n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"")&&(n=" "+n),s+="except"+n+": \n"+(e.statementToCode(this,"DO"+i)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},Tr=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",r=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",o=e.statementToCode(t,"DO"),a=(o=e.addLoopTrap(o,t.id)||e.PASS,""),l=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},rt.isNumber(n)&&rt.isNumber(s)&&rt.isNumber(r))n=parseFloat(n),s=parseFloat(s),r=Math.abs(parseFloat(r)),0==n%1&&0==s%1&&0==r%1?(n<=s?(s++,t=0==n&&1==r?s:n+", "+s,1!=r&&(t+=", "+r)):t=n+", "+--s+", -"+r,t="range("+t+")"):(t=n<s?l():u(),t+="("+n+", "+s+", "+r+")");else{var p=function(t,n){if(rt.isNumber(t))t=parseFloat(t);else{var s=e.variableDB_.getDistinctName(i+n,rt.Variables.NAME_TYPE);a+=s+" = "+t+"\n",t=s}return t};n=p(n,"_start"),s=p(s,"_end");p(r,"_inc"),t="number"==typeof n&&"number"==typeof s?n<s?l(0,s):u(0,s):t(n,s,r)}return a+="for "+i+" in "+t+":\n"+o},mr=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",r=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",o=e.statementToCode(t,"DO"),a=e.addLoopTrap(o,t.id)||e.PASS;return e.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+i+" in mixly_range("+n+", "+s+", "+r+"):\n"+a},gr=function(t,e){var i="UNTIL"==t.getFieldValue("MODE"),n=e.valueToCode(t,"BOOL",e.ORDER_NONE)||"False",s=e.statementToCode(t,"DO");return i&&(n="not "+n),"while "+n+":\n"+(s=e.addLoopTrap(s,t.id)||e.PASS)},Ir=function(t){switch(t.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},Er=function(t,e){return"sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Or=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},Mr=function(t,e){e.definitions_.import_time="import time";return["time.time()",e.ORDER_ATOMIC]},Rr=function(t,e){return e.definitions_.import_microbit="from microbit import *","reset()\n"},Ar=function(){return"interrupts();\n"},yr=function(){return"noInterrupts();\n"},Sr=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"''",n=e.valueToCode(t,"LIST",e.ORDER_RELATIONAL)||"[]",s=e.statementToCode(t,"DO");return"for "+i+" in "+n+":\n"+(s=e.addLoopTrap(s,t.id)||e.PASS)},vr=function(t,e){return["range("+(e.valueToCode(this,"FROM",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"TO",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"STEP",e.ORDER_NONE)||"1")+")",e.ORDER_ATOMIC]},Cr=function(t,e){var i="lambda "+(e.valueToCode(t,"BOOL",e.ORDER_NONE)||"None")+": "+(e.statementToCode(t,"DO")||"pass");return[i=i.replace("\n","").replace(" ",""),e.ORDER_ATOMIC]},Lr=function(t,e){return e.definitions_.import_time="import time","time.sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},br=function(){return"pass\n"},Dr=function(t,e){e.definitions_.import__thread="import _thread";var i=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return"_thread.start_new_thread("+e.variableDB_.getName(e.valueToCode(this,"callback",e.ORDER_NONE)||"None",rt.Procedures.NAME_TYPE)+", "+i+")\n"},wr=function(t,e){var i=e.valueToCode(this,"select_data",e.ORDER_NONE)||"False",n=e.statementToCode(this,"input_data");return n="true"==this.getFieldValue("type")?n+" if ("+i+"):\n break\n":n+" if not ("+i+"):\n break\n","while True:\n"+(n=e.addLoopTrap(n,this.id)||e.PASS)},Nr=function(t,e){var i=e.valueToCode(this,"TIMES",e.ORDER_ATOMIC),n=e.statementToCode(t,"DO");return"for _my_variable in range("+i+"):\n"+(n=e.addLoopTrap(n,t.id)||e.PASS)},Fr=function(t,e){e.definitions_.import_gc="import gc";return"gc.collect()\n"},Pr=function(t,e){e.definitions_.import_gc="import gc";return["gc.mem_alloc()",e.ORDER_ATOMIC]},xr=function(t,e){e.definitions_.import_gc="import gc";return["gc.mem_free()",e.ORDER_ATOMIC]},kr=function(t,e){e.definitions_.import_machine="import machine";return["machine.unique_id()",e.ORDER_ATOMIC]},Vr=Nr,Yr=function(t,e){return e.definitions_.import_datatime="import datatime",["datatime.datatime.fromtimestamp("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Br=function(t,e){var i=ot.Boards.getSelectedBoardKey().split(":")[2];e.definitions_["import_"+i+"uuid"]="from "+i+" import uuid";return["uuid()",e.ORDER_ATOMIC]},Ur=function(t,e){var i=this.getFieldValue("NUM");return[i,i<0?e.ORDER_UNARY_PREFIX:e.ORDER_ATOMIC]},Xr=function(t,e){return e.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),e.ORDER_ATOMIC]},Gr=function(t,e){return e.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),e.ORDER_ATOMIC]},Hr=function(t,e){var i=this.getFieldValue("OP"),n=e.ORDER_ATOMIC;return["("+(e.valueToCode(this,"A",n)||"0")+i+(e.valueToCode(this,"B",n)||"0")+")",n]},Wr=function(t,e){var i=(n={ADD:[" + ",e.ORDER_ADDITIVE],MINUS:[" - ",e.ORDER_ADDITIVE],MULTIPLY:[" * ",e.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",e.ORDER_MULTIPLICATIVE],QUYU:[" % ",e.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",e.ORDER_MULTIPLICATIVE],POWER:[" ** ",e.ORDER_EXPONENTIATION]}[t.getFieldValue("OP")])[0],n=n[1];return[(e.valueToCode(t,"A",n)||"0")+i+(t=e.valueToCode(t,"B",n)||"0"),n]},jr=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_RELATIONAL)||"0",n=e.valueToCode(this,"B",e.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var s="+=";break;case"MINUS":s="-=";break;case"MULTIPLY":s="*=";break;case"DIVIDE":s="/=";break;case"QUYU":s="%=";break;case"ZHENGCHU":s="//=";break;case"POWER":s="**="}return i+" "+s+" "+n+"\n"},qr=function(t,e){var i,n=t.getFieldValue("OP");if("NEG"==n)return["-"+(i=e.valueToCode(t,"NUM",e.ORDER_UNARY_SIGN)||"0"),e.ORDER_UNARY_SIGN];switch(e.definitions_.import_math="import math",t="SIN"==n||"COS"==n||"TAN"==n?e.valueToCode(t,"NUM",e.ORDER_MULTIPLICATIVE)||"0":e.valueToCode(t,"NUM",e.ORDER_NONE)||"0",n){case"ABS":i="math.fabs("+t+")";break;case"ROOT":i="math.sqrt("+t+")";break;case"LN":i="math.log("+t+")";break;case"LOG10":i="math.log10("+t+")";break;case"EXP":i="math.exp("+t+")";break;case"POW10":i="math.pow(10,"+t+")";break;case"ROUND":i="round("+t+")";break;case"ROUNDUP":i="math.ceil("+t+")";break;case"ROUNDDOWN":i="math.floor("+t+")";break;case"SIN":i="math.sin("+t+")";break;case"COS":i="math.cos("+t+")";break;case"TAN":i="math.tan("+t+")";break;case"++":i="++("+t+")";break;case"--":i="--("+t+")";break;case"-":i="-("+t+")"}if(i)return[i,e.ORDER_EXPONENTIATION];switch(n){case"ASIN":i="math.degrees(math.asin("+t+"))";break;case"ACOS":i="math.degrees(math.acos("+t+"))";break;case"ATAN":i="math.degrees(math.atan("+t+"))"}return[i,e.ORDER_MULTIPLICATIVE]},Kr=qr,zr=function(t,e){var i=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+i+")",e.ORDER_ATOMIC]},$r=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_NONE)||"0",n=this.getFieldValue("OP"),s="";return"round"===n?s=n+"("+i+")":(s="math."+n+"("+i+")",e.definitions_.import_math="import math"),[s,e.ORDER_ATOMIC]},Qr=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_NONE)||"0",n=e.valueToCode(this,"B",e.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+i+", "+n+")",e.ORDER_ATOMIC]},Jr=function(t,e){e.definitions_.import_random="import random";var i=this.getFieldValue("TYPE"),n=e.valueToCode(this,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(this,"TO",e.ORDER_NONE)||"0";if("int"==i)var r="random.randint("+n+", "+s+")";else if("float"==i)r="random.uniform("+n+", "+s+")";return[r,e.ORDER_UNARY_POSTFIX]},Zr=function(t,e){var i=e.valueToCode(this,"NUM",e.ORDER_NONE),n=e.valueToCode(this,"fromLow",e.ORDER_ATOMIC),s=e.valueToCode(this,"fromHigh",e.ORDER_ATOMIC),r=e.valueToCode(this,"toLow",e.ORDER_ATOMIC),o=e.valueToCode(this,"toHigh",e.ORDER_ATOMIC);return e.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+i+", "+n+", "+s+", "+r+", "+o+")",e.ORDER_NONE]},to=function(t,e){return["min(max("+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"LOW",e.ORDER_NONE)||"0")+"), "+(e.valueToCode(this,"HIGH",e.ORDER_NONE)||"0")+")",e.ORDER_UNARY_POSTFIX]},eo=function(t,e){var i=t.getFieldValue("OP"),n=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0",s=t.getFieldValue("OP2");e.definitions_.import_math="import math";var r="",o="10";if("two"==i?o="2":"eight"==i?o="8":"ten"==i?o="10":"sixteen"==i&&(o="16"),"two"==s?r="bin":"eight"==s?r="oct":"ten"==s?r="":"sixteen"==s&&(r="hex"),""==r)var a="int(str("+n+"), "+o+")";else a=r+"(int(str("+n+"), "+o+"))";return[a,e.ORDER_ATOMIC]},io=function(t,e){return e.definitions_.import_random="import random","random.seed("+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+");\n"},no=function(t,e){var i=this.getFieldValue("NUM");return[i,i<0?e.ORDER_UNARY_PREFIX:e.ORDER_ATOMIC]},so=function(t,e){return["round("+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"VAR",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},ro=function(t,e){var i=this.getFieldValue("TOWHAT"),n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"b"==i?[n+'.encode("utf-8")',e.ORDER_ATOMIC]:"bti"==i?["int.from_bytes("+n+',"big")',e.ORDER_ATOMIC]:[i+"("+n+")",e.ORDER_ATOMIC]},oo=function(t,e){var i=this.getFieldValue("TOWHAT"),n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"b"==i?[n+'.encode("utf-8")',e.ORDER_ATOMIC]:[i+"("+n+")",e.ORDER_ATOMIC]},ao=Zr,lo=function(t,e){return e.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+").decode()",e.ORDER_ATOMIC]},uo=function(t,e){e.definitions_.import_itertools="import itertools";let i=e.valueToCode(this,"REPEAT",e.ORDER_ATOMIC),n=new Array(this.itemCount_);for(let t=0;t<this.itemCount_;t++)n[t]=e.valueToCode(this,`ADD${t}`,e.ORDER_NONE)||"0";let s="";return this.itemCount_&&(s=`itertools.product(${n.join(", ")}, repeat=${i})`),[s,e.ORDER_ATOMIC]},po=function(t,e){return e.definitions_.import_math="import math",["math.degrees("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ho=function(t,e){return e.definitions_.import_math="import math",["math.radians("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},co=function(t,e){return[e.quote_(this.getFieldValue("TEXT")),e.ORDER_ATOMIC]},_o=function(t,e){return['"""'+this.getFieldValue("VALUE")+'"""',e.ORDER_ATOMIC]},fo=function(t,e){return["'"+this.getFieldValue("TEXT")+"'",e.ORDER_ATOMIC]},To=function(t,e){return[e.valueToCode(this,"A",e.ORDER_ATOMIC)+" + "+e.valueToCode(this,"B",e.ORDER_ATOMIC),e.ORDER_ADDITIVE]},mo=function(t,e){return["chr("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},go=function(t,e){return["ord("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"a")+")",e.ORDER_ATOMIC]},Io=function(t,e){return["str("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Eo=function(t,e){return["len("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},Oo=function(t,e){var i=t.getFieldValue("WHERE")||"FROM_START",n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""';switch(i){case"FROM_START":return[n+"["+(t=e.getAdjustedInt(t,"AT"))+"]",e.ORDER_ATOMIC];case"FROM_END":return[n+"["+(t=e.getAdjustedInt(t,"AT",1,!0))+"]",e.ORDER_ATOMIC];case"RANDOM":return e.definitions_.import_random="import random",["random.choice("+n+")",e.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},Mo=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"["+(e.valueToCode(this,"AT",e.ORDER_ATOMIC)||0)+"]",e.ORDER_ATOMIC]},Ro=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""';return e.definitions_.import_random="import random",["random.choice("+i+")",e.ORDER_FUNCTION_CALL]},Ao=function(t,e){var i=e.valueToCode(this,"STR1",e.ORDER_ATOMIC)||'""',n=e.valueToCode(this,"STR2",e.ORDER_ATOMIC)||'""',s=this.getFieldValue("DOWHAT");return"==="===s?[i+" == "+n,e.ORDER_ATOMIC]:[i+"."+s+"("+n+")",e.ORDER_ATOMIC]},yo=function(t,e){return["cmp("+(e.valueToCode(this,"STR1",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"STR2",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},So=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',n=t.getFieldValue("WHERE1"),s=t.getFieldValue("WHERE2");switch(n){case"FROM_START":"0"==(r=e.getAdjustedInt(t,"AT1"))&&(r="");break;case"FROM_END":var r=e.getAdjustedInt(t,"AT1",0,!0);break;case"FIRST":r="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(s){case"FROM_START":var o=e.getAdjustedInt(t,"AT2");break;case"FROM_END":o=e.getAdjustedInt(t,"AT2",0,!0);rt.isNumber(String(o))?"0"==o&&(o=""):(e.definitions_.import_sys="import sys",o+=" or sys.maxsize");break;case"LAST":o="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[i+"["+r+" : "+o+"]",e.ORDER_ATOMIC]},vo=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"["+e.valueToCode(this,"AT1",e.ORDER_ATOMIC)+" : "+e.valueToCode(this,"AT2",e.ORDER_ATOMIC)+"]",e.ORDER_ATOMIC]},Co=function(t,e){var i=this.getFieldValue("CAPITAL");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Lo=function(t,e){var i=this.getFieldValue("CENTER");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"WID",e.ORDER_ATOMIC)+","+e.valueToCode(this,"Symbol",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},bo=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".find("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Do=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".join("+(e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},wo=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".replace("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},No=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+".split("+(e.valueToCode(this,"VAL",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},Fo=function(t,e){var i=this.getFieldValue("TOWHAT");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Po=function(t,e){for(var i=this.getFieldValue("VAR"),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return[n=i+".format("+n.join(", ")+")",e.ORDER_ATOMIC]},xo=function(t,e){for(var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return[n=i+".format("+n.join(", ")+")",e.ORDER_ATOMIC]},ko=vo,Vo=yo,Yo=Mo,Bo=function(t,e){var i=this.getFieldValue("DIR"),n=this.getFieldValue("CODE");return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"."+i+'("'+n+'")',e.ORDER_ATOMIC]},Uo=function(t,e){return["eval("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Xo=function(t,e){return e.definitions_.import_os="import os","os.system("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Go=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+e.valueToCode(this,"AT1",e.ORDER_ADDITIVE)+" : "+e.valueToCode(this,"AT2",e.ORDER_ADDITIVE)+"]",e.ORDER_ATOMIC]},Ho=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ATOMIC)||"mylist")+"["+(e.valueToCode(this,"row",e.ORDER_ATOMIC)||0)+","+(e.valueToCode(this,"col",e.ORDER_ATOMIC)||0)+"]",e.ORDER_ATOMIC]},Wo=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ATOMIC)||"mylist")+"["+(e.valueToCode(this,"row_start",e.ORDER_ATOMIC)||0)+" : "+(e.valueToCode(this,"row_end",e.ORDER_ATOMIC)||1)+","+(e.valueToCode(this,"col_start",e.ORDER_ATOMIC)||0)+" : "+(e.valueToCode(this,"col_end",e.ORDER_ATOMIC)||1)+"]",e.ORDER_ATOMIC]},jo=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return n=i+" = ["+n.join(", ")+"]\n"},qo=function(t,e){return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = ["+this.getFieldValue("TEXT")+"]\n"},Ko=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||0)+"]",e.ORDER_ATOMIC]},zo=function(t,e){return(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"0")+"] = "+(e.valueToCode(this,"TO",e.ORDER_ASSIGNMENT)||"0")+"\n"},$o=function(t,e){var i=e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"DATA",e.ORDER_ASSIGNMENT)||"0";return i+"."+this.getFieldValue("OP")+"("+n+")\n"},Qo=function(t,e){return e.definitions_.import_random="import random",["random.choice("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+")",e.ORDER_ATOMIC]},Jo=function(t,e){return e.definitions_.import_random="import random",["random.sample("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Zo=function(t,e){return(e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0")+".insert("+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"0")+", "+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")\n"},ta=function(t,e){return(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+".reverse()\n"},ea=function(t,e){return(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},ia=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";if("INDEX"==i)var r=n+".index("+s+")";else if("COUNT"==i)r=n+".count("+s+")";return[r,e.ORDER_ATOMIC]},na=function(t,e){var i=e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"DATA",e.ORDER_ASSIGNMENT)||"0";return"del"==this.getFieldValue("OP")?"del "+i+"["+n+"]\n":i+".remove("+n+")\n"},sa=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+".pop("+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},ra=function(t,e){var i,n=t.getFieldValue("OP");switch(e.definitions_.import_math="import math",t=e.valueToCode(t,"data",e.ORDER_NONE),n){case"LEN":i="len("+t+")";break;case"SUM":i="sum("+t+")";break;case"MIN":i="min("+t+")";break;case"MAX":i="max("+t+")";break;case"AVERAGE":e.definitions_.import_mixpy_math_mean="from mixpy import math_mean",i="math_mean("+t+")";break;case"MEDIAN":e.definitions_.import_mixpy_math_median="from mixpy import math_median",i="math_median("+t+")";break;case"MODE":e.definitions_.import_mixpy_math_modes="from mixpy import math_modes",i="math_modes("+t+")";break;case"STD_DEV":e.definitions_.import_mixpy_math_standard_deviation="from mixpy import math_standard_deviation",i="math_standard_deviation("+t+")";break;default:throw"Unknown operator: "+n}if(i)return[i,e.ORDER_ATOMIC]},oa=function(t,e){return e.definitions_.import_mixpy_lists_sort="from mixpy import lists_sort",["lists_sort("+(e.valueToCode(t,"LIST",e.ORDER_NONE)||"[]")+', "'+t.getFieldValue("TYPE")+'", '+("1"===t.getFieldValue("DIRECTION")?"False":"True")+")",e.ORDER_ATOMIC]},aa=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s="";return"array"==i?(e.definitions_.import_numpy="import numpy",s="numpy.array("+n+")"):s=i+"("+n+")",[s,e.ORDER_ATOMIC]},la=function(t,e){return["["+this.getFieldValue("CONTENT")+"]",e.ORDER_ATOMIC]},ua=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0";return[i="["+i.join(", ")+"]",e.ORDER_ATOMIC]},pa=aa,ha=function(t,e){return"del "+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+"\n"},da=jo,ca=qo,_a=Ko,fa=Go,Ta=zo,ma=Zo,ga=na,Ia=function(t,e){return["list("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Ea=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+".tolist()",e.ORDER_ATOMIC]},Oa=function(t,e){return["enumerate("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+",start="+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Ma=function(t,e){var i=e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist";return[(e.valueToCode(this,"CON",e.ORDER_ASSIGNMENT)||"0")+" in "+i,e.ORDER_ATOMIC]},Ra=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++){var r=this.getFieldValue("KEY"+s);n[s]=r+":"+(e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0")}return n=i+"= {"+n.join(", ")+"}\n"},Aa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".keys()",e.ORDER_ATOMIC]},ya=function(t,e){var i=ot.Boards.getSelectedBoardKey().split(":")[2],n=e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);if("educore"==i)var r=n+".get("+s+")";else r=n+"["+s+"]";return[r,e.ORDER_ATOMIC]},Sa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".get("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},va=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"] = "+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+"\n"},Ca=function(t,e){return"del "+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"]\n"},La=function(t,e){var i=e.valueToCode(this,"DICT2",e.ORDER_ASSIGNMENT)||"0";return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".update("+i+")\n"},ba=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Da=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".items()",e.ORDER_ATOMIC]},wa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".values()",e.ORDER_ATOMIC]},Na=function(t,e){return["len("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Fa=function(t,e){return"del "+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"\n"},Pa=function(t,e){var i=e.valueToCode(t,"DICT",e.ORDER_MEMBER)||"[]",n=t.getFieldValue("WHERE"),s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);switch(n){case"INSERT":var r=i+"["+s+"] = "+(e.valueToCode(this,"AT2",e.ORDER_ASSIGNMENT)||"0")+"\n";break;case"DELETE":r="del "+i+"["+s+"]\n";break;default:throw"Unhandled option (lists_setIndex2)"}return r},xa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".pop("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+")",e.ORDER_ATOMIC]},ka=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+".setdefault("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")\n"},Va=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++){var s=this.getFieldValue("KEY"+n);i[n]=s+": "+(e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0")}return[i="{"+i.join(", ")+"}",e.ORDER_ATOMIC]},Ya=function(t,e){return["dict("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Ba=function(t,e){return e.definitions_.import_json="import json",["json.dumps("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Ua=function(t,e){return e.definitions_.import_json="import json",["json.loads("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"null")+")",e.ORDER_ATOMIC]},Xa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"["+(e.valueToCode(this,"VAR1",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR2",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR3",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR4",e.ORDER_ASSIGNMENT)||"null")+"]",e.ORDER_ATOMIC]},Ga=function(t,e){return e.definitions_.import_json="import json",e.definitions_.import_ujson="import ujson",["ujson.loads("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Ha=function(t,e){var i=this.getFieldValue("OP"),n=Ha.OPERATORS[i],s="=="==n||"!="==n?e.ORDER_EQUALITY:e.ORDER_RELATIONAL;return[(e.valueToCode(this,"A",s)||"0")+" "+n+" "+(e.valueToCode(this,"B",s)||"0"),s]},Wa=function(t,e){var i=this.getFieldValue("OP1"),n=Ha.OPERATORS[i],s=this.getFieldValue("OP2"),r=Ha.OPERATORS[s];return[(e.valueToCode(this,"A",e.ORDER_RELATIONAL)||"0")+" "+n+" "+(e.valueToCode(this,"B",e.ORDER_RELATIONAL)||"0")+" "+r+" "+(e.valueToCode(this,"C",e.ORDER_RELATIONAL)||"0"),e.ORDER_RELATIONAL]};Ha.OPERATORS={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="};const ja=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",r=e.valueToCode(this,"B",n)||"False";if("AND"==i)var o=s+" and "+r;else if("OR"==i)o=s+" or "+r;else if("NOR"==i)o="not("+s+"^"+r+")";else o=s+"^"+r;return[o,n]},qa=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Ka=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},za=function(t,e){return["None",e.ORDER_ATOMIC]},$a=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Qa=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Ja=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},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"},il=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},nl=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 i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},rl=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ol=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},al=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ll=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},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"},hl=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"},cl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},_l=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},fl=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},Tl=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]},gl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Il=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"},El=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},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 i=e.variableDB_.getName(this.getFieldValue("NAME"),rt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var r=[],o=0;o<this.arguments_.length;o++){var a=e.variableDB_.getName(this.arguments_[o],rt.Variables.NAME_TYPE);r[o]=a}var l="def "+i+"("+r.join(", ")+"):\n"+n+s+"\n";return l=e.scrub_(this,l),e.setups_[i]=l,null},Al=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),rt.Procedures.NAME_TYPE),n=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);for(var s=[],r=0;r<this.arguments_.length;r++){var o=e.variableDB_.getName(this.arguments_[r],rt.Variables.NAME_TYPE);s[r]=o}var a="def "+i+"("+s.join(", ")+"):\n"+n+"\n";return a=e.scrub_(this,a),e.setups_[i]=a,null},yl=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("NAME"),rt.Procedures.NAME_TYPE),n=[],s=0;s<this.arguments_.length;s++)n[s]=e.valueToCode(this,"ARG"+s,e.ORDER_NONE)||"null";return[i+"("+n.join(", ")+")",e.ORDER_UNARY_POSTFIX]},Sl=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("NAME"),rt.Procedures.NAME_TYPE),n=[],s=0;s<this.arguments_.length;s++)n[s]=e.valueToCode(this,"ARG"+s,e.ORDER_NONE)||"null";return i+"("+n.join(", ")+")\n"},vl=function(t,e){var i="if ("+(e.valueToCode(this,"CONDITION",e.ORDER_NONE)||"False")+") :\n";this.hasReturnValue_?i+=" return "+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"None"):i+=" return None";return i+="\n"},Cl=function(t,e){var i="";this.hasReturnValue_?i+="return "+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"None"):i+="return None";return i+="\n"},Ll=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";if(1!=this.itemCount_)n=i+"= ("+n.join(", ")+")\n";else n=i+"= ("+n.join(", ")+",)\n";return n},bl=function(t,e){return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+"= ("+this.getFieldValue("TEXT")+")\n"},Dl=function(t,e){return["("+this.getFieldValue("TEXT")+")",e.ORDER_ATOMIC]},wl=function(t,e){var i=e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"1";return n.match(/^\d+$/)&&(n=parseInt(n,10)),[i+"["+n+"]",e.ORDER_ATOMIC]},Nl=function(t,e){return["len("+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Fl=function(t,e){return"del "+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+"\n"},Pl=function(t,e){return[(e.valueToCode(this,"TUP1",e.ORDER_ASSIGNMENT)||"0")+" + "+(e.valueToCode(this,"TUP2",e.ORDER_ASSIGNMENT)||"0"),e.ORDER_ATOMIC]},xl=function(t,e){var i=e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0";return[this.getFieldValue("DIR")+"("+i+")",e.ORDER_ATOMIC]},kl=function(t,e){return[this.getFieldValue("OP")+"("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")\n",e.ORDER_ATOMIC]},Vl=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";if("INDEX"==i)var r=n+".index("+s+")";else if("COUNT"==i)r=n+".count("+s+")";return[r,e.ORDER_ATOMIC]},Yl=function(t,e){var i,n=t.getFieldValue("OP");switch(e.definitions_.import_math="import math",t=e.valueToCode(t,"data",e.ORDER_NONE),n){case"LEN":i="len("+t+")";break;case"SUM":i="sum("+t+")";break;case"MIN":i="min("+t+")";break;case"MAX":i="max("+t+")";break;case"AVERAGE":i=e.provideFunction_("math_mean",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = [e for e in myList if type(e) == int or type(e) == float]"," if not localList: return"," return float(sum(localList)) / len(localList)"])+"("+t+")";break;case"MEDIAN":i=e.provideFunction_("math_median",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = sorted([e for e in myList if type(e) == int or type(e) == float])"," if not localList: return"," if len(localList) % 2 == 0:"," return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0"," else:"," return localList[(len(localList) - 1) // 2]"])+"("+t+")";break;case"MODE":i=e.provideFunction_("math_modes",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(some_list):"," modes = []"," # Using a lists of [item, count] to keep count rather than dict",' # to avoid "unhashable" errors when the counted item is itself a list or dict.'," counts = []"," maxCount = 1"," for item in some_list:"," found = False"," for count in counts:"," if count[0] == item:"," count[1] += 1"," maxCount = max(maxCount, count[1])"," found = True"," if not found:"," counts.append([item, 1])"," for counted_item, item_count in counts:"," if item_count == maxCount:"," modes.append(counted_item)"," return modes"])+"("+t+")";break;case"STD_DEV":e.definitions_.import_math="import math",i=e.provideFunction_("math_standard_deviation",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(numbers):"," n = len(numbers)"," if n == 0: return"," mean = float(sum(numbers)) / n"," variance = sum((x - mean) ** 2 for x in numbers) / n"," return math.sqrt(variance)"])+"("+t+")";break;default:throw"Unknown operator: "+n}if(i)return[i,e.ORDER_FUNCTION_CALL]},Bl=function(t,e){var i=e.valueToCode(t,"LIST",e.ORDER_MEMBER)||"[]",n=t.getFieldValue("WHERE1"),s=t.getFieldValue("WHERE2");switch(n){case"FROM_START":"0"==(r=e.getAdjustedInt(t,"AT1"))&&(r="");break;case"FROM_END":var r=e.getAdjustedInt(t,"AT1",1,!0);break;case"FIRST":r="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(s){case"FROM_START":var o=e.getAdjustedInt(t,"AT2",1);o-=1;break;case"FROM_END":o=e.getAdjustedInt(t,"AT2",1,!0);rt.isNumber(String(o))?"0"==o&&(o=""):(e.definitions_.import_sys="import sys",o+=" or sys.maxsize");break;case"LAST":o="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[i+"["+r+" : "+o+"]",e.ORDER_MEMBER]},Ul=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0";if(1!=this.itemCount_)i="("+i.join(", ")+")";else i="("+i.join(", ")+",)";return[i,e.ORDER_ATOMIC]},Xl=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"0")+"["+(e.valueToCode(this,"AT1",e.ORDER_ADDITIVE)||"0")+" : "+(e.valueToCode(this,"AT2",e.ORDER_ADDITIVE)||"0")+"]",e.ORDER_ATOMIC]},Gl=function(t,e){return e.definitions_.import_random="import random",["random.choice("+(e.valueToCode(this,"TUP",e.ORDER_ADDITIVE)||"mytup")+")",e.ORDER_ATOMIC]},Hl=function(t,e){return["tuple("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Wl=function(t,e){return["("+this.getFieldValue("CONTENT")+")",e.ORDER_ATOMIC]},jl=function(t,e){for(var i=e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return n=i+"= {"+n.join(", ")+"}\n",0==this.itemCount_&&(n=i+" = set()\n"),n},ql=function(t,e){return["len("+(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Kl=function(t,e){return[(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".pop()",e.ORDER_ATOMIC]},zl=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},$l=function(t,e){var i=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return[i+"."+this.getFieldValue("OPERATE")+"("+n+")",e.ORDER_ATOMIC]},Ql=function(t,e){var i=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return i+"."+this.getFieldValue("OPERATE")+"("+n+")\n"},Jl=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("OPERATE")+"("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},Zl=function(t,e){var i=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return[i+"."+this.getFieldValue("OPERATE")+"("+n+")",e.ORDER_ATOMIC]},tu=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".update("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},eu=function(t,e){return["{"+this.getFieldValue("TEXT")+"}",e.ORDER_ATOMIC]},iu=function(t,e){return["set("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},nu=function(t,e){return["'''<!DOCTYPE HTML>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n"+e.statementToCode(this,"HEAD")+"</head>\n<body>\n"+e.statementToCode(this,"BODY")+"</body>\n</html>\n'''",e.ORDER_ATOMIC]},su=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<h"+n+">\n"+i+"</h"+n+">\n"},ru=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t<meta charset="utf-8">\n'+i+"</"+n+">\n";else s="<"+n+">\n"+i+"</"+n+">\n";return s},ou=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"</"+n+">\n"},au=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"</"+s+">\n"},lu=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},uu=function(t,e){return'<input type="'+this.getFieldValue("LEVEL")+'" name="'+this.getFieldValue("NAME")+'" value="'+this.getFieldValue("VALUE")+'" '+(e.valueToCode(this,"style")||"")+" />"},pu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},hu=function(){return this.getFieldValue("TEXT")+"\n"},du=function(t){return t.getFieldValue("TEXT")+"\n"},cu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},_u=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},fu=function(){return""},Tu=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},mu=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),r=0;r<t.itemCount_;r++)s[r]=e.valueToCode(t,"ARGUMENT"+r,e.ORDER_NONE)||"___";var o=i+"("+s.join(", ")+")";return n?[o,e.ORDER_ATOMIC]:o+"\n"},gu=function(t,e){var i=e.valueToCode(t,"MODULE",e.ORDER_ATOMIC),n=e.valueToCode(t,"NAME",e.ORDER_ATOMIC);return[i+"."+(n=n.substring(1,n.length-1)),e.ORDER_NONE]},Iu={};Iu.NAME_TYPE=rt.PROCEDURE_CATEGORY_NAME,Iu.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s<e.length;s++)if(e[s].getProcedureDef){var r=e[s].getProcedureDef();r&&(r[2]?i.push(r):n.push(r))}return n.sort(Iu.procTupleComparator_),i.sort(Iu.procTupleComparator_),[n,i]},Iu.procTupleComparator_=function(t,e){return t[0].toLowerCase().localeCompare(e[0].toLowerCase())},Iu.findLegalName=function(t,e){if(e.isInFlyout)return t;for(t=t||rt.Msg.UNNAMED_KEY||"unnamed";!Iu.isLegalName_(t,e.workspace,e);){var i=t.match(/^(.*?)(\d+)$/);i?t=i[1]+(parseInt(i[2],10)+1):t+="2"}return t},Iu.isLegalName_=function(t,e,i){return!Iu.isNameUsed(t,e,i)},Iu.isNameUsed=function(t,e,i){for(var n=e.getAllBlocks(!1),s=0;s<n.length;s++)if(n[s]!=i&&n[s].getProcedureDef){var r=n[s].getProcedureDef();if(rt.Names.equals(r[0],t))return!0}return!1},Iu.rename=function(t){t=t.trim();var e=Iu.findLegalName(t,this.getSourceBlock()),i=this.getValue();if(i!=t&&i!=e)for(var n=this.getSourceBlock().workspace.getAllBlocks(!1),s=0;s<n.length;s++)n[s].renameProcedure&&n[s].renameProcedure(i,e);return e},Iu.flyoutCategory=function(t){var e,i,n=[];rt.Blocks.procedures_defnoreturn&&((i=rt.utils.xml.createElement("block")).setAttribute("type","procedures_defnoreturn"),i.setAttribute("gap",16),(e=rt.utils.xml.createElement("field")).setAttribute("name","NAME"),e.appendChild(rt.utils.xml.createTextNode(rt.Msg.PROCEDURES_DEFNORETURN_PROCEDURE)),i.appendChild(e),n.push(i));rt.Blocks.procedures_defreturn&&((i=rt.utils.xml.createElement("block")).setAttribute("type","procedures_defreturn"),i.setAttribute("gap",16),(e=rt.utils.xml.createElement("field")).setAttribute("name","NAME"),e.appendChild(rt.utils.xml.createTextNode(rt.Msg.PROCEDURES_DEFRETURN_PROCEDURE)),i.appendChild(e),n.push(i));rt.Blocks.procedures_return&&((i=rt.utils.xml.createElement("block")).setAttribute("type","procedures_return"),i.setAttribute("gap",16),n.push(i));rt.Blocks.procedures_ifreturn&&((i=rt.utils.xml.createElement("block")).setAttribute("type","procedures_ifreturn"),i.setAttribute("gap",16),n.push(i));function s(t,e){for(var i=0;i<t.length;i++){var s=t[i][0],r=t[i][1],o=rt.utils.xml.createElement("block");o.setAttribute("type",e),o.setAttribute("gap",16);var a=rt.utils.xml.createElement("mutation");a.setAttribute("name",s),o.appendChild(a);for(var l=0;l<r.length;l++){var u=rt.utils.xml.createElement("arg");u.setAttribute("name",r[l]),a.appendChild(u)}n.push(o)}}n.length&&n[n.length-1].setAttribute("gap",24);var r=Iu.allProcedures(t);return s(r[0],"procedures_callnoreturn"),s(r[1],"procedures_callreturn"),n},Iu.getCallers=function(t,e){for(var i=[],n=e.getAllBlocks(!1),s=0;s<n.length;s++)if(n[s].getProcedureCall){var r=n[s].getProcedureCall();r&&rt.Names.equals(r,t)&&i.push(n[s])}return i},Iu.mutateCallers=function(t){const e=rt.Events.getRecordUndo(),i=t.getProcedureDef()[0],n=t.mutationToDom(!0),s=rt.Procedures.getCallers(i,t.workspace);for(let t,i=0;t=s[i];i++){const i=t.mutationToDom(),s=i&&rt.utils.xml.domToText(i);t.domToMutation&&t.domToMutation(n);const r=t.mutationToDom(),o=r&&rt.utils.xml.domToText(r);s!==o&&(rt.Events.setRecordUndo(!1),rt.Events.fire(new(rt.Events.get(rt.Events.BLOCK_CHANGE))(t,"mutation",null,s,o)),rt.Events.setRecordUndo(e))}},Iu.getDefinition=function(t,e){for(var i=e.getTopBlocks(!1),n=0;n<i.length;n++)if(i[n].getProcedureDef){var s=i[n].getProcedureDef();if(s&&rt.Names.equals(s[0],t))return i[n]}return null};const Eu=Iu,Ou=new rt.Generator("Python");Ou.INDENT=" ",Ou.addReservedWords("False,None,True,and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,nonlocal,not,or,pass,print,raise,return,try,while,with,yield,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StandardError,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,ZeroDivisionError,_,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,all,any,apply,ascii,basestring,bin,bool,buffer,bytearray,bytes,callable,chr,classmethod,cmp,coerce,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,execfile,exit,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,license,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip"),Ou.ORDER_ATOMIC=0,Ou.ORDER_COLLECTION=1,Ou.ORDER_STRING_CONVERSION=1,Ou.ORDER_UNARY_POSTFIX=1,Ou.ORDER_UNARY_PREFIX=2,Ou.ORDER_MEMBER=2.1,Ou.ORDER_FUNCTION_CALL=2.2,Ou.ORDER_EXPONENTIATION=3,Ou.ORDER_UNARY_SIGN=4,Ou.ORDER_BITWISE_NOT=4,Ou.ORDER_MULTIPLICATIVE=5,Ou.ORDER_ADDITIVE=6,Ou.ORDER_BITWISE_SHIFT=7,Ou.ORDER_BITWISE_AND=8,Ou.ORDER_BITWISE_XOR=9,Ou.ORDER_BITWISE_OR=10,Ou.ORDER_RELATIONAL=11,Ou.ORDER_EQUALITY=11,Ou.ORDER_LOGICAL_NOT=12,Ou.ORDER_LOGICAL_AND=13,Ou.ORDER_LOGICAL_OR=14,Ou.ORDER_ASSIGNMENT=14,Ou.ORDER_CONDITIONAL=15,Ou.ORDER_LAMBDA=16,Ou.ORDER_NONE=99,Ou.ORDER_OVERRIDES=[[Ou.ORDER_FUNCTION_CALL,Ou.ORDER_MEMBER],[Ou.ORDER_FUNCTION_CALL,Ou.ORDER_FUNCTION_CALL],[Ou.ORDER_MEMBER,Ou.ORDER_MEMBER],[Ou.ORDER_MEMBER,Ou.ORDER_FUNCTION_CALL]],Ou.init=function(){Ou.PASS=this.INDENT+"pass\n",Ou.definitions_=Object.create(null),Ou.functionNames_=Object.create(null),Ou.setups_=Object.create(null),Ou.loops_=Object.create(null),Ou.codeEnd_=Object.create(null),Ou.variableDB_?Ou.variableDB_.reset():Ou.variableDB_=new pt(Ou.RESERVED_WORDS_)},Ou.finish=function(t){""!==t&&(t=(t=t.replace(/\n/g,"\n")).replace(/\n\s+$/,"\n"));var e=[],i=[],n=[];for(var s in this.definitions_){var r=this.definitions_[s];0===s.indexOf("import")?e.push(r):0===s.indexOf("var_declare")?i.push(r):n.push(r)}e.length&&e.push("\n\n"),i.length&&i.push("\n\n"),n.length&&n.push("\n\n");var o=[];for(var s in Ou.functions_)o.push(Ou.functions_[s]);o.length&&o.push("\n\n");var a=[];for(var s in Ou.setups_)a.push(Ou.setups_[s]);a.length&&a.push("\n\n");var l=[];for(var s in Ou.loops_)l.push(Ou.loops_[s]);var u=[];for(var s in Ou.codeEnd_)u.push(Ou.codeEnd_[s]);return 0!==u.length&&u.push("\n"),l.length>0?e.join("\n")+i.join("\n")+n.join("\n")+o.join("\n")+a.join("")+t+"while True:\n"+l.join("")+u.join("\n"):e.join("\n")+i.join("\n")+n.join("\n")+o.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,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(r=t.getCommentText())&&(r=rt.utils.string.wrap(r,Ou.COMMENT_WRAP-3),n+=Ou.prefixLines(r+"\n","# "));for(var s=0;s<t.inputList.length;s++)if(t.inputList[s].type==rt.INPUT_VALUE){var r,o=t.inputList[s].connection.targetBlock();if(o)(r=Ou.allNestedComments(o))&&(n+=Ou.prefixLines(r,"# "))}}var a=t.nextConnection&&t.nextConnection.targetBlock();return n+e+(i?"":Ou.blockToCode(a))},Ou.getAdjustedInt=function(t,e,i,n){var s=i||0;t.workspace.options.oneBasedIndex&&s--;var r=t.workspace.options.oneBasedIndex?"1":"0",o=s?Ou.ORDER_ADDITIVE:Ou.ORDER_NONE,a=Ou.valueToCode(t,e,o)||r;return rt.isNumber(a)?(a=parseInt(a,10)+s,n&&(a=-a)):(a=s>0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",n&&(a="-"+a)),a};const Mu=205,Ru={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(rt.Msg.MIXLY_CHOOSE_AND_GET).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[rt.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[rt.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},Au={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(rt.Msg.MIXLY_SETUP).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[rt.Msg.MIXLY_AipSpeech,"AipSpeech"],[rt.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[rt.Msg.MIXLY_AipFace,"AipFace"],[rt.Msg.MIXLY_AipOcr,"AipOcr"],[rt.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(rt.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},yu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipSpeech_synthesis).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(rt.Msg.OLED_STRING).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Su={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipSpeech_asr).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_AipSpeech_File).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},vu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipImageClassify).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(rt.Msg.MIXLY_AIP_FUNC).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(rt.Msg.MIXLY_AipImageClassify_Image).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Cu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[rt.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[rt.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[rt.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[rt.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[rt.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},Lu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipFace_match).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_AipImageClassify_Image+"1"+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(rt.Msg.MIXLY_AipImageClassify_Image+"2"+rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},bu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipOcr).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(rt.Msg.MIXLY_AIP_FUNC).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(rt.Msg.MIXLY_AipImageClassify_Image).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Du={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[rt.Msg.MIXLY_AipOcr_webImage,"webImage"],[rt.Msg.MIXLY_AipOcr_idcard,"idcard"],[rt.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[rt.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[rt.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[rt.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[rt.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[rt.Msg.MIXLY_AipOcr_receipt,"receipt"],[rt.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[rt.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[rt.Msg.MIXLY_AipOcr_form,"tableRecognition"],[rt.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[rt.Msg.MIXLY_AipOcr_passport,"passport"],[rt.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},wu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipNlp).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(rt.Msg.MIXLY_AIP_FUNC).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(rt.Msg.OLED_STRING).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Nu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipNlp_Sim).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(rt.Msg.MIXLY_AIP_FUNC).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(rt.Msg.OLED_STRING+"1").setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(rt.Msg.OLED_STRING+"2").setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Fu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_AipNlp_lexer,"lexer"],[rt.Msg.MIXLY_AipNlp_depParser,"depParser"],[rt.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[rt.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[rt.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[rt.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[rt.Msg.MIXLY_AipNlp_keyword,"keyword"],[rt.Msg.MIXLY_AipNlp_topic,"topic"],[rt.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[rt.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Pu={init:function(){this.setColour(Mu),this.appendDummyInput("").appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[rt.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},xu={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipNlp_topic).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(rt.Msg.MIXLY_AipNlp_Topic_Title).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(rt.Msg.MIXLY_AipNlp_Topic_Content).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},ku={init:function(){this.setColour(Mu),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_AipNlp_summary).appendField(rt.Msg.MIXLY_Client).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(rt.Msg.MIXLY_AipNlp_Topic_Content).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(rt.Msg.MIXLY_LIST_LEN).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(rt.Msg.MIXLY_AIP_ATTR).setAlign(rt.inputs.Align.RIGHT),this.setTooltip(rt.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Vu={init:function(){this.setColour(Mu),this.appendValueInput("VAR").appendField(rt.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(rt.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Yu={init:function(){this.setColour(Mu),this.appendValueInput("VAR").appendField(rt.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(rt.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},Bu={init:function(){this.setColour(Mu),this.appendValueInput("AI").appendField(rt.Msg.MIXPY_AI_RESULT).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_AipImageClassify,"Image"],[rt.Msg.MIXLY_AipSpeech_asr,"Speech"],[rt.Msg.MIXLY_AipFace_match,"Face"],[rt.Msg.MIXLY_AipOcr,"Ocr"],[rt.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[rt.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(rt.Msg.LOGIC_NEGATE_TOOLTIP)}},Uu="#526FC3",Xu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Gu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},ju={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},qu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ku={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$u={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},Qu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ju={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zu={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},tp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ep={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ip={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},np={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},rp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},op={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ap={init:function(){this.appendDummyInput().appendField("准备").appendField(new rt.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),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(Uu),this.setTooltip(""),this.setHelpUrl("")}},up={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},cp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},_p={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},Tp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},gp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ip={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ep={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Op={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Mp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new rt.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Rp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ap={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},yp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Sp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField("n"+rt.Msg.MIXLY_VALUE2).appendField(new rt.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},vp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Cp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Lp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},bp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Dp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},wp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Np={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Fp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Pp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},xp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},kp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("计算").appendField(new rt.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Vp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Yp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField(new rt.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new rt.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Bp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("设置").appendField(new rt.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Up={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Xp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("若3人一排列队多1人"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("若5人一排列队多2人"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("若7人一排列队多2人"),this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Gp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new rt.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Hp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("使士兵").appendField(new rt.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Wp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("剩余").appendField(new rt.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},jp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},qp={init:function(){this.appendDummyInput().setAlign(rt.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setTooltip(""),this.setHelpUrl("")}},Kp={init:function(){this.appendDummyInput().appendField("准备").appendField(new rt.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Uu),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},zp={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$p={init:function(){this.setColour(Uu),this.appendDummyInput().appendField(rt.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},Qp={init:function(){this.setColour(Uu),this.appendDummyInput("").setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Jp="#3288dd",Zp={init:function(){this.setColour(Jp),this.appendValueInput("DOMAIN").appendField(rt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(rt.Msg.blockpy_REQUESTS_GET).appendField(new rt.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},th={init:function(){this.setColour(Jp),this.appendValueInput("URL").appendField(rt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(rt.Msg.blockpy_CONDUCT).appendField(new rt.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(rt.Msg.blockpy_REQUESTS).appendField(rt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},eh={init:function(){this.setColour(Jp),this.appendValueInput("URL").appendField(rt.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(rt.Msg.blockpy_CONDUCT).appendField(new rt.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(rt.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(rt.Msg.blockpy_REQUESTS+rt.Msg.OLED_STRING),this.appendDummyInput("").appendField(rt.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},ih={init:function(){this.appendValueInput("VAL");var t=[[rt.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[rt.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[rt.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[rt.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[rt.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Jp),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_JS_GET).appendField(new rt.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},nh={init:function(){this.appendValueInput("VAR").appendField(rt.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Jp),this.appendDummyInput("").appendField(rt.Msg.blockpy_CONDUCT).appendField(new rt.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:rt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},sh="f0a559",rh={init:function(){this.setColour(sh),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},oh={init:function(){this.setColour(sh),this.appendValueInput("FILE").appendField(rt.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(rt.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ah={init:function(){this.setColour(sh),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(rt.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},lh={init:function(){this.setColour(sh),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(rt.Msg.MIXLY_MILLIS+rt.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},uh={init:function(){this.setColour(sh),this.appendDummyInput().appendField(rt.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},ph={init:function(){this.setColour(sh),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_IMAGE);var t=[[rt.Msg.MIXLY_CV_RECT,"rectangle"],[rt.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(rt.Msg.MIXLY_DISPLAY_DRAW).appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+rt.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+rt.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(rt.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},hh={init:function(){this.setColour(sh),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(rt.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(rt.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+rt.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new rt.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(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+rt.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(rt.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},dh={init:function(){this.setColour(sh),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},ch={init:function(){this.setColour(sh),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(rt.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(rt.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(rt.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},_h={init:function(){this.setColour(sh),this.appendValueInput("FILE").appendField(rt.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(rt.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(rt.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(rt.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(rt.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(rt.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(rt.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},fh=170,Th={init:function(){this.setColour(fh),this.appendDummyInput("").appendField(rt.Msg.blockpy_series_create).appendField(new rt.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(rt.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mh={init:function(){this.setColour(fh),this.appendDummyInput("").appendField(rt.Msg.blockpy_series_create).appendField(new rt.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(rt.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(rt.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},gh={init:function(){this.setColour(fh),this.appendDummyInput("").appendField(rt.Msg.blockpy_dataframe_create).appendField(new rt.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(rt.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ih={init:function(){this.setColour(fh);var t=[[rt.Msg.DATAFRAME_RAW,"index"],[rt.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(rt.Msg.blockpy_dataframe_create).appendField(new rt.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(rt.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new rt.FieldDropdown(t),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(rt.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Eh={init:function(){this.setColour(fh),this.appendDummyInput("").appendField(rt.Msg.blockpy_dataframe_create).appendField(new rt.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(rt.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(rt.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(rt.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Oh={init:function(){this.setColour(fh),this.appendDummyInput("").appendField(new rt.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new rt.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Mh={init:function(){this.setColour(fh);var t=[[rt.Msg.SERIES_INDEX,"index"],[rt.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(rt.Msg.SERIES_INDEX_VALUE).appendField(new rt.FieldDropdown(t),"INDEX_VALUE"),this.setOutput(!0,"List");var e=this;this.setTooltip((function(){var t=e.getFieldValue("INDEX_VALUE");return{index:rt.Msg.SERIES_INDEX_TOOLTIP,value:rt.Msg.HTML_VALUE_TOOLTIP}[t]}))}},Rh={init:function(){this.setColour(fh),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(rt.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(rt.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(rt.Msg.TUPLE_GET_INDEX_TOOLTIP)}},Ah={init:function(){this.setColour(fh),this.appendValueInput("SER").setCheck("Series").appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yh={init:function(){this.setColour(fh);var t=[[rt.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[rt.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[rt.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[rt.Msg.COLOUR_RGB_BLUE,"b"],[rt.Msg.COLOUR_RGB_GREEN,"g"],[rt.Msg.COLOUR_RGB_RED,"r"],[rt.Msg.COLOUR_CYAN,"c"],[rt.Msg.COLOUR_MAGENTA,"m"],[rt.Msg.COLOUR_YELLOW,"y"],[rt.Msg.COLOUR_BLACK,"k"],[rt.Msg.COLOUR_WHITE,"w"]],i=[[rt.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[rt.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new rt.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new rt.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sh={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vh={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ch={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lh={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bh={init:function(){this.setColour(fh);var t=[[rt.Msg.PYLAB_LABEL_X,"x"],[rt.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_SET_LABEL).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(rt.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dh={init:function(){this.setColour(fh),this.appendValueInput("FROM").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_SPLITBYDOU).appendField(rt.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},wh={init:function(){this.setColour(fh);var t=[[rt.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[rt.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(rt.Msg.MIXLY_DISPLAY_DRAW).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.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:rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:rt.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Nh={init:function(){this.setColour(fh);var t=[[rt.Msg.COLOUR_RGB_BLUE,"b"],[rt.Msg.COLOUR_RGB_GREEN,"g"],[rt.Msg.COLOUR_RGB_RED,"r"],[rt.Msg.COLOUR_CYAN,"c"],[rt.Msg.COLOUR_MAGENTA,"m"],[rt.Msg.COLOUR_YELLOW,"y"],[rt.Msg.COLOUR_BLACK,"k"],[rt.Msg.COLOUR_WHITE,"w"]],e=[[rt.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[rt.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_SCATTER).appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(rt.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new rt.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Fh={init:function(){this.setColour(fh);var t=[[rt.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[rt.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[rt.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[rt.Msg.COLOUR_RGB_BLUE,"b"],[rt.Msg.COLOUR_RGB_GREEN,"g"],[rt.Msg.COLOUR_RGB_RED,"r"],[rt.Msg.COLOUR_CYAN,"c"],[rt.Msg.COLOUR_MAGENTA,"m"],[rt.Msg.COLOUR_YELLOW,"y"],[rt.Msg.COLOUR_BLACK,"k"],[rt.Msg.COLOUR_WHITE,"w"]],i=[[rt.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[rt.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_PLOT_XY).appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new rt.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new rt.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ph={init:function(){this.setColour(fh);var t=[[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[rt.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_BAR).appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(rt.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(rt.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new rt.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},xh={init:function(){this.setColour(fh);var t=[[rt.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[rt.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[rt.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[rt.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[rt.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[rt.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_PIE).appendField(rt.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(rt.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(rt.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new rt.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(rt.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new rt.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},kh={init:function(){this.setColour(fh),this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_HIST).appendField(rt.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vh={init:function(){this.setColour(fh);var t=[[rt.Msg.PYLAB_LABEL_X,"x"],[rt.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(rt.Msg.MIXLY_SETTING).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_TICKS).appendField(rt.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Yh={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[rt.Msg.LANG_MATH_TO_ROUND,"round"],[rt.Msg.LANG_MATH_TO_CEIL,"ceil"],[rt.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(fh),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(rt.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new rt.FieldDropdown(t),"OP"),this.setTooltip(rt.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Bh={init:function(){this.setColour(fh),this.appendValueInput("VET").setCheck(Number).appendField(rt.Msg.mixpy_SUBPLOT).appendField(rt.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(rt.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(rt.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Uh={init:function(){this.setColour(fh),this.appendValueInput("FILENAME").appendField(rt.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[rt.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(rt.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xh={init:function(){this.setColour(fh),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(rt.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(rt.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new rt.FieldDropdown([[rt.Msg.DATAFRAME_COLUMN,"column"],[rt.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(rt.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Gh={init:function(){this.setColour(fh),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Hh={init:function(){this.setColour(fh);var t=[[rt.Msg.TEXT_TRIM_LEFT,"right"],[rt.Msg.mixpy_PL_TEXT_CENTER,"center"],[rt.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[rt.Msg.mixpy_PL_TEXT_TOP,"bottom"],[rt.Msg.mixpy_PL_TEXT_CENTER,"center"],[rt.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(rt.Msg.MIXLY_SETTING).appendField(rt.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(rt.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(rt.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(rt.Msg.mixpy_PL_TEXT_HOR).appendField(new rt.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(rt.Msg.mixpy_PL_TEXT_VER).appendField(new rt.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PL_TEXT_TOOLTIP)}},Wh={init:function(){this.setColour(fh),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(rt.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},jh={init:function(){this.setColour(fh),this.appendValueInput("SER").setCheck("Series").appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qh={init:function(){this.setColour(fh);var t=[[rt.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[rt.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[rt.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[rt.Msg.COLOUR_RGB_BLUE,"b"],[rt.Msg.COLOUR_RGB_GREEN,"g"],[rt.Msg.COLOUR_RGB_RED,"r"],[rt.Msg.COLOUR_CYAN,"c"],[rt.Msg.COLOUR_MAGENTA,"m"],[rt.Msg.COLOUR_YELLOW,"y"],[rt.Msg.COLOUR_BLACK,"k"],[rt.Msg.COLOUR_WHITE,"w"]],i=[[rt.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[rt.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(rt.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new rt.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new rt.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Kh={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zh={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$h={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qh={init:function(){this.setColour(fh),this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jh={init:function(){this.setColour(fh);var t=[[rt.Msg.PYLAB_LABEL_X,"x"],[rt.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(rt.Msg.blockpy_PYLAB_SET_LABEL).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(rt.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zh={init:function(){this.setColour(fh);var t=[[rt.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[rt.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(rt.Msg.MIXLY_DISPLAY_DRAW).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.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:rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:rt.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},td={init:function(){this.setColour(fh);var t=[[rt.Msg.COLOUR_RGB_BLUE,"b"],[rt.Msg.COLOUR_RGB_GREEN,"g"],[rt.Msg.COLOUR_RGB_RED,"r"],[rt.Msg.COLOUR_CYAN,"c"],[rt.Msg.COLOUR_MAGENTA,"m"],[rt.Msg.COLOUR_YELLOW,"y"],[rt.Msg.COLOUR_BLACK,"k"],[rt.Msg.COLOUR_WHITE,"w"]],e=[[rt.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[rt.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_SCATTER).appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(rt.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new rt.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},ed={init:function(){this.setColour(fh);var t=[[rt.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[rt.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[rt.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[rt.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[rt.Msg.COLOUR_RGB_BLUE,"b"],[rt.Msg.COLOUR_RGB_GREEN,"g"],[rt.Msg.COLOUR_RGB_RED,"r"],[rt.Msg.COLOUR_CYAN,"c"],[rt.Msg.COLOUR_MAGENTA,"m"],[rt.Msg.COLOUR_YELLOW,"y"],[rt.Msg.COLOUR_BLACK,"k"],[rt.Msg.COLOUR_WHITE,"w"]],i=[[rt.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[rt.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[rt.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_PLOT_XY).appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new rt.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(rt.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new rt.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},id={init:function(){this.setColour(fh);var t=[[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[rt.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_BAR).appendField(rt.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(rt.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(rt.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new rt.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(rt.Msg.HTML_COLOUR).appendField(new rt.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},nd={init:function(){this.setColour(fh);var t=[[rt.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[rt.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[rt.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[rt.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[rt.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[rt.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_PIE).appendField(rt.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(rt.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(rt.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new rt.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(rt.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new rt.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},sd={init:function(){this.setColour(fh),this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_HIST).appendField(rt.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(rt.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rd={init:function(){this.setColour(fh);var t=[[rt.Msg.PYLAB_LABEL_X,"x"],[rt.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(rt.Msg.MIXLY_SETTING).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(rt.Msg.mixpy_PYLAB_TICKS).appendField(rt.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(rt.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},od={init:function(){this.setColour(fh),this.appendValueInput("VET").setCheck(Number).appendField(rt.Msg.mixpy_SUBPLOT).appendField(rt.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(rt.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(rt.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ad={init:function(){this.setColour(fh),this.appendDummyInput("").appendField(rt.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},ld={init:function(){this.setColour(fh);var t=[[rt.Msg.TEXT_TRIM_LEFT,"right"],[rt.Msg.mixpy_PL_TEXT_CENTER,"center"],[rt.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[rt.Msg.mixpy_PL_TEXT_TOP,"bottom"],[rt.Msg.mixpy_PL_TEXT_CENTER,"center"],[rt.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(rt.Msg.MIXLY_SETTING).appendField(rt.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(rt.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(rt.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(rt.Msg.mixpy_PL_TEXT_HOR).appendField(new rt.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(rt.Msg.mixpy_PL_TEXT_VER).appendField(new rt.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.mixpy_PL_TEXT_TOOLTIP)}},ud={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},pd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},hd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new rt.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(fh),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new rt.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.")}},cd={init:function(){this.setColour(fh),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.")}},_d={init:function(){this.setColour(fh),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.")}},fd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new rt.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},Td={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new rt.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(fh),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},gd={init:function(){this.setColour(fh),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},Id={init:function(){this.setColour(fh),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},Ed={init:function(){this.setColour(fh),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(fh),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},Md={init:function(){this.setColour(fh),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},Rd={init:function(){this.setColour(fh),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},Ad={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},yd={init:function(){this.setColour(fh),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},Sd={init:function(){this.setColour(fh),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new rt.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.")}},vd={init:function(){this.setColour(fh),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},Cd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new rt.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},Ld={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new rt.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},bd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},Dd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},wd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},Nd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},Fd={init:function(){this.setColour(fh),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Pd={init:function(){this.setColour(fh),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},xd={init:function(){this.setColour(fh),this.appendValueInput("DICT").setAlign(rt.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(rt.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField("排序方式").appendField(new rt.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},kd={init:function(){this.setColour(fh),this.appendValueInput("DICT").setAlign(rt.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField("获取").appendField(new rt.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(rt.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Vd={init:function(){this.setColour(fh),this.appendValueInput("DICT").setAlign(rt.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(rt.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Yd={init:function(){this.setColour(fh),this.appendValueInput("DICT").setAlign(rt.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(rt.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Bd={init:function(){this.setColour(fh),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(rt.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ud={init:function(){this.setColour(fh),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xd=80,Gd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new rt.FieldLabel(rt.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new rt.FieldLabel(rt.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new rt.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new rt.FieldLabel(rt.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new rt.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(rt.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(rt.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 i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("ds_create_linkedlist_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldTextInput(t.length>e?t[e]:"name"),"KEY"+e).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hd={init:function(){this.setColour(Xd),this.appendDummyInput().appendField(rt.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},Wd={init:function(){this.setColour(Xd),this.appendDummyInput().appendField(rt.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},jd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(rt.Msg.DS_CREATE_NODE_USE).appendField(new rt.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(rt.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_CREATE_NODE_TOOLTIP)}},qd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(rt.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_AIP_ATTR).appendField(new rt.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(rt.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},Kd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(rt.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_AIP_ATTR).appendField(new rt.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(rt.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},zd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(rt.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[rt.Msg.DS_ADD_NODE_BEFORE,"before"],[rt.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(rt.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(rt.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_ADD_NODE_TOOLTIP)}},$d={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(rt.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[rt.Msg.DS_ADD_NODE_BEFORE,"before"],[rt.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(rt.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(rt.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new rt.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_AS),this.appendDummyInput("").appendField(rt.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_ADD_NODE_TOOLTIP)}},Qd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(rt.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(rt.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(rt.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_DEL_NODE_TOOLTIP)}},Jd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(rt.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(rt.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(rt.Msg.DS_DEL_NODE_ATTR).appendField(new rt.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_AS),this.appendDummyInput("").appendField(rt.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_DEL_NODE_TOOLTIP)}},Zd={init:function(){this.setColour(Xd),this.appendValueInput("NODE").appendField(rt.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(rt.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(rt.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.DS_DEL_NODE_TOOLTIP)}},tc="#777777",ec={init:function(){this.setColour(tc),this.appendDummyInput("").appendField("from ").appendField(new rt.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new rt.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ic={init:function(){this.setColour(tc),this.appendDummyInput("").appendField("import ").appendField(new rt.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},nc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;e<this.arguments_.length;e++){var i=document.createElement("arg");i.setAttribute("name",this.arguments_[e]),t.appendChild(i)}return t},domToMutation:function(t){this.arguments_=[];for(var e=0;t.childNodes[e];e++){let i=t.childNodes[e];"arg"==i.nodeName.toLowerCase()&&this.arguments_.push(i.getAttribute("name"))}this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("factory_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("factory_create_with_item");s.initSvg(),s.setFieldValue(this.arguments_[n],"NAME"),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){this.arguments_=[];for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)this.arguments_.push(e.getFieldValue("NAME")),i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setAlign(rt.inputs.Align.RIGHT).appendField(this.arguments_[t])}},sc={init:function(){this.setColour(tc),this.appendDummyInput().appendField(rt.Msg.MIXLY_PARAMS),this.appendStatementInput("STACK"),this.contextMenu=!1}},rc={init:function(){this.setColour(tc),this.appendDummyInput().appendField(rt.Msg.LISTS_CREATE_WITH_ITEM_TITLE+":").appendField(new rt.FieldTextInput("x"),"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1}},oc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new rt.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:nc.mutationToDom,domToMutation:nc.domToMutation,decompose:nc.decompose,compose:nc.compose,saveConnections:nc.saveConnections,updateShape_:nc.updateShape_},ac={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput("test"),"NAME").appendField("=").appendField(new rt.FieldTextInput("Test"),"TYPE").appendField("()"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput("test"),"NAME").appendField(".").appendField(new rt.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:nc.mutationToDom,domToMutation:nc.domToMutation,decompose:nc.decompose,compose:nc.compose,saveConnections:nc.saveConnections,updateShape_:nc.updateShape_},uc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput("test"),"NAME").appendField(".").appendField(new rt.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new rt.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:nc.mutationToDom,domToMutation:nc.domToMutation,decompose:nc.decompose,compose:nc.compose,saveConnections:nc.saveConnections,updateShape_:nc.updateShape_},pc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput('display.scroll("Hello World!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldTextInput("test"),"VALUE"),this.setOutput(!0)}},dc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldMultilineInput('display.scroll("Hello World!")\ndisplay.scroll("Hello Mixly!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},cc={init:function(){this.setColour(tc),this.appendDummyInput("").appendField(new rt.FieldMultilineInput("Hello\nMixly"),"VALUE"),this.setOutput(!0)}},_c=40,fc={init:function(){this.setColour(_c),this.appendDummyInput("").appendField(rt.Msg.MIXLY_HARDWARE),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(rt.Msg.MIXLY_HARDWARE_START),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tc={init:function(){this.setColour(_c),this.appendDummyInput("").appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_HIGH,"HIGH"],[rt.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},mc={init:function(){this.setColour(_c),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(rt.Msg.MIXLY_Digital_PINMODEOUT).appendField(rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("STAT").appendField(rt.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.LANG_INOUT_DIGITAL_WRITE_TOOLTIP)}},gc={init:function(){this.setColour(_c),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(rt.Msg.MIXLY_Digital_PINMODEIN).appendField(rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_INOUT_DIGITAL_READ)}},Ic={init:function(){this.setColour(_c),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(rt.Msg.MIXLY_Analog_PINMODEOUT).appendField(rt.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).appendField(rt.Msg.MIXLY_VALUE2).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_WRITE)}},Ec={init:function(){this.setColour(_c),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(rt.Msg.MIXLY_Analog_PINMODEIN).appendField(rt.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_READ)}},Oc={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(rt.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(rt.Msg.INOUT_input_TOOLTIP)}},Mc={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(rt.Msg.BLOCKPY_PRINT_TOOLTIP)}},Rc={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(rt.Msg.TEXT_PRINT_TOOLTIP)}},Ac={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(rt.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},yc={init:function(){var t=[[rt.Msg.LANG_MATH_STRING,"str"],[rt.Msg.LANG_MATH_INT,"int"],[rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(20),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(rt.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:rt.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:rt.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:rt.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Sc={init:function(){var t=[[rt.Msg.LANG_MATH_STRING,"str"],[rt.Msg.LANG_MATH_INT,"int"],[rt.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(20),this.appendDummyInput("").appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new rt.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(rt.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:rt.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:rt.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:rt.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},vc={init:function(){this.setColour(20),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new rt.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("inout_print_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(rt.Msg.MIXLY_MIXPY_INOUT_PRINT_EMPTY);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(rt.Msg.MIXLY_SERIAL_PRINTLN)}}},Cc={init:function(){this.setColour(20),this.appendDummyInput().appendField(rt.Msg.MIXLY_SERIAL_PRINTLN),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},Lc={init:function(){this.setColour(20),this.appendDummyInput().appendField(rt.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_ITEM_TOOLTIP),this.contextMenu=!1}},bc="#526FC3",Dc={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+rt.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setCheck(String).appendField(rt.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setCheck(String).appendField(rt.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setCheck(String).appendField(rt.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(rt.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setCheck(String).appendField(rt.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").appendField(rt.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},wc={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},Nc={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Fc={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new rt.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},Pc={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(rt.inputs.Align.RIGHT),this.appendDummyInput().appendField(new rt.FieldLabel(rt.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(rt.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new rt.Mutator(["iot_publish_item"])),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var s=t.newBlock("iot_create_with_item");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),i=[],n=0;e;)i[n]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),n++;this.itemCount_=n,this.updateShape_();for(n=0;n<this.itemCount_;n++)i[n]&&this.getInput("ADD"+n).connection.connect(i[n])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=0;e;){var n=this.getInput("ADD"+i);e.valueConnection_=n&&n.connection.targetConnection,i++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.setFieldValue(rt.Msg.MIXLY_ESP32_PUBLISH_ONENET_EMPTY,"TIP");else{this.setFieldValue(rt.Msg.MIXLY_ESP32_PUBLISH_ONENET,"TIP");for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldTextInput(t.length>e?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},xc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},kc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Vc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Yc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(rt.Msg.MIXLY_EMQX_SERVER).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(rt.Msg.MIXLY_WIFI_USERNAME).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(rt.Msg.MIXLY_IOT_PASSWORD).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(rt.Msg.MIXLY_EMQX_PROJECT).setAlign(rt.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(rt.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(rt.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Uc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(rt.Msg.MIXLY_EMQX_SUBSCRIBE+rt.Msg.MIXLY_MICROBIT_MSG).appendField(rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(rt.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Xc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(rt.Msg.MSG.stop+rt.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(rt.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Gc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(rt.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(rt.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(rt.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},qc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(rt.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Kc={init:function(){this.setColour(bc),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},zc={init:function(){this.setColour(bc),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},$c={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(rt.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(rt.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},Qc={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO").appendField(rt.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(rt.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Jc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(rt.Msg.MIXLY_EMQX_SERVER).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(rt.Msg.CONTROLS_FOR_INPUT_WITH+rt.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zc={init:function(){this.setColour(bc),this.appendDummyInput().appendField(rt.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(rt.Msg.MIXLY_EMQX_SERVER).setAlign(rt.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(rt.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(rt.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},t_={init:function(){this.VISITOR_ID=ot.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(bc),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new rt.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 rt.FieldImage(e,12,12,'"')}},e_={init:function(){this.VISITOR_ID=ot.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(bc),this.appendDummyInput("").appendField(new rt.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},i_={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MixIO").appendField(rt.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},n_={init:function(){this.setColour(bc),this.appendDummyInput().appendField("HTTP"+rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(rt.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(rt.Msg.MIXLY_REQUESTS_GET).appendField(rt.Msg.MIXLY_GET_CURRENT_TIME).appendField(rt.Msg.MIXLY_OPEN_DEBUG).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},s_={init:function(){this.setColour(bc),this.appendDummyInput().appendField("HTTP"+rt.Msg.MIXLY_Client).appendField(rt.Msg.MIXLY_GET).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[rt.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},r_={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MQTT"+rt.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(rt.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(rt.Msg.MIXLY_INIT_SUBSCRIBE).appendField(rt.MQTT_Topic).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(rt.Msg.MIXLY_OPEN_DEBUG).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},o_={init:function(){this.setColour(bc),this.appendDummyInput().appendField("MQTT"+rt.Msg.MIXLY_Client).appendField(rt.Msg.MIXLY_GET).appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_REQUESTS_LEN,"client_len"],[rt.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[rt.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},a_=Dc,l_=wc,u_=Nc,p_=Pc,h_=230,d_={init:function(){this.setColour(h_),this.appendDummyInput("").appendField(new rt.FieldDropdown(ot.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},c_={init:function(){this.setColour(h_),this.appendDummyInput("").appendField(new rt.FieldDropdown(ot.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},__={init:function(){this.setColour(h_),this.appendDummyInput("").appendField(new rt.FieldDropdown(ot.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},f_={init:function(){this.setColour(h_),this.appendDummyInput("").appendField(new rt.FieldDropdown(ot.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},T_={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new rt.FieldLabel(rt.Msg.MIXPY_SERIAL_OPEN)).appendField(new rt.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(rt.Msg.MIXLY_SERIAL_BEGIN).appendField(new rt.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(rt.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(rt.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},m_={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(rt.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(rt.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},g_={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(rt.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},I_={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(rt.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(rt.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},E_=80,O_={init:function(){this.appendDummyInput().appendField(rt.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},M_={init:function(){this.appendDummyInput().appendField(rt.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},R_={init:function(){this.appendDummyInput().appendField(rt.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},A_={init:function(){var t=[[rt.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[rt.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[rt.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[rt.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[rt.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[rt.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+rt.Msg.LOAD).appendField(new rt.FieldDropdown(t),"type").appendField(new rt.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("name"))&&this.setTitleValue(e,"name")}},y_={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+rt.Msg.DATA_SET),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_GET).appendField(new rt.FieldDropdown([[rt.Msg.EIGENVALUES,"data"],[rt.Msg.LABEL_VALUE,"target"],[rt.Msg.FEATURE,"feature_names"],[rt.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},S_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},v_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},C_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},L_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},b_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new rt.FieldDropdown([[rt.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[rt.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},D_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new rt.FieldDropdown([[rt.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[rt.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},w_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_KNN_INIT).appendField(new rt.FieldDropdown([[rt.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[rt.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},N_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},F_={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},P_={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},x_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},k_={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},V_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},Y_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},B_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},U_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},X_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},G_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(rt.inputs.Align.RIGHT).setCheck(null).appendField(rt.Msg.MODEL_NAME),this.appendDummyInput().setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_GET).appendField(new rt.FieldDropdown([[rt.Msg.SKLEARN_COEF,"coef_"],[rt.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},H_={init:function(){this.appendDummyInput().appendField("sklearn "+rt.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MODEL_NAME),this.appendDummyInput().appendField(rt.Msg.MIXLY_GET).appendField(new rt.FieldDropdown([[rt.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[rt.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[rt.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},W_={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField("sklearn").appendField(new rt.FieldDropdown([[rt.Msg.SKLEARN_SAVE_MODEL,"dump"],[rt.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+rt.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(rt.inputs.Align.RIGHT).appendField(rt.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(E_),this.setTooltip(""),this.setHelpUrl("")}},j_=120,q_={init:function(){this.setColour(j_),this.appendValueInput("DELAY_TIME",Number).appendField(rt.Msg.MIXLY_DELAY+"("+rt.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},K_={init:function(){this.setColour(j_),this.appendDummyInput().appendField(rt.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},z_={init:function(){this.setColour(j_),this.appendDummyInput("").appendField(rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new rt.FieldDropdown([[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[rt.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},$_={init:function(){this.setColour(j_),this.appendValueInput("STATUS_CODE",Number).appendField(rt.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Q_={init:function(){this.setColour(j_),this.appendDummyInput().appendField(rt.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},J_={init:function(){this.setColour(j_),this.appendValueInput("TIME").setCheck(Number).setAlign(rt.inputs.Align.RIGHT).appendField("MsTimer2").appendField(rt.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(rt.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Z_={init:function(){this.setColour(j_),this.appendDummyInput().appendField("MsTimer2").appendField(rt.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},tf={init:function(){this.setColour(j_),this.appendDummyInput().appendField("MsTimer2").appendField(rt.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ef={init:function(){this.setColour(j_),this.appendValueInput("DELAY_TIME",Number).appendField(rt.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(rt.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},nf=180,sf={init:function(){this.setColour(nf),this.appendDummyInput("").appendField(rt.Msg.blockpy_turtle_create).appendField(new rt.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rf={init:function(){this.setColour(nf),this.appendDummyInput().appendField(rt.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},of={init:function(){this.setColour(nf),this.appendDummyInput().appendField(rt.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},af={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_forward,"forward"],[rt.Msg.blockpy_backward,"backward"]];this.setColour(nf),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:rt.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},lf={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_left,"left"],[rt.Msg.blockpy_right,"right"]];this.setColour(nf),this.appendValueInput("VAR").appendField(rt.Msg.blockpy_turtle_rotate).appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:rt.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[t]}))}},uf={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.blockpy_setheading),this.appendDummyInput().appendField(rt.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pf={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(rt.Msg.MIXLY_MILLIS),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hf={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(rt.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(rt.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},df={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.PYLAB_LABEL_X,"x"],[rt.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(nf),this.appendValueInput("VAR").appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},cf={init:function(){this.setColour(nf);var t=[[rt.Msg.TURTLE_POS,"pos"],[rt.Msg.TURTLE_SHAPE,"shape"],[rt.Msg.TURTLE_HEADING,"heading"],[rt.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[rt.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[rt.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(rt.Msg.TURTLE_POS_SHAPE).appendField(new rt.FieldDropdown(t),"DIR");var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pos:rt.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:rt.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:rt.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:rt.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:rt.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:rt.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[t]})),this.setOutput(!0),this.setInputsInline(!0)}},_f={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[rt.Msg.blockpy_turtle_reset,"reset"],[rt.Msg.blockpy_turtle_home,"home"]];this.setColour(nf),this.appendDummyInput("").appendField(new rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:rt.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:rt.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},ff={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_turtle_penup,"penup"],[rt.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(nf),this.appendDummyInput("").appendField(new rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:rt.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[t]}))}},Tf={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_turtle_beginfill,"begin"],[rt.Msg.blockpy_turtle_endfill,"end"]];this.setColour(nf),this.appendDummyInput("").appendField(new rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:rt.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[t]}))}},mf={init:function(){this.appendDummyInput("").appendField(new rt.FieldTextInput("tina"),"TUR");var t=[[rt.Msg.blockpy_turtle_size,"pensize"],[rt.Msg.MIXLY_SPEED,"speed"]];this.setColour(nf),this.appendValueInput("VAR").appendField(rt.Msg.blockpy_turtle_set).appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:rt.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[t]}))}},gf={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.blockpy_turtle_set_size),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},If={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.blockpy_turtle_set_speed),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ef={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_turtle_circle,"circle"],[rt.Msg.blockpy_turtle_dot,"dot"]];this.setColour(nf),this.appendValueInput("VAR").appendField(rt.Msg.blockpy_turtle_draw).appendField(new rt.FieldDropdown(t),"DIR").appendField(rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:rt.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[t]}))}},Of={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(rt.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(rt.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},Mf={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_turtle_hide,"hideturtle"],[rt.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(nf),this.appendDummyInput("").appendField(new rt.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:rt.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:rt.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[t]}))}},Rf={init:function(){this.setColour(nf),this.appendDummyInput().appendField(rt.Msg.blockpy_turtle_bgcolor).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Af={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendDummyInput().appendField(rt.Msg.blockpy_turtle_pencolor).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendDummyInput().appendField(rt.Msg.blockpy_turtle_fillcolor).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sf={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(rt.Msg.TURTLE_CLONE),this.setTooltip(rt.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},vf={init:function(){this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendDummyInput().appendField(rt.Msg.blockpy_turtle_pencolor).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(rt.Msg.blockpy_turtle_fillcolor).appendField(new rt.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Df={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR1").setCheck(String).appendField(rt.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(rt.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wf={init:function(){this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ff={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Pf={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[rt.Msg.blockpy_turtle_shape_arrow,"arrow"],[rt.Msg.blockpy_turtle_shape_turtle,"turtle"],[rt.Msg.blockpy_turtle_shape_circle,"circle"],[rt.Msg.blockpy_turtle_shape_square,"square"],[rt.Msg.blockpy_turtle_shape_triangle,"triangle"],[rt.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(nf),this.appendDummyInput("").appendField(rt.Msg.blockpy_turtle_shape).appendField(new rt.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TURTLE_SHAPE_TOOLTIP)}},xf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(rt.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(rt.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(rt.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},kf={init:function(){this.appendDummyInput("").appendField(rt.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(nf),this.appendValueInput("TITLE").setCheck(String).appendField(rt.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(rt.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(rt.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(rt.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(rt.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(rt.Msg.TURTLE_NUMINPUT_TOOLTIP)}},Vf={init:function(){this.appendDummyInput("").appendField(rt.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(nf),this.appendValueInput("TITLE").setCheck(String).appendField(rt.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(rt.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(rt.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},Yf={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TURTLE_WRITE_TOOLTIP)}},Bf={init:function(){var t=[[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],i=[[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new rt.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new rt.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new rt.FieldDropdown(i),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TURTLE_WRITE_TOOLTIP)}},Uf={init:function(){var t=[[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[rt.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[rt.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],i=[[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(nf),this.appendValueInput("VAR").setCheck(String).appendField(rt.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new rt.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new rt.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new rt.FieldDropdown(i),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.TURTLE_WRITE_TOOLTIP)}},Xf={init:function(){this.setColour(nf),this.appendDummyInput("").setAlign(rt.inputs.Align.RIGHT).appendField(new rt.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Gf={init:function(){this.setColour(nf),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new rt.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(rt.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){rt.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Hf={init:function(){this.setColour(nf),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},Wf={init:function(){this.setColour(nf),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(rt.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},jf={init:function(){this.setColour(nf),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(rt.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(rt.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(rt.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(rt.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},qf={init:function(){this.setColour(nf),this.appendValueInput("TUR"),this.appendDummyInput().appendField(rt.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Kf={init:function(){this.setColour(nf),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(rt.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(rt.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},zf=function(t,e){var i=this.getFieldValue("TYPE");return e.definitions_.import_FileDialog="import FileDialog",["FileDialog."+i+"()",e.ORDER_ATOMIC]},$f=function(t,e){var i=this.getFieldValue("CTYPE");return e.definitions_.import_aip="import aip",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = aip."+i+"("+e.valueToCode(this,"API_KEY",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SECRET_KEY",e.ORDER_ATOMIC)+")\n"},Qf=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]},Jf=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]},Zf=function(t,e){e.definitions_.import_aip="import aip";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[i+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+n+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},tT=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]},eT=function(t,e){e.definitions_.import_aip="import aip";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[i+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+n+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},iT=function(t,e){e.definitions_.import_aip="import aip";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"STR",e.ORDER_ATOMIC);return[i+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+n+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},nT=function(t,e){e.definitions_.import_aip="import aip";var i=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),n=e.valueToCode(this,"STR1",e.ORDER_ATOMIC),s=e.valueToCode(this,"STR2",e.ORDER_ATOMIC);return[i+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+n+","+s+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},sT=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]},rT=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]},oT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},aT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},lT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},uT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},pT=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"},hT=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"},dT=function(t,e){var i=e.valueToCode(this,"AI",e.ORDER_ASSIGNMENT)||"0",n=this.getFieldValue("CTYPE");if("Image"==n)var s=i+'["result"][0]["keyword"]';if("Speech"==n)s=i+'["result"][0]';if("Face"==n||"OcrSimilarity"==n)s=i+'["score"]';if("Ocr"==n)s=i+'["words_result"]';return[s,e.ORDER_ATOMIC]},cT=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"},_T=function(){return"path = [1]\nmask.show()\ncar = sprite.Sprite('xnie', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},fT=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"},TT=function(t,e){return["flag == 1",e.ORDER_ATOMIC]},mT=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},gT=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},IT=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"},ET=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},OT=function(t,e){return["len(path) == 7",e.ORDER_ATOMIC]},MT=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},RT=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"},AT=function(t,e){return["f == 1",e.ORDER_ATOMIC]},yT=function(){return"print('没有符合条件的路线')\n"},ST=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'},vT=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'},CT=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]<tmp and i!=last:\n next=i\n tmp=g[now][i]\nstu.slideTo(position[next][0], position[next][1], 1)\ntime.sleep(0.5)\npath.append(next)\nlast=now\nnow=next\nif len(path)>6:\n print("路线错乱!程序有误!")\n exit()\n'},LT=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},bT=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},DT=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},wT=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var i=this.getFieldValue("NUM");if(i>=7)var n="print('层数过高不得高于6层')\nexit()\n";else n="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+i+"\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 n},NT=function(t,e){var i=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",n=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${i}])>0 :\n _HanoiBlockMoved = _Hanoi[${i}].pop()\n if len(_Hanoi[${n}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${n}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${n}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${n}*200+200, 400-len(_Hanoi[${n}])*27, 0.2)\n _Hanoi[${n}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},FT=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"},PT=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"},xT=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"},kT=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]},VT=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]},YT=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var i="res+=1\nflag=ring[res]\n";return i="Books[res].filterGray()\ntime.sleep(0.3)\n"+(i+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},BT=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},UT=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},XT=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"},GT=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"},HT=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"},WT=function(t,e){var i=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(${i}):\n ring.append(0)\nfor i in range(1, ${i}+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"}[i]}))\ntime.sleep(1)\nmode=3\n`},jT=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器0', 30, 200)\n"},qT=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},KT=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},zT=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"},$T=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},QT=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},JT=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"},ZT=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},tm=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量'+str(_rabbit)+'只。')\n"},em=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"},im=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 i=this.getFieldValue("PATHNAME");const n=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${i}.show()\ntime.sleep(1)\n`,s+=4!=i?`_Slen[${i}] = _Llen[${n[i][0]}] + _Llen[${n[i][1]}]\n_text_${i}.changeText('S${i}'+str(_Slen[${i}])+'m')\ntime.sleep(1)\n_S${i}.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"},sm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var i="";return[i+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},rm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var i=this.getFieldValue("PATHNAME"),n="";return n+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${i}\n_S${i}.show()\ntime.sleep(0.5)\n_S${i}.hide()\ntime.sleep(0.5)\n_S${i}.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"},am=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"},lm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var i="";return i+=`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`},um=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var i=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${i})*50 + (i//(4*${i}))*(${i}+1)*50 +(i%3-2), 80+(i//${i})*100-(i//(4*${i}))*4*100+(i%2), 0.05)\n_line = ${i}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},pm=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]},hm=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"},dm=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},cm=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),n=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<b:\n print('非法移动,不能将大盘放置在小盘上')\n exit() \n t.goto(150 * y - 150,20 * len(tower[y]) - 90)\n tower[y].append(t)\n tower_num[y].append(a)\n except IndexError:\n print('非法移动,未找到可移动的圆盘')\n exit()\n",`num = ${n}\ntower = [[], [], []]\ntower_num = [[], [], []]\nA,B,C=0,1,2\ntotal_num=[0]\ncolor= (${i})\ninit_Hanoi()\nfor i in range(0, num, 1):\n tina = turtle.Turtle()\n tina.penup()\n tina.shape('square')\n if num == 1:\n tina.shapesize(1,7,1)\n else:\n tina.shapesize(1,7 - (6 / (num - 1)) * i,1)\n tina.color("#000000",color)\n tina.speed(3)\n tina.goto(-150,20 * i - 90)\n tower[0].append(tina)\n tower_num[0].append(i)\ncount_turtle=turtle.Turtle()\ncount_turtle.hideturtle()\ncount_turtle.penup()\ncount_turtle.goto(0,150)\ncount_turtle.write('总步数0') \nbegin()\n`},_m=function(){return"f = path[(len(path) - 1)]\n"},fm=function(t,e){return["len(path)==0",e.ORDER_ATOMIC]},Tm=function(t,e){return['"'+this.getFieldValue("COLOR")+'"',e.ORDER_ATOMIC]},mm=function(t,e){return e.definitions_.import_requests="import requests",e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+"= requests.get("+e.valueToCode(this,"DOMAIN",e.ORDER_ATOMIC)+")\n"},gm=function(t,e){return e.definitions_.import_requests="import requests",["requests."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"URL",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Im=function(t,e){return e.definitions_.import_requests="import requests",["requests."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"URL",e.ORDER_ATOMIC)+",data="+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Em=function(t,e){return e.definitions_.import_requests="import requests",[(e.valueToCode(this,"VAL",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("ATTR"),e.ORDER_ATOMIC]},Om=function(t,e){return e.definitions_.import_requests="import requests","requests."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"};var Mm=__webpack_require__(936);const Rm=function(t,e){e.definitions_.import_pandas="import pandas";var i=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = pandas.Series("+i+")\n"},Am=function(t,e){e.definitions_.import_pandas="import pandas";var i=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"INDEX",e.ORDER_ATOMIC)||"''";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = pandas.Series("+i+",index="+n+")\n"},ym=function(t,e){e.definitions_.import_pandas="import pandas";var i=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = pandas.DataFrame("+i+")\n"},Sm=function(t,e){e.definitions_.import_pandas="import pandas";var i=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"INDEX_COLUMN",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"INDEX_RAW",e.ORDER_ATOMIC)||"''";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = pandas.DataFrame("+i+",columns="+n+",index="+s+")\n"},vm=function(t,e){e.definitions_.import_pandas="import pandas";var i=this.getFieldValue("COLUMN_RAW"),n=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"INDEX",e.ORDER_ATOMIC)||"''";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = pandas.DataFrame("+n+","+i+"="+s+")\n"},Cm=function(t,e){return e.definitions_.import_pandas="import pandas",e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = pandas.Series(["+this.getFieldValue("TEXT")+"])\n"},Lm=function(t,e){return e.definitions_.import_pandas="import pandas",[(e.valueToCode(this,"SERIES",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("INDEX_VALUE"),e.ORDER_ATOMIC]},bm=function(t,e){return[(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"1")+"]",e.ORDER_ATOMIC]},Dm=function(t,e){e.definitions_.import_pylab="import pylab";return"pylab.show()\n"},wm=function(t,e){e.definitions_.import_pylab="import pylab";return"pylab.axes(aspect=1)\n"},Nm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+")\n"},Fm=function(t,e){e.definitions_.import_pylab="import pylab";var i=this.getFieldValue("LINE"),n=this.getFieldValue("COLOR"),s=this.getFieldValue("DOT");return"pylab.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+",'"+s+i+n+"')\n"},Pm=function(t,e){e.definitions_.import_pylab="import pylab",e.definitions_.import_matplotlib_font_manager="import matplotlib.font_manager";return'pylab.legend(prop=matplotlib.font_manager.FontProperties("STSong"))\n'},xm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.title("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+', fontproperties = "STSong")\n'},km=function(t,e){return e.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"label("+e.valueToCode(this,"LABEL",e.ORDER_ATOMIC)+', fontproperties = "STSong")\n'},Vm=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.arange("+(e.valueToCode(this,"FROM",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"TO",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"STEP",e.ORDER_NONE)||"1")+")",e.ORDER_ATOMIC]},Ym=function(t,e){return e.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},Bm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.scatter("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+",s="+(e.valueToCode(this,"S",e.ORDER_ATOMIC)||"''")+",c='"+this.getFieldValue("COLOR")+"',marker='"+this.getFieldValue("DOT")+"',label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},Um=function(t,e){e.definitions_.import_pylab="import pylab";var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=this.getFieldValue("LINE"),r=this.getFieldValue("COLOR");return"pylab.plot("+i+","+n+",'"+this.getFieldValue("DOT")+s+r+"',label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},Xm=function(t,e){e.definitions_.import_pylab="import pylab";var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''",r=e.valueToCode(this,"WIDTH",e.ORDER_RELATIONAL)||"0",o=this.getFieldValue("COLOR");return"pylab.bar("+i+","+n+',align="'+this.getFieldValue("ALIGN")+'",color="'+o+'",width='+r+",label="+s+")\n"},Gm=function(t,e){e.definitions_.import_pylab="import pylab";var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"EXPLODE",e.ORDER_ATOMIC)||"''",r=this.getFieldValue("SHADOW"),o=this.getFieldValue("autopct");return"None"!=o&&(o="'"+o+"'"),"pylab.pie("+i+",explode="+s+",labels="+n+",autopct="+o+",shadow="+r+")\n"},Hm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.hist("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},Wm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"ticks("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+",fontproperties = 'STSong')\n"},jm=function(t,e){e.definitions_.import_numpy="import numpy";var i=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0";return["numpy."+this.getFieldValue("OP")+"("+i+")",e.ORDER_ATOMIC]},qm=function(t,e){return e.definitions_.import_numpy="import numpy","pylab.subplot("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+")\n"},Km=function(t,e){return e.definitions_.import_pandas="import pandas",["pandas.read_csv("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", header="+this.getFieldValue("MODE")+")",e.ORDER_ATOMIC]},zm=function(t,e){var i=this.getFieldValue("MODE"),n=e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);if("column"==i)var r=n+"["+s+"]";else if("raw"==i)r=n+".loc["+s+"]";return[r,e.ORDER_ATOMIC]},$m=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.savefig("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Qm=function(t,e){return e.definitions_.import_numpy="import numpy","pylab.text("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+", ha='"+this.getFieldValue("HALIGN")+"', va='"+this.getFieldValue("VALIGN")+"', fontsize="+(e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0")+")\n"},Jm=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0";return e.definitions_.import_numpy="import numpy",["numpy.array("+i+")",e.ORDER_ATOMIC]},Zm=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.show()\n"},tg=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.axes(aspect=1)\n"},eg=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+")\n"},ig=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var i=this.getFieldValue("LINE"),n=this.getFieldValue("COLOR"),s=this.getFieldValue("DOT");return"plt.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+", '"+s+i+n+"')\n"},ng=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt",e.definitions_.import_matplotlib_font_manager="import matplotlib.font_manager";return'plt.legend(prop=matplotlib.font_manager.FontProperties("STSong"))\n'},sg=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.title("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+', fontproperties="STSong")\n'},rg=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"label("+e.valueToCode(this,"LABEL",e.ORDER_ATOMIC)+', fontproperties="STSong")\n'},og=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},ag=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.scatter("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+", s="+(e.valueToCode(this,"S",e.ORDER_ATOMIC)||"''")+", c='"+this.getFieldValue("COLOR")+"', marker='"+this.getFieldValue("DOT")+"', label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},lg=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=this.getFieldValue("LINE"),r=this.getFieldValue("COLOR");return"plt.plot("+i+", "+n+", '"+this.getFieldValue("DOT")+s+r+"', label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},ug=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''",r=e.valueToCode(this,"WIDTH",e.ORDER_RELATIONAL)||"0",o=this.getFieldValue("COLOR");return"plt.bar("+i+", "+n+', align="'+this.getFieldValue("ALIGN")+'", color="'+o+'", width='+r+", label="+s+")\n"},pg=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"EXPLODE",e.ORDER_ATOMIC)||"''",r=this.getFieldValue("SHADOW"),o=this.getFieldValue("autopct");return"None"!=o&&(o="'"+o+"'"),"plt.pie("+i+", explode="+s+", labels="+n+", autopct="+o+", shadow="+r+")\n"},hg=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.hist("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},dg=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"ticks("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+", fontproperties = 'STSong')\n"},cg=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.subplot("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+")\n"},_g=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.savefig('1.png')\n"},fg=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.text("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+", ha='"+this.getFieldValue("HALIGN")+"', va='"+this.getFieldValue("VALIGN")+"', fontsize="+(e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0")+")\n"},Tg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.shape("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},mg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.reshape("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+", "+(e.valueToCode(t,"DIMENSIONS",e.ORDER_ATOMIC)||"(1, -1)")+")",e.ORDER_ATOMIC]},gg=function(t,e){return e.definitions_.import_numpy="import numpy",[(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+".astype("+t.getFieldValue("TYPE")+")",e.ORDER_ATOMIC]},Ig=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.imshow("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+', cmap="'+(t.getFieldValue("COLORMAP")||"gray")+'")\n'},Eg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.mean("+(e.valueToCode(t,"X",e.ORDER_ATOMIC)||"[]")+"["+(e.valueToCode(t,"Y",e.ORDER_ATOMIC)||"[]")+" == "+(e.valueToCode(t,"DIGIT",e.ORDER_ATOMIC)||"0")+"], axis=0)",e.ORDER_ATOMIC]},Og=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_cv2="import cv2",["numpy.argmin([numpy.sum(cv2.absdiff("+(e.valueToCode(t,"IMAGE",e.ORDER_ATOMIC)||"[]")+", template)) for template in "+(e.valueToCode(t,"TEMPLATES",e.ORDER_ATOMIC)||"[]")+"])",e.ORDER_ATOMIC]},Mg=function(t,e){e.definitions_.import_numpy="import numpy";var i=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",n=t.getFieldValue("AXIS");if("NONE"===n)var s="numpy.mean("+i+")";else s="numpy.mean("+i+", axis="+n+")";return[s,e.ORDER_ATOMIC]},Rg=function(t,e){e.definitions_.import_numpy="import numpy";var i=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",n=t.getFieldValue("AXIS");if("NONE"===n)var s="numpy.std("+i+")";else s="numpy.std("+i+", axis="+n+")";return[s,e.ORDER_ATOMIC]},Ag=function(t,e){return e.definitions_.import_pandas="import pandas",[(e.valueToCode(t,"DF",e.ORDER_ATOMIC)||"df")+".dropna()",e.ORDER_MEMBER]},yg=function(t,e){return e.definitions_.import_pandas="import pandas",[(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".drop(columns="+(e.valueToCode(t,"COLUMNS",e.ORDER_ATOMIC)||"[]")+", axis=1)",e.ORDER_ATOMIC]},Sg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.ones("+(e.valueToCode(t,"NUM",e.ORDER_ATOMIC)||"1")+")",e.ORDER_ATOMIC]},vg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.c_["+(e.valueToCode(t,"ARRAY1",e.ORDER_ATOMIC)||"[]")+", "+(e.valueToCode(t,"ARRAY2",e.ORDER_ATOMIC)||"[]")+"]",e.ORDER_ATOMIC]},Cg=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_linalg="import numpy.linalg",["numpy.linalg.det("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},Lg=function(t,e){return[(e.valueToCode(t,"MATRIX",e.ORDER_ATOMIC)||"[]")+".T",e.ORDER_ATOMIC]},bg=function(t,e){return[(e.valueToCode(t,"MATRIX1",e.ORDER_ATOMIC)||"[]")+" @ "+(e.valueToCode(t,"MATRIX2",e.ORDER_ATOMIC)||"[]"),e.ORDER_ATOMIC]},Dg=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_linalg="import numpy.linalg",["numpy.linalg.inv("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},wg=function(t,e){return[(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".median()",e.ORDER_ATOMIC]},Ng=function(t,e){return(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".fillna(value="+(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"0")+", inplace="+(t.getFieldValue("INPLACE")||"False")+")\n"},Fg=function(t,e){return[(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".info()",e.ORDER_ATOMIC]},Pg=function(t,e){e.definitions_.import_numpy="import numpy";var i=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",n=t.getFieldValue("AXIS");return["None"===n?"numpy.min("+i+")":"numpy.min("+i+", axis="+n+")",e.ORDER_ATOMIC]},xg=function(t,e){e.definitions_.import_numpy="import numpy";var i=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",n=t.getFieldValue("AXIS");return["None"===n?"numpy.max("+i+")":"numpy.max("+i+", axis="+n+")",e.ORDER_ATOMIC]},kg=function(t,e){return e.definitions_.import_numpy="import numpy",[(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+".size",e.ORDER_ATOMIC]},Vg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.dot("+(e.valueToCode(t,"ARRAY1",e.ORDER_ATOMIC)||"[]")+", "+(e.valueToCode(t,"ARRAY2",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},Yg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.square("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},Bg=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.sum("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},Ug=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.random.random("+(e.valueToCode(t,"SIZE",e.ORDER_ATOMIC)||"1")+")",e.ORDER_ATOMIC]},Xg=function(t,e){return["sum("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},Gg=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.sort_values(by=${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"'tag'"}, ascending=${t.getFieldValue("AS_CENDING")})`,e.ORDER_ATOMIC]},Hg=function(t,e){const i=e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df",n=e.valueToCode(t,"LINES",e.ORDER_ATOMIC)||"1";return[`${i}.${t.getFieldValue("TYPE")}(${n})`,e.ORDER_ATOMIC]},Wg=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}[${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"df['tag'] > 1"}]`,e.ORDER_ATOMIC]},jg=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]},qg=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.${t.getFieldValue("TYPE")}()`,e.ORDER_ATOMIC]},Kg=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},zg=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE),n=e.variableDB_.getName(this.getFieldValue("TYPE"),rt.Variables.NAME_TYPE),s="class "+n+":\n";s+=" def __init__(self):\n";for(var r=new Array(this.itemCount_),o=0;o<this.itemCount_;o++){var a=this.getFieldValue("KEY"+o);r[o]=" self."+a+" = "+(e.valueToCode(this,"ADD"+o,e.ORDER_NONE)||"0")}return s+=r.join("\n")+"\n",s+=" self.next = None\n",s+=i+" = "+n+"()\n"},$g=function(t,e){return(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+" = "+e.variableDB_.getName(this.getFieldValue("TYPE"),rt.Variables.NAME_TYPE)+"()\n"},Qg=function(t,e){return[(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+"."+e.variableDB_.getName(this.getFieldValue("TYPE"),rt.Variables.NAME_TYPE),e.ORDER_ATOMIC]},Jg=function(t,e){return(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+"."+e.variableDB_.getName(this.getFieldValue("TYPE"),rt.Variables.NAME_TYPE)+" = "+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+"\n"},Zg=function(t,e){var i=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"NODE2",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"NODE3",e.ORDER_ASSIGNMENT)||"0",r=this.getFieldValue("DIR");if("after"==r){var o="now = "+i+"\n";o+="while now != "+n+" and now != None:\n",o+=" now = now.next\n",o+="if now != None:\n",o+=" "+s+".next = now.next\n",o+=" now.next = "+s+"\n",o+=' print("插入节点成功")\n',o+="else:\n",o+=' print("插入节点失败,未找到指定名称的节点")\n'}if("before"==r){o="if "+i+" == "+n+":\n";o+=" "+s+".next = "+i+"\n",o+="else:\n",o+=" now = "+i+"\n",o+=" while now.next != "+n+" and now.next != None:\n",o+=" now = now.next\n",o+=" if now != None:\n",o+=" "+s+".next = now.next\n",o+=" now.next = "+s+"\n",o+=' print("插入节点成功")\n',o+=" else:\n",o+=' print("插入节点失败,未找到指定名称的节点")\n'}return o},tI=function(t,e){var i=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"NODE3",e.ORDER_ASSIGNMENT)||"0",r=e.variableDB_.getName(this.getFieldValue("TYPE"),rt.Variables.NAME_TYPE),o=this.getFieldValue("DIR");if("after"==o){var a="now = "+i+"\n";a+="while now."+r+" != "+n+" and now != None:\n",a+=" now = now.next\n",a+="if now != None:\n",a+=" "+s+".next = now.next\n",a+=" now.next = "+s+"\n",a+=' print("插入节点成功")\n',a+="else:\n",a+=' print("插入节点失败,未找到指定的节点")\n'}if("before"==o){a="if "+i+"."+r+" == "+n+":\n";a+=" "+s+".next = "+i+"\n",a+="else:\n",a+=" now = "+i+"\n",a+=" while now.next."+r+" != "+n+"and now.next != None:\n",a+=" now = now.next\n",a+=" if now != None:\n",a+=" "+s+".next = now.next\n",a+=" now.next = "+s+"\n",a+=' print("插入节点成功")\n',a+=" else:\n",a+=' print("插入节点失败,未找到指定的节点")\n'}return a},eI=function(t,e){var i=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"NODE2",e.ORDER_ASSIGNMENT)||"0",s="if "+i+" == "+n+":\n";return s+=" "+i+".next = None\n",s+="else:\n",s+=" now = "+i+"\n",s+=" while now.next != "+n+" and now.next != None:\n",s+=" now = now.next\n",s+=" if now != None:\n",s+=" now.next = now.next.next\n",s+=' print("删除节点成功")\n',s+=" else:\n",s+=' print("删除节点失败,未找到指定名称的节点")\n'},iI=function(t,e){var i=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.variableDB_.getName(this.getFieldValue("TYPE"),rt.Variables.NAME_TYPE),r="if "+i+"."+s+" == "+n+":\n";return r+=" "+i+".next = None\n",r+="else:\n",r+=" now = "+i+"\n",r+=" while now.next."+s+" != "+n+" and now.next != None:\n",r+=" now = now.next\n",r+=" if now != None:\n",r+=" now.next = now.next.next\n",r+=' print("删除节点成功")\n',r+=" else:\n",r+=' print("删除节点失败,未找到指定的节点")\n'},nI=function(t,e){var i="ptr = "+(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+"\n";return i+="before = None\n",i+="while ptr != None:\n",i+=" last = before\n",i+=" before = ptr\n",i+=" ptr = ptr.next\n",i+=" before.next = last\n",i+=(e.valueToCode(this,"NODE2",e.ORDER_ASSIGNMENT)||"0")+" = before\n"},sI=function(t,e){var i=this.getFieldValue("path"),n=this.getFieldValue("module");return e.definitions_["import_"+i+"_"+n]="from "+i+" import "+n,""},rI=function(t,e){var i=this.getFieldValue("module");return e.definitions_["import_"+i]="import "+i,""},oI=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"";return i+"("+n.join(", ")+")\n"},aI=function(t,e){for(var i=this.getFieldValue("NAME"),n=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)n[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"";return[i+"("+n.join(", ")+")",e.ORDER_ATOMIC]},lI=function(){var t=this.getFieldValue("TYPE");return this.getFieldValue("NAME")+" = "+t+"()\n"},uI=function(t,e){for(var i=this.getFieldValue("NAME"),n=this.getFieldValue("METHOD"),s=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)s[r]=e.valueToCode(this,"ADD"+r,e.ORDER_NONE)||"";return i+"."+n+"("+s.join(", ")+")\n"},pI=function(t,e){for(var i=this.getFieldValue("NAME"),n=this.getFieldValue("METHOD"),s=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)s[r]=e.valueToCode(this,"ADD"+r,e.ORDER_NONE)||"";return[i+"."+n+"("+s.join(", ")+")",e.ORDER_ATOMIC]},hI=function(){return this.getFieldValue("VALUE")+"\n"},dI=function(t,e){return[this.getFieldValue("VALUE"),e.ORDER_ATOMIC]},cI=function(){return this.getFieldValue("VALUE")+"\n"},_I=function(t,e){return[this.getFieldValue("VALUE"),e.ORDER_ATOMIC]},fI=function(t,e){return e.definitions_.import_s4alib="import s4alib",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+' = s4alib.s4a_start("'+ot.JSFuncs.getCom()+'")\n'},TI=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},mI=function(t,e){e.definitions_.import_s4alib="import s4alib";var i="";return i+=e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".digital_write("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},gI=function(t,e){e.definitions_.import_s4alib="import s4alib";return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".digital_read("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},II=function(t,e){e.definitions_.import_s4alib="import s4alib";return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".analog_read("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},EI=function(t,e){e.definitions_.import_s4alib="import s4alib";var i="";return i+=e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".analog_write("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},OI=function(t,e){return["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},MI=function(t,e){return"print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},RI=function(t,e){return"print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},AI=function(t,e){return"print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+",end ="+(e.valueToCode(this,"END",e.ORDER_ATOMIC)||'""')+")\n"},yI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',n=this.getFieldValue("DIR");if("str"==n)var s="input("+i+")";else if("int"==n)s="int(input("+i+"))";else if("float"==n)s="float(input("+i+"))";return[s,e.ORDER_ATOMIC]},SI=function(t,e){var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',n=this.getFieldValue("DIR");if(e.definitions_.import_pyinput="import pyinput","str"==n)var s="pyinput.input("+i+")";else if("int"==n)s="int(pyinput.input("+i+"))";else if("float"==n)s="float(pyinput.input("+i+"))";return[s,e.ORDER_ATOMIC]},vI=function(t,e){for(var i=new Array(this.itemCount_),n=0;n<this.itemCount_;n++)i[n]=e.valueToCode(this,"ADD"+n,e.ORDER_NONE)||"0";return i="print("+i.join(", ")+")\n"},CI=function(t,e){e.definitions_.import_mixiot="import mixiot";var i=e.valueToCode(this,"SERVER",e.ORDER_ATOMIC),n=e.valueToCode(this,"USERNAME",e.ORDER_ATOMIC),s=e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC),r=e.valueToCode(this,"PROJECT",e.ORDER_ATOMIC),o=Math.round(new Date).toString(),a="f'python-mqtt-"+n.replace("'","").replace("'","")+o.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO("+i+", 1883 ,"+n+", "+s+", "+r+", "+a+")\n"},LI=function(t,e){var i=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC),n=e.valueToCode(this,"MSG",e.ORDER_ATOMIC);return e.definitions_.import_mixiot="import mixiot","mqtt_client.publish("+i+", "+n+")\n"},bI=function(t,e){var i=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC),n=e.valueToCode(this,"METHOD",e.ORDER_ATOMIC);return e.definitions_.import_mixiot="import mixiot","mqtt_client.subscribe_and_set_callback("+i+","+n+")\n"},DI=function(t,e){var i=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC);return e.definitions_.import_mixiot="import mixiot","mqtt_client.unsubscribe("+i+")\n"},wI=function(t,e){e.definitions_.import_mixiot="import mixiot";return"mqtt_client.disconnect()\n"},NI=function(t,e){e.definitions_.import_mixiot="import mixiot";return"mqtt_client.connect()\n"},FI=function(t,e){e.definitions_.import_mixiot="import mixiot";return"mqtt_client.check_msg()\n"},PI=function(t,e){return['mqtt_client.decode("utf-8").split("/")[-1]',e.ORDER_ATOMIC]},xI=function(t,e){return['mqtt_client.decode("utf-8")',e.ORDER_ATOMIC]},kI=function(t,e){return e.definitions_.import_mixpy="import mixpy",["mixpy.format_content("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+", mqtt_client.client_id)",e.ORDER_ATOMIC]},VI=function(t,e){return e.definitions_.import_mixpy="import mixpy",["mixpy.format_str("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},YI=function(t,e){e.definitions_.import_mixiot="import mixiot";var i=e.valueToCode(this,"SERVER",e.ORDER_ATOMIC),n=e.valueToCode(this,"KEY",e.ORDER_ATOMIC),s=Math.round(new Date).toString(),r="f'python-mqtt-"+n.replace("'","").replace("'","")+s.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO.from_mixly_key("+i+", 1883 ,"+n+", "+r+")\n"},BI=function(t,e){return[this.getFieldValue("VISITOR_ID"),e.ORDER_ATOMIC]},UI=function(t,e){return["'"+this.getFieldValue("VISITOR_ID")+"'",e.ORDER_ATOMIC]},XI=function(t,e){e.definitions_.import_mixiot="import mixiot";var i=e.valueToCode(this,"SERVER",e.ORDER_ATOMIC),n=e.valueToCode(this,"KEY",e.ORDER_ATOMIC),s=Math.round(new Date).toString(),r="f'python-mqtt-"+n.replace("'","").replace("'","")+s.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO.from_share_key("+i+", 1883 ,"+n+", "+r+")\n"},GI=function(t,e){e.definitions_.import_mixiot="import mixiot";return["mqtt_client.pingSync()",e.ORDER_ATOMIC]},HI=function(t,e){return e.definitions_.import_mixiot="import mixiot",["mixiot.ntp("+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},WI=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},jI=WI,qI=WI,KI=WI,zI=WI,$I=function(t,e){e.definitions_.import_serial="import serial";var i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0",n=e.variableDB_.getName(this.getFieldValue("SER"),rt.Variables.NAME_TYPE),s=this.getFieldValue("BPS");return n+' = serial.Serial("'+ot.JSFuncs.getCom()+'", '+s+", timeout="+i+")\n"},QI=function(t,e){return e.definitions_.import_serial="import serial",(e.valueToCode(this,"SER",e.ORDER_ADDITIVE)||"ser")+".write("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},JI=function(t,e){return e.definitions_.import_serial="import serial",[(e.valueToCode(this,"SER",e.ORDER_ADDITIVE)||"ser")+".read("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},ZI=function(t,e){return e.definitions_.import_serial="import serial",(e.valueToCode(this,"SER",e.ORDER_ADDITIVE)||"ser")+".close()\n"},tE=function(t,e){var i=e.valueToCode(this,"n_samples",e.ORDER_ATOMIC)||"100",n=e.valueToCode(this,"n_features",e.ORDER_ATOMIC)||"20",s=e.valueToCode(this,"n_informative",e.ORDER_ATOMIC)||"2",r=e.valueToCode(this,"n_redundant",e.ORDER_ATOMIC)||"2",o=e.valueToCode(this,"n_repeated",e.ORDER_ATOMIC)||"0",a=e.valueToCode(this,"n_classes",e.ORDER_ATOMIC)||"2",l=e.valueToCode(this,"n_clusters_per_class",e.ORDER_ATOMIC)||"2",u=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_make_classification="from sklearn.datasets import make_classification",["make_classification(n_samples="+i+",n_features="+n+",n_informative="+s+",n_redundant="+r+",n_repeated="+o+",n_classes="+a+",n_clusters_per_class="+l+",random_state="+u+")",e.ORDER_ATOMIC]},eE=function(t,e){var i=e.valueToCode(this,"n_samples",e.ORDER_ATOMIC)||"100",n=e.valueToCode(this,"n_features",e.ORDER_ATOMIC)||"100",s=e.valueToCode(this,"n_informative",e.ORDER_ATOMIC)||"10",r=e.valueToCode(this,"n_targets",e.ORDER_ATOMIC)||"1",o=e.valueToCode(this,"bias",e.ORDER_ATOMIC)||"0.0",a=e.valueToCode(this,"noise",e.ORDER_ATOMIC)||"0.0",l=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_make_regression="from sklearn.datasets import make_regression",["make_regression(n_samples="+i+",n_features="+n+",n_informative="+s+",n_targets="+r+",bias="+o+",noise="+a+",random_state="+l+")",e.ORDER_ATOMIC]},iE=function(t,e){var i=e.valueToCode(this,"n_samples",e.ORDER_ATOMIC)||"100",n=e.valueToCode(this,"n_features",e.ORDER_ATOMIC)||"2",s=e.valueToCode(this,"centers",e.ORDER_ATOMIC)||"None",r=e.valueToCode(this,"cluster_std",e.ORDER_ATOMIC)||"1.0",o=e.valueToCode(this,"center_box",e.ORDER_ATOMIC)||"(-10.0,10.0)",a=e.valueToCode(this,"shuffle",e.ORDER_ATOMIC)||"True",l=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_make_blobs="from sklearn.datasets import make_blobs",["make_blobs(n_samples="+i+",n_features="+n+",centers="+s+",cluster_std="+r+",center_box="+o+",shuffle="+a+",random_state="+l+")",e.ORDER_ATOMIC]},nE=function(t,e){var i=this.getFieldValue("type"),n=this.getFieldValue("name");return e.definitions_.import_sklearn_datasets="from sklearn import datasets",n+" = datasets."+i+"()\n"},sE=function(t,e){return[(e.valueToCode(this,"name",e.ORDER_ATOMIC)||"iris")+"."+this.getFieldValue("type"),e.ORDER_ATOMIC]},rE=function(t,e){var i=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"iris_X",n=e.valueToCode(this,"train_target",e.ORDER_ATOMIC)||"iris_y",s=e.valueToCode(this,"test_size",e.ORDER_ATOMIC)||"0.3",r=e.valueToCode(this,"rondom_state",e.ORDER_ATOMIC)||"None";if(e.definitions_.import_sklearn_train_test_split="from sklearn.model_selection import train_test_split","None"==n)var o="train_test_split("+i+",test_size = "+s+",random_state = "+r+")";else o="train_test_split("+i+","+n+",test_size = "+s+",random_state = "+r+")";return[o,e.ORDER_ATOMIC]},oE=function(t,e){var i=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"iris_X",n=e.valueToCode(this,"test_size",e.ORDER_ATOMIC)||"0.3",s=e.valueToCode(this,"rondom_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_train_test_split="from sklearn.model_selection import train_test_split",["train_test_split("+i+",test_size = "+n+",random_state = "+s+")",e.ORDER_ATOMIC]},aE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=e.valueToCode(this,"fit_intercept",e.ORDER_ATOMIC)||"True",s=e.valueToCode(this,"normalize",e.ORDER_ATOMIC)||"False",r=e.valueToCode(this,"n_jobs",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_linear_model="from sklearn.linear_model import LinearRegression",i+" = LinearRegression(fit_intercept = "+n+",normalize = "+s+",n_jobs = "+r+")\n"},lE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=e.valueToCode(this,"alpha",e.ORDER_ATOMIC)||"1.0",s=e.valueToCode(this,"fit_intercept",e.ORDER_ATOMIC)||"True",r=e.valueToCode(this,"normalize",e.ORDER_ATOMIC)||"False",o=e.valueToCode(this,"max_iter",e.ORDER_ATOMIC)||"300",a=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_linear_model="from sklearn.linear_model import Ridge",i+" = Ridge(alpha = "+n+",fit_intercept = "+s+",normalize = "+r+",max_iter = "+o+",random_state = "+a+")\n"},uE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=this.getFieldValue("type"),s=e.valueToCode(this,"max_depth",e.ORDER_ATOMIC)||"None",r=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_["import_sklearn_"+n]="from sklearn.tree import "+n,i+" = "+n+"(max_depth = "+s+",random_state = "+r+")\n"},pE=function(t,e){var i=this.getFieldValue("type"),n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"Model",s=e.valueToCode(this,"n_estimators",e.ORDER_ATOMIC)||"100",r=e.valueToCode(this,"max_depth",e.ORDER_ATOMIC)||"None",o=e.valueToCode(this,"n_jobs",e.ORDER_ATOMIC)||"None",a=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_["import_sklearn_"+i]="from sklearn.ensemble import "+i,n+" = "+i+"(n_estimators = "+s+",max_depth = "+r+",n_jobs = "+o+",random_state = "+a+")\n"},hE=function(t,e){var i=this.getFieldValue("type"),n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",s=e.valueToCode(this,"K",e.ORDER_ATOMIC)||"5",r=e.valueToCode(this,"n_jobs",e.ORDER_ATOMIC)||"None";return e.definitions_["import_sklearn_"+i]="from sklearn.neighbors import "+i,n+" = "+i+"(n_neighbors = "+s+",n_jobs = "+r+")\n"},dE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model";return e.definitions_.import_sklearn_GaussianNB="from sklearn.naive_bayes import GaussianNB",i+" = GaussianNB()\n"},cE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"pca",n=e.valueToCode(this,"n_components",e.ORDER_ATOMIC)||"2";return e.definitions_.import_sklearn_pca="from sklearn.decomposition import PCA",i+" = PCA(n_components="+n+")\n"},_E=function(t,e){return[e.valueToCode(t,"model_name",e.ORDER_ATOMIC)+".fit_transform("+e.valueToCode(t,"train_data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},fE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=e.valueToCode(this,"n_clusters",e.ORDER_ATOMIC)||"8",s=e.valueToCode(this,"max_iter",e.ORDER_ATOMIC)||"300",r=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_KMeans="from sklearn.cluster import KMeans",i+" = KMeans(n_clusters = "+n+",max_iter = "+s+",random_state = "+r+")\n"},TE=function(t,e){return e.valueToCode(t,"model_name",e.ORDER_ATOMIC)+".fit("+e.valueToCode(t,"train_data",e.ORDER_ATOMIC)+")\n"},mE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train",s=e.valueToCode(this,"train_target",e.ORDER_ATOMIC)||"y_train";if("None"==s)var r=i+".fit("+n+")\n";else r=i+".fit("+n+","+s+")\n";return r},gE=function(t,e){return(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+".fit("+(e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train")+")\n"},IE=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+".predict("+(e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_test")+")",e.ORDER_ATOMIC]},EE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train",s=e.valueToCode(this,"train_target",e.ORDER_ATOMIC)||"y_train";if("None"==s)var r=i+".score("+n+")";else r=i+".score("+n+","+s+")";return[r,e.ORDER_ATOMIC]},OE=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+".score("+(e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train")+")",e.ORDER_ATOMIC]},ME=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+"."+this.getFieldValue("type"),e.ORDER_ATOMIC]},RE=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+"."+this.getFieldValue("type"),e.ORDER_ATOMIC]},AE=function(t,e){var i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",n=this.getFieldValue("type"),s=e.valueToCode(this,"address",e.ORDER_ATOMIC)||"D:/mixly/test.pkl";e.definitions_.import_sklearn_joblib="import joblib";return"dump"==n?"joblib.dump("+i+","+s+")\n":i+" = joblib.load("+s+")\n"},yE=function(t,e){e.definitions_.import_time="import time";return["time.time()",e.ORDER_ATOMIC]},SE=function(){return"exit()\n"},vE=function(t,e){e.definitions_.import_time="import time";var i=this.getFieldValue("op"),n="time.localtime()["+i+"]";if("all"===i){return["time.localtime()",e.ORDER_ASSIGNMENT]}return[n,e.ORDER_ASSIGNMENT]},CE=function(t,e){return e.definitions_.import_turtle="import turtle",e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = turtle.Turtle()\n"},LE=function(t,e){e.definitions_.import_turtle="import turtle";return"turtle.done()\n"},bE=function(t,e){e.definitions_.import_turtle="import turtle";return"turtle.exitonclick()\n"},DE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},wE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},NE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".setheading("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},FE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".screen.delay("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},PE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".goto("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+","+(e.valueToCode(this,"val",e.ORDER_ASSIGNMENT)||"0")+")\n"},xE=function(t,e){return e.definitions_.import_turtle="import turtle",[(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()",e.ORDER_ATOMIC]},kE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},VE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},YE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"_fill()\n"},BE=function(t,e){return e.definitions_.import_turtle="import turtle",this.getFieldValue("TUR")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},UE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".pensize("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},XE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".speed("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},GE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},HE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".set"+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},WE=function(t,e){e.definitions_.import_turtle="import turtle";var i=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";return i+".circle ("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+n+")\n"},jE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},qE=function(t,e){return e.definitions_.import_turtle="import turtle",'turtle.bgcolor("'+this.getFieldValue("FIELDNAME")+'")\n'},KE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+'.pencolor("'+this.getFieldValue("FIELDNAME")+'")\n'},zE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+'.fillcolor("'+this.getFieldValue("FIELDNAME")+'")\n'},$E=function(t,e){return e.definitions_.import_turtle="import turtle",[(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".clone()",e.ORDER_ATOMIC]},QE=function(t,e){return e.definitions_.import_turtle="import turtle","turtle.bgcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},JE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".pencolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},ZE=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".fillcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},tO=function(t,e){return e.definitions_.import_turtle="import turtle","turtle.bgcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},eO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".pencolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},iO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".fillcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},nO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".color("+e.valueToCode(this,"VAR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"VAR2",e.ORDER_ATOMIC)+")\n"},sO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+'.color("'+this.getFieldValue("FIELDNAME")+'","'+this.getFieldValue("FIELDNAME2")+'")\n'},rO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".shape('"+this.getFieldValue("DIR")+"')\n"},oO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".shapesize("+(e.valueToCode(this,"WID",e.ORDER_ASSIGNMENT)||"0")+","+(e.valueToCode(this,"LEN",e.ORDER_ASSIGNMENT)||"0")+","+(e.valueToCode(this,"OUTLINE",e.ORDER_ASSIGNMENT)||"0")+")\n"},aO=function(t,e){return e.definitions_.import_turtle="import turtle",["turtle.textinput("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PROMPT",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},lO=function(t,e){return e.definitions_.import_turtle="import turtle",["turtle.numinput("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PROMPT",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DEFAULT",e.ORDER_ATOMIC)+",minval = "+e.valueToCode(this,"MIN",e.ORDER_ATOMIC)+",maxval = "+e.valueToCode(this,"MAX",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},uO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".write("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},pO=function(t,e){e.definitions_.import_turtle="import turtle";var i=this.getFieldValue("MOVE"),n=this.getFieldValue("ALIGN"),s=e.valueToCode(this,"FONTNAME",e.ORDER_ATOMIC),r=e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0",o=this.getFieldValue("FONTTYPE");return(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".write("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+i+',align="'+n+'",font=('+s+","+r+',"'+o+'"))\n'},hO=function(t,e){e.definitions_.import_turtle="import turtle";var i=this.getFieldValue("MOVE"),n=this.getFieldValue("ALIGN"),s=e.valueToCode(this,"FONTNAME",e.ORDER_ATOMIC),r=e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0",o=this.getFieldValue("FONTTYPE");return(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".write("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+i+',align="'+n+'",font=('+s+","+r+',"'+o+'"))\n'},dO=function(t,e){return['"'+this.getFieldValue("COLOR")+'"',e.ORDER_ATOMIC]},cO=function(t,e){e.definitions_.import_turtle="import turtle";var i=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0";return e.variableDB_.getName(this.getFieldValue("VAR"),rt.Variables.NAME_TYPE)+" = "+i+".getscreen()\n"},_O=function(t,e){e.definitions_.import_turtle="import turtle";var i=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return i+".onkey("+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+", "+n+")\n"},fO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".onclick("+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},TO=function(t,e){e.definitions_.import_turtle="import turtle";var i=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0",n=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return i+".ontimer("+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+", "+n+")\n"},mO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".listen()\n"},gO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".getcanvas().postscript(file="+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"};var IO=__webpack_require__(6944);const EO=$;var OO=__webpack_require__.n(EO),MO=__webpack_require__(6619),RO=__webpack_require__.n(MO);const AO={stage:new(RO().Container),pointer:{x:0,y:0},backgroundSprite:null,sprites:{},texts:{},counter:0,keys:{},state:!1,running:!1,repeatPlay:()=>{},displayTag:!1,processingDisplayEvent:null,successDisplayEvents:[],successProcessingDisplayEvents:[],startTime:performance.now(),timer:0,lastFrameTime:null,lastSecond:null,targetFPS:60,frameCount:0,currentFPS:60,canvasHeight:450,canvasWidth:800,gameLoop:()=>{1==AO.state&&(AO.repeatPlay(),AO.gameLoopDisplay()),AO.timer=performance.now()-AO.startTime},animate:t=>{t-AO.lastFrameTime>=1e3/AO.targetFPS&&(AO.frameCount++,AO.gameLoop(),AO.renderer.render(AO.stage),AO.lastFrameTime=t),t-AO.lastSecond>=1e3&&(AO.currentFPS=AO.frameCount,AO.frameCount=0,AO.lastSecond=t),requestAnimationFrame(AO.animate)}};AO.createBackground=(t,e=0)=>{var i;return 0==e&&(i=new(RO().Sprite.fromImage)(`../common/media/spriteimg/${t}.png`)),i.name="background",i.anchor.set(.5),i.x=AO.canvasWidth/2,i.y=AO.canvasHeight/2,i.width=AO.canvasWidth,i.height=AO.canvasHeight,i.interactive=!0,i.buttonMode=!0,i.isDown=!1,i.isUp=!0,i.on("mousedown",(function(){this.isDown=!0,this.isUp=!1,AO.state&&this.runningMouseDown()})).on("mouseup",(function(){this.isDown=!1,this.isUp=!0})).on("mouseupoutside",(function(){this.isDown=!1,this.isUp=!0})),i.runningMouseDown=new Function(""),AO.backgroundSprite&&AO.backgroundSprite.parent&&AO.stage.removeChild(AO.backgroundSprite),AO.backgroundSprite=i,AO.stage.addChildAt(AO.backgroundSprite,0),0},AO.createASprite=(t,e=AO.canvasWidth/2,i=AO.canvasHeight/2,n="",s=0)=>{var r;return""==n&&(n="sprite"+ ++AO.counter),0==s&&(r=new(RO().Sprite.fromImage)(`../common/media/spriteimg/${t}.png`)),AO.sprites[n]||AO.texts[n]||(r.name=n,r.anchor.set(.5),r.x=e,r.y=i,r.interactive=!0,r.buttonMode=!0,r.isDown=!1,r.isUp=!0,r.on("mousedown",(function(t){this.isDown=!0,this.isUp=!1,AO.state?this.runningMouseDown():(this.data=t.data,this.alpha=.5,this.dragging=!0)})).on("mouseup",(function(){this.isDown=!1,this.isUp=!0,AO.state||(this.alpha=1,this.dragging=!1,this.data=null)})).on("mouseupoutside",(function(){this.isDown=!1,this.isUp=!0,AO.state||(this.alpha=1,this.dragging=!1,this.data=null)})).on("mousemove",(function(){if(!AO.state&&this.dragging){var t=this.data.getLocalPosition(this.parent);this.position.x=t.x,this.position.y=t.y}})),r.runningMouseDown=new Function(""),r.show=function(){this.visible=!0},r.hide=function(){this.visible=!1},r.enlarge=function(t){const e=this.height/this.width;var i=Math.sqrt(this.height*this.width);i+=t,this.width=Math.sqrt(i*i/e),this.height=this.width*e},r.enlargeTo=function(t){var e=this.height/this.width;this.width=Math.sqrt(t*t/e),this.height=this.width*e},r.expandTo=async function(t,e=1){if(AO.running){AO.displayTag=!0,AO.processingDisplayEvent={sprite:this,targetS:t,totalTime:1e3*e,startTime:performance.now(),displayType:"expand"};var i=new Promise((t=>{if(!1===AO.displayTag)t();else{const e=setInterval((()=>{!1===AO.displayTag&&(clearInterval(e),t())}),10)}}));return await i}return AO.successProcessingDisplayEvents.push({sprite:this,targetS:t,totalTime:1e3*e,startTime:performance.now(),displayType:"expand"}),0},r.move=function(t){this.x+=t*Math.cos(this.rotation),this.y+=t*Math.sin(this.rotation)},r.moveTo=function(t,e){this.x=t,this.y=e},r.slideTo=async function(t,e,i=1){if(AO.running){AO.displayTag=!0,AO.processingDisplayEvent={sprite:this,targetX:t,targetY:e,totalTime:1e3*i,startTime:performance.now(),displayType:"slide"};var n=new Promise((t=>{const e=setInterval((()=>{!1===AO.displayTag&&(clearInterval(e),t())}),10)}));return await n}return AO.successProcessingDisplayEvents.push({sprite:this,targetX:t,targetY:e,totalTime:1e3*i,startTime:performance.now(),displayType:"slide"}),0},r.addX=function(t){this.x+=t},r.addY=function(t){this.y+=t},r.rotate=function(t){this.rotation+=Math.PI/180*t},r.rotateTo=function(t){this.rotation=Math.PI/180*t},r.circleTo=async function(t,e=1){if(AO.running){AO.displayTag=!0,AO.processingDisplayEvent={sprite:this,targetDegree:t,totalTime:1e3*e,startTime:performance.now(),displayType:"circle"};var i=new Promise((t=>{if(!1===AO.displayTag)t();else{const e=setInterval((()=>{!1===AO.displayTag&&(clearInterval(e),t())}),10)}}));return await i}return AO.successProcessingDisplayEvents.push({sprite:this,targetDegree:t,totalTime:1e3*e,startTime:performance.now(),displayType:"circle"}),0},r.hit=function(t){return AO.hitTestRectangle(this,t)},r.outOfScreen=function(){return this.y>=AO.renderer.height||this.y<=0||this.x<=0||this.x>=AO.renderer.width},r.mouseAction=function(t){this.runningMouseDown=t},r.setScale=function(t=0,e=0){0==t&&(t=this.height),0==e&&(e=this.width),this.height=t,this.width=e},r.filterGray=function(){const t=new(RO().filters.ColorMatrixFilter);t.blackAndWhite(),this.filters=[t]},r.filterBrighter=function(){const t=new(RO().filters.ColorMatrixFilter);t.brightness(1.25),this.filters=[t]},r.filterOrigin=function(){this.filters=null},AO.stage.addChild(r),AO.sprites[n]=r),n},AO.clearAllSprites=()=>{AO.backgroundSprite&&AO.backgroundSprite.parent&&AO.backgroundSprite.parent.removeChild(AO.backgroundSprite);for(const t in AO.sprites)AO.sprites[t].parent.removeChild(AO.sprites[t]),delete AO.sprites[t];for(const t in AO.texts)AO.texts[t].parent.removeChild(AO.texts[t]),delete AO.texts[t];return AO.counter=0,AO.clearTimer(),0},AO.createText=(t,e=AO.canvasWidth/2,i=AO.canvasHeight/2,n="")=>{if(""==n&&(n="text"+ ++AO.counter),!AO.sprites[n]&&!AO.texts[n]){var s=new(RO().Text)(t);s.name=n,s.x=e,s.y=i,s.interactive=!0,s.buttonMode=!0,s.on("mousedown",(function(t){this.isDown=!0,this.isUp=!1,AO.state?this.runningMouseDown():(this.data=t.data,this.alpha=.5,this.dragging=!0)})).on("mouseup",(function(){this.isDown=!1,this.isUp=!0,AO.state||(this.alpha=1,this.dragging=!1,this.data=null)})).on("mouseupoutside",(function(){this.isDown=!1,this.isUp=!0,AO.state||(this.alpha=1,this.dragging=!1,this.data=null)})).on("mousemove",(function(){if(!AO.state&&this.dragging){var t=this.data.getLocalPosition(this.parent);this.position.x=t.x,this.position.y=t.y}})),s.runningMouseDown=new Function(""),s.changeText=function(t){this.text=t},s.show=function(){this.visible=!0},s.hide=function(){this.visible=!1},AO.stage.addChild(s),AO.texts[n]=s}return n},AO.hitTestRectangle=(t,e)=>{let i,n,s,r,o;return i=!1,t.centerX=t.x+t.width/2,t.centerY=t.y+t.height/2,e.centerX=e.x+e.width/2,e.centerY=e.y+e.height/2,t.halfWidth=t.width/2,t.halfHeight=t.height/2,e.halfWidth=e.width/2,e.halfHeight=e.height/2,r=t.centerX-e.centerX,o=t.centerY-e.centerY,n=t.halfWidth+e.halfWidth,s=t.halfHeight+e.halfHeight,i=Math.abs(r)<n&&Math.abs(o)<s,i},AO.repeat=t=>{AO.repeatPlay=t},AO.isKeyboardHit=t=>{if(!AO.keys[t]){let e=AO.keyboard(t);AO.keys[t]=e}return AO.keys[t].isDown},AO.keyboardListener=(t,e)=>{if(AO.keys[t])AO.keys[t].press=function(){AO.state&&e()};else{let i=AO.keyboard(t);i.press=function(){AO.state&&e()},AO.keys[t]=i}},AO.keyboard=t=>{let e={};e.value=t,e.isDown=!1,e.isUp=!0,e.press=void 0,e.release=void 0,e.downHandler=t=>{t.key===e.value&&(e.isUp&&e.press&&e.press(),e.isDown=!0,e.isUp=!1,t.preventDefault())},e.upHandler=t=>{t.key===e.value&&(e.isDown&&e.release&&e.release(),e.isDown=!1,e.isUp=!0,t.preventDefault())};const i=e.downHandler.bind(e),n=e.upHandler.bind(e);return window.addEventListener("keydown",i,!1),window.addEventListener("keyup",n,!1),e.unsubscribe=()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",n)},e},AO.clearTimer=()=>{AO.startTime=performance.now()},AO.gameLoopDisplay=()=>{if(AO.processingDisplayEvent){const t=AO.processingDisplayEvent;switch(t.displayType){case"slide":if(performance.now()>=t.totalTime+t.startTime)t.sprite.moveTo(t.targetX,t.targetY),AO.displayTag=!1,AO.processingDisplayEvent=null;else(e=AO.currentFPS*(t.totalTime+t.startTime-performance.now())/1e3)>=1&&(t.sprite.addX((t.targetX-t.sprite.x)/e),t.sprite.addY((t.targetY-t.sprite.y)/e));break;case"expand":if(performance.now()>=t.totalTime+t.startTime)t.sprite.enlargeTo(t.targetS),AO.displayTag=!1,AO.processingDisplayEvent=null;else(e=AO.currentFPS*(t.totalTime+t.startTime-performance.now())/1e3)>=1&&t.sprite.enlarge((t.targetS-Math.sqrt(t.sprite.height*t.sprite.width))/e);break;case"circle":if(performance.now()>=t.totalTime+t.startTime)t.sprite.rotateTo(t.targetDegree),AO.displayTag=!1,AO.processingDisplayEvent=null;else(e=AO.currentFPS*(t.totalTime+t.startTime-performance.now())/1e3)>=1&&t.sprite.rotate((t.targetDegree-180*t.sprite.rotation/Math.PI)/e)}}if(!AO.running&&AO.successProcessingDisplayEvents.length)for(var t=AO.successProcessingDisplayEvents.length-1;t>=0;t--){const i=AO.successProcessingDisplayEvents[t];switch(i.displayType){case"slide":if(performance.now()>=i.totalTime+i.startTime)i.sprite.moveTo(i.targetX,i.targetY),AO.successProcessingDisplayEvents.splice(t,1);else(e=AO.currentFPS*(i.totalTime+i.startTime-performance.now())/1e3)>=1&&(i.sprite.addX((i.targetX-i.sprite.x)/e),i.sprite.addY((i.targetY-i.sprite.y)/e));break;case"expand":if(performance.now()>=i.totalTime+i.startTime)i.sprite.enlargeTo(i.targetS),AO.successProcessingDisplayEvents.splice(t,1);else(e=AO.currentFPS*(i.totalTime+i.startTime-performance.now())/1e3)>=1&&i.sprite.enlarge((i.targetS-Math.sqrt(i.sprite.height*i.sprite.width))/e);break;case"circle":var e;if(performance.now()>=i.totalTime+i.startTime)i.sprite.rotateTo(i.targetDegree),AO.successProcessingDisplayEvents.splice(t,1);else(e=AO.currentFPS*(i.totalTime+i.startTime-performance.now())/1e3)>=1&&i.sprite.rotate((i.targetDegree-180*i.sprite.rotation/Math.PI)/e)}}},AO.changeWidth=t=>{const e=OO()(AO.renderer.view),i=e.width(),n=e.height();e.width(t),e.height(t/i*n)},AO.kill=()=>{AO.state=!1,AO.repeatPlay=new Function;for(let t in AO.keys)AO.keys[t].unsubscribe(),delete AO.keys[t];AO.processingDisplayEvent=null,AO.displayTag=!1,AO.running=!1,AO.clearTimer()},AO.runit=t=>{const e=OO()(t);e.empty(),RO().SCALE_MODES.DEFAULT=RO().SCALE_MODES.NEAREST,AO.renderer=RO().autoDetectRenderer(AO.canvasWidth,AO.canvasHeight,{backgroundColor:16777215}),e.append(AO.renderer.view),AO.pointer={x:0,y:0},AO.stage.sortableChildren=!0,AO.stage.interactive=!0,AO.stage.on("mousemove",((t=RO().InteractionEvent)=>{AO.pointer.x=t.data.global.x,AO.pointer.y=t.data.global.y})),AO.lastFrameTime=0,AO.running=!0,AO.lastFrameTime||(AO.lastFrameTime=performance.now(),AO.lastSecond=performance.now()),AO.animate(performance.now()),AO.repeatPlay=new Function;for(let t in AO.keys)AO.keys[t].unsubscribe(),delete AO.keys[t];AO.backgroundSprite&&(AO.backgroundSprite.runningMouseDown=new Function);for(let t in AO.sprites)AO.sprites[t].runningMouseDown=new Function;for(let t in AO.texts)AO.texts[t].runningMouseDown=new Function;AO.processingDisplayEvent=null,AO.displayTag=!1,AO.clearTimer(),AO.changeWidth(OO()("body").width()/2),AO.state=!0},window.mixlySprite=AO;const yO=AO;var SO=__webpack_require__(9610);class vO{constructor(t,e){this._pageLoad=new SO.D,this._kernelAvailable=new SO.D,this._loaderId="basthon-loader",this._doNotHideLoader=!0;const i=t.language;if(null!=e&&(this._loaderId=e),"loading"===document.readyState){const t=()=>{document.removeEventListener("DOMContentLoaded",t),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",t)}else this._pageLoad.resolve();(async()=>{switch(i){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:n}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new n(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:r}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new r(t);break;case"ocaml":const{KernelOCaml:o}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new o(t);break;default:return window.console.error(`Kernel '${i}' 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,i=!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 n="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(n);const r=document.createElement("div");r.classList.add("basthon-loader-container"),r.classList.add(n),s.appendChild(r);const o=document.createElement("div");o.classList.add("basthon-loader-spinner"),o.classList.add(n),o.innerHTML="<span><span></span><span></span></span>",r.appendChild(o);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(n),r.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(n),l.innerHTML=t,r.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(n),u.style.display="none",r.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 !!!<br>Vérifiez que votre navigateur est à jour.<br>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 o.classList.remove("basthon-loader-spinner"),o.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,i&&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,i=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(i[1])?{name:"IE",version:(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1]||""}:"Chrome"===i[1]&&null!=(t=e.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:t[1]}:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&i.splice(1,1,t[1]),{name:i[0],version:i[1]})}}class CO extends ot.PageBase{static{ot.HTMLTemplate.add("html/statusbar/statusbar-image.html",new ot.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n flex-wrap: wrap;\r\n align-content: flex-start;\r\n overflow: auto;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] {\r\n background-color: #ffffff;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] {\r\n background-color: #1e1e1e;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item"></div>')),this.init=function(){ot.StatusBarsManager.typesRegistry.register(["images"],CO);const t=ot.Workspace.getMain().getStatusBarsManager();return t.add({type:"images",id:"images",name:rt.Msg.PYTHON_PYODIDE_IMAGE,title:rt.Msg.PYTHON_PYODIDE_IMAGE}),t.changeTo("output"),t.get("images")}}constructor(){super();const t=OO()(ot.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(),i=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let n=t.content,s=null,r=null;switch(t.display_type){case"p5":n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.justifyContent="center",n.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())&&i(e)}))))})).observe(n,{childList:!0}),n.querySelectorAll("canvas,video").forEach(i),e.append(n);break;case"matplotlib":s=n.querySelector("canvas"),s&&(n=s),n.style.width="",n.style.height="",n.style.maxWidth="100%",n.style.maxHeight="100%",e.append(n);break;case"ocaml-canvas":n.style.width="",n.style.height="",n.style.maxWidth="100%",n.style.maxHeight="100%",e.append(n);break;case"turtle":n.setAttribute("width","100%"),n.setAttribute("height","100%"),e.append(n.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 i of["image/svg+xml","image/png","text/html","text/plain"])if(i in t.content){let n=t.content[i];"image/png"===i&&(n='<img src="data:image/png;base64,'+n+'" style="max-width: 100%; max-height: 100%;">'),e.append(n);break}break;case"tutor":if(e.append(OO()(t.content.replace("overflow-y%3A%20hidden%3B",""))),r=this.getContent()[0].getElementsByTagName("iframe")[0],null==r)return;r.style.maxHeight=r.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const i=t[0];i&&!i.isIntersecting||(r.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(r);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const LO=layui;var bO;!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"}(bO||(bO={}));const DO={[bO.EPERM]:"Operation not permitted",[bO.ENOENT]:"No such file or directory",[bO.EINTR]:"Interrupted system call",[bO.EIO]:"Input/output error",[bO.ENXIO]:"No such device or address",[bO.EBADF]:"Bad file descriptor",[bO.EAGAIN]:"Resource temporarily unavailable",[bO.ENOMEM]:"Cannot allocate memory",[bO.EACCES]:"Permission denied",[bO.EFAULT]:"Bad address",[bO.ENOTBLK]:"Block device required",[bO.EBUSY]:"Resource busy or locked",[bO.EEXIST]:"File exists",[bO.EXDEV]:"Invalid cross-device link",[bO.ENODEV]:"No such device",[bO.ENOTDIR]:"File is not a directory",[bO.EISDIR]:"File is a directory",[bO.EINVAL]:"Invalid argument",[bO.ENFILE]:"Too many open files in system",[bO.EMFILE]:"Too many open files",[bO.ETXTBSY]:"Text file busy",[bO.EFBIG]:"File is too big",[bO.ENOSPC]:"No space left on disk",[bO.ESPIPE]:"Illegal seek",[bO.EROFS]:"Cannot modify a read-only file system",[bO.EMLINK]:"Too many links",[bO.EPIPE]:"Broken pipe",[bO.EDOM]:"Numerical argument out of domain",[bO.ERANGE]:"Numerical result out of range",[bO.EDEADLK]:"Resource deadlock would occur",[bO.ENAMETOOLONG]:"File name too long",[bO.ENOLCK]:"No locks available",[bO.ENOSYS]:"Function not implemented",[bO.ENOTEMPTY]:"Directory is not empty",[bO.ELOOP]:"Too many levels of symbolic links",[bO.ENOMSG]:"No message of desired type",[bO.EBADE]:"Invalid exchange",[bO.EBADR]:"Invalid request descriptor",[bO.EXFULL]:"Exchange full",[bO.ENOANO]:"No anode",[bO.EBADRQC]:"Invalid request code",[bO.ENOSTR]:"Device not a stream",[bO.ENODATA]:"No data available",[bO.ETIME]:"Timer expired",[bO.ENOSR]:"Out of streams resources",[bO.ENONET]:"Machine is not on the network",[bO.EREMOTE]:"Object is remote",[bO.ENOLINK]:"Link has been severed",[bO.ECOMM]:"Communication error on send",[bO.EPROTO]:"Protocol error",[bO.EBADMSG]:"Bad message",[bO.EOVERFLOW]:"Value too large for defined data type",[bO.EBADFD]:"File descriptor in bad state",[bO.ESTRPIPE]:"Streams pipe error",[bO.ENOTSOCK]:"Socket operation on non-socket",[bO.EDESTADDRREQ]:"Destination address required",[bO.EMSGSIZE]:"Message too long",[bO.EPROTOTYPE]:"Protocol wrong type for socket",[bO.ENOPROTOOPT]:"Protocol not available",[bO.EPROTONOSUPPORT]:"Protocol not supported",[bO.ESOCKTNOSUPPORT]:"Socket type not supported",[bO.ENOTSUP]:"Operation is not supported",[bO.ENETDOWN]:"Network is down",[bO.ENETUNREACH]:"Network is unreachable",[bO.ENETRESET]:"Network dropped connection on reset",[bO.ETIMEDOUT]:"Connection timed out",[bO.ECONNREFUSED]:"Connection refused",[bO.EHOSTDOWN]:"Host is down",[bO.EHOSTUNREACH]:"No route to host",[bO.EALREADY]:"Operation already in progress",[bO.EINPROGRESS]:"Operation now in progress",[bO.ESTALE]:"Stale file handle",[bO.EREMOTEIO]:"Remote I/O error",[bO.EDQUOT]:"Disk quota exceeded"};class wO extends Error{static fromJSON(t){const e=new wO(t.errno,t.message,t.path,t.syscall);return e.code=t.code,e.stack=t.stack,e}static With(t,e,i){return new wO(bO[t],DO[bO[t]],e,i)}constructor(t,e=DO[t],i,n=""){super(e),this.errno=t,this.path=i,this.syscall=n,this.code=bO[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 NO="/";function FO(t,e){let i="",n=0,s=-1,r=0,o="\0";for(let a=0;a<=t.length;++a){if(a<t.length)o=t[a];else{if("/"==o)break;o="/"}if("/"==o){if(s===a-1||1===r);else if(2===r){if(i.length<2||2!==n||"."!==i.at(-1)||"."!==i.at(-2)){if(i.length>2){const t=i.lastIndexOf("/");-1===t?(i="",n=0):(i=i.slice(0,t),n=i.length-1-i.lastIndexOf("/")),s=a,r=0;continue}if(0!==i.length){i="",n=0,s=a,r=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(s+1,a):i=t.slice(s+1,a),n=a-s-1;s=a,r=0}else"."===o&&-1!==r?++r:r=-1}return i}function PO(...t){let e="";for(const i of[...t.reverse(),NO])if(i.length&&(e=`${i}/${e}`,i.startsWith("/")))break;const i=e.startsWith("/");return e=FO(e,!i),i?`/${e}`:e.length?e:"/"}function xO(...t){if(!t.length)return".";const e=t.join("/");return e?.length?function(t){if(!t.length)return".";const e=t.startsWith("/"),i=t.endsWith("/");return(t=FO(t,!e)).length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}(e):"."}function kO(t){if(0===t.length)return".";const e="/"===t[0];let i=-1,n=!0;for(let e=t.length-1;e>=1;--e)if("/"===t[e]){if(!n){i=e;break}}else n=!1;return-1===i?e?"/":".":e&&1===i?"//":t.slice(0,i)}function VO(t,e){let i=0,n=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let r=e.length-1,o=-1;for(let a=t.length-1;a>=0;--a)if("/"===t[a]){if(!s){i=a+1;break}}else-1===o&&(s=!1,o=a+1),r>=0&&(t[a]===e[r]?-1==--r&&(n=a):(r=-1,n=o));return i===n?n=o:-1===n&&(n=t.length),t.slice(i,n)}for(let e=t.length-1;e>=0;--e)if("/"===t[e]){if(!s){i=e+1;break}}else-1===n&&(s=!1,n=e+1);return-1===n?"":t.slice(i,n)}function YO(t){const e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(0===t.length)return i;const n=e?1:0;let s=-1,r=0,o=-1,a=!0,l=t.length-1,u=0;for(;l>=n;--l)if("/"!==t[l])-1===o&&(a=!1,o=l+1),"."===t[l]?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!a){r=l+1;break}if(-1!==o){const n=0===r&&e?1:r;-1===s||0===u||1===u&&s===o-1&&s===r+1?i.base=i.name=t.slice(n,o):(i.name=t.slice(n,s),i.base=t.slice(n,o),i.ext=t.slice(s,o))}return r>0?i.dir=t.slice(0,r-1):e&&(i.dir="/"),i}const BO=new TextEncoder;function UO(t){if("string"!=typeof t)throw new wO(bO.EINVAL,"Can not encode a non-string");return BO.encode(t)}const XO=new TextDecoder;function GO(t){if(!(t instanceof Uint8Array))throw new wO(bO.EINVAL,"Can not decode a non-Uint8Array");return XO.decode(t)}function HO(t){return JSON.parse(GO(t),((t,e)=>""==t?e:BigInt(e)))}function WO(t){return UO(JSON.stringify(t,((t,e)=>""==t?e:e.toString())))}function jO(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 wO(bO.EINVAL,"Invalid mode: "+t?.toString())}function qO(t){if(t instanceof Date)return t;try{return new Date(t)}catch{throw new wO(bO.EINVAL,"Invalid time.")}}function KO(t){if((t=t.toString()).includes("\0"))throw new wO(bO.EINVAL,"Path can not contain null character");if(0==t.length)throw new wO(bO.EINVAL,"Path can not be empty");return PO(t.replaceAll(/[/\\]+/g,"/"))}function zO(t,e="utf8",i,n=0){return"object"!=typeof t||null===t?{encoding:"string"==typeof t?t:e??null,flag:i,mode:n}:{encoding:"string"==typeof t?.encoding?t.encoding:e??null,flag:"string"==typeof t?.flag?t.flag:i,mode:jO("mode"in t?t?.mode:null,n)}}function $O(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const QO={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function JO(t){return{suid:t.uid,sgid:t.gid,euid:t.uid,egid:t.gid,groups:[],...t}}const ZO=0,tM=4,eM=2,iM=1,nM=1,sM=2,rM=4,oM=0,aM=1,lM=2,uM=64,pM=128,hM=256,dM=512,cM=1024,_M=65536,fM=262144,TM=131072,mM=1052672,gM=4096,IM=32768,EM=16384,OM=2048,MM=61440,RM=49152,AM=40960,yM=32768,SM=24576,vM=16384,CM=8192,LM=4096,bM=2048,DM=1024,wM=512,NM=448,FM=256,PM=128,xM=64,kM=56,VM=32,YM=16,BM=8,UM=7,XM=4,GM=2,HM=1,WM=0,jM=2**32-1,qM={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let t,e;const i=new Promise(((i,n)=>{t=i,e=n}));return{promise:i,resolve:t,reject:e}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class KM{_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:i,birthtimeMs:n,uid:s,gid:r,size:o,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(e??u),this.ctimeMs=this._convert(i??u),this.birthtimeMs=this._convert(n??u),this.uid=this._convert(s??0),this.gid=this._convert(r??0),this.size=this._convert(o??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&yM),this.mode&MM||(this.mode=this.mode|this._convert(yM))}isFile(){return(this.mode&MM)===yM}isDirectory(){return(this.mode&MM)===vM}isSymbolicLink(){return(this.mode&MM)===AM}isSocket(){return(this.mode&MM)===RM}isBlockDevice(){return(this.mode&MM)===SM}isCharacterDevice(){return(this.mode&MM)===CM}isFIFO(){return(this.mode&MM)===LM}hasAccess(t,e){const i=e?.credentials||QO;if(this.isSymbolicLink()||0===i.euid||0===i.egid)return!0;let n=0;return i.uid===this.uid&&(this.mode&FM&&(n|=tM),this.mode&PM&&(n|=eM),this.mode&xM&&(n|=iM)),(i.gid===this.gid||i.groups.includes(Number(this.gid)))&&(this.mode&VM&&(n|=tM),this.mode&YM&&(n|=eM),this.mode&BM&&(n|=iM)),this.mode&XM&&(n|=tM),this.mode&GM&&(n|=eM),this.mode&HM&&(n|=iM),(n&t)===t}chmod(t){this.mode=this._convert(this.mode&MM|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 zM(t,e,i){!isNaN(e)&&0<=e&&e<2**32&&(t.uid=e),!isNaN(i)&&0<=i&&i<2**32&&(t.gid=i)}class $M extends KM{constructor(){super(...arguments),this._isBigint=!1}}class QM extends KM{constructor(){super(...arguments),this._isBigint=!0}}class JM{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=jM,this.ffree=jM}}class ZM{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(jM),this.ffree=BigInt(jM)}}const tR=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function eR(t){if("number"==typeof t)return function(t){switch(t){case oM:return"r";case oM|mM:return"rs";case lM:return"r+";case lM|mM:return"rs+";case dM|uM|aM:return"w";case dM|uM|aM|pM:return"wx";case dM|uM|lM:return"w+";case dM|uM|lM|pM:return"wx+";case cM|uM|aM:return"a";case cM|uM|aM|pM:return"ax";case cM|uM|lM:return"a+";case cM|uM|lM|pM:return"ax+";default:throw new Error("Invalid flag number: "+t)}}(t);if(!tR.includes(t))throw new Error("Invalid flag string: "+t);return t}function iR(t){let e=0;return e<<=1,e+=+nR(t),e<<=1,e+=+sR(t),e<<=1,e}function nR(t){return-1!==t.indexOf("r")||-1!==t.indexOf("+")}function sR(t){return-1!==t.indexOf("w")||-1!==t.indexOf("a")||-1!==t.indexOf("+")}function rR(t){return-1!==t.indexOf("w")}function oR(t){return-1!==t.indexOf("a")}function aR(t){return-1!==t.indexOf("x")}class lR{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 uR extends lR{constructor(t,e,i,n,s=new Uint8Array(new ArrayBuffer(0,t.metadata().noResizableBuffers?{}:{maxByteLength:jM}))){if(super(t,e),this.flag=i,this.stats=n,this._buffer=s,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=s.byteLength){if(nR(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 oR(this.flag)?this.stats.size:this._position}set position(t){this._position=t}async sync(){if(this.closed)throw wO.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 wO.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 wO.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw wO.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(t){if(this.closed)throw wO.With("EBADF",this.path,"File.dispose");if(this.dirty&&!t)throw wO.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw wO.With("EBADF",this.path,"File.stat");return Promise.resolve(new $M(this.stats))}statSync(){if(this.closed)throw wO.With("EBADF",this.path,"File.stat");return new $M(this.stats)}_truncate(t){if(this.closed)throw wO.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!sR(this.flag))throw new wO(bO.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),qM.syncImmediately&&await this.sync()}truncateSync(t){this._truncate(t),qM.syncImmediately&&this.syncSync()}_write(t,e=0,i=this.stats.size,n=this.position){if(this.closed)throw wO.With("EBADF",this.path,"File.write");if(!sR(this.flag))throw new wO(bO.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const s=n+i,r=t.slice(e,e+i);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(qM.unsafeBufferReplace)this._buffer=r;else{const t=new Uint8Array(new ArrayBuffer(s,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:jM}));t.set(this._buffer),this._buffer=t}return this._buffer.set(r,n),this.stats.mtimeMs=Date.now(),this.position=n+r.byteLength,r.byteLength}async write(t,e,i,n){const s=this._write(t,e,i,n);return qM.syncImmediately&&await this.sync(),s}writeSync(t,e=0,i=this.stats.size,n=this.position){const s=this._write(t,e,i,n);return qM.syncImmediately&&this.syncSync(),s}_read(t,e=0,i=this.stats.size,n){if(this.closed)throw wO.With("EBADF",this.path,"File.read");if(!nR(this.flag))throw new wO(bO.EPERM,"File not opened with a readable mode.");qM.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),n??(n=this.position);let s=n+i;s>this.stats.size&&(s=n+Math.max(this.stats.size-n,0)),this._position=s;const r=s-n;return 0==r||new Uint8Array(t.buffer,e,i).set(this._buffer.slice(n,s)),r}async read(t,e,i,n){const s=this._read(t,e,i,n);return qM.syncImmediately&&await this.sync(),{bytesRead:s,buffer:t}}readSync(t,e,i,n){const s=this._read(t,e,i,n);return qM.syncImmediately&&this.syncSync(),s}async chmod(t){if(this.closed)throw wO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>MM?~MM:MM)|t,(qM.syncImmediately||t>MM)&&await this.sync()}chmodSync(t){if(this.closed)throw wO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>MM?~MM:MM)|t,(qM.syncImmediately||t>MM)&&this.syncSync()}async chown(t,e){if(this.closed)throw wO.With("EBADF",this.path,"File.chown");this.dirty=!0,zM(this.stats,t,e),qM.syncImmediately&&await this.sync()}chownSync(t,e){if(this.closed)throw wO.With("EBADF",this.path,"File.chown");this.dirty=!0,zM(this.stats,t,e),qM.syncImmediately&&this.syncSync()}async utimes(t,e){if(this.closed)throw wO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,qM.syncImmediately&&await this.sync()}utimesSync(t,e){if(this.closed)throw wO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,qM.syncImmediately&&this.syncSync()}}class pR{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 hR=__webpack_require__(228);Symbol.toStringTag,Symbol.iterator;const dR=Intl.NumberFormat("en",{notation:"compact"});dR.format.bind(dR);function cR(t){return t.at(0).toUpperCase()+t.slice(1)}const _R=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],fR=[..._R,..._R.map((t=>cR(t))),"char"],TR=/^(u?int|float)(8|16|32|64)$/i;function mR(t){return"char"==t?"uint8":t.toLowerCase()}function gR(t){return TR.test(t.toString())}function IR(t){return"char"==t||TR.test(t.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function ER(t){const e=Symbol.metadata||Object.getOwnPropertySymbols(t).find((t=>"Symbol.metadata"==t.description));var i;if(i=t,Symbol?.metadata&&(Symbol.metadata in i||Object.defineProperty(i,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 OR(t){return"function"==typeof t&&ER(t)in t&&function(t){return null!=t&&"object"==typeof t&&Symbol.struct_metadata in t}(t[ER(t)])}function MR(t){return null!=t&&"object"==typeof t&&OR(t.constructor)}function RR(t){if(!MR(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct instance")}function AR(t){if(!function(t){return MR(t)||OR(t)}(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct")}function yR(t){if("string"==typeof t)return function(t){if(!IR(t))throw new TypeError("Not a valid primitive type: "+t)}(t),+mR(t).match(TR)[2]/8;AR(t);const e=OR(t)?t:t.constructor;return e[ER(e)][Symbol.struct_metadata].size}function SR(t={}){return function(e,i){i.metadata??={},i.metadata[Symbol.struct_init]||=[];let n=0;const s=new Map;for(const e of i.metadata[Symbol.struct_init]){const{name:i,type:a,length:l}=e;if(!IR(a)&&!OR(a))throw new TypeError("Not a valid type: "+a);s.set(i,{offset:n,type:IR(a)?mR(a):a,length:l}),n+=yR(a)*(l||1),r=n,o=t.align||1,n=Math.ceil(r/o)*o}var r,o;return i.metadata[Symbol.struct_metadata]={options:t,members:s,size:n},e}}function vR(t,e){return function(i,n){let s=n.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 n.metadata??={},n.metadata[Symbol.struct_init]||=[],n.metadata[Symbol.struct_init].push({name:s,type:t,length:e}),i}}function CR(t){RR(t);const{options:e,members:i}=t.constructor[ER(t.constructor)][Symbol.struct_metadata],n=new Uint8Array(yR(t)),s=new DataView(n.buffer);for(const[r,{type:o,length:a,offset:l}]of i)for(let i=0;i<(a||1);i++){const u=l+yR(o)*i;let p=a>0?t[r][i]:t[r];if("string"==typeof p&&(p=p.charCodeAt(0)),!gR(o)){n.set(p?CR(p):new Uint8Array(yR(o)),u);continue}const h="set"+cR(o);"setInt64"!=h?"setUint64"!=h?s[h](u,Number(p),!e.bigEndian):s.setBigUint64(u,BigInt(p),!e.bigEndian):s.setBigInt64(u,BigInt(p),!e.bigEndian)}return n}function LR(t,e){RR(t);const{options:i,members:n}=t.constructor[ER(t.constructor)][Symbol.struct_metadata],s=e instanceof Uint8Array?e:new Uint8Array("buffer"in e?e.buffer:e),r=new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength));for(const[e,{type:o,offset:a,length:l}]of n)for(let n=0;n<(l||1);n++){let u=l>0?t[e]:t;const p=l>0?n:e,h=a+yR(o)*n;if("string"==typeof t[e]){t[e]=t[e].slice(0,n)+String.fromCharCode(r.getUint8(h))+t[e].slice(n+1);continue}if(!gR(o)){if(null===u[p]||void 0===u[p])continue;LR(u[p],new Uint8Array(s.slice(h,h+yR(o))));continue}l>0&&(u||=[]);const d="get"+cR(o);"getInt64"!=d?u[p]="getUint64"!=d?r[d](h,!i.bigEndian):r.getBigUint64(h,!i.bigEndian):u[p]=r.getBigInt64(h,!i.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const bR=Object.fromEntries(fR.map((t=>{return[t,(e=t,function(t,i){return"number"==typeof t?vR(e,t):vR(e)(t,i)})];var e})));var DR=function(t,e,i,n,s,r){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=n.kind,u="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?n.static?t:t.prototype:null,h=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),d=!1,c=i.length-1;c>=0;c--){var _={};for(var f in n)_[f]="access"===f?{}:n[f];for(var f in n.access)_.access[f]=n.access[f];_.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");r.push(o(t||null))};var T=(0,i[c])("accessor"===l?{get:h.get,set:h.set}:h[u],_);if("accessor"===l){if(void 0===T)continue;if(null===T||"object"!=typeof T)throw new TypeError("Object expected");(a=o(T.get))&&(h.get=a),(a=o(T.set))&&(h.set=a),(a=o(T.init))&&s.unshift(a)}else(a=o(T))&&("field"===l?s.unshift(a):h[u]=a)}p&&Object.defineProperty(p,n.name,h),d=!0},wR=function(t,e,i){for(var n=arguments.length>2,s=0;s<e.length;s++)i=n?e[s].call(t,i):e[s].call(t);return n?i:void 0},NR=function(t,e,i){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})};let FR=(()=>{var t,e,i,n,s,r,o,a,l,u,p;let h,d,c,_,f,T,m,g,I,E,O,M,R,A=[SR()],y=[],S=[],v=[],C=[],L=[],b=[],D=[],w=[],N=[],F=[],P=[],x=[],k=[],V=[],Y=[],B=[],U=[],X=[],G=[],H=[],W=[],j=[],q=[];var K=d=class{constructor(t){if(this.data=wR(this,S,void 0),this.size=(wR(this,v),wR(this,C,void 0)),this.mode=(wR(this,L),wR(this,b,void 0)),this.nlink=(wR(this,D),wR(this,w,void 0)),this.uid=(wR(this,N),wR(this,F,void 0)),this.gid=(wR(this,P),wR(this,x,void 0)),this.atimeMs=(wR(this,k),wR(this,V,void 0)),this.birthtimeMs=(wR(this,Y),wR(this,B,void 0)),this.mtimeMs=(wR(this,U),wR(this,X,void 0)),this.ctimeMs=(wR(this,G),wR(this,H,void 0)),this.ino=(wR(this,W),wR(this,j,void 0)),wR(this,q),t){const e=yR(K),i=e-yR("uint64");if(t.byteLength<i)throw new RangeError(`Can not create an inode from a buffer less than ${i} bytes`);if(t.byteLength<e){const i=new Uint8Array(e);i.set(new Uint8Array(ArrayBuffer.isView(t)?t.buffer:t));const n=crypto.getRandomValues(new Uint32Array(2));i.set(n,e-2),t=i}return void LR(this,t)}this.ino=$O(),this.data=$O(),this.nlink=1,this.size=4096;const e=Date.now();this.atimeMs=e,this.mtimeMs=e,this.ctimeMs=e,this.birthtimeMs=e}toStats(){return new $M(this)}update(t){let e=!1;return this.size!==t.size&&(this.size=t.size,e=!0),this.mode!==t.mode&&(this.mode=t.mode,e=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,e=!0),this.uid!==t.uid&&(this.uid=t.uid,e=!0),this.gid!==t.gid&&(this.gid=t.gid,e=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,e=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,e=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,e=!0),e}};return NR(d,"Inode"),(()=>{const z="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;c=[(t=bR).uint64.bind(t)],_=[(e=bR).uint32.bind(e)],f=[(i=bR).uint16.bind(i)],T=[(n=bR).uint32.bind(n)],m=[(s=bR).uint32.bind(s)],g=[(r=bR).uint32.bind(r)],I=[(o=bR).float64.bind(o)],E=[(a=bR).float64.bind(a)],O=[(l=bR).float64.bind(l)],M=[(u=bR).float64.bind(u)],R=[(p=bR).uint64.bind(p)],DR(null,null,c,{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:z},S,v),DR(null,null,_,{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:z},C,L),DR(null,null,f,{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:z},b,D),DR(null,null,T,{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:z},w,N),DR(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:z},F,P),DR(null,null,g,{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:z},x,k),DR(null,null,I,{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:z},V,Y),DR(null,null,E,{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:z},B,U),DR(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:z},X,G),DR(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:z},H,W),DR(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:z},j,q),DR(null,h={value:d},A,{kind:"class",name:d.name,metadata:z},null,y),K=d=h.value,z&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:z}),wR(d,y)})(),K=d})();var PR=function(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e},xR=function(t){return function(e){function i(i){e.error=e.hasError?new t(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(t,(function(e){return i(e),t()}))}catch(t){i(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n});class kR extends pR{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 i={stack:[],error:void 0,hasError:!1};try{const n=PR(i,this.store.transaction(),!0),s=YO(t),r=YO(e),o=await this.findInode(n,s.dir,"rename"),a=HO(await this.get(n,o.data,s.dir,"rename"));if(!a[s.base])throw wO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0===(r.dir+"/").indexOf(t+"/"))throw new wO(bO.EBUSY,s.dir);const u=r.dir==s.dir,p=u?o:await this.findInode(n,r.dir,"rename"),h=u?a:HO(await this.get(n,p.data,r.dir,"rename"));if(h[r.base]){const t=new FR(await this.get(n,h[r.base],e,"rename"));if(!t.toStats().isFile())throw wO.With("EPERM",e,"rename");await n.remove(t.data),await n.remove(h[r.base])}h[r.base]=l,await n.set(o.data,WO(a)),await n.set(p.data,WO(h)),await n.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=xR(i);t&&await t}}renameSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=PR(i,this.store.transaction(),!1),s=YO(t),r=YO(e),o=this.findInodeSync(n,s.dir,"rename"),a=HO(this.getSync(n,o.data,s.dir,"rename"));if(!a[s.base])throw wO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0==(r.dir+"/").indexOf(t+"/"))throw new wO(bO.EBUSY,s.dir);const u=r.dir===s.dir,p=u?o:this.findInodeSync(n,r.dir,"rename"),h=u?a:HO(this.getSync(n,p.data,r.dir,"rename"));if(h[r.base]){const t=new FR(this.getSync(n,h[r.base],e,"rename"));if(!t.toStats().isFile())throw wO.With("EPERM",e,"rename");n.removeSync(t.data),n.removeSync(h[r.base])}h[r.base]=l,n.setSync(o.data,WO(a)),n.setSync(p.data,WO(h)),n.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{xR(i)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{const i=PR(e,this.store.transaction(),!0);return(await this.findInode(i,t,"stat")).toStats()}catch(t){e.error=t,e.hasError=!0}finally{const t=xR(e);t&&await t}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{const i=PR(e,this.store.transaction(),!1);return this.findInodeSync(i,t,"stat").toStats()}catch(t){e.error=t,e.hasError=!0}finally{xR(e)}}async createFile(t,e,i){const n=await this.commitNew(t,yM,i,new Uint8Array,"createFile");return new uR(this,t,e,n.toStats(),new Uint8Array)}createFileSync(t,e,i){const n=this.commitNewSync(t,yM,i,new Uint8Array,"createFile");return new uR(this,t,e,n.toStats(),new Uint8Array)}async openFile(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=PR(i,this.store.transaction(),!0),s=await this.findInode(n,t,"openFile"),r=await this.get(n,s.data,t,"openFile");return new uR(this,t,e,s.toStats(),r)}catch(t){i.error=t,i.hasError=!0}finally{const t=xR(i);t&&await t}}openFileSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=PR(i,this.store.transaction(),!1),s=this.findInodeSync(n,t,"openFile"),r=this.getSync(n,s.data,t,"openFile");return new uR(this,t,e,s.toStats(),r)}catch(t){i.error=t,i.hasError=!0}finally{xR(i)}}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 wO.With("ENOTEMPTY",t,"rmdir");await this.remove(t,!0,"rmdir")}rmdirSync(t){if(this.readdirSync(t).length)throw wO.With("ENOTEMPTY",t,"rmdir");this.removeSync(t,!0,"rmdir")}async mkdir(t,e){await this.commitNew(t,vM,e,UO("{}"),"mkdir")}mkdirSync(t,e){this.commitNewSync(t,vM,e,UO("{}"),"mkdir")}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{const i=PR(e,this.store.transaction(),!0),n=await this.findInode(i,t,"readdir");return Object.keys(HO(await this.get(i,n.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{const t=xR(e);t&&await t}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{const i=PR(e,this.store.transaction(),!1),n=this.findInodeSync(i,t,"readdir");return Object.keys(HO(this.getSync(i,n.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{xR(e)}}async sync(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=PR(n,this.store.transaction(),!0),r=await this._findInode(s,t,"sync"),o=new FR(await this.get(s,r,t,"sync")),a=o.update(i);await s.set(o.data,e),a&&await s.set(r,CR(o)),await s.commit()}catch(t){n.error=t,n.hasError=!0}finally{const t=xR(n);t&&await t}}syncSync(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=PR(n,this.store.transaction(),!1),r=this._findInodeSync(s,t,"sync"),o=new FR(this.getSync(s,r,t,"sync")),a=o.update(i);s.setSync(o.data,e),a&&s.setSync(r,CR(o)),s.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{xR(n)}}async link(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=PR(i,this.store.transaction(),!0),s=kO(e),r=await this.findInode(n,s,"link"),o=HO(await this.get(n,r.data,s,"link")),a=await this._findInode(n,t,"link"),l=new FR(await this.get(n,a,t,"link"));l.nlink++,o[VO(e)]=a,n.setSync(a,CR(l)),n.setSync(r.data,WO(o)),n.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{const t=xR(i);t&&await t}}linkSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=PR(i,this.store.transaction(),!1),s=kO(e),r=this.findInodeSync(n,s,"link"),o=HO(this.getSync(n,r.data,s,"link")),a=this._findInodeSync(n,t,"link"),l=new FR(this.getSync(n,a,t,"link"));l.nlink++,o[VO(e)]=a,n.setSync(a,CR(l)),n.setSync(r.data,WO(o)),n.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{xR(i)}}async checkRoot(){const t={stack:[],error:void 0,hasError:!1};try{const e=PR(t,this.store.transaction(),!0);if(await e.get(0n))return;const i=new FR;i.ino=0n,i.mode=511|vM,await e.set(i.data,UO("{}")),await e.set(0n,CR(i)),await e.commit()}catch(e){t.error=e,t.hasError=!0}finally{const e=xR(t);e&&await e}}checkRootSync(){const t={stack:[],error:void 0,hasError:!1};try{const e=PR(t,this.store.transaction(),!1);if(e.getSync(0n))return;const i=new FR;i.ino=0n,i.mode=511|vM,e.setSync(i.data,UO("{}")),e.setSync(0n,CR(i)),e.commitSync()}catch(e){t.error=e,t.hasError=!0}finally{xR(t)}}async _findInode(t,e,i,n=new Set){if(n.has(e))throw new wO(bO.EIO,"Infinite loop detected while finding inode",e);if(n.add(e),"/"==e)return 0n;const{dir:s,base:r}=YO(e),o="/"==s?new FR(await this.get(t,0n,s,i)):await this.findInode(t,s,i,n),a=HO(await this.get(t,o.data,s,i));if(!(r in a))throw wO.With("ENOENT",PO(s,r),i);return a[r]}_findInodeSync(t,e,i,n=new Set){if(n.has(e))throw new wO(bO.EIO,"Infinite loop detected while finding inode",e);if(n.add(e),"/"==e)return 0n;const{dir:s,base:r}=YO(e),o="/"==s?new FR(this.getSync(t,0n,s,i)):this.findInodeSync(t,s,i,n),a=HO(this.getSync(t,o.data,s,i));if(!(r in a))throw wO.With("ENOENT",PO(s,r),i);return a[r]}async findInode(t,e,i,n=new Set){const s=await this._findInode(t,e,i,n);return new FR(await this.get(t,s,e,i))}findInodeSync(t,e,i,n=new Set){const s=this._findInodeSync(t,e,i,n);return new FR(this.getSync(t,s,e,i))}async get(t,e,i,n){const s=await t.get(e);if(!s)throw wO.With("ENOENT",i,n);return s}getSync(t,e,i,n){const s=t.getSync(e);if(!s)throw wO.With("ENOENT",i,n);return s}async allocNew(t,e,i){for(let e=0;e<5;e++){const e=$O();if(!await t.get(e))return e}throw new wO(bO.ENOSPC,"No IDs available",e,i)}allocNewSync(t,e,i){for(let e=0;e<5;e++){const e=$O();if(!t.getSync(e))return e}throw new wO(bO.ENOSPC,"No IDs available",e,i)}async commitNew(t,e,i,n,s){const r={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw wO.With("EEXIST",t,s);const o=PR(r,this.store.transaction(),!0),{dir:a,base:l}=YO(t),u=await this.findInode(o,a,s),p=HO(await this.get(o,u.data,a,s));if(p[l])throw wO.With("EEXIST",t,s);const h=new FR;return h.ino=await this.allocNew(o,t,s),h.data=await this.allocNew(o,t,s),h.mode=i|e,h.uid=u.mode&bM?u.uid:QO.uid,h.gid=u.mode&DM?u.gid:QO.gid,h.size=n.length,await o.set(h.ino,CR(h)),await o.set(h.data,n),p[l]=h.ino,await o.set(u.data,WO(p)),await o.commit(),h}catch(t){r.error=t,r.hasError=!0}finally{const t=xR(r);t&&await t}}commitNewSync(t,e,i,n,s){const r={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw wO.With("EEXIST",t,s);const o=PR(r,this.store.transaction(),!1),{dir:a,base:l}=YO(t),u=this.findInodeSync(o,a,s),p=HO(this.getSync(o,u.data,a,s));if(p[l])throw wO.With("EEXIST",t,s);const h=new FR;return h.ino=this.allocNewSync(o,t,s),h.data=this.allocNewSync(o,t,s),h.size=n.length,h.mode=i|e,h.uid=u.mode&bM?u.uid:QO.uid,h.gid=u.mode&DM?u.gid:QO.gid,o.setSync(h.ino,CR(h)),o.setSync(h.data,n),p[l]=h.ino,o.setSync(u.data,WO(p)),o.commitSync(),h}catch(t){r.error=t,r.hasError=!0}finally{xR(r)}}async remove(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=PR(n,this.store.transaction(),!0),{dir:r,base:o}=YO(t),a=await this.findInode(s,r,i),l=HO(await this.get(s,a.data,r,i));if(!l[o])throw wO.With("ENOENT",t,"remove");const u=l[o],p=new FR(await this.get(s,u,t,i));if(delete l[o],!e&&p.toStats().isDirectory())throw wO.With("EISDIR",t,"remove");await s.set(a.data,WO(l)),--p.nlink<1&&(await s.remove(p.data),await s.remove(u)),await s.commit()}catch(t){n.error=t,n.hasError=!0}finally{const t=xR(n);t&&await t}}removeSync(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=PR(n,this.store.transaction(),!1),{dir:r,base:o}=YO(t),a=this.findInodeSync(s,r,i),l=HO(this.getSync(s,a.data,r,i)),u=l[o];if(!u)throw wO.With("ENOENT",t,"remove");const p=new FR(this.getSync(s,u,t,i));if(delete l[o],!e&&p.toStats().isDirectory())throw wO.With("EISDIR",t,"remove");s.setSync(a.data,WO(l)),--p.nlink<1&&(s.removeSync(p.data),s.removeSync(u)),s.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{xR(n)}}}class VR{constructor(t){this.store=t,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class YR extends VR{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 BR extends YR{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 UR extends Map{constructor(t="tmp"){super(),this.name=t}async sync(){}clearSync(){this.clear()}transaction(){return new BR(this)}}const XR={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:t}){const e=new kR(new UR(t));return e.checkRootSync(),e}};"function"==typeof SuppressedError&&SuppressedError;class GR{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 HR=new GR,WR=new GR;var jR=__webpack_require__(8287);function qR(t,e){return Object.fromEntries(Object.entries(t).map((([t,i])=>[t,"function"==typeof i?i.bind(e):i])))}const KR=new Map;let zR=100;function $R(t){const e=zR++;return KR.set(e,t),e}function QR(t){if(!KR.has(t))throw new wO(bO.EBADF);return KR.get(t)}const JR=new Map;function ZR(t,e){if("/"!==t[0]&&(t="/"+t),t=PO(t),JR.has(t))throw new wO(bO.EINVAL,"Mount point "+t+" is already in use.");JR.set(t,e),WR.clear()}function tA(t){if("/"!==t[0]&&(t="/"+t),t=PO(t),!JR.has(t))throw new wO(bO.EINVAL,"Mount point "+t+" is already unmounted.");JR.delete(t),WR.clear()}function eA(t,e){const i=e?.root||"/";t=KO(xO(i,t));const n=[...JR].sort(((t,e)=>t[0].length>e[0].length?-1:1));for(const[e,s]of n)if(e.length<=t.length&&t.startsWith(e))return""===(t=t.slice(e.length>1?e.length:0))&&(t=i),{fs:s,path:t,mountPoint:e,root:i};throw new wO(bO.EIO,"No file system")}async function iA(){await Promise.all([...JR.values()].map((t=>t.ready())))}function nA(t,e){for(const[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}function sA(t,e){"string"==typeof t.stack&&(t.stack=nA(t.stack,e));try{t.message=nA(t.message,e)}catch{}return t.path&&(t.path=nA(t.path,e)),t}function rA(t){"/"in t&&tA("/");for(const[e,i]of Object.entries(t))ZR(e,i)}function oA(t,e){const i=t.metadata(),n=i.blockSize||4096;return{type:(e?BigInt:Number)(i.type),bsize:(e?BigInt:Number)(n),ffree:(e?BigInt:Number)(i.freeNodes||jM),files:(e?BigInt:Number)(i.totalNodes||jM),bavail:(e?BigInt:Number)(i.freeSpace/n),bfree:(e?BigInt:Number)(i.freeSpace/n),blocks:(e?BigInt:Number)(i.totalSpace/n)}}function aA(t,e){const i=this?.credentials;if(i?.uid&&i?.gid&&i?.euid&&i?.egid)throw new wO(bO.EPERM,"Can not chroot() as non-root user");return e&&this?(this.root+=t,this):function(t,e=structuredClone(QO)){const i={root:t,credentials:JO(e)},n=qR(st,i),s=qR(nt,i);return{...i,...n,promises:s}}(xO(this?.root||"/",t),i)}ZR("/",XR.create({name:"root"}));class lA extends hR{off(t,e,i,n){return super.off(t,e,i,n)}removeListener(t,e,i,n){return super.removeListener(t,e,i,n)}constructor(t){super(),this.path=t}setMaxListeners(){throw wO.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw wO.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw wO.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw wO.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw wO.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class uA extends lA{constructor(t,e){super(t),this.options=e,function(t,e){const i=KO(t);hA.has(i)||hA.set(i,new Set);hA.get(i).add(e)}(t.toString(),this)}close(){super.emit("close"),function(t,e){const i=KO(t);hA.has(i)&&(hA.get(i).delete(e),0===hA.get(i).size&&hA.delete(i))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class pA extends lA{constructor(t,e){super(t),this.options=e,this.start()}onInterval(){try{const i=mA(this.path);t=this.previous,e=i,(t.size!=e.size||+t.atime!=+e.atime||+t.mtime!=+e.mtime||+t.ctime!=+e.ctime||t.mode!=e.mode)&&(this.emit("change",i,this.previous),this.previous=i)}catch(t){this.emit("error",t)}var t,e}start(){const t=this.options.interval||5e3;try{this.previous=mA(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 hA=new Map;function dA(t,e){if(e=KO(e),hA.has(e))for(const i of hA.get(e))i.emit("change",t,VO(e));let i,n=e;for(;n!==i;)if(i=n,n=kO(n),hA.has(n))for(const i of hA.get(n))i.emit("change",t,e.slice(n.length+("/"==n?0:1)))}var cA=function(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e},_A=function(t){return function(e){function i(i){e.error=e.hasError?new t(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(t,(function(e){return i(e),t()}))}catch(t){i(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n});function fA(t,e){t=KO(t),e=KO(e);const i=eA(t,this),n=eA(e,this);if(qM.checkAccess&&!mA.call(this,kO(t)).hasAccess(eM,this))throw wO.With("EACCES",t,"rename");try{if(i===n)return i.fs.renameSync(i.path,n.path),dA("rename",t.toString()),void dA("change",e.toString());SA.call(this,e,yA(t)),EA.call(this,t),dA("rename",t.toString())}catch(s){throw sA(s,{[i.path]:t,[n.path]:e})}}function TA(t){t=KO(t);try{const{fs:e,path:i}=eA($A.call(this,t),this);return e.existsSync(i)}catch(t){if(t.errno==bO.ENOENT)return!1;throw t}}function mA(t,e){t=KO(t);const{fs:i,path:n}=eA($A.call(this,t),this);try{const t=i.statSync(n);if(qM.checkAccess&&!t.hasAccess(tM,this))throw wO.With("EACCES",n,"stat");return e?.bigint?new QM(t):t}catch(e){throw sA(e,{[n]:t})}}function gA(t,e){t=KO(t);const{fs:i,path:n}=eA(t,this);try{const t=i.statSync(n);return e?.bigint?new QM(t):t}catch(e){throw sA(e,{[n]:t})}}function IA(t,e=0){const i={stack:[],error:void 0,hasError:!1};try{const n=cA(i,OA.call(this,t,"r+"),!1);if(e||(e=0),e<0)throw new wO(bO.EINVAL);n.truncateSync(e)}catch(t){i.error=t,i.hasError=!0}finally{_A(i)}}function EA(t){t=KO(t);const{fs:e,path:i}=eA(t,this);try{if(qM.checkAccess&&!(HR.get(t)||e.statSync(i)).hasAccess(eM,this))throw wO.With("EACCES",i,"unlink");e.unlinkSync(i),dA("rename",t.toString())}catch(e){throw sA(e,{[i]:t})}}function OA(t,e,i,n=!0){t=KO(t);const s=jO(i,420),r=eR(e);t=n?$A.call(this,t):t;const{fs:o,path:a}=eA(t,this);let l;try{l=o.statSync(a)}catch{}if(!l){if(!sR(r)&&!oR(r)||"r+"==r)throw wO.With("ENOENT",t,"_open");const e=o.statSync(kO(a));if(qM.checkAccess&&!e.hasAccess(eM,this))throw wO.With("EACCES",kO(t),"_open");if(!e.isDirectory())throw wO.With("ENOTDIR",kO(t),"_open");return o.createFileSync(a,r,s)}if(qM.checkAccess&&(!l.hasAccess(s,this)||!l.hasAccess(iR(r),this)))throw wO.With("EACCES",t,"_open");if(aR(r))throw wO.With("EEXIST",t,"_open");const u=o.openFileSync(a,r);return rR(r)&&u.truncateSync(0),u}function MA(t,e,i=ZO){return $R(OA.call(this,t,e,i,!0))}function RA(t,e,i){return $R(OA.call(this,t,e,i,!1))}function AA(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=cA(n,OA.call(this,t,e,420,i),!1),r=s.statSync(),o=new Uint8Array(r.size);return s.readSync(o,0,r.size,0),o}catch(t){n.error=t,n.hasError=!0}finally{_A(n)}}function yA(t,e={}){const i=zO(e,null,"r",420);if(!nR(eR(i.flag)))throw new wO(bO.EINVAL,"Flag passed to readFile must allow for reading.");const n=jR.Buffer.from(AA.call(this,"number"==typeof t?QR(t).path:t.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}function SA(t,e,i={}){const n={stack:[],error:void 0,hasError:!1};try{const s=zO(i,"utf8","w+",420),r=eR(s.flag);if(!sR(r))throw new wO(bO.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof e&&!s.encoding)throw new wO(bO.EINVAL,"Encoding not specified");const o="string"==typeof e?jR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new wO(bO.EINVAL,"Data not specified");cA(n,OA.call(this,"number"==typeof t?QR(t).path:t.toString(),r,s.mode,!0),!1).writeSync(o,0,o.byteLength,0),dA("change",t.toString())}catch(t){n.error=t,n.hasError=!0}finally{_A(n)}}function vA(t,e,i={}){const n={stack:[],error:void 0,hasError:!1};try{const s=zO(i,"utf8","a+",420),r=eR(s.flag);if(!oR(r))throw new wO(bO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new wO(bO.EINVAL,"Encoding not specified");const o="string"==typeof e?jR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);cA(n,OA.call(this,"number"==typeof t?QR(t).path:t.toString(),r,s.mode,!0),!1).writeSync(o,0,o.byteLength)}catch(t){n.error=t,n.hasError=!0}finally{_A(n)}}function CA(t,e){const i=QR(t).statSync();return e?.bigint?new QM(i):i}function LA(t){QR(t).closeSync(),KR.delete(t)}function bA(t,e=0){if(e||(e=0),e<0)throw new wO(bO.EINVAL);QR(t).truncateSync(e)}function DA(t){QR(t).syncSync()}function wA(t){QR(t).datasyncSync()}function NA(t,e,i,n,s){let r,o,a,l;if("string"==typeof e){l="number"==typeof i?i:null;const t="string"==typeof n?n:"utf8";o=0,r=jR.Buffer.from(e,t),a=r.byteLength}else r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=i,a=n,l="number"==typeof s?s:null;const u=QR(t);l??(l=u.position);const p=u.writeSync(r,o,a,l);return dA("change",u.path),p}function FA(t,e,i,n,s){const r=QR(t),o="object"==typeof i?i.offset:i;return"object"==typeof i&&(n=i.length,s=i.position),s=Number(s),isNaN(s)&&(s=r.position),r.readSync(e,o,n,s)}function PA(t,e,i){QR(t).chownSync(e,i)}function xA(t,e){const i=jO(e,-1);if(i<0)throw new wO(bO.EINVAL,"Invalid mode.");QR(t).chmodSync(i)}function kA(t,e,i){QR(t).utimesSync(qO(e),qO(i))}function VA(t){t=KO(t);const{fs:e,path:i}=eA($A.call(this,t),this);try{const n=HR.get(t)||e.statSync(i);if(!n.isDirectory())throw wO.With("ENOTDIR",i,"rmdir");if(qM.checkAccess&&!n.hasAccess(eM,this))throw wO.With("EACCES",i,"rmdir");e.rmdirSync(i),dA("rename",t.toString())}catch(e){throw sA(e,{[i]:t})}}function YA(t,e){e="object"==typeof e?e:{mode:e};const i=jO(e?.mode,511);t=$A.call(this,t);const{fs:n,path:s,root:r}=eA(t,this),o={[s]:t};try{if(!e?.recursive){if(qM.checkAccess&&!n.statSync(kO(s)).hasAccess(eM,this))throw wO.With("EACCES",kO(s),"mkdir");return n.mkdirSync(s,i)}const a=[];for(let e=s,i=t;!n.existsSync(e);e=kO(e),i=kO(i))a.unshift(e),o[e]=i;for(const t of a){if(qM.checkAccess&&!n.statSync(kO(t)).hasAccess(eM,this))throw wO.With("EACCES",kO(t),"mkdir");n.mkdirSync(t,i),dA("rename",t)}return 1==r.length?a[0]:a[0]?.slice(r.length)}catch(t){throw sA(t,o)}}function BA(t,e){e="object"==typeof e?e:{encoding:e},t=KO(t);const{fs:i,path:n}=eA($A.call(this,t),this);let s;try{const e=HR.get(t)||i.statSync(n);if(HR.set(t,e),qM.checkAccess&&!e.hasAccess(tM,this))throw wO.With("EACCES",n,"readdir");if(!e.isDirectory())throw wO.With("ENOTDIR",n,"readdir");s=i.readdirSync(n)}catch(e){throw sA(e,{[n]:t})}const r=[];for(const o of s){const s=HR.get(xO(t,o))||i.statSync(xO(n,o));if(HR.set(xO(t,o),s),e?.withFileTypes?r.push(new oy(o,s)):"buffer"==e?.encoding?r.push(jR.Buffer.from(o)):r.push(o),s.isDirectory()&&e?.recursive)for(const i of BA.call(this,xO(t,o),{...e,_isIndirect:!0}))i instanceof oy?(i.path=xO(o,i.path),r.push(i)):jR.Buffer.isBuffer(i)?r.push(jR.Buffer.from(xO(o,GO(i)))):r.push(xO(o,i))}return e?._isIndirect||HR.clear(),r}function UA(t,e){if(t=KO(t),qM.checkAccess&&!mA(kO(t)).hasAccess(tM,this))throw wO.With("EACCES",kO(t),"link");if(e=KO(e),qM.checkAccess&&!mA(kO(e)).hasAccess(eM,this))throw wO.With("EACCES",kO(e),"link");const{fs:i,path:n}=eA(t,this),s=eA(e,this);if(i!=s.fs)throw wO.With("EXDEV",e,"link");try{if(qM.checkAccess&&!i.statSync(n).hasAccess(tM,this))throw wO.With("EACCES",n,"link");return i.linkSync(n,e)}catch(i){throw sA(i,{[n]:t,[s.path]:e})}}function XA(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new wO(bO.EINVAL,"Invalid type: "+i);if(TA.call(this,e))throw wO.With("EEXIST",e.toString(),"symlink");SA.call(this,e,t.toString());OA.call(this,e,"r+",420,!1).chmodSync(AM)}function GA(t,e){const i=jR.Buffer.from(AA.call(this,t.toString(),"r",!1)),n="object"==typeof e?e?.encoding:e;return"buffer"==n?i:i.toString(n)}function HA(t,e,i){const n=MA.call(this,t,"r+");PA(n,e,i),LA(n)}function WA(t,e,i){const n=RA.call(this,t,"r+");PA(n,e,i),LA(n)}function jA(t,e){const i=MA.call(this,t,"r+");xA(i,e),LA(i)}function qA(t,e){const i=RA.call(this,t,"r+");xA(i,e),LA(i)}function KA(t,e,i){const n=MA.call(this,t,"r+");kA(n,e,i),LA(n)}function zA(t,e,i){const n=RA.call(this,t,"r+");kA(n,e,i),LA(n)}function $A(t,e){t=KO(t);const i=(this?.root||"")+t;if(WR.has(i))return WR.get(i);const{base:n,dir:s}=YO(t),r="/"==s?"/":WR.get((this?.root||"")+s)||$A.call(this,s),o=xO(r,n),{fs:a,path:l}=eA(o,this);try{const n=HR.get(o)||a.statSync(l);if(HR.set(o,n),!n.isSymbolicLink())return WR.set(t,o),o;const s=PO(r,GA.call(this,o,e).toString()),u=WR.get((this?.root||"")+s)||$A.call(this,s);return WR.set(i,u),u}catch(e){if("ENOENT"==e.code)return t;throw sA(e,{[l]:o})}}function QA(t,e=384){if(qM.checkAccess&&!mA.call(this,t).hasAccess(e,this))throw new wO(bO.EACCES)}function JA(t,e){let i;t=KO(t);try{i=HR.get(t)||gA.bind(this)(t)}catch(t){if("ENOENT"!=t.code||!e?.force)throw t}if(i){switch(HR.set(t,i),i.mode&MM){case vM:if(e?.recursive)for(const i of BA.call(this,t,{_isIndirect:!0}))JA.call(this,xO(t,i),{...e,_isIndirect:!0});VA.call(this,t);break;case yM:case AM:case SM:case CM:EA.call(this,t);break;default:throw HR.clear(),new wO(bO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||HR.clear()}}function ZA(t,e){const i="object"==typeof e?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return YA.call(this,n),"buffer"==i?jR.Buffer.from(n):n}function ty(t,e,i){if(t=KO(t),e=KO(e),i&&i&nM&&TA(e))throw new wO(bO.EEXIST,"Destination file already exists.",e,"copyFile");SA.call(this,e,yA(t)),dA("rename",e.toString())}function ey(t,e,i){const n=QR(t);let s=0;for(const t of e)s+=n.readSync(t,0,t.byteLength,i+s);return s}function iy(t,e,i){const n=QR(t);let s=0;for(const t of e)s+=n.writeSync(new Uint8Array(t.buffer),0,t.byteLength,i+s);return s}function ny(t,e){return t=KO(t),new ay(t,this)}function sy(t,e,i){t=KO(t),e=KO(e);const n=gA.call(this,t);if(i?.errorOnExist&&TA.call(this,e))throw new wO(bO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(n.mode&MM){case vM:if(!i?.recursive)throw new wO(bO.EISDIR,t+" is a directory (not copied)",t,"cp");YA.call(this,e,{recursive:!0});for(const n of BA.call(this,t,{withFileTypes:!0}))i.filter&&!i.filter(xO(t,n.name),xO(e,n.name))||sy.call(this,xO(t,n.name),xO(e,n.name),i);break;case yM:case AM:ty.call(this,t,e);break;default:throw new wO(bO.EPERM,"File type not supported",t,"rm")}i?.preserveTimestamps&&KA.call(this,e,n.atime,n.mtime)}function ry(t,e){t=KO(t);const{fs:i}=eA(t,this);return oA(i,e?.bigint)}class oy{get name(){return VO(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 ay{checkClosed(){if(this.closed)throw new wO(bO.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 vy.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=BA.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 ly=__webpack_require__(6248);class uy extends ly.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new wO(bO.EIO,e.toString()))}}}class py extends ly.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new wO(bO.EIO,e.toString()))}}}var hy=function(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e},dy=function(t){return function(e){function i(i){e.error=e.hasError?new t(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(t,(function(e){return i(e),t()}))}catch(t){i(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n});class cy{constructor(t,e){this.context=e;const i="number"!=typeof t;this.fd=i?$R(t):t,this.file=i?t:QR(t)}async chown(t,e){await this.file.chown(t,e),dA("change",this.file.path)}async chmod(t){const e=jO(t,-1);if(e<0)throw new wO(bO.EINVAL,"Invalid mode.");await this.file.chmod(e),dA("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 wO(bO.EINVAL);await this.file.truncate(t),dA("change",this.file.path)}async utimes(t,e){await this.file.utimes(qO(t),qO(e)),dA("change",this.file.path)}async appendFile(t,e={}){const i=zO(e,"utf8","a",420);if(!oR(eR(i.flag)))throw new wO(bO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!i.encoding)throw new wO(bO.EINVAL,"Encoding not specified");const n="string"==typeof t?jR.Buffer.from(t,i.encoding):t;await this.file.write(n,0,n.length),dA("change",this.file.path)}read(t,e,i,n){return isNaN(+n)&&(n=this.file.position),this.file.read(t,e,i,n)}async readFile(t){const e=zO(t,null,"r",292);if(!nR(eR(e.flag)))throw new wO(bO.EINVAL,"Flag passed must allow for reading.");const{size:i}=await this.stat(),{buffer:n}=await this.file.read(new Uint8Array(i),0,i,0),s=jR.Buffer.from(n);return e.encoding?s.toString(e.encoding):s}readableWebStream(t={}){const e=globalThis;if(!("ReadableStream"in e))throw new wO(bO.ENOSYS,"ReadableStream is missing on globalThis");return new e.ReadableStream({start:async t=>{try{const e=65536,i=1e7;let n=0,s=0,r=NaN;for(;r>0;){const o=await this.read(new Uint8Array(e),0,e,s);if(!o.bytesRead)return void t.close();if(t.enqueue(o.buffer.slice(0,o.bytesRead)),s+=o.bytesRead,++n>=i)throw new wO(bO.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");r=o.bytesRead}}catch(e){t.error(e)}},type:t.type})}readLines(t){throw wO.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){const e=await this.file.stat();if(qM.checkAccess&&!e.hasAccess(tM,this.context))throw wO.With("EACCES",this.file.path,"stat");return t?.bigint?new QM(e):e}async write(t,e,i,n){let s,r,o;if("string"==typeof t){n="number"==typeof e?e:null;const a="string"==typeof i?i:"utf8";r=0,s=jR.Buffer.from(t,a),o=s.length}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),r=e,o=i,n="number"==typeof n?n:null;n??(n=this.file.position);const a=await this.file.write(s,r,o,n);return dA("change",this.file.path),{buffer:s,bytesWritten:a}}async writeFile(t,e={}){const i=zO(e,"utf8","w",420);if(!sR(eR(i.flag)))throw new wO(bO.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof t&&!i.encoding)throw new wO(bO.EINVAL,"Encoding not specified");const n="string"==typeof t?jR.Buffer.from(t,i.encoding):t;await this.file.write(n,0,n.length,0),dA("change",this.file.path)}async close(){await this.file.close(),KR.delete(this.fd)}async writev(t,e){let i=0;for(const n of t)i+=(await this.write(n,0,n.length,e+i)).bytesWritten;return{bytesWritten:i,buffers:t}}async readv(t,e){let i=0;for(const n of t)i+=(await this.read(n,0,n.byteLength,e+i)).bytesRead;return{bytesRead:i,buffers:t}}createReadStream(t){const e=new uy({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:async t=>{try{const i=await this.read(new Uint8Array(t),0,t,this.file.position);e.push(i.bytesRead?i.buffer.slice(0,i.bytesRead):null),this.file.position+=i.bytesRead}catch(t){e.destroy(t)}}});return e.path=this.file.path,e}createWriteStream(t){const e=new py({highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:async(t,e,i)=>{try{const{bytesWritten:n}=await this.write(t,null,e);i(n==t.length?null:new Error("Failed to write full chunk"))}catch(t){i(t)}}});return e.path=this.file.path,e}}async function _y(t,e){t=KO(t),e=KO(e);const i=eA(t,this),n=eA(e,this);if(qM.checkAccess&&!(await Ty.call(this,kO(t))).hasAccess(eM,this))throw wO.With("EACCES",t,"rename");try{if(i.mountPoint==n.mountPoint)return await i.fs.rename(i.path,n.path),dA("rename",t.toString()),void dA("change",e.toString());await Ry.call(this,e,await My(t)),await Iy.call(this,t),dA("rename",t.toString())}catch(s){throw sA(s,{[i.path]:t,[n.path]:e})}}async function fy(t){try{const{fs:e,path:i}=eA(await ky.call(this,t),this);return await e.exists(i)}catch(t){if(t instanceof wO&&"ENOENT"==t.code)return!1;throw t}}async function Ty(t,e){t=KO(t);const{fs:i,path:n}=eA(await ky.call(this,t),this);try{const t=await i.stat(n);if(qM.checkAccess&&!t.hasAccess(tM,this))throw wO.With("EACCES",n,"stat");return e?.bigint?new QM(t):t}catch(e){throw sA(e,{[n]:t})}}async function my(t,e){t=KO(t);const{fs:i,path:n}=eA(t,this);try{const t=await i.stat(n);return e?.bigint?new QM(t):t}catch(e){throw sA(e,{[n]:t})}}async function gy(t,e=0){const i={stack:[],error:void 0,hasError:!1};try{const n=hy(i,await Oy.call(this,t,"r+"),!0);await n.truncate(e)}catch(t){i.error=t,i.hasError=!0}finally{const t=dy(i);t&&await t}}async function Iy(t){t=KO(t);const{fs:e,path:i}=eA(t,this);try{if(qM.checkAccess&&!(await(HR.getAsync(t)||e.stat(i))).hasAccess(eM,this))throw wO.With("EACCES",i,"unlink");await e.unlink(i),dA("rename",t.toString())}catch(e){throw sA(e,{[i]:t})}}async function Ey(t,e,i=420,n){t=KO(t);const s=jO(i,420),r=eR(e);t=n?await ky.call(this,t):t;const{fs:o,path:a}=eA(t,this),l=await o.stat(a).catch((()=>null));if(!l){if(!sR(r)&&!oR(r)||"r+"==r)throw wO.With("ENOENT",t,"_open");const e=await o.stat(kO(a));if(qM.checkAccess&&!e.hasAccess(eM,this))throw wO.With("EACCES",kO(t),"_open");if(!e.isDirectory())throw wO.With("ENOTDIR",kO(t),"_open");return new cy(await o.createFile(a,r,s),this)}if(qM.checkAccess&&!l.hasAccess(iR(r),this))throw wO.With("EACCES",t,"_open");if(aR(r))throw wO.With("EEXIST",t,"_open");const u=new cy(await o.openFile(a,r),this);return rR(r)&&await u.truncate(0),u}async function Oy(t,e="r",i=420){return await Ey.call(this,t,e,i,!0)}async function My(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=zO(e,null,"r",420),s=hy(i,"object"==typeof t&&"fd"in t?t:await Oy.call(this,t,n.flag,n.mode),!0);return await s.readFile(n)}catch(t){i.error=t,i.hasError=!0}finally{const t=dy(i);t&&await t}}async function Ry(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=zO(i,"utf8","w+",420),r=hy(n,t instanceof cy?t:await Oy.call(this,t.toString(),s.flag,s.mode),!0),o=e;if("string"!=typeof o&&!(o instanceof Uint8Array))throw new wO(bO.EINVAL,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,s)}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function Ay(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=zO(i,"utf8","a",420);if(!oR(eR(s.flag)))throw new wO(bO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new wO(bO.EINVAL,"Encoding not specified");const r="string"==typeof e?jR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=hy(n,"object"==typeof t&&"fd"in t?t:await Oy.call(this,t,s.flag,s.mode),!0);await o.appendFile(r,s)}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function yy(t){t=await ky.call(this,t);const{fs:e,path:i}=eA(t,this);try{const n=await(HR.getAsync(t)||e.stat(i));if(!n)throw wO.With("ENOENT",t,"rmdir");if(!n.isDirectory())throw wO.With("ENOTDIR",i,"rmdir");if(qM.checkAccess&&!n.hasAccess(eM,this))throw wO.With("EACCES",i,"rmdir");await e.rmdir(i),dA("rename",t.toString())}catch(e){throw sA(e,{[i]:t})}}async function Sy(t,e){e="object"==typeof e?e:{mode:e};const i=jO(e?.mode,511);t=await ky.call(this,t);const{fs:n,path:s,root:r}=eA(t,this),o={[s]:t};try{if(!e?.recursive){if(qM.checkAccess&&!(await n.stat(kO(s))).hasAccess(eM,this))throw wO.With("EACCES",kO(s),"mkdir");return await n.mkdir(s,i),void dA("rename",t.toString())}const a=[];for(let e=s,i=t;!await n.exists(e);e=kO(e),i=kO(i))a.unshift(e),o[e]=i;for(const t of a){if(qM.checkAccess&&!(await n.stat(kO(t))).hasAccess(eM,this))throw wO.With("EACCES",kO(t),"mkdir");await n.mkdir(t,i),dA("rename",t)}return 1==r.length?a[0]:a[0]?.slice(r.length)}catch(t){throw sA(t,o)}}async function vy(t,e){e="object"==typeof e?e:{encoding:e},t=await ky.call(this,t);const i=e=>{throw sA(e,{[s]:t})},{fs:n,path:s}=eA(t,this),r=HR.getAsync(t)||n.stat(s).catch(i);HR.setAsync(t,r);const o=await r;if(!o)throw wO.With("ENOENT",t,"readdir");if(qM.checkAccess&&!o.hasAccess(tM,this))throw wO.With("EACCES",t,"readdir");if(!o.isDirectory())throw wO.With("ENOTDIR",t,"readdir");const a=await n.readdir(s).catch(i),l=[];return await Promise.all(a.map((async r=>{let o;if(e?.recursive||e?.withFileTypes){const e=HR.getAsync(xO(t,r))||n.stat(xO(s,r)).catch(i);HR.setAsync(xO(t,r),e),o=await e}if(e?.withFileTypes?l.push(new oy(r,o)):"buffer"==e?.encoding?l.push(jR.Buffer.from(r)):l.push(r),e?.recursive&&o?.isDirectory())for(const i of await vy.call(this,xO(t,r),{...e,_isIndirect:!0}))i instanceof oy?(i.path=xO(r,i.path),l.push(i)):jR.Buffer.isBuffer(i)?l.push(jR.Buffer.from(xO(r,GO(i)))):l.push(xO(r,i))}))),e?._isIndirect||HR.clear(),l}async function Cy(t,e){t=KO(t),e=KO(e);const{fs:i,path:n}=eA(t,this),s=eA(e,this);if(i!=s.fs)throw wO.With("EXDEV",e,"link");try{if(qM.checkAccess&&!(await i.stat(kO(t))).hasAccess(tM,this))throw wO.With("EACCES",kO(n),"link");if(qM.checkAccess&&!(await Ty.call(this,kO(e))).hasAccess(eM,this))throw wO.With("EACCES",kO(e),"link");if(qM.checkAccess&&!(await i.stat(n)).hasAccess(tM,this))throw wO.With("EACCES",n,"link");return await i.link(n,s.path)}catch(i){throw sA(i,{[s.path]:e,[n]:t})}}async function Ly(t,e,i="file"){const n={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(i))throw new wO(bO.EINVAL,"Invalid symlink type: "+i);if(await fy.call(this,e))throw wO.With("EEXIST",e.toString(),"symlink");const s=hy(n,await Ey.call(this,e,"w+",420,!1),!0);await s.writeFile(t.toString()),await s.file.chmod(AM)}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function by(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=hy(i,await Ey.call(this,KO(t),"r",420,!1),!0),s=await n.readFile(),r="object"==typeof e?e?.encoding:e;return"buffer"==r?s:s.toString(r)}catch(t){i.error=t,i.hasError=!0}finally{const t=dy(i);t&&await t}}async function Dy(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=hy(n,await Oy.call(this,t,"r+"),!0);await s.chown(e,i)}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function wy(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=hy(n,await Ey.call(this,t,"r+",420,!1),!0);await s.chown(e,i)}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function Ny(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=hy(i,await Oy.call(this,t,"r+"),!0);await n.chmod(e)}catch(t){i.error=t,i.hasError=!0}finally{const t=dy(i);t&&await t}}async function Fy(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=hy(i,await Ey.call(this,t,"r+",420,!1),!0);await n.chmod(e)}catch(t){i.error=t,i.hasError=!0}finally{const t=dy(i);t&&await t}}async function Py(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=hy(n,await Oy.call(this,t,"r+"),!0);await s.utimes(e,i)}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function xy(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{const s=hy(n,await Ey.call(this,t,"r+",420,!1),!0);await s.utimes(new Date(e),new Date(i))}catch(t){n.error=t,n.hasError=!0}finally{const t=dy(n);t&&await t}}async function ky(t,e){t=KO(t);const i=(this?.root||"")+t;if(WR.hasAsync(i))return WR.getAsync(i);const{base:n,dir:s}=YO(t),r="/"==s?"/":await(WR.getAsync((this?.root||"")+s)||ky.call(this,s)),o=xO(r,n),{fs:a,path:l}=eA(o,this);try{const e=HR.getAsync(o)||a.stat(l);if(HR.setAsync(o,e),!(await e).isSymbolicLink())return WR.set(t,o),o;const n=PO(r,(await by.call(this,o)).toString()),s=WR.getAsync((this?.root||"")+n)||ky.call(this,n);return WR.setAsync(i,s),await s}catch(e){if("ENOENT"==e.code)return t;throw sA(e,{[l]:o})}}function Vy(t,e={}){return{[Symbol.asyncIterator](){const i=new uA(t.toString(),"string"!=typeof e?e:{encoding:e}),n=[];function s(){i.close();for(const t of n)t({value:null,done:!0});return n.length=0,Promise.resolve({value:null,done:!0})}return i.on("change",((t,e)=>{n.shift()?.({value:{eventType:t,filename:e},done:!1})})),{async next(){const{promise:t,resolve:e}=Promise.withResolvers();return n.push(e),t},return:s,throw:s}}}}async function Yy(t,e=ZO){if(!qM.checkAccess)return;if(!(await Ty.call(this,t)).hasAccess(e,this))throw new wO(bO.EACCES)}async function By(t,e){t=KO(t);const i=await(HR.getAsync(t)||my.call(this,t).catch((t=>{if("ENOENT"!=t.code||!e?.force)throw t})));if(i){switch(HR.set(t,i),i.mode&MM){case vM:if(e?.recursive)for(const i of await vy.call(this,t,{_isIndirect:!0}))await By.call(this,xO(t,i),{...e,_isIndirect:!0});await yy.call(this,t);break;case yM:case AM:case SM:case CM:await Iy.call(this,t);break;default:throw HR.clear(),new wO(bO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||HR.clear()}}async function Uy(t,e){const i="object"==typeof e?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Sy.call(this,n),"buffer"==i?jR.Buffer.from(n):n}async function Xy(t,e,i){if(t=KO(t),e=KO(e),i&&i&nM&&await fy.call(this,e))throw new wO(bO.EEXIST,"Destination file already exists.",e,"copyFile");await Ry.call(this,e,await My.call(this,t)),dA("rename",e.toString())}function Gy(t,e){return t=KO(t),Promise.resolve(new ay(t,this))}async function Hy(t,e,i){t=KO(t),e=KO(e);const n=await my.call(this,t);if(i?.errorOnExist&&await fy.call(this,e))throw new wO(bO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(n.mode&MM){case vM:{if(!i?.recursive)throw new wO(bO.EISDIR,t+" is a directory (not copied)",t,"cp");const[n]=await Promise.all([vy.call(this,t,{withFileTypes:!0}),Sy.call(this,e,{recursive:!0})]),s=async n=>{i.filter&&!i.filter(xO(t,n.name),xO(e,n.name))||await Hy.call(this,xO(t,n.name),xO(e,n.name),i)};await Promise.all(n.map(s));break}case yM:case AM:await Xy.call(this,t,e);break;default:throw new wO(bO.EPERM,"File type not supported",t,"rm")}i?.preserveTimestamps&&await Py.call(this,e,n.atime,n.mtime)}async function Wy(t,e){t=KO(t);const{fs:i}=eA(t,this);return Promise.resolve(oA(i,e?.bigint))}const jy=()=>{};function qy(t,e,i=jy){_y.call(this,t,e).then((()=>i())).catch(i)}function Ky(t,e=jy){fy.call(this,t).then(e).catch((()=>e(!1)))}function zy(t,e,i=jy){i="function"==typeof e?e:i,Ty.call(this,t,"function"!=typeof e?e:{}).then((t=>i(void 0,t))).catch(i)}function $y(t,e,i=jy){i="function"==typeof e?e:i,my.call(this,t,"function"!=typeof e?e:{}).then((t=>i(void 0,t))).catch(i)}function Qy(t,e=0,i=jy){i="function"==typeof e?e:i;const n="number"==typeof e?e:0;gy.call(this,t,n).then((()=>i())).catch(i)}function Jy(t,e=jy){Iy.call(this,t).then((()=>e())).catch(e)}function Zy(t,e,i,n=jy){const s=jO(i,420);n="function"==typeof i?i:n,Oy.call(this,t,e,s).then((t=>n(void 0,t.fd))).catch(n)}function tS(t,e,i=jy){i="function"==typeof e?e:i,My.call(this,t,"function"==typeof e?null:e).then((t=>i(void 0,t))).catch(i)}function eS(t,e,i,n=jy){n="function"==typeof i?i:n,Ry.call(this,t,e,"function"!=typeof i?i:null).then((()=>n(void 0))).catch(n)}function iS(t,e,i,n=jy){const s="function"!=typeof i?i:void 0;n="function"==typeof i?i:n,Ay.call(this,t,e,s).then((()=>n())).catch(n)}function nS(t,e,i=jy){i="function"==typeof e?e:i,QR(t).stat().then((t=>i(void 0,"object"==typeof e&&e?.bigint?new QM(t):t))).catch(i)}function sS(t,e=jy){const i=QR(t).close();KR.delete(t),i.then((()=>e())).catch(e)}function rS(t,e,i=jy){const n="number"==typeof e?e:0;i="function"==typeof e?e:i;const s=QR(t);if(n<0)throw new wO(bO.EINVAL);s.truncate(n).then((()=>i())).catch(i)}function oS(t,e=jy){QR(t).sync().then((()=>e())).catch(e)}function aS(t,e=jy){QR(t).datasync().then((()=>e())).catch(e)}function lS(t,e,i,n,s,r=jy){let o,a,l,u,p;const h=new cy(t,this);if("string"==typeof e){switch(p="utf8",typeof i){case"function":r=i;break;case"number":u=i,p="string"==typeof n?n:"utf8",r="function"==typeof s?s:r;break;default:return void(r="function"==typeof n?n:"function"==typeof s?s:r)(new wO(bO.EINVAL,"Invalid arguments."))}o=jR.Buffer.from(e),a=0,l=o.length;const t=r;h.write(o,a,l,u).then((({bytesWritten:e})=>t(void 0,e,o.toString(p)))).catch(t)}else{o=jR.Buffer.from(e.buffer),a=i,l=n,u="number"==typeof s?s:null;const t="function"==typeof s?s:r;h.write(o,a,l,u).then((({bytesWritten:e})=>t(void 0,e,o))).catch(t)}}function uS(t,e,i,n,s,r=jy){new cy(t,this).read(e,i,n,s).then((({bytesRead:t,buffer:e})=>r(void 0,t,e))).catch(r)}function pS(t,e,i,n=jy){new cy(t,this).chown(e,i).then((()=>n())).catch(n)}function hS(t,e,i){new cy(t,this).chmod(e).then((()=>i())).catch(i)}function dS(t,e,i,n=jy){new cy(t,this).utimes(e,i).then((()=>n())).catch(n)}function cS(t,e=jy){yy.call(this,t).then((()=>e())).catch(e)}function _S(t,e,i=jy){Sy.call(this,t,e).then((()=>i())).catch(i)}function fS(t,e,i=jy){i="function"==typeof e?e:i;const n="function"!=typeof e?e:{};vy.call(this,t,n).then((t=>i(void 0,t))).catch(i)}function TS(t,e,i=jy){Cy.call(this,t,e).then((()=>i())).catch(i)}function mS(t,e,i,n=jy){const s="string"==typeof i?i:"file";n="function"==typeof i?i:n,Ly.call(this,t,e,s).then((()=>n())).catch(n)}function gS(t,e,i=jy){i="function"==typeof e?e:i,by.call(this,t).then((t=>i(void 0,t))).catch(i)}function IS(t,e,i,n=jy){Dy.call(this,t,e,i).then((()=>n())).catch(n)}function ES(t,e,i,n=jy){wy.call(this,t,e,i).then((()=>n())).catch(n)}function OS(t,e,i=jy){Ny.call(this,t,e).then((()=>i())).catch(i)}function MS(t,e,i=jy){Fy.call(this,t,e).then((()=>i())).catch(i)}function RS(t,e,i,n=jy){Py.call(this,t,e,i).then((()=>n())).catch(n)}function AS(t,e,i,n=jy){xy.call(this,t,e,i).then((()=>n())).catch(n)}function yS(t,e,i=jy){i="function"==typeof e?e:i,ky.call(this,t,"function"==typeof e?null:e).then((t=>i(void 0,t))).catch(i)}function SS(t,e,i=jy){const n="number"==typeof e?e:tM;i="function"==typeof e?e:i,Yy.call(this,t,n).then((()=>i())).catch(i)}const vS=new Map;function CS(t,e,i){const n=KO(t.toString()),s="function"!=typeof e?e:{};if("function"==typeof e&&(i=e),!i)throw new wO(bO.EINVAL,"No listener specified",t.toString(),"watchFile");if(vS.has(n)){const t=vS.get(n);return void(t&&t.listeners.add(i))}const r=new pA(n,s);r.on("change",((t,e)=>{const i=vS.get(n);if(i)for(const n of i.listeners)n(t,e)})),vS.set(n,{watcher:r,listeners:new Set})}function LS(t,e=jy){const i=KO(t.toString()),n=vS.get(i);n&&(e&&e!==jy?n.listeners.delete(e):n.listeners.clear(),0===n.listeners.size&&(n.watcher.stop(),vS.delete(i)))}function bS(t,e,i){const n=new uA(KO(t),"object"==typeof e?e:{});return i="function"==typeof e?e:i,n.on("change",i||jy),n}function DS(t,e){const i=this;let n;const s=new uy({highWaterMark:(e="object"==typeof e?e:{encoding:e}).highWaterMark||65536,encoding:e.encoding||"utf8",async read(r){try{n||(n=await Oy.call(i,t,"r",e?.mode));const o=await n.read(new Uint8Array(r),0,r,n.file.position);s.push(o.bytesRead?o.buffer.slice(0,o.bytesRead):null),n.file.position+=o.bytesRead,o.bytesRead||await n.close()}catch(t){await(n?.close()),s.destroy(t)}},destroy(t,e){n?.close().then((()=>e(t))).catch(jy)}});return s.path=t.toString(),s}function wS(t,e){const i=this;let n;e="object"==typeof e?e:{encoding:e};const s=new py({highWaterMark:e?.highWaterMark,async write(s,r,o){try{n||(n=await Oy.call(i,t,"w",e?.mode||438)),await n.write(s,0,r),o(void 0)}catch(t){await(n?.close()),o(t)}},destroy(t,e){e(t),n?.close().then((()=>e(t))).catch(e)},final(t){n?.close().then((()=>t())).catch(t)}});return s.path=t.toString(),s}function NS(t,e,i=jy){i="function"==typeof e?e:i,By.call(this,t,"function"==typeof e?void 0:e).then((()=>i(void 0))).catch(i)}function FS(t,e,i=jy){i="function"==typeof e?e:i,Uy.call(this,t,"function"!=typeof e?e:null).then((t=>i(void 0,t))).catch(i)}function PS(t,e,i,n=jy){n="function"==typeof i?i:n,Xy.call(this,t,e,"function"==typeof i?void 0:i).then((()=>n(void 0))).catch(n)}function xS(t,e,i,n=jy){n="function"==typeof i?i:n,new cy(t,this).readv(e,"function"==typeof i?void 0:i).then((({buffers:t,bytesRead:e})=>n(void 0,e,t))).catch(n)}function kS(t,e,i,n=jy){n="function"==typeof i?i:n,new cy(t,this).writev(e,"function"==typeof i?void 0:i).then((({buffers:t,bytesWritten:e})=>n(void 0,e,t))).catch(n)}function VS(t,e,i=jy){i="function"==typeof e?e:i,Gy.call(this,t,"function"==typeof e?void 0:e).then((t=>i(void 0,t))).catch(i)}function YS(t,e,i,n=jy){n="function"==typeof i?i:n,Hy.call(this,t,e,"function"==typeof i?void 0:i).then((()=>n(void 0))).catch(n)}function BS(t,e,i=jy){i="function"==typeof e?e:i,Wy.call(this,t,"function"==typeof e?void 0:e).then((t=>i(void 0,t))).catch(i)}async function US(t,e){const i=await Oy.call(this,t.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}var XS=function(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e},GS=function(t){return function(e){function i(i){e.error=e.hasError?new t(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(t,(function(e){return i(e),t()}))}catch(t){i(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n});function HS(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 kR&&this instanceof kR){const t=this._sync.store.transaction(),e=this.store.transaction(),i=[];for(const n of await e.keys())i.push(e.get(n).then((e=>t.setSync(n,e))));return await Promise.all(i),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 wO(bO.ENOTSUP,"Sync caching has been disabled for this async file system",t,e);if(!this._sync)throw new wO(bO.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,i){return this.checkSync(t,"createFile"),this._sync.createFileSync(t,e,i),this.queue("createFile",t,e,i),this.openFileSync(t,e)}openFileSync(t,e){this.checkSync(t,"openFile");const i=this._sync.openFileSync(t,e+"+"),n=i.statSync(),s=new Uint8Array(n.size);return i.readSync(s),new uR(this,t,e,n,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,i){this.checkSync(t,"sync"),this._sync.syncSync(t,e,i),this.queue("sync",t,e,i)}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 i={stack:[],error:void 0,hasError:!1};try{const n=XS(i,await this.openFile(t,eR("r")),!0),s=XS(i,this._sync.createFileSync(t,eR("w"),e.mode),!1),r=new Uint8Array(e.size);return await n.read(r),void s.writeSync(r,0,e.size)}catch(t){i.error=t,i.hasError=!0}finally{const t=GS(i);t&&await t}}if("/"!==t){const e=await this.stat(t);this._sync.mkdirSync(t,e.mode)}const i=[];for(const e of await this.readdir(t))i.push(this.crossCopy(xO(t,e)));await Promise.all(i)}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;HS(pR);new Map;Map;WS=pR;var WS;var jS=function(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e},qS=function(t){return function(e){function i(i){e.error=e.hasError?new t(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(t,(function(e){return i(e),t()}))}catch(t){i(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n});class KS{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 zS{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const t=new KS(this.currentLock);return this.currentLock=t,t}async lock(t,e){const i=this.currentLock,n=this.addLock(),s=(new Error).stack;return setTimeout((()=>{if(n.isLocked){const i=wO.With("EDEADLK",t,e);throw i.stack+=s?.slice(5),i}}),5e3),await(i?.done()),n}lockSync(t,e){if(this.currentLock?.isLocked)throw wO.With("EBUSY",t,e);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,await this.lock(t,"rename"),!1);await this._fs.rename(t,e)}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}renameSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,this.lockSync(t,"rename"),!1);return this._fs.renameSync(t,e)}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,await this.lock(t,"stat"),!1);return await this._fs.stat(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,this.lockSync(t,"stat"),!1);return this._fs.statSync(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}async openFile(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,await this.lock(t,"openFile"),!1);const n=await this._fs.openFile(t,e);return n.fs=this,n}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}openFileSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,this.lockSync(t,"openFile"),!1);const n=this._fs.openFileSync(t,e);return n.fs=this,n}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}async createFile(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{jS(n,await this.lock(t,"createFile"),!1);const s=await this._fs.createFile(t,e,i);return s.fs=this,s}catch(t){n.error=t,n.hasError=!0}finally{qS(n)}}createFileSync(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{jS(n,this.lockSync(t,"createFile"),!1);const s=this._fs.createFileSync(t,e,i);return s.fs=this,s}catch(t){n.error=t,n.hasError=!0}finally{qS(n)}}async unlink(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,await this.lock(t,"unlink"),!1);await this._fs.unlink(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}unlinkSync(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,this.lockSync(t,"unlink"),!1);return this._fs.unlinkSync(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}async rmdir(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,await this.lock(t,"rmdir"),!1);await this._fs.rmdir(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}rmdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,this.lockSync(t,"rmdir"),!1);return this._fs.rmdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}async mkdir(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,await this.lock(t,"mkdir"),!1);await this._fs.mkdir(t,e)}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}mkdirSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,this.lockSync(t,"mkdir"),!1);return this._fs.mkdirSync(t,e)}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,await this.lock(t,"readdir"),!1);return await this._fs.readdir(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,this.lockSync(t,"readdir"),!1);return this._fs.readdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}async exists(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,await this.lock(t,"exists"),!1);return await this._fs.exists(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}existsSync(t){const e={stack:[],error:void 0,hasError:!1};try{jS(e,this.lockSync(t,"exists"),!1);return this._fs.existsSync(t)}catch(t){e.error=t,e.hasError=!0}finally{qS(e)}}async link(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,await this.lock(t,"link"),!1);await this._fs.link(t,e)}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}linkSync(t,e){const i={stack:[],error:void 0,hasError:!1};try{jS(i,this.lockSync(t,"link"),!1);return this._fs.linkSync(t,e)}catch(t){i.error=t,i.hasError=!0}finally{qS(i)}}async sync(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{jS(n,await this.lock(t,"sync"),!1);await this._fs.sync(t,e,i)}catch(t){n.error=t,n.hasError=!0}finally{qS(n)}}syncSync(t,e,i){const n={stack:[],error:void 0,hasError:!1};try{jS(n,this.lockSync(t,"sync"),!1);return this._fs.syncSync(t,e,i)}catch(t){n.error=t,n.hasError=!0}finally{qS(n)}}}var $S=function(t,e,i){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e},QS=function(t){return function(e){function i(i){e.error=e.hasError?new t(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var s=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(s).then(t,(function(e){return i(e),t()}))}catch(t){i(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n});const JS="/.deleted";class ZS extends pR{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 wO(bO.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:tv.name}}async sync(t,e,i){await this.copyForWrite(t),await this.writable.exists(t)||await this.writable.createFile(t,"w",420),await this.writable.sync(t,e,i)}syncSync(t,e,i){this.copyForWriteSync(t),this.writable.syncSync(t,e,i)}async _initialize(){if(!this._isInitialized){try{const t=await this.writable.openFile(JS,eR("r")),{size:e}=await t.stat(),{buffer:i}=await t.read(new Uint8Array(e));this._deleteLog=GO(i)}catch(t){if(t.errno!==bO.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 wO.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 wO.With("ENOENT",t,"rename")}}async stat(t){this.checkInitialized();try{return await this.writable.stat(t)}catch{if(this._deletedFiles.has(t))throw wO.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 wO.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 i=await this.readable.openFile(t,eR("r")),n=await i.stat(),{buffer:s}=await i.read(new Uint8Array(n.size));return new uR(this,t,e,n,s)}openFileSync(t,e){if(this.writable.existsSync(t))return this.writable.openFileSync(t,e);const i=this.readable.openFileSync(t,eR("r")),n=i.statSync(),s=new Uint8Array(n.size);return i.readSync(s),new uR(this,t,e,n,s)}async createFile(t,e,i){return this.checkInitialized(),await this.writable.createFile(t,e,i),this.openFile(t,e)}createFileSync(t,e,i){return this.checkInitialized(),this.writable.createFileSync(t,e,i),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 wO.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 wO.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 wO.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 wO.With("ENOTEMPTY",t,"rmdir");await this.deletePath(t)}}rmdirSync(t){if(this.checkInitialized(),!this.existsSync(t))throw wO.With("ENOENT",t,"rmdir");if(this.writable.existsSync(t)&&this.writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length)throw wO.With("ENOTEMPTY",t,"rmdir");this.deletePath(t)}}async mkdir(t,e){if(this.checkInitialized(),await this.exists(t))throw wO.With("EEXIST",t,"mkdir");await this.createParentDirectories(t),await this.writable.mkdir(t,e)}mkdirSync(t,e){if(this.checkInitialized(),this.existsSync(t))throw wO.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 i={};return e.filter((t=>{const e=!i[t];return i[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 i={};return e.filter((t=>{const e=!i[t];return i[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(JS,eR("w"));try{await e.write(UO(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 wO(bO.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==JS)throw wO.With("EPERM",t,"checkPath")}createParentDirectoriesSync(t){let e=kO(t);const i=[];for(;!this.writable.existsSync(e);)i.push(e),e=kO(e);for(const t of i.reverse())this.writable.mkdirSync(t,this.statSync(t).mode)}async createParentDirectories(t){let e=kO(t);const i=[];for(;!await this.writable.exists(e);)i.push(e),e=kO(e);for(const t of i.reverse()){const e=await this.stat(t);await this.writable.mkdir(t,e.mode)}}copyForWriteSync(t){if(!this.existsSync(t))throw wO.With("ENOENT",t,"copyForWrite");this.writable.existsSync(kO(t))||this.createParentDirectoriesSync(t),this.writable.existsSync(t)||this.copyToWritableSync(t)}async copyForWrite(t){if(!await this.exists(t))throw wO.With("ENOENT",t,"copyForWrite");if(await this.writable.exists(kO(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 i=this.statSync(t);if(i.isDirectory())return void this.writable.mkdirSync(t,i.mode);const n=new Uint8Array(i.size);$S(e,this.readable.openFileSync(t,"r"),!1).readSync(n);$S(e,this.writable.createFileSync(t,"w",146|i.mode),!1).writeSync(n)}catch(t){e.error=t,e.hasError=!0}finally{QS(e)}}async copyToWritable(t){const e={stack:[],error:void 0,hasError:!1};try{const i=await this.stat(t);if(i.isDirectory())return void await this.writable.mkdir(t,i.mode);const n=new Uint8Array(i.size),s=$S(e,await this.readable.openFile(t,"r"),!0);await s.read(n);const r=$S(e,await this.writable.createFile(t,"w",146|i.mode),!0);await r.write(n)}catch(t){e.error=t,e.hasError=!0}finally{const t=QS(e);t&&await t}}}class tv extends(function(t){return class extends zS{constructor(...e){super(),this._fs=new t(...e)}}}(ZS)){}function ev(t,e,i){if(t instanceof wO)return t;const n=t instanceof DOMException?bO[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)]:bO.EIO,s=new wO(n,t.message,e,i);return s.stack=t.stack,s.cause=t.cause,s}globalThis.__zenfs__=st;class iv extends(HS(pR)){constructor(t){super(),this._handles=new Map,this._sync=XR.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 i=await this.getHandle(t);if(i instanceof FileSystemDirectoryHandle){const i=await this.readdir(t);if(await this.mkdir(e),!i.length)return void await this.unlink(t);for(const n of i)await this.rename(xO(t,n),xO(e,n)),await this.unlink(t);return}if(!(i instanceof FileSystemFileHandle))throw new wO(bO.ENOTSUP,"Not a file or directory handle",t,"rename");const n=await i.getFile().catch((e=>{throw ev(e,t,"rename")})),s=await this.getHandle(kO(e));if(!(s instanceof FileSystemDirectoryHandle))return;const r=await s.getFileHandle(VO(e),{create:!0}).catch((t=>{throw ev(t,e,"rename")})),o=await r.createWritable();await o.write(await n.arrayBuffer()),await o.close(),await this.unlink(t)}async writeFile(t,e){if(e.buffer.resizable)throw new wO(bO.EINVAL,"Resizable buffers can not be written",t,"write");const i=await this.getHandle(kO(t));if(!(i instanceof FileSystemDirectoryHandle))return;const n=await i.getFileHandle(VO(t),{create:!0}),s=await n.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 wO.With("ENOENT",t,"stat");if(e instanceof FileSystemDirectoryHandle)return new $M({mode:511|vM,size:4096});if(e instanceof FileSystemFileHandle){const{lastModified:t,size:i}=await e.getFile();return new $M({mode:511|yM,size:i,mtimeMs:t})}throw new wO(bO.EBADE,"Handle is not a directory or file",t,"stat")}async openFile(t,e){const i=await this.getHandle(t);if(!(i instanceof FileSystemFileHandle))throw wO.With("EISDIR",t,"openFile");const n=await i.getFile().catch((e=>{throw ev(e,t,"openFile")})),s=new Uint8Array(await n.arrayBuffer()),r=new $M({mode:511|yM,size:n.size,mtimeMs:n.lastModified});return new uR(this,t,e,r,s)}async unlink(t){const e=await this.getHandle(kO(t));if(!(e instanceof FileSystemDirectoryHandle))throw wO.With("ENOTDIR",kO(t),"unlink");await e.removeEntry(VO(t),{recursive:!0}).catch((e=>{throw ev(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 wO.With("EEXIST",t,"mkdir");const e=await this.getHandle(kO(t));if(!(e instanceof FileSystemDirectoryHandle))throw wO.With("ENOTDIR",t,"mkdir");await e.getDirectoryHandle(VO(t),{create:!0})}async readdir(t){const e=await this.getHandle(t);if(!(e instanceof FileSystemDirectoryHandle))throw wO.With("ENOTDIR",t,"readdir");const i=[];for await(const t of e.keys())i.push(t);return i}async getHandle(t){if(this._handles.has(t))return this._handles.get(t);let e="/";for(const i of t.split("/").slice(1)){const t=this._handles.get(e);if(!(t instanceof FileSystemDirectoryHandle))throw wO.With("ENOTDIR",e,"getHandle");e=xO(e,i);const n=await t.getDirectoryHandle(i).catch((n=>{switch(n.name){case"TypeMismatchError":return t.getFileHandle(i).catch((t=>{}));case"TypeError":throw new wO(bO.ENOENT,n.message,e,"getHandle");default:throw ev(n,e,"getHandle")}}));n&&this._handles.set(e,n)}return this._handles.get(t)}}function nv(t){return new Promise(((e,i)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>i(t.error)}))}let sv;function rv(){return sv||(sv=function(t,e){const i=indexedDB.open(t);i.onupgradeneeded=()=>i.result.createObjectStore(e);const n=nv(i);return(t,i)=>n.then((n=>i(n.transaction(e,t).objectStore(e))))}("keyval-store","keyval")),sv}class ov extends iv{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 av extends ot.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 ov(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 ov(t),t}async getFSCache(){return function(t,e=rv()){return e("readonly",(e=>nv(e.get(t))))}("mixly-pyodide-fs")}async setFSCache(t){await function(t,e,i=rv()){return i("readwrite",(i=>(i.put(e,t),nv(i.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 i=this.#e.encode(e);return this.#t.writeFile(t,i)}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 lv extends ot.FileTree{constructor(){super(new av)}async readFolder(t){let e=[];try{const i=this.getFS();if(!await i.isDirectory(t))return e;const n=await i.readDirectory(t);for(let s of n){const n=IO.join(t,s);if(await i.isDirectory(n)){const t=await i.isDirectoryEmpty(n);e.push({type:"folder",id:n,children:!t,title:`/${this.getRootFolderName()}${n}`})}else e.push({type:"file",id:n,children:!1,title:`/${this.getRootFolderName()}${n}`})}}catch(t){ot.Debug.error(t)}return e}}class uv extends ot.PageBase{static{ot.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new ot.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > .file-tree {\r\n width: 15%;\r\n height: 100%;\r\n border-right-width: 1px;\r\n border-right-style: solid;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] > .file-tree {\r\n border-right-color: #c9c9c9;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] > .file-tree {\r\n border-right-color: rgba(128, 128, 128, 0.35);\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > .editor {\r\n width: 85%;\r\n height: 100%;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div class="file-tree"></div>\r\n <div class="editor"></div>\r\n</div>')),ot.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new ot.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > button {\r\n margin: 15px;\r\n max-width: 200px;\r\n width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n color: #fff !important;\r\n height: 25px;\r\n border-radius: 3px;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}">\r\n <button class="layui-btn layui-btn-xs m-btn self-adaption-btn">{{ d.msg.loadFS }}</button>\r\n</div>')),ot.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new ot.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > div {\r\n width: 150px;\r\n height: 150px;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] > div {\r\n background: url(\'../common/css/svg/empty/empty-light.svg\');\r\n background-size: 100% auto;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] > div {\r\n background: url(\'../common/css/svg/empty/empty-dark.svg\');\r\n background-size: 100% auto;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div></div>\r\n</div>')),this.init=function(){ot.StatusBarsManager.typesRegistry.register(["file-system"],uv);const t=ot.Workspace.getMain().getStatusBarsManager();return t.add({type:"file-system",id:"file-system",name:rt.Msg.PYTHON_PYODIDE_FILE_SYSTEM,title:rt.Msg.PYTHON_PYODIDE_FILE_SYSTEM}),t.changeTo("output"),t.get("file-system")}}#i=null;#n=null;#s=null;#r=null;#o=null;#a=null;#l=null;#u=null;#p=!1;#h=!1;#d=!1;#c=null;constructor(){super();const t=OO()(ot.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(t),this.#l=new lv,this.#n=t.children(".file-tree"),this.#r=OO()(ot.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:rt.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#n.append(this.#r),this.#a=new ot.StatusBar,this.#s=t.children(".editor"),this.#o=OO()(ot.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#s.append(this.#o)}#_(){this.#u=new ot.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#u.bind("sizeChanged",(()=>{this.resize()})),this.#r.children("button").click((()=>{this.selectFS().catch(ot.Debug.error)})),this.#l.bind("beforeSelectLeaf",(t=>{const e=t[0].id,i=this.#a.getFileMode(IO.extname(e));return i?(this.#a.setMode(i),!0):(LO.layer.msg(ot.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)})),this.#l.bind("afterSelectLeaf",(async t=>{const e=t[0].id;this.#l.showProgress();const i=this.#l.getFS();try{const t=await i.readFile(e);this.showEditor(),this.#a.setValue(t),this.#a.scrollToTop(),this.#a.focus(),this.setStatus(!1)}catch(t){ot.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:ot.Menu.getItem(ot.Msg.Lang["fileTree.copyPath"]),callback:(t,{$trigger:e})=>{let i=null;i="root"===e.attr("type")?this.#l.getRootFolderTitle():e.attr("title"),navigator.clipboard.writeText(i).catch(ot.Debug.error)}}}),t.add({weight:14,type:"sep5",preconditionFn:t=>{const e=this.#l.getSelectedNodeId();let i=t.attr("type"),n=t.attr("id");return"file"!==i||e===n},data:"---------"}),t.add({weight:15,type:"refresh",preconditionFn:t=>{const e=this.#l.getSelectedNodeId();let i=t.attr("type"),n=t.attr("id");return"file"!==i||e===n},data:{isHtmlName:!0,name:ot.Menu.getItem(ot.Msg.Lang["statusbar.ampy.refresh"]),callback:(t,{$trigger:e})=>{let i=e.attr("type");if("root"===i)this.#l.openRootFolder(),this.#l.refreshFolder("/");else if("folder"===i){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:ot.Menu.getItem(ot.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:ot.Menu.getItem(ot.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#a.cut()}}),e.add({weight:1,type:"copy",data:{isHtmlName:!0,name:ot.Menu.getItem(ot.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#a.copy()}}),e.add({weight:2,type:"paste",data:{isHtmlName:!0,name:ot.Menu.getItem(ot.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:ot.Menu.getItem(ot.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:ot.Menu.getItem(ot.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:i}=this.#a.getEditor();i.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){ot.Debug.error(t)}finally{this.#l.hideProgress()}}showFileTree(){this.#p||(this.#r.detach(),this.#n.empty(),this.#n.append(this.#l.getContent()),this.#p=!0)}hideFileTree(){this.#p&&(this.#l.getContent().detach(),this.#n.empty(),this.#n.append(this.#r),this.#p=!1)}showEditor(){this.#h||(this.#o.detach(),this.#s.empty(),this.#s.append(this.#a.getContent()),this.#h=!0)}hideEditor(){this.#h&&(this.#a.getContent().detach(),this.#s.empty(),this.#s.append(this.#o),this.#h=!1,this.setStatus(!1))}getDrag(){return this.#u}init(){super.init(),this.hideCloseBtn(),this.#a.init(),this.#_();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(ot.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.#c=await window.pyodide.mountNativeFS(e,t)}closeFS(){const t=this.#l.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(IO.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.#c}dispose(){this.#a.dispose(),this.#a=null,this.#l.dispose(),this.#l=null,super.dispose()}}class pv{static{ot.HTMLTemplate.add("html/statusbar/loader.html",new ot.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n position: absolute;\r\n background-color: transparent !important;\r\n font-size: 12px;\r\n line-height: 12px;\r\n color: #fff;\r\n bottom: 0;\r\n height: var(--footer-height);\r\n width: 100%;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > p {\r\n margin-left: 5px;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}">\r\n <div class="ui mini active inline slow loader"></div>\r\n <p>{{d.msg.loading}}</p>\r\n</div>')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=OO()(ot.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:rt.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){ot.app.getFooterBar().getContent().after(this.$loader);const t=IO.relative(ot.Env.indexDirPath,ot.Env.boardDirPath),e=new vO({rootPath:IO.join(t,"deps"),language:"python3"}),i=await e.kernelAvailable();i&&(await i.init(),await i.loaded(),this.loader=e,this.kernel=i,this.statusBarImage=CO.init(),this.statusBarFileSystem=uv.init(),this.pythonShell=new pv,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=ot.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#f=null;#T=null;#m=null;#g={row:0,column:0};#I="";#E=null;#O=null;#M=!1;#R=!1;#A=null;#y=()=>this.#S();#v=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#g.row){const t=this.#f.getEndPos();let e=this.#f.getValueRange(this.#g,t);e=e.replace(this.#I,""),this.#E?.(e),this.#E=null,this.#O=null,this.#f.addValue("\n"),this.#C()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row<this.#g.row||e.column<=this.#g.column}}];constructor(){const t=ot.Workspace.getMain();this.#m=t.getStatusBarsManager(),this.#f=this.#m.getStatusBarById("output"),this.#T=this.#m.getStatusBarById("images"),this.#A=pv.kernel,this.#_()}#_(){this.#A.addEventListener("eval.finished",(()=>{this.#R=!1,this.#f.addValue(`\n==${ot.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(ot.Debug.error)})),this.#A.addEventListener("eval.output",(t=>{this.#f.addValue(t.content)})),this.#A.addEventListener("eval.error",(()=>{this.#R=!1,this.#f.addValue(`\n==${ot.Msg.Lang["shell.finish"]}==`)})),this.#A.addEventListener("eval.input",(t=>{const e=String(t?.content?.prompt);this.#f.addValue(e),this.#I=e,this.#E=t.resolve,this.#O=t.reject,this.#L()})),this.#A.addEventListener("eval.display",(t=>{this.#m.changeTo("images"),this.#T.display(t)}))}#S(){const t=this.#f.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.row<this.#g.row||e.column<this.#g.column)}#L(){if(!this.#R)return;this.#M=!0,this.#g=this.#f.getEndPos();const t=this.#f.getEditor();t.setReadOnly(!1),t.focus();t.getSession().selection.on("changeCursor",this.#y),t.commands.addCommands(this.#v)}#C(){this.#M=!1;const t=this.#f.getEditor();t.getSession().selection.off("changeCursor",this.#y),t.commands.removeCommands(this.#v),this.#I="",this.#E?.(""),this.cursor_={row:0,column:0},t.setReadOnly(!0)}async run(t){await this.stop(),await this.syncfs(!0),-1!==t.indexOf("import turtle")&&(t+="\nturtle.done()\n"),-1!==t.indexOf("import matplotlib.pyplot")&&(t+="\nplt.clf()\n"),yO.runit(this.#T.getContent()[0]),-1!==t.indexOf("import sprite")||-1!==t.indexOf("from sprite import")?this.#m.changeTo("images"):this.#m.changeTo("output"),this.#m.show(),this.#f.setValue(`${ot.Msg.Lang["shell.running"]}...\n`),this.#R=!0,this.#A.dispatchEvent("eval.request",{code:t,interactive:!1})}async stop(){if(this.#M&&this.#C(),this.#R){const t=5;pv.interruptBuffer[0]=2;const e=Number(new Date);for(;Number(new Date)-e<1e3*t&&this.#R;)pv.interruptBuffer[0]=2,await this.sleep(100);this.#R=!1}}async syncfs(t=!1){return new Promise((e=>{window.pyodide.FS.syncfs(t,e)}))}sleep(t){return new Promise((e=>setTimeout(e,t)))}}const hv={init:async function(){const t=ot.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:rt.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{pv.run().catch(ot.Debug.error)},scopeType:ot.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:rt.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{pv.stop().catch(ot.Debug.error)},scopeType:ot.Nav.Scope.LEFT,weight:5}),await pv.init()}};hv.init(),Object.assign(rt.Variables,lt),Object.assign(rt.Procedures,Eu),rt.Python=Ou,rt.generator=Ou,ot.Profile.default={},Object.assign(rt.Blocks,t,e,i,n,s,r,o,a,l,u,p,h,d,S,v,C,L,b,D,w,N,F,P,x,k,V,Y,B),Object.assign(rt.Python.forBlock,c,_,f,T,m,g,I,E,O,M,R,A,y,U,X,G,Mm,H,W,j,q,K,z,Q,J,Z,tt,et)})()})();