l(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}function l(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();t.unstable_now=function(){return i.now()-u}}var s=[],c=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)a(c);else{if(!(t.startTime<=e))break;a(c),t.sortIndex=t.expirationTime,n(s,t)}t=r(c)}}function k(e){if(g=!1,w(e),!m)if(null!==r(s))m=!0,R(S);else{var t=r(c);null!==t&&z(k,t.startTime-e)}}function S(e,n){m=!1,g&&(g=!1,y(_),_=-1),h=!0;var l=p;try{for(w(n),f=r(s);null!==f&&(!(f.expirationTime>n)||e&&!O());){var o=f.callback;if("function"===typeof o){f.callback=null,p=f.priorityLevel;var i=o(f.expirationTime<=n);n=t.unstable_now(),"function"===typeof i?f.callback=i:f===r(s)&&a(s),w(n)}else a(s);f=r(s)}if(null!==f)var u=!0;else{var d=r(c);null!==d&&z(k,d.startTime-n),u=!1}return u}finally{f=null,p=l,h=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,C=!1,E=null,_=-1,P=5,j=-1;function O(){return!(t.unstable_now()-je||125o?(e.sortIndex=l,n(c,e),null===r(s)&&e===r(c)&&(g?(y(_),_=-1):g=!0,z(k,l-o))):(e.sortIndex=i,n(s,e),m||h||(m=!0,R(S))),e},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},7116:(e,t,n)=>{e.exports=n(9169)},5384:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessages=t.ErrorType=void 0,function(e){e.MalformedUnicode="MALFORMED_UNICODE",e.MalformedHexadecimal="MALFORMED_HEXADECIMAL",e.CodePointLimit="CODE_POINT_LIMIT",e.OctalDeprecation="OCTAL_DEPRECATION",e.EndOfString="END_OF_STRING"}(n=t.ErrorType||(t.ErrorType={})),t.errorMessages=new Map([[n.MalformedUnicode,"malformed Unicode character escape sequence"],[n.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[n.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[n.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[n.EndOfString,"malformed escape sequence at end of string"]])},2527:(e,t,n)=>{t.MH=void 0;const r=n(5384);function a(e,t,n){const a=function(e){return e.match(/[^a-f0-9]/i)?NaN:parseInt(e,16)}(e);if(Number.isNaN(a)||void 0!==n&&n!==e.length)throw new SyntaxError(r.errorMessages.get(t));return a}function l(e,t){const n=a(e,r.ErrorType.MalformedUnicode,4);if(void 0!==t){const e=a(t,r.ErrorType.MalformedUnicode,4);return String.fromCharCode(n,e)}return String.fromCharCode(n)}const o=new Map([["b","\b"],["f","\f"],["n","\n"],["r","\r"],["t","\t"],["v","\v"],["0","\0"]]);const i=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function u(e,t=!1){return e.replace(i,(function(e,n,i,u,s,c,d,f,p){if(void 0!==n)return"\\";if(void 0!==i)return function(e){const t=a(e,r.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(t)}(i);if(void 0!==u)return function(e){if("{"!==(t=e).charAt(0)||"}"!==t.charAt(t.length-1))throw new SyntaxError(r.errorMessages.get(r.ErrorType.MalformedUnicode));var t;const n=a(e.slice(1,-1),r.ErrorType.MalformedUnicode);try{return String.fromCodePoint(n)}catch(l){throw l instanceof RangeError?new SyntaxError(r.errorMessages.get(r.ErrorType.CodePointLimit)):l}}(u);if(void 0!==s)return l(s,c);if(void 0!==d)return l(d);if("0"===f)return"\0";if(void 0!==f)return function(e,t=!1){if(t)throw new SyntaxError(r.errorMessages.get(r.ErrorType.OctalDeprecation));const n=parseInt(e,8);return String.fromCharCode(n)}(f,!t);if(void 0!==p)return h=p,o.get(h)||h;var h;throw new SyntaxError(r.errorMessages.get(r.ErrorType.EndOfString))}))}t.MH=u},910:(e,t,n)=>{n.d(t,{L:()=>p,A:()=>f});var r=n(4544),a=n(8878),l=n(1916),o=n(2469);const i="NAND2TetrisIndexedDB",u=1,s="FileSystemAccess",c="Handler";function d(){return new Promise(((e,t)=>{const n=window.indexedDB.open(i,u);n.onsuccess=()=>{e(n.result)},n.onerror=()=>{t(n.error)},n.onupgradeneeded=e=>{n.result.createObjectStore(s)}}))}function f(){const e=(0,a.useMemo)((()=>new r.JU),[]),[t,n]=(0,a.useState)(new r.Q2(e)),[u,f]=(0,a.useState)(),p=(0,a.useCallback)((a=>{const o=new r.Q2(new l.Le(new l.Ik(a),e));o.cd(t.cwd()),n(o),f(a.name)}),[n,f]);(0,a.useEffect)((()=>{u||async function(){const e=await d();return new Promise(((t,n)=>{const r=e.transaction([s],"readonly"),a=r.objectStore(s).get(c);a.onsuccess=()=>{const e=a.result;void 0===e?t():((0,o.vA)(e instanceof FileSystemDirectoryHandle,`Retrieved ${c} in ${s} in ${i} is not a FileSystemDirectoryHandle`),t(e))},r.onerror=()=>{console.error("Error in loading FileSystemDirectoryHandle transaction",{err:r.error}),n(r.error)},a.onerror=()=>{console.error("Error in FileSystemDirectoryHandle handleRequest",{err:a.error}),n(a.error)}}))}().then((e=>{e&&p(e)}))}),[u,p]);const h="showDirectoryPicker"in window,m=(0,a.useCallback)((async(e=!1)=>{if(!h||u&&!e)return;const t=await(0,l.EH)(),n=await async function(e){const t=(await d()).transaction([s],"readwrite");return t.objectStore(s).add(e,c),t.commit(),new Promise(((n,r)=>{t.oncomplete=()=>{n(e)},t.onerror=()=>{r(t.error)}}))}(t);p(n)}),[u,p]),g=(0,a.useCallback)((async()=>{u&&(await async function(){const e=(await d()).transaction([s],"readwrite");return e.objectStore(s).delete(c),new Promise(((t,n)=>{e.oncomplete=()=>{t()},e.onerror=()=>{n(e.error)}}))}(),n(new r.Q2(e)),f(void 0))}),[u,e]),[v,y]=(0,a.useState)("");return{fs:t,status:v,setStatus:y,storage:localStorage,canUpgradeFs:h,upgradeFs:m,closeFs:g,upgraded:u}}const p=(0,a.createContext)({fs:new r.Q2(new r.JU),canUpgradeFs:!1,upgradeFs(){},closeFs(){},status:"",setStatus(){},storage:{}})},1916:(e,t,n)=>{n.d(t,{EH:()=>l,Ik:()=>o,Le:()=>i});var r=n(4544);function a(e){return e.split(r.d$).slice(0,-1).join(r.d$)}function l(){return window.showDirectoryPicker({id:"nand2tetris",mode:"readwrite",startIn:"documents"})}class o{baseDir;constructor(e){this.baseDir=e}async getFolder(e,t=!1){let n=this.baseDir;const a=e.split(r.d$).slice(1).filter((e=>""!=e.trim()));for(const r of a)n=await n.getDirectoryHandle(r,{create:t});return n}async copyFile(e,t){throw new Error("unimplemented: FileSystemAccessFileSystemAdapter::copyFile")}async mkdir(e){this.getFolder(e,!0)}async readFile(e){const t=await this.getFolder(a(e));return(await(await t.getFileHandle((0,r.P8)(e))).getFile()).text()}async writeFile(e,t){const n=await this.getFolder(a(e),!0),l=await(await n.getFileHandle((0,r.P8)(e),{create:!0})).createWritable();await l.write(t),await l.close()}async readdir(e){const t=await this.getFolder(e),n=[];for await(const[r,a]of t.entries())n.push(r);return n}async scandir(e){const t=await this.getFolder(e),n=[];for await(const[r,a]of t.entries())n.push({name:r,isDirectory:()=>"directory"==a.kind,isFile:()=>"file"==a.kind});return n}async stat(e){const t=await this.getFolder(a(e));for await(const[n,a]of t.entries())if(n==(0,r.P8)(e))return{name:n,isDirectory:()=>"directory"==a.kind,isFile:()=>"file"==a.kind};return{name:(0,r.P8)(e),isDirectory:()=>!1,isFile:()=>!1}}async rm(e){const t=await this.getFolder(a(e),!0);await t.removeEntry((0,r.P8)(e),{recursive:!0})}}class i{adapter;nextAdapter;constructor(e,t){this.adapter=e,this.nextAdapter=t}stat(e){return this.adapter.stat(e).catch((t=>{if(this.nextAdapter)return this.nextAdapter.stat(e);throw t}))}readdir(e){return this.adapter.readdir(e).catch((t=>{if(this.nextAdapter)return this.nextAdapter.readdir(e);throw t}))}scandir(e){return this.adapter.scandir(e).catch((t=>{if(this.nextAdapter)return this.nextAdapter.scandir(e);throw t}))}async mkdir(e){return this.nextAdapter&&await this.nextAdapter.mkdir(e),this.adapter.mkdir(e)}async copyFile(e,t){return this.nextAdapter&&await this.nextAdapter.copyFile(e,t),this.adapter.copyFile(e,t)}readFile(e){return this.adapter.readFile(e).catch((t=>{if(this.nextAdapter)return this.nextAdapter.readFile(e);throw t}))}async writeFile(e,t){return this.nextAdapter&&await(this.nextAdapter?.writeFile(e,t)),this.adapter.writeFile(e,t)}async rm(e){return this.nextAdapter&&await this.nextAdapter.rm(e),this.adapter.rm(e)}}},2469:(e,t,n)=>{n.d(t,{H8:()=>o,Z1:()=>l,vA:()=>a});class r extends Error{constructor(e="Assertion failed"){super(e)}}function a(e,t){if(!e)throw new r(t instanceof Function?t():t)}function l(e,t="Assertion failed: value does not exist"){return a(null!=e,t),e}function o(e,t=`Unexpected value ${e}`){throw new Error(t instanceof Function?t():t)}},4544:(e,t,n)=>{n.d(t,{JU:()=>p,P8:()=>s,Q2:()=>d,cL:()=>h,d$:()=>o});const r={SEP:"\\",WD:"C:\\\\",isAbsolute:e=>Boolean(e.match(new RegExp("^[a-zA-Z]:\\\\")))},a={SEP:"/",WD:"/",isAbsolute:e=>"/"==e[0]},l="undefined"!==typeof process&&"win32"==process.platform?r:a,o=l.SEP,i=l.WD,u=l.isAbsolute;function s(e){e.endsWith(o)&&(e=e.substring(0,e.length-1));return e.split(o).at(-1)??""}function c(...e){const t=[];for(const n of e)for(const e of n.split(o))switch(e){case"":case".":break;case"..":t.pop();break;default:t.push(e)}return(l==a?o:"")+t.join(o)}class d{adapter;wd=i;stack=[];constructor(e=new f){this.adapter=e}cwd(){return this.wd}cd(e){this.wd=this.p(e)}pushd(e){this.stack.push(this.wd),this.cd(e)}popd(){this.stack.length>0&&(this.wd=this.stack.pop())}stat(e){return this.adapter.stat(this.p(e))}scandir(e){return this.adapter.scandir(this.p(e))}readdir(e){return this.adapter.readdir(this.p(e))}mkdir(e){return this.adapter.mkdir(this.p(e))}copyFile(e,t){return this.adapter.copyFile(this.p(e),this.p(t))}readFile(e){return this.adapter.readFile(this.p(e))}writeFile(e,t){return this.adapter.writeFile(this.p(e),t)}rm(e){return this.adapter.rm(this.p(e))}p(e){return u(e)?e:c(this.cwd(),e)}}class f{fs;constructor(e={}){this.fs=e}stat(e){return new Promise(((t,n)=>{if(this.fs[e])return t({name:s(e),isDirectory:()=>!1,isFile:()=>!0});e.endsWith(o)||(e+=o);for(let r of Object.keys(this.fs))if(r.startsWith(e))return t({name:s(e),isDirectory:()=>!0,isFile:()=>!1});n()}))}async scandir(e){return(await this.readdir(e)).map((t=>{let n=void 0!==this.fs[c(e,t)];return{name:t,isDirectory:()=>!n,isFile:()=>n}}))}readdir(e){return e.endsWith(o)||(e+=o),new Promise((t=>{let n=new Set;for(const r of Object.keys(this.fs))if(r.startsWith(e)){const t=r.indexOf(o,e.length+1),a=r.substring(e.length,-1===t?void 0:t);n.add(a)}return t([...n].sort())}))}mkdir(e){return Promise.resolve()}copyFile(e,t){return new Promise((n=>{this.fs[t]=this.fs[e],n()}))}readFile(e){return new Promise(((t,n)=>{let r=this.fs[e];if(void 0===r){n(new Error(`File Not Found ${e}`))}else t(r)}))}writeFile(e,t){return new Promise((n=>{this.fs[e]=t,n()}))}rm(e){return new Promise((t=>{delete this.fs[e],t()}))}}class p extends f{constructor(){super(window.localStorage)}}async function h(e,t){for(const[n,r]of Object.entries(t))"string"===typeof r?await e.writeFile(n,r):(e.cd(n),await h(e,r),e.cd(".."))}},8256:(e,t,n)=>{n.d(t,{Ru:()=>x});var r=n(2527);const a=e=>"string"===typeof e,l=new Map,o="en";function i(e){return[...Array.isArray(e)?e:[e],o]}function u(e,t,n){const r=i(e);return d((()=>f("date",r,n)),(()=>new Intl.DateTimeFormat(r,n))).format(a(t)?new Date(t):t)}function s(e,t,n){const r=i(e);return d((()=>f("number",r,n)),(()=>new Intl.NumberFormat(r,n))).format(t)}function c(e,t,n,{offset:r=0,...a}){const l=i(e),o=t?d((()=>f("plural-ordinal",l)),(()=>new Intl.PluralRules(l,{type:"ordinal"}))):d((()=>f("plural-cardinal",l)),(()=>new Intl.PluralRules(l,{type:"cardinal"})));return a[n]??a[o.select(n-r)]??a.other}function d(e,t){const n=e();let r=l.get(n);return r||(r=t(),l.set(n,r)),r}function f(e,t,n){return`${e}-${t.join("-")}-${JSON.stringify(n)}`}const p=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,h="%__lingui_octothorpe__%",m=(e,t)=>t[e]??t.other;function g(e,t,n){return(l={},o)=>{const i=((e,t,n={})=>{const r=t||e,a=e=>"object"===typeof e?e:n[e]||{style:e},l=(e,t)=>{const l=Object.keys(n).length?a("number"):void 0,o=s(r,e,l);return t.replace(new RegExp(h,"g"),o)};return{plural:(e,t)=>{const{offset:n=0}=t,a=c(r,!1,e,t);return l(e-n,a)},selectordinal:(e,t)=>{const{offset:n=0}=t,a=c(r,!0,e,t);return l(e-n,a)},select:m,number:(e,t)=>s(r,e,a(t)),date:(e,t)=>u(r,e,a(t))}})(t,n,o),d=(e,t=!1)=>Array.isArray(e)?e.reduce(((e,n)=>{if("#"===n&&t)return e+h;if(a(n))return e+n;const[r,o,u]=n;let s,c={};if("plural"===o||"selectordinal"===o||"select"===o?Object.entries(u).forEach((([e,t])=>{c[e]=d(t,"plural"===o||"selectordinal"===o)})):c=u,o){s=(0,i[o])(l[r],c)}else s=l[r];return null==s?e:e+s}),""):e,f=d(e);return a(f)&&p.test(f)?(0,r.MH)(f.trim()):a(f)?f.trim():f?String(f):""}}var v=Object.defineProperty,y=(e,t,n)=>(((e,t,n)=>{t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);class b{constructor(){y(this,"_events",{})}on(e,t){var n;return(n=this._events)[e]??(n[e]=[]),this._events[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){const n=this._getListeners(e);if(!n)return;const r=n.indexOf(t);~r&&n.splice(r,1)}emit(e,...t){const n=this._getListeners(e);n&&n.map((e=>e.apply(this,t)))}_getListeners(e){const t=this._events[e];return!!Array.isArray(t)&&t}}var w=Object.defineProperty,k=(e,t,n)=>(((e,t,n)=>{t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);class S extends b{constructor(e){super(),k(this,"_locale",""),k(this,"_locales"),k(this,"_localeData",{}),k(this,"_messages",{}),k(this,"_missing"),k(this,"t",this._.bind(this)),null!=e.missing&&(this._missing=e.missing),null!=e.messages&&this.load(e.messages),null!=e.localeData&&this.loadLocaleData(e.localeData),("string"===typeof e.locale||e.locales)&&this.activate(e.locale??o,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,t){const n=this._localeData[e];n?Object.assign(n,t):this._localeData[e]=t}loadLocaleData(e,t){null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((t=>this._loadLocaleData(t,e[t]))),this.emit("change")}_load(e,t){const n=this._messages[e];n?Object.assign(n,t):this._messages[e]=t}load(e,t){"string"==typeof e&&"object"===typeof t?this._load(e,t):Object.entries(e).forEach((([e,t])=>this._load(e,t))),this.emit("change")}loadAndActivate({locale:e,locales:t,messages:n}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=n,this.emit("change")}activate(e,t){this._locale=e,this._locales=t,this.emit("change")}_(e,t,n){let r=n?.message;e||(e=""),a(e)||(t=e.values||t,r=e.message,e=e.id);const l=this.messages[e],o=void 0===l,i=this._missing;if(i&&o)return"function"===typeof i?i(this._locale,e):i;o&&this.emit("missing",{id:e,locale:this._locale});let u=l||r||e;return a(u)&&p.test(u)?JSON.parse(`"${u}"`):a(u)?u:g(u,this._locale,this._locales)(t,n?.formats)}date(e,t){return u(this._locales||this._locale,e,t)}number(e,t){return s(this._locales||this._locale,e,t)}}const x=function(e={}){return new S(e)}()},6458:(e,t,n)=>{n.d(t,{CY:()=>h,x6:()=>m});var r=n(8878);const a=/<([a-zA-Z0-9]+)>(.*?)<\/\1>|<([a-zA-Z0-9]+)\/>/,l=/(?:\r\n|\r|\n)/g,o={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0};function i(e,t={}){const n=s(0,"$lingui$"),c=e.replace(l,"").split(a);if(1===c.length)return e;const d=[],f=c.shift();f&&d.push(f);for(const[a,l,s]of u(c)){let e="undefined"!==typeof a?t[a]:void 0;(!e||o[e.type]&&l)&&(e?console.error(`${e.type} is a void element tag therefore it must have no children`):console.error(`Can't use element at index '${a}' as it is not declared in the original translation`),e=r.createElement(r.Fragment)),Array.isArray(e)&&(e=r.createElement(r.Fragment,{},e)),d.push(r.cloneElement(e,{key:n()},l?i(l,t):e.props.children)),s&&d.push(s)}return d}function u(e){if(!e.length)return[];const[t,n,r,a]=e.slice(0,4);return[[t||r,n||"",a]].concat(u(e.slice(4,e.length)))}const s=(e=0,t="")=>()=>`${t}_${e++}`;function c(e){const{render:t,component:n,id:a,message:l,formats:o,lingui:{i18n:u,defaultComponent:s}}=e,c={...e.values},f={...e.components};c&&Object.keys(c).forEach((e=>{const t=c[e];if(!(r.isValidElement(t)||Array.isArray(t)&&t.every(r.isValidElement)))return;const n=Object.keys(f).length;f[n]=t,c[e]=`<${n}/>`}));const p=u&&"function"===typeof u._?u._(a,c,{message:l,formats:o}):a,h=p?i(p,f):null;if(null===t||null===n)return h;const m=s||d,g={id:a,message:l,translation:h,isTranslated:a!==h&&l!==h,children:h};if(t&&n)console.error("You can't use both `component` and `render` prop at the same time. `component` is ignored.");else if(t&&"function"!==typeof t)console.error(`Invalid value supplied to prop \`render\`. It must be a function, provided ${t}`);else if(n&&"function"!==typeof n)return console.error(`Invalid value supplied to prop \`component\`. It must be a React component, provided ${n}`),r.createElement(m,g,h);if("function"===typeof t)return t(g);const v=n||m;return r.createElement(v,g,h)}const d=({children:e})=>r.createElement(r.Fragment,null,e),f=r.createContext(null),p=e=>r.useContext(f);const h=({i18n:e,defaultComponent:t,children:n})=>{const a=r.useRef(e.locale),l=r.useCallback((()=>({i18n:e,defaultComponent:t,_:e.t.bind(e)})),[e,t]),[o,i]=r.useState(l());return r.useEffect((()=>{const t=()=>{a.current=e.locale,i(l())},n=e.on("change",t);return a.current!==e.locale&&t(),n}),[e,l]),a.current?r.createElement(f.Provider,{value:o},n):null};function m(e){let t;const n=p(t);return r.createElement(c,{...e,lingui:n})}},5777:(e,t,n)=>{async function r(e,t){(await Promise.all([n.e(828),n.e(288)]).then(n.bind(n,3288))).resetFiles(e,t)}async function a(e,t){(await Promise.all([n.e(828),n.e(288)]).then(n.bind(n,3288))).resetTests(e,t)}async function l(e){(await Promise.all([n.e(828),n.e(297)]).then(n.bind(n,9297))).loadSamples(e)}async function o(e){(await n.e(269).then(n.bind(n,1269))).loadSolutions(e)}n.r(t),n.d(t,{default:()=>u,loadSamples:()=>l,loadSolutions:()=>o,loaders:()=>i,resetFiles:()=>r,resetTests:()=>a});const i={resetFiles:r,loadSolutions:o,loadSamples:l},u=i}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,n),l.exports}n.m=e,n.amdO={},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,a){if(1&a&&(r=this(r)),8&a)return r;if("object"===typeof r&&r){if(4&a&&r.__esModule)return r;if(16&a&&"function"===typeof r.then)return r}var l=Object.create(null);n.r(l);var o={};e=e||[null,t({}),t([]),t(t)];for(var i=2&a&&r;"object"==typeof i&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach((e=>o[e]=()=>r[e]));return o.default=()=>r,n.d(l,o),l}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+"."+{19:"41e234a9",71:"c99ce94e",200:"33bb522e",233:"880b3b5e",269:"1e46835e",288:"9fdaec0d",297:"2c45dab0",323:"14a08baf",408:"a13c70a8",447:"98604c94",535:"74ad7816",548:"ba61af54",578:"b9f22ec3",608:"6d63ee31",614:"12dbb7c0",656:"c1a30912",700:"b4462144",828:"e00c10f6",840:"ca28c6ce",911:"5accc151",965:"0b77a136",983:"998a7064"}[e]+".chunk.js",n.miniCssF=e=>"static/css/"+e+"."+{19:"cdc27113",71:"8f63efb7",408:"4548b55f",447:"5a5c5941",535:"a8c1f171",840:"f76be948",911:"afb55690"}[e]+".chunk.css",n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="@nand2tetris/web:";n.l=(r,a,l,o)=>{if(e[r])e[r].push(a);else{var i,u;if(void 0!==l)for(var s=document.getElementsByTagName("script"),c=0;c{i.onerror=i.onload=null,clearTimeout(p);var a=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(n))),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),u&&document.head.appendChild(i)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/web-ide/",(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((t,r)=>{var a=n.miniCssF(e),l=n.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",n.nc&&(o.nonce=n.nc),o.onerror=o.onload=n=>{if(o.onerror=o.onload=null,"load"===n.type)a();else{var r=n&&n.type,i=n&&n.target&&n.target.href||t,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+": "+i+")");u.name="ChunkLoadError",u.code="CSS_CHUNK_LOAD_FAILED",u.type=r,u.request=i,o.parentNode&&o.parentNode.removeChild(o),l(u)}},o.href=t,r?r.parentNode.insertBefore(o,r.nextSibling):document.head.appendChild(o)})(e,l,null,t,r)})),t={792:0};n.f.miniCss=(n,r)=>{t[n]?r.push(t[n]):0!==t[n]&&{19:1,71:1,408:1,447:1,535:1,840:1,911:1}[n]&&r.push(t[n]=e(n).then((()=>{t[n]=0}),(e=>{throw delete t[n],e})))}}})(),(()=>{var e={792:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{var l=new Promise(((n,r)=>a=e[t]=[n,r]));r.push(a[2]=l);var o=n.p+n.u(t),i=new Error;n.l(o,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var l=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+l+": "+o+")",i.name="ChunkLoadError",i.type=l,i.request=o,a[1](i)}}),"chunk-"+t,t)}};var t=(t,r)=>{var a,l,[o,i,u]=r,s=0;if(o.some((t=>0!==e[t]))){for(a in i)n.o(i,a)&&(n.m[a]=i[a]);if(u)u(n)}for(t&&t(r);s{var e={};n.r(e),n.d(e,{messages:()=>C});var t={};n.r(t),n.d(t,{messages:()=>E});var r=n(8878),a=n(4664);const l=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function o(e,t){navigator.serviceWorker.register(e).then((e=>{e.onupdatefound=()=>{const n=e.installing;null!=n&&(n.onstatechange=()=>{"installed"===n.state&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),t&&t.onUpdate&&t.onUpdate(e)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(e)))})}})).catch((e=>{console.error("Error during service worker registration:",e)}))}var i=n(8256),u=n(6458),s=n(910),c=n(5777);const d=(e,t)=>{const n=String(e).split("."),r=!n[1],a=Number(n[0])==e,l=a&&n[0].slice(-1),o=a&&n[0].slice(-2);return t?1==l&&11!=o?"one":2==l&&12!=o?"two":3==l&&13!=o?"few":"other":1==e&&r?"one":"other"};var f=n(8330),p=n(3229),h=n(8029);const m={comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]},g={tokenizer:{root:[[/(@)(.+)/,["operator","keyword"]],[/(\()(.+)(\))/,["operator","keyword","operator"]],{include:"@whitespace"}],...m}},v={keywords:["class","int","char","bool","void","let","function","method","constructor","var","if","do","while","else","return","true","false","null","this","field","static"],tokenizer:{root:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/\d+/,"number"],[/"[^"\n]*"/,"string"],{include:"@whitespace"}],...m}},y={defaultToken:"invalid",keywords:["CHIP","CPU","IN","OUT","PARTS","BUILTIN","CLOCKED"],chips:["Nand","Nand16","Not","Not16","And","And16","Or","Or16","Or8Way","XOr","XOr16","Xor","Xor16","Mux","Mux16","Mux4Way16","Mux8Way16","DMux","DMux4Way","DMux8Way","HalfAdder","FullAdder","Add16","Inc16","ALU","ALUNoStat","DFF","Bit","Register","ARegister","DRegister","PC","RAM8","RAM64","RAM512","RAM4K","RAM16K","ROM32K","Screen","Keyboard","CPU","Computer","Memory","ARegister","DRegister"],operators:["="],symbols:/[=]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z][a-zA-Z0-9]*/,{cases:{"@keywords":"keyword","@chips":"keyword.chip","@default":"identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/@\s*[a-zA-Z_$][\w$]*/,{token:"annotation",log:"annotation token: $0"}],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+(..\d+)?/,"number"],[/[;:,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/@escapes/,"string.escape"],[/'/,"string.invalid"]],...m}},b={Add16:"Add16(a = , b = , out = );",ALU:"ALU(x= , y= , zx= , nx= , zy= , ny= , f= , no= , out= , zr= , ng= );",And:"And(a= , b= , out= );",And16:"And16(a= , b= , out= );",ARegister:"ARegister(in= , load= , out= );",Bit:"Bit(in= , load= , out= );",CPU:"CPU(inM= , instruction= , reset= , outM= , writeM= , addressM= , pc= );",DFF:"DFF(in= , out= );",DMux:"DMux(in= , sel= , a= , b= );",DMux4Way:"DMux4Way(in= , sel= , a= , b= , c= , d= );",DMux8Way:"DMux8Way(in= , sel= , a= , b= , c= , d= , e= , f= , g= , h= );",DRegister:"DRegister(in= , load= , out= );",HalfAdder:"HalfAdder(a= , b= , sum= , carry= );",FullAdder:"FullAdder(a= , b= , c= , sum= , carry= );",Inc16:"Inc16(in= , out= );",Keyboard:"Keyboard(out= );",Memory:"Memory(in= , load= , address= , out= );",Mux:"Mux(a= , b= , sel= , out= );",Mux16:"Mux16(a= , b= , sel= , out= );",Mux4Way16:"Mux4Way16(a= , b= , c= , d= , sel= , out= );",Mux8Way16:"Mux8Way16(a= , b= , c= , d= , e= , f= , g= , h= , sel= , out= );",Nand:"Nand(a= , b= , out= );",Not16:"Not16(in= , out= );",Not:"Not(in= , out= );",Or:"Or(a= , b= , out= );",Or8Way:"Or8Way(in= , out= );",Or16:"Or16(a= , b= , out= );",PC:"PC(in= , load= , inc= , reset= , out= );",RAM8:"RAM8(in= , load= , address= , out= );",RAM64:"RAM64(in= , load= , address= , out= );",RAM512:"RAM512(in= , load= , address= , out= );",RAM4K:"RAM4K(in= , load= , address= , out= );",RAM16K:"RAM16K(in= , load= , address= , out= );",Register:"Register(in= , load= , out= );",ROM32K:"ROM32K(address= , out= );",Screen:"Screen(in= , load= , address= , out= );",Xor:"Xor(a = , b = , out = );"},w={provideCompletionItems:()=>({suggestions:Object.entries(b).map((([e,t])=>({label:e,kind:1,insertText:t})))})},k={hdl:y,cmp:{tokenizer:{root:[[/[a-z_$][\w$]*/,"identifier"],[/[ \t\r\n]+/,"white"],[/\d+\+?/,"number"],[/[|]/,"delimiter"]]}},tst:{defaultToken:"invalid",keywords:["output-list","set","eval","output","echo","clear-echo","repeat","while","load"],tokenizer:{root:[[/%[BDSX]\d+\.\d+\.\d+/,"keyword"],[/ROM32K/,"keyword"],[/[a-zA-Z-]+/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/%X[0-9a-fA-F]+/,"number.hex"],[/(%D)?\d+/,"number"],[/%B[01]+/,"number"],{include:"@whitespace"},[/[{}]/,"@bracket"],[/<>/,"operator"],[/[[\].]/,"operator"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/[;:!,]/,"delimiter"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}},vm:{keywords:["push","pop","add","sub","neg","lt","gt","eq","and","or","not","function","call","return","label","goto","if-goto","argument","local","static","constant","this","that","pointer","temp"],tokenizer:{root:[[/if-goto/,"keyword"],[/[_a-zA-Z][_a-zA-Z0-9.$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/\d+/,"number"],{include:"@whitespace"}],...m}},asm:g,jack:v},S={hdl:w};let x=!1;const C=JSON.parse('{"J/hVSQ":[["0"]],"pDgeaz":[["title"]],"Pza0F/":"Allocated memory size must be positive (Memory.alloc)","PH2rP+":"Allow anonymous interaction tracking","zh5lcC":"Array size must be positive (Array.new)","YBt9YP":"Beta","BUAJAb":"Binary Code","++LBSt":"Builtin","RsyXWz":"Cannot compute square root of a negative number (Math.sqrt)","Ow/xRO":"Cannot test a chip that has syntax errors","L3ICHv":"Change Local FileSystem","C7rK3y":"Chip","+yPBXI":"Choose file","3rHyAJ":"Clock","UV+b1H":"Compare Code","oXeVWH":"Create a new file in the currently opened folder","pvnfJD":"Dark","iGq+of":"Division by zero (Math.divide)","mzI/c+":"Download","Ovrln6":"Download .hdl files","9dwWEz":"Duration must be positive (Sys.wait)","uBAxNB":"Editor","lYGfRP":"English","J3L683":"Eval","7Bj3x9":"Failed","A9bii0":"Failed to load local file system.","sER+bs":"Files","EqbNAN":"Heap overflow (Memory.alloc)","SLzG45":"Illegal center coordinates (Screen.drawCircle)","EQU4AC":"Illegal cursor location (Output.moveCursor)","y4CC1u":"Illegal line coordinates (Screen.drawLine)","Lo+J/U":"Illegal pixel coordinates (Screen.drawPixel)","ijwovO":"Illegal radius (Screen.drawCircle)","5tI3XX":"Illegal rectangle coordinates (Screen.drawRectangle)","fkP0ib":"Insufficient string capacity (String.setInt)","vXIe7J":"Language","1njn7W":"Light","1/5eLk":"Load the compiled code into the VM emulator","etZuY4":"Maximum length must be non-negative (String.new)","FZeS2z":"Open a folder containing Jack file(s)","1tSpqV":"Parse Error","nqMwPi":"Passed","e0NrBM":"Project","E+NWKU":"Pseudolocale","9aloPG":"References","rdShiY":"Registers","OfhWJH":"Reset","d2mxgE":"Samples","Tz0i8g":"Settings","wdxz7K":"Source","GbPVvk":"String index out of bounds (String.charAt)","IgLZZI":"String index out of bounds (String.setCharAt)","RE1zuN":"String is empty (String.eraseLastChar)","CACwfm":"String is full (String.appendChar)","LWSJ0G":"Symbol Table","RFMyN+":"Syntax errors in the HDL code or test","D+NlUC":"System","NnH3pK":"Test","FEr96N":"Theme","U0HZma":"Tracking","/QBhoT":"Use Local FileSystem","zQo0yv":"Use Monaco Editor","4d8jc9":["Using ",["upgraded"]],"q3JCcX":"Visualization","1qK+lw":"VM Code","2BSTzk":"VM Structures"}'),E=JSON.parse('{"J/hVSQ":[["0"]],"pDgeaz":[["title"]],"Pza0F/":"\xc0\u013a\u013a\u014d\u0107\xe0\u0163\u0113\u010f m\u0113m\u014d\u0155\u0177 \u015b\u0129\u017a\u0113 m\u0169\u015b\u0163 \u0180\u0113 \u01a5\u014d\u015b\u0129\u0163\u0129v\u0113 (M\u0113m\u014d\u0155\u0177.\xe0\u013a\u013a\u014d\u0107)","PH2rP+":"\xc0\u013a\u013a\u014d\u0175 \xe0\u0144\u014d\u0144\u0177m\u014d\u0169\u015b \u0129\u0144\u0163\u0113\u0155\xe0\u0107\u0163\u0129\u014d\u0144 \u0163\u0155\xe0\u0107\u0137\u0129\u0144\u011d","zh5lcC":"\xc0\u0155\u0155\xe0\u0177 \u015b\u0129\u017a\u0113 m\u0169\u015b\u0163 \u0180\u0113 \u01a5\u014d\u015b\u0129\u0163\u0129v\u0113 (\xc0\u0155\u0155\xe0\u0177.\u0144\u0113\u0175)","YBt9YP":"\xdf\u0113\u0163\xe0","BUAJAb":"\xdf\u0129\u0144\xe0\u0155\u0177 \u0106\u014d\u010f\u0113","++LBSt":"\xdf\u0169\u0129\u013a\u0163\u0129\u0144","RsyXWz":"\u0106\xe0\u0144\u0144\u014d\u0163 \u0107\u014dm\u01a5\u0169\u0163\u0113 \u015b\u01eb\u0169\xe0\u0155\u0113 \u0155\u014d\u014d\u0163 \u014d\u0192 \xe0 \u0144\u0113\u011d\xe0\u0163\u0129v\u0113 \u0144\u0169m\u0180\u0113\u0155 (M\xe0\u0163\u0125.\u015b\u01eb\u0155\u0163)","Ow/xRO":"\u0106\xe0\u0144\u0144\u014d\u0163 \u0163\u0113\u015b\u0163 \xe0 \u0107\u0125\u0129\u01a5 \u0163\u0125\xe0\u0163 \u0125\xe0\u015b \u015b\u0177\u0144\u0163\xe0x \u0113\u0155\u0155\u014d\u0155\u015b","L3ICHv":"\u0106\u0125\xe0\u0144\u011d\u0113 \u0139\u014d\u0107\xe0\u013a \u0191\u0129\u013a\u0113\u015a\u0177\u015b\u0163\u0113m","C7rK3y":"\u0106\u0125\u0129\u01a5","+yPBXI":"\u0106\u0125\u014d\u014d\u015b\u0113 \u0192\u0129\u013a\u0113","3rHyAJ":"\u0106\u013a\u014d\u0107\u0137","UV+b1H":"\u0106\u014dm\u01a5\xe0\u0155\u0113 \u0106\u014d\u010f\u0113","oXeVWH":"\u0106\u0155\u0113\xe0\u0163\u0113 \xe0 \u0144\u0113\u0175 \u0192\u0129\u013a\u0113 \u0129\u0144 \u0163\u0125\u0113 \u0107\u0169\u0155\u0155\u0113\u0144\u0163\u013a\u0177 \u014d\u01a5\u0113\u0144\u0113\u010f \u0192\u014d\u013a\u010f\u0113\u0155","pvnfJD":"\u010e\xe0\u0155\u0137","iGq+of":"\u010e\u0129v\u0129\u015b\u0129\u014d\u0144 \u0180\u0177 \u017a\u0113\u0155\u014d (M\xe0\u0163\u0125.\u010f\u0129v\u0129\u010f\u0113)","mzI/c+":"\u010e\u014d\u0175\u0144\u013a\u014d\xe0\u010f","Ovrln6":"\u010e\u014d\u0175\u0144\u013a\u014d\xe0\u010f .\u0125\u010f\u013a \u0192\u0129\u013a\u0113\u015b","9dwWEz":"\u010e\u0169\u0155\xe0\u0163\u0129\u014d\u0144 m\u0169\u015b\u0163 \u0180\u0113 \u01a5\u014d\u015b\u0129\u0163\u0129v\u0113 (\u015a\u0177\u015b.\u0175\xe0\u0129\u0163)","uBAxNB":"\u0112\u010f\u0129\u0163\u014d\u0155","lYGfRP":"\u0112\u0144\u011d\u013a\u0129\u015b\u0125","J3L683":"\u0112v\xe0\u013a","7Bj3x9":"\u0191\xe0\u0129\u013a\u0113\u010f","A9bii0":"\u0191\xe0\u0129\u013a\u0113\u010f \u0163\u014d \u013a\u014d\xe0\u010f \u013a\u014d\u0107\xe0\u013a \u0192\u0129\u013a\u0113 \u015b\u0177\u015b\u0163\u0113m.","sER+bs":"\u0191\u0129\u013a\u0113\u015b","EqbNAN":"\u0124\u0113\xe0\u01a5 \u014dv\u0113\u0155\u0192\u013a\u014d\u0175 (M\u0113m\u014d\u0155\u0177.\xe0\u013a\u013a\u014d\u0107)","SLzG45":"\u0128\u013a\u013a\u0113\u011d\xe0\u013a \u0107\u0113\u0144\u0163\u0113\u0155 \u0107\u014d\u014d\u0155\u010f\u0129\u0144\xe0\u0163\u0113\u015b (\u015a\u0107\u0155\u0113\u0113\u0144.\u010f\u0155\xe0\u0175\u0106\u0129\u0155\u0107\u013a\u0113)","EQU4AC":"\u0128\u013a\u013a\u0113\u011d\xe0\u013a \u0107\u0169\u0155\u015b\u014d\u0155 \u013a\u014d\u0107\xe0\u0163\u0129\u014d\u0144 (\u014c\u0169\u0163\u01a5\u0169\u0163.m\u014dv\u0113\u0106\u0169\u0155\u015b\u014d\u0155)","y4CC1u":"\u0128\u013a\u013a\u0113\u011d\xe0\u013a \u013a\u0129\u0144\u0113 \u0107\u014d\u014d\u0155\u010f\u0129\u0144\xe0\u0163\u0113\u015b (\u015a\u0107\u0155\u0113\u0113\u0144.\u010f\u0155\xe0\u0175\u0139\u0129\u0144\u0113)","Lo+J/U":"\u0128\u013a\u013a\u0113\u011d\xe0\u013a \u01a5\u0129x\u0113\u013a \u0107\u014d\u014d\u0155\u010f\u0129\u0144\xe0\u0163\u0113\u015b (\u015a\u0107\u0155\u0113\u0113\u0144.\u010f\u0155\xe0\u0175\u01a4\u0129x\u0113\u013a)","ijwovO":"\u0128\u013a\u013a\u0113\u011d\xe0\u013a \u0155\xe0\u010f\u0129\u0169\u015b (\u015a\u0107\u0155\u0113\u0113\u0144.\u010f\u0155\xe0\u0175\u0106\u0129\u0155\u0107\u013a\u0113)","5tI3XX":"\u0128\u013a\u013a\u0113\u011d\xe0\u013a \u0155\u0113\u0107\u0163\xe0\u0144\u011d\u013a\u0113 \u0107\u014d\u014d\u0155\u010f\u0129\u0144\xe0\u0163\u0113\u015b (\u015a\u0107\u0155\u0113\u0113\u0144.\u010f\u0155\xe0\u0175\u0154\u0113\u0107\u0163\xe0\u0144\u011d\u013a\u0113)","fkP0ib":"\u0128\u0144\u015b\u0169\u0192\u0192\u0129\u0107\u0129\u0113\u0144\u0163 \u015b\u0163\u0155\u0129\u0144\u011d \u0107\xe0\u01a5\xe0\u0107\u0129\u0163\u0177 (\u015a\u0163\u0155\u0129\u0144\u011d.\u015b\u0113\u0163\u0128\u0144\u0163)","vXIe7J":"\u0139\xe0\u0144\u011d\u0169\xe0\u011d\u0113","1njn7W":"\u0139\u0129\u011d\u0125\u0163","1/5eLk":"\u0139\u014d\xe0\u010f \u0163\u0125\u0113 \u0107\u014dm\u01a5\u0129\u013a\u0113\u010f \u0107\u014d\u010f\u0113 \u0129\u0144\u0163\u014d \u0163\u0125\u0113 VM \u0113m\u0169\u013a\xe0\u0163\u014d\u0155","etZuY4":"M\xe0x\u0129m\u0169m \u013a\u0113\u0144\u011d\u0163\u0125 m\u0169\u015b\u0163 \u0180\u0113 \u0144\u014d\u0144-\u0144\u0113\u011d\xe0\u0163\u0129v\u0113 (\u015a\u0163\u0155\u0129\u0144\u011d.\u0144\u0113\u0175)","FZeS2z":"\u014c\u01a5\u0113\u0144 \xe0 \u0192\u014d\u013a\u010f\u0113\u0155 \u0107\u014d\u0144\u0163\xe0\u0129\u0144\u0129\u0144\u011d \u0135\xe0\u0107\u0137 \u0192\u0129\u013a\u0113(\u015b)","1tSpqV":"\u01a4\xe0\u0155\u015b\u0113 \u0112\u0155\u0155\u014d\u0155","nqMwPi":"\u01a4\xe0\u015b\u015b\u0113\u010f","e0NrBM":"\u01a4\u0155\u014d\u0134\u0113\u0107\u0163","E+NWKU":"\u01a4\u015b\u0113\u0169\u010f\u014d\u013a\u014d\u0107\xe0\u013a\u0113","9aloPG":"\u0154\u0113\u0192\u0113\u0155\u0113\u0144\u0107\u0113\u015b","rdShiY":"\u0154\u0113\u011d\u0129\u015b\u0163\u0113\u0155\u015b","OfhWJH":"\u0154\u0113\u015b\u0113\u0163","d2mxgE":"\u015a\xe0m\u01a5\u013a\u0113\u015b","Tz0i8g":"\u015a\u0113\u0163\u0163\u0129\u0144\u011d\u015b","wdxz7K":"\u015a\u014d\u0169\u0155\u0107\u0113","GbPVvk":"\u015a\u0163\u0155\u0129\u0144\u011d \u0129\u0144\u010f\u0113x \u014d\u0169\u0163 \u014d\u0192 \u0180\u014d\u0169\u0144\u010f\u015b (\u015a\u0163\u0155\u0129\u0144\u011d.\u0107\u0125\xe0\u0155\xc0\u0163)","IgLZZI":"\u015a\u0163\u0155\u0129\u0144\u011d \u0129\u0144\u010f\u0113x \u014d\u0169\u0163 \u014d\u0192 \u0180\u014d\u0169\u0144\u010f\u015b (\u015a\u0163\u0155\u0129\u0144\u011d.\u015b\u0113\u0163\u0106\u0125\xe0\u0155\xc0\u0163)","RE1zuN":"\u015a\u0163\u0155\u0129\u0144\u011d \u0129\u015b \u0113m\u01a5\u0163\u0177 (\u015a\u0163\u0155\u0129\u0144\u011d.\u0113\u0155\xe0\u015b\u0113\u0139\xe0\u015b\u0163\u0106\u0125\xe0\u0155)","CACwfm":"\u015a\u0163\u0155\u0129\u0144\u011d \u0129\u015b \u0192\u0169\u013a\u013a (\u015a\u0163\u0155\u0129\u0144\u011d.\xe0\u01a5\u01a5\u0113\u0144\u010f\u0106\u0125\xe0\u0155)","LWSJ0G":"\u015a\u0177m\u0180\u014d\u013a \u0162\xe0\u0180\u013a\u0113","RFMyN+":"\u015a\u0177\u0144\u0163\xe0x \u0113\u0155\u0155\u014d\u0155\u015b \u0129\u0144 \u0163\u0125\u0113 \u0124\u010e\u0139 \u0107\u014d\u010f\u0113 \u014d\u0155 \u0163\u0113\u015b\u0163","D+NlUC":"\u015a\u0177\u015b\u0163\u0113m","NnH3pK":"\u0162\u0113\u015b\u0163","FEr96N":"\u0162\u0125\u0113m\u0113","U0HZma":"\u0162\u0155\xe0\u0107\u0137\u0129\u0144\u011d","/QBhoT":"\u0168\u015b\u0113 \u0139\u014d\u0107\xe0\u013a \u0191\u0129\u013a\u0113\u015a\u0177\u015b\u0163\u0113m","zQo0yv":"\u0168\u015b\u0113 M\u014d\u0144\xe0\u0107\u014d \u0112\u010f\u0129\u0163\u014d\u0155","4d8jc9":["\u0168\u015b\u0129\u0144\u011d ",["upgraded"]],"q3JCcX":"V\u0129\u015b\u0169\xe0\u013a\u0129\u017a\xe0\u0163\u0129\u014d\u0144","1qK+lw":"VM \u0106\u014d\u010f\u0113","2BSTzk":"VM \u015a\u0163\u0155\u0169\u0107\u0163\u0169\u0155\u0113\u015b"}'),_=e,P=t;var j=n(6073),O=n(782);const N=function(){const{status:e}=(0,r.useContext)(s.L);return(0,O.jsx)("div",{children:e})},T=()=>(0,O.jsx)("footer",{className:"flex row justify-between",children:(0,O.jsx)(N,{})});var L=n(3015),R=n(3499);function z(e,t,n){return{href:e.href,tool:e.tool,tooltip:null!==n&&void 0!==n?n:e.tool&&Object.keys(R.It).includes(e.tool)?R.It[e.tool]:"",icon:t,target:e.target}}const F={chip:"user_guide/chip.pdf",cpu:"user_guide/cpu.pdf",asm:"user_guide/asm.pdf",vm:"user_guide/vm.pdf",compiler:"user_guide/compiler.pdf"},A="Guide not available for this tool";const M=[z(R.Ay.chip,"memory"),z(R.Ay.cpu,"developer_board"),z(R.Ay.asm,"list_alt"),z(R.Ay.vm,"computer"),..."showDirectoryPicker"in window?[z(R.Ay.compiler,"code")]:[],z(R.Ay.bitmap,"grid_on"),z(R.Ay.util,"function","Converter Tool"),{onClick:async function(e){if(!F[e.pathname])return void e.baseContext.setStatus(A);const t=F[e.pathname];404!==(await fetch(t)).status?window.open(t,"_blank","width=1000,height=800"):e.baseContext.setStatus(A)},tooltip:"Guide",icon:"menu_book"},{href:"https://github.com/nand2tetris/web-ide/issues/new/choose",icon:"bug_report",tooltip:"Bug Report"},{onClick:e=>{e.appContext.settings.open()},icon:"settings",tooltip:"Settings"},z(R.Ay.about,"info","About")],D=()=>{const e=(0,r.useContext)(h.BR),t=(0,r.useContext)(s.L),{setStatus:n}=(0,r.useContext)(s.L),a={};for(const o of M)o.href&&(a[o.href]=(0,r.useRef)(null));const l=(0,p.zy)().pathname.replaceAll("/","");return(0,O.jsx)("header",{children:(0,O.jsxs)("nav",{style:{width:"100%"},children:[(0,O.jsx)("ul",{children:(0,O.jsxs)("li",{children:[(0,O.jsx)("strong",{children:(0,O.jsx)("a",{href:"https://nand2tetris.org",target:"_blank",rel:"noreferrer",children:"NAND2Tetris"})}),R.It[l]&&` / ${R.It[l]}`,e.title&&` / ${e.title}`]})}),(0,O.jsx)("ul",{className:"icon-list",children:M.map((({href:r,icon:o,onClick:i,tooltip:u,target:s,tool:c})=>(0,O.jsxs)("li",{"data-tooltip":u,"data-placement":"bottom",onClick:()=>{var o;(e.setTitle(void 0),n(""),i)?null===i||void 0===i||i({appContext:e,baseContext:t,pathname:l}):r&&(s&&localStorage.setItem(R.p3,r),null===(o=a[r].current)||void 0===o||o.click())},children:[(0,O.jsx)(L.I,{name:o}),r&&(s?(0,O.jsx)(f.N_,{to:r,ref:a[r],style:{display:"none"}}):(0,O.jsx)("a",{href:r,target:"new",ref:a[r],style:{display:"none"}}))]},o)))})]})})};var I=n(5270);const U="version",B=9;function $(){var e;return Number(null!==(e=localStorage.getItem(U))&&void 0!==e?e:"0")}function W(e){localStorage.setItem(U,e.toString())}const H={0:async e=>{for(const t of["hdl","cmp","tst"])await e.writeFile(`/projects/01/Xor/Xor.${t}`,await e.readFile(`/projects/01/XOr/XOr.${t}`))},1:async e=>{await(0,c.resetFiles)(e,[4])},2:async e=>{await(0,c.resetTests)(e,[1])},3:async e=>{await(0,c.resetTests)(e)},4:async e=>{await(0,c.resetFiles)(e,[7,8])},5:async e=>{await(0,c.resetTests)(e,[3,5])},6:async e=>{await(0,c.resetTests)(e,[4])},7:async e=>{await(0,c.resetTests)(e,[1])},8:async e=>{await(0,c.resetFiles)(e,[6])}};var V=n(3508);const Q=()=>{const{toolStates:e}=(0,r.useContext)(h.BR),{fs:t,setStatus:a,canUpgradeFs:l,upgradeFs:o,closeFs:c,upgraded:d}=(0,r.useContext)(s.L),{settings:f,monaco:p,theme:m,setTheme:g,tracking:v}=(0,r.useContext)(h.BR),[y,b]=(0,r.useState)(!1),w=(0,r.useMemo)((()=>e=>{i.Ru.activate(e),t.writeFile("/locale",e)}),[t]);(0,r.useEffect)((()=>{t.readFile("/locale").then((e=>i.Ru.activate(e))).catch((()=>w("en")))}),[t,w]);const k=(0,V.s)(),S=(0,V.s)(),x=(0,O.jsx)("dialog",{open:k.isOpen,children:(0,O.jsx)("article",{children:(0,O.jsxs)("main",{children:[(0,O.jsx)("div",{style:{margin:"10px"},children:'The "reset files" action will result in erasing all the HDL files kept in your browser\'s memory, replacing them with a fresh set of skeletal HDL files. You may want to back-up your files before resetting them. Are you sure that you want to reset the files?'}),(0,O.jsxs)("div",{style:{display:"flex",justifyContent:"space-around",marginTop:"30px"},children:[(0,O.jsx)("button",{style:{width:"100px"},onClick:async()=>{await(async()=>{const r=$();localStorage.clear(),W(r),localStorage["/chip/project"]="01",localStorage["/chip/chip"]="Not";const a=await Promise.resolve().then(n.bind(n,5777));await a.resetFiles(t),e.compiler.reset()})(),k.close(),S.open()},children:"Yes"}),(0,O.jsx)("button",{style:{width:"100px"},onClick:()=>{k.close()},children:"Cancel"})]})]})})}),C=(0,O.jsx)("dialog",{open:S.isOpen,children:(0,O.jsxs)("article",{children:[(0,O.jsx)("header",{children:"Your files were reset"}),(0,O.jsx)("main",{children:(0,O.jsx)("button",{onClick:S.close,children:"Ok"})})]})});return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("dialog",{open:f.isOpen,children:(0,O.jsxs)("article",{children:[(0,O.jsxs)("header",{children:[(0,O.jsx)("p",{children:(0,O.jsx)(u.x6,{id:"Tz0i8g"})}),(0,O.jsx)("a",{className:"close",href:"#root",onClick:e=>{e.preventDefault(),f.close()}})]}),(0,O.jsx)("main",{children:(0,O.jsxs)("dl",{children:[(0,O.jsx)("header",{children:(0,O.jsx)(u.x6,{id:"e0NrBM"})}),(0,O.jsx)("dt",{children:(0,O.jsx)(u.x6,{id:"9aloPG"})}),(0,O.jsxs)("dd",{children:[(0,O.jsx)("div",{children:(0,O.jsx)("a",{href:"https://nand2tetris.org",target:"_blank",rel:"noreferrer",children:"nand2tetris.org"})}),(0,O.jsx)("div",{children:(0,O.jsx)("a",{href:"https://github.com/davidsouther/nand2tetris",target:"_blank",rel:"noreferrer",children:"GitHub"})})]}),(0,O.jsx)("dt",{children:(0,O.jsx)(u.x6,{id:"sER+bs"})}),(0,O.jsxs)("dd",{children:[(0,O.jsx)(O.Fragment,{}),(0,O.jsx)("button",{onClick:async()=>{k.open()},children:(0,O.jsx)(u.x6,{id:"OfhWJH"})}),(0,O.jsx)("button",{onClick:async()=>{const e=await Promise.resolve().then(n.bind(n,5777));await e.loadSamples(t),a("Loaded sample files...")},children:(0,O.jsx)(u.x6,{id:"d2mxgE"})})]}),(0,O.jsx)("dt",{children:(0,O.jsx)(u.x6,{id:"vXIe7J"})}),(0,O.jsxs)("dd",{children:[(0,O.jsx)("button",{onClick:()=>w("en"),children:(0,O.jsx)(u.x6,{id:"lYGfRP"})}),(0,O.jsx)("button",{onClick:()=>w("en-PL"),children:(0,O.jsx)(u.x6,{id:"E+NWKU"})})]}),(0,O.jsx)("dt",{children:(0,O.jsx)(u.x6,{id:"uBAxNB"})}),(0,O.jsx)("dd",{children:(0,O.jsxs)("label",{children:[(0,O.jsx)("input",{type:"checkbox",name:"switch",role:"switch",checked:p.wants,disabled:!p.canUse,onChange:e=>p.toggle(e.target.checked)}),(0,O.jsx)(u.x6,{id:"zQo0yv"})]})}),(0,O.jsx)("dt",{children:(0,O.jsx)(u.x6,{id:"FEr96N"})}),(0,O.jsx)("dd",{children:(0,O.jsxs)("fieldset",{role:"group",children:[(0,O.jsxs)("label",{role:"button","aria-current":"light"===m,children:[(0,O.jsx)("input",{type:"radio",name:"theme",value:"light",checked:"light"===m,onChange:()=>g("light")}),(0,O.jsx)(u.x6,{id:"1njn7W"})]}),(0,O.jsxs)("label",{role:"button","aria-current":"dark"===m,children:[(0,O.jsx)("input",{type:"radio",name:"theme",value:"dark",checked:"dark"===m,onChange:()=>g("dark")}),(0,O.jsx)(u.x6,{id:"pvnfJD"})]}),(0,O.jsxs)("label",{role:"button","aria-current":"system"===m,children:[(0,O.jsx)("input",{type:"radio",name:"theme",value:"system",checked:"system"===m,onChange:()=>g("system")}),(0,O.jsx)(u.x6,{id:"D+NlUC"})]})]})}),(0,O.jsx)("dt",{children:(0,O.jsx)(u.x6,{id:"U0HZma"})}),(0,O.jsx)("dd",{children:(0,O.jsxs)("label",{children:[(0,O.jsx)("input",{type:"checkbox",name:"switch",role:"switch",checked:v.canTrack,onChange:e=>{e.target.checked?v.accept():v.reject()}}),(0,O.jsx)(u.x6,{id:"PH2rP+"}),(0,O.jsx)(I.dQ,{})]})})]})})]})}),x,C]})};class q extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?this.props.fallback({error:this.state.error}):this.props.children}}const K=({error:e})=>{var t;return e?(0,O.jsxs)("div",{children:[(0,O.jsxs)("p",{children:[(0,O.jsxs)("b",{children:[null!==(t=e.name)&&void 0!==t?t:"Error",":"]})," ",e.message]}),e.stack&&(0,O.jsx)("pre",{children:(0,O.jsx)("code",{children:e.stack})}),e.cause?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{children:(0,O.jsx)("em",{children:"Caused by"})}),(0,O.jsx)(K,{error:e.cause})]}):(0,O.jsx)(O.Fragment,{})]}):(0,O.jsx)("p",{children:"Unknown Error"})},G=()=>{const[e,t]=(0,r.useState)();return(0,r.useEffect)((()=>{var e;const n=null!==(e=localStorage.getItem(R.p3))&&void 0!==e?e:"/chip";t(n)}),[]),e?(0,O.jsx)(p.C5,{to:e}):(0,O.jsx)(O.Fragment,{})};i.Ru.load("en",_.messages),i.Ru.load("en-PL",P.messages),i.Ru.loadLocaleData({en:{plurals:d},"en-US":{plurals:d},"en-PL":{plurals:d}}),i.Ru.activate(navigator.language);const X=function(){const e=(0,s.A)(),t=(0,h.Us)(),a=e.fs;return(0,r.useEffect)((()=>{!async function(){if(x)return;x=!0,x=!0;const{loader:e}=await n.e(983).then(n.bind(n,7983)),{languages:t}=await e.init();for(const[n,r]of Object.entries(k))t.register({id:n}),t.setMonarchTokensProvider(n,r),S[n]&&t.registerCompletionItemProvider(n,S[n]);x=!1}()}),[]),(0,r.useEffect)((()=>{a.stat("/projects/01/Not/Not.hdl").catch((async()=>{await c.loaders.resetFiles(a)})),async function(e){let t=$();for(;t{document.children[0].dataset.theme="system"===t.theme?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t.theme}),[t.theme]),(0,O.jsx)(u.CY,{i18n:i.Ru,children:(0,O.jsx)(s.L.Provider,{value:e,children:(0,O.jsxs)(h.BR.Provider,{value:t,children:[(0,O.jsx)(Q,{}),(0,O.jsx)(j.Nk,{}),(0,O.jsxs)(f.Kd,{basename:"/web-ide",children:[(0,O.jsx)(D,{}),(0,O.jsx)("main",{className:"flex flex-1",children:(0,O.jsx)(q,{fallback:K,children:(0,O.jsx)(r.Suspense,{fallback:(0,O.jsx)("div",{children:"Loading..."}),children:(0,O.jsxs)(p.BV,{children:[(0,O.jsx)(p.qh,{path:"/",element:(0,O.jsx)(G,{})}),Object.values(R.Ay).map((({href:e,target:t})=>(0,O.jsx)(p.qh,{path:e,element:t},e)))]})})})}),(0,O.jsx)(T,{}),(0,O.jsx)(I.w,{})]})]})})})},J=e=>{e&&e instanceof Function&&n.e(578).then(n.bind(n,1578)).then((({getCLS:t,getFID:n,getFCP:r,getLCP:a,getTTFB:l})=>{t(e),n(e),r(e),a(e),l(e)}))};a.createRoot(document.getElementById("root")).render((0,O.jsx)(r.StrictMode,{children:(0,O.jsx)(X,{})})),function(e){if("serviceWorker"in navigator){if(new URL("/web-ide",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",(()=>{const t="/web-ide/service-worker.js";l?(!function(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then((n=>{const r=n.headers.get("content-type");404===n.status||null!=r&&-1===r.indexOf("javascript")?navigator.serviceWorker.ready.then((e=>{e.unregister().then((()=>{window.location.reload()}))})):o(e,t)})).catch((()=>{console.log("No internet connection found. App is running in offline mode.")}))}(t,e),navigator.serviceWorker.ready.then((()=>{console.log("This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA")}))):o(t,e)}))}}(),J()})()})();
\ No newline at end of file
diff --git a/static/js/main.9fb233e1.js.LICENSE.txt b/static/js/main.64a1b230.js.LICENSE.txt
similarity index 100%
rename from static/js/main.9fb233e1.js.LICENSE.txt
rename to static/js/main.64a1b230.js.LICENSE.txt
diff --git a/util/index.html b/util/index.html
index ec54756f..bb406fa8 100644
--- a/util/index.html
+++ b/util/index.html
@@ -1 +1 @@
-NAND2Tetris
\ No newline at end of file
+NAND2Tetris
\ No newline at end of file
diff --git a/vm/index.html b/vm/index.html
index ec54756f..bb406fa8 100644
--- a/vm/index.html
+++ b/vm/index.html
@@ -1 +1 @@
-NAND2Tetris
\ No newline at end of file
+NAND2Tetris
\ No newline at end of file