diff --git a/assets/index-854444ea.js b/assets/index-45a0c004.js similarity index 99% rename from assets/index-854444ea.js rename to assets/index-45a0c004.js index e24f477..49ea3f7 100644 --- a/assets/index-854444ea.js +++ b/assets/index-45a0c004.js @@ -38,6 +38,6 @@ `).replace(ud,"")}function Sr(e,t,n){if(t=Cu(t),Cu(e)!==t&&n)throw Error(g(425))}function Zr(){}var Po=null,zo=null;function To(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lo=typeof setTimeout=="function"?setTimeout:void 0,sd=typeof clearTimeout=="function"?clearTimeout:void 0,Nu=typeof Promise=="function"?Promise:void 0,ad=typeof queueMicrotask=="function"?queueMicrotask:typeof Nu<"u"?function(e){return Nu.resolve(null).then(e).catch(cd)}:Lo;function cd(e){setTimeout(function(){throw e})}function Yl(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Qn(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Qn(t)}function ct(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Pu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var dn=Math.random().toString(36).slice(2),$e="__reactFiber$"+dn,Zn="__reactProps$"+dn,Ze="__reactContainer$"+dn,jo="__reactEvents$"+dn,fd="__reactListeners$"+dn,dd="__reactHandles$"+dn;function Et(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ze]||n[$e]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pu(e);e!==null;){if(n=e[$e])return n;e=Pu(e)}return t}e=n,n=e.parentNode}return null}function ur(e){return e=e[$e]||e[Ze],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bt(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(g(33))}function yl(e){return e[Zn]||null}var Ro=[],Wt=-1;function gt(e){return{current:e}}function I(e){0>Wt||(e.current=Ro[Wt],Ro[Wt]=null,Wt--)}function M(e,t){Wt++,Ro[Wt]=e.current,e.current=t}var vt={},oe=gt(vt),de=gt(!1),Tt=vt;function rn(e,t){var n=e.type.contextTypes;if(!n)return vt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function pe(e){return e=e.childContextTypes,e!=null}function Jr(){I(de),I(oe)}function zu(e,t,n){if(oe.current!==vt)throw Error(g(168));M(oe,t),M(de,n)}function da(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(g(108,Gc(e)||"Unknown",l));return V({},n,r)}function qr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vt,Tt=oe.current,M(oe,e),M(de,de.current),!0}function Tu(e,t,n){var r=e.stateNode;if(!r)throw Error(g(169));n?(e=da(e,t,Tt),r.__reactInternalMemoizedMergedChildContext=e,I(de),I(oe),M(oe,e)):I(de),M(de,n)}var He=null,gl=!1,Xl=!1;function pa(e){He===null?He=[e]:He.push(e)}function pd(e){gl=!0,pa(e)}function wt(){if(!Xl&&He!==null){Xl=!0;var e=0,t=O;try{var n=He;for(O=1;e>=i,l-=i,Ke=1<<32-Oe(t)+l|n<P?(W=C,C=null):W=C.sibling;var j=p(f,C,d[P],y);if(j===null){C===null&&(C=W);break}e&&C&&j.alternate===null&&t(f,C),c=o(j,c,P),E===null?_=j:E.sibling=j,E=j,C=W}if(P===d.length)return n(f,C),U&&_t(f,P),_;if(C===null){for(;PP?(W=C,C=null):W=C.sibling;var ze=p(f,C,j.value,y);if(ze===null){C===null&&(C=W);break}e&&C&&ze.alternate===null&&t(f,C),c=o(ze,c,P),E===null?_=ze:E.sibling=ze,E=ze,C=W}if(j.done)return n(f,C),U&&_t(f,P),_;if(C===null){for(;!j.done;P++,j=d.next())j=m(f,j.value,y),j!==null&&(c=o(j,c,P),E===null?_=j:E.sibling=j,E=j);return U&&_t(f,P),_}for(C=r(f,C);!j.done;P++,j=d.next())j=v(C,f,P,j.value,y),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?P:j.key),c=o(j,c,P),E===null?_=j:E.sibling=j,E=j);return e&&C.forEach(function(pn){return t(f,pn)}),U&&_t(f,P),_}function F(f,c,d,y){if(typeof d=="object"&&d!==null&&d.type===Ut&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case dr:e:{for(var _=d.key,E=c;E!==null;){if(E.key===_){if(_=d.type,_===Ut){if(E.tag===7){n(f,E.sibling),c=l(E,d.props.children),c.return=f,f=c;break e}}else if(E.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===tt&&Iu(_)===E.type){n(f,E.sibling),c=l(E,d.props),c.ref=kn(f,E,d),c.return=f,f=c;break e}n(f,E);break}else t(f,E);E=E.sibling}d.type===Ut?(c=zt(d.props.children,f.mode,y,d.key),c.return=f,f=c):(y=$r(d.type,d.key,d.props,null,f.mode,y),y.ref=kn(f,c,d),y.return=f,f=y)}return i(f);case Ft:e:{for(E=d.key;c!==null;){if(c.key===E)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=no(d,f.mode,y),c.return=f,f=c}return i(f);case tt:return E=d._init,F(f,c,E(d._payload),y)}if(En(d))return w(f,c,d,y);if(hn(d))return k(f,c,d,y);xr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,d),c.return=f,f=c):(n(f,c),c=to(d,f.mode,y),c.return=f,f=c),i(f)):n(f,c)}return F}var on=Sa(!0),_a=Sa(!1),sr={},Ve=gt(sr),Jn=gt(sr),qn=gt(sr);function Nt(e){if(e===sr)throw Error(g(174));return e}function zi(e,t){switch(M(qn,t),M(Jn,e),M(Ve,sr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ho(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ho(t,e)}I(Ve),M(Ve,t)}function un(){I(Ve),I(Jn),I(qn)}function xa(e){Nt(qn.current);var t=Nt(Ve.current),n=ho(t,e.type);t!==n&&(M(Jn,e),M(Ve,n))}function Ti(e){Jn.current===e&&(I(Ve),I(Jn))}var $=gt(0);function ll(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Gl=[];function Li(){for(var e=0;en?n:4,e(!0);var r=Zl.transition;Zl.transition={};try{e(!1),t()}finally{O=n,Zl.transition=r}}function $a(){return Pe().memoizedState}function yd(e,t,n){var r=pt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Aa(e))Va(t,n);else if(n=ya(e,t,n,r),n!==null){var l=ue();Me(n,e,r,l),Ba(n,t,r)}}function gd(e,t,n){var r=pt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Aa(e))Va(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,De(u,i)){var s=t.interleaved;s===null?(l.next=l,Ni(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=ya(e,t,l,r),n!==null&&(l=ue(),Me(n,e,r,l),Ba(n,t,r))}}function Aa(e){var t=e.alternate;return e===A||t!==null&&t===A}function Va(e,t){Dn=ol=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ba(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,di(e,n)}}var il={readContext:Ne,useCallback:ne,useContext:ne,useEffect:ne,useImperativeHandle:ne,useInsertionEffect:ne,useLayoutEffect:ne,useMemo:ne,useReducer:ne,useRef:ne,useState:ne,useDebugValue:ne,useDeferredValue:ne,useTransition:ne,useMutableSource:ne,useSyncExternalStore:ne,useId:ne,unstable_isNewReconciler:!1},wd={readContext:Ne,useCallback:function(e,t){return Ue().memoizedState=[e,t===void 0?null:t],e},useContext:Ne,useEffect:Uu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dr(4194308,4,Ma.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dr(4,2,e,t)},useMemo:function(e,t){var n=Ue();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ue();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yd.bind(null,A,e),[r.memoizedState,e]},useRef:function(e){var t=Ue();return e={current:e},t.memoizedState=e},useState:Fu,useDebugValue:Di,useDeferredValue:function(e){return Ue().memoizedState=e},useTransition:function(){var e=Fu(!1),t=e[0];return e=vd.bind(null,e[1]),Ue().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=A,l=Ue();if(U){if(n===void 0)throw Error(g(407));n=n()}else{if(n=t(),q===null)throw Error(g(349));jt&30||Na(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Uu(za.bind(null,r,o,e),[e]),r.flags|=2048,tr(9,Pa.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ue(),t=q.identifierPrefix;if(U){var n=Ye,r=Ke;n=(r&~(1<<32-Oe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[$e]=t,e[Zn]=r,Ja(e,t,!1,!1),t.stateNode=e;e:{switch(i=yo(n,r),n){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;lan&&(t.flags|=128,r=!0,Sn(o,!1),t.lanes=4194304)}else{if(!r)if(e=ll(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!U)return re(t),null}else 2*Q()-o.renderingStartTime>an&&n!==1073741824&&(t.flags|=128,r=!0,Sn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Q(),t.sibling=null,n=$.current,M($,r?n&1|2:n&1),t):(re(t),null);case 22:case 23:return Vi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?he&1073741824&&(re(t),t.subtreeFlags&6&&(t.flags|=8192)):re(t),null;case 24:return null;case 25:return null}throw Error(g(156,t.tag))}function Pd(e,t){switch(Si(t),t.tag){case 1:return pe(t.type)&&Jr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return un(),I(de),I(oe),Li(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ti(t),null;case 13:if(I($),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(g(340));ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I($),null;case 4:return un(),null;case 10:return Ci(t.type._context),null;case 22:case 23:return Vi(),null;case 24:return null;default:return null}}var Cr=!1,le=!1,zd=typeof WeakSet=="function"?WeakSet:Set,S=null;function Yt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){B(e,t,r)}else n.current=null}function Ho(e,t,n){try{n()}catch(r){B(e,t,r)}}var Yu=!1;function Td(e,t){if(Po=Yr,e=ra(),wi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,h=0,m=e,p=null;t:for(;;){for(var v;m!==n||l!==0&&m.nodeType!==3||(u=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)p=m,m=v;for(;;){if(m===e)break t;if(p===n&&++a===l&&(u=i),p===o&&++h===r&&(s=i),(v=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=v}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(zo={focusedElem:e,selectionRange:n},Yr=!1,S=t;S!==null;)if(t=S,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,S=e;else for(;S!==null;){t=S;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,F=w.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:Le(t.type,k),F);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(g(163))}}catch(y){B(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,S=e;break}S=t.return}return w=Yu,Yu=!1,w}function In(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Ho(t,n,o)}l=l.next}while(l!==r)}}function Sl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ec(e){var t=e.alternate;t!==null&&(e.alternate=null,ec(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$e],delete t[Zn],delete t[jo],delete t[fd],delete t[dd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tc(e){return e.tag===5||e.tag===3||e.tag===4}function Xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ko(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zr));else if(r!==4&&(e=e.child,e!==null))for(Ko(e,t,n),e=e.sibling;e!==null;)Ko(e,t,n),e=e.sibling}function Yo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yo(e,t,n),e=e.sibling;e!==null;)Yo(e,t,n),e=e.sibling}var b=null,je=!1;function et(e,t,n){for(n=n.child;n!==null;)nc(e,t,n),n=n.sibling}function nc(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount=="function")try{Ae.onCommitFiberUnmount(pl,n)}catch{}switch(n.tag){case 5:le||Yt(n,t);case 6:var r=b,l=je;b=null,et(e,t,n),b=r,je=l,b!==null&&(je?(e=b,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):b.removeChild(n.stateNode));break;case 18:b!==null&&(je?(e=b,n=n.stateNode,e.nodeType===8?Yl(e.parentNode,n):e.nodeType===1&&Yl(e,n),Qn(e)):Yl(b,n.stateNode));break;case 4:r=b,l=je,b=n.stateNode.containerInfo,je=!0,et(e,t,n),b=r,je=l;break;case 0:case 11:case 14:case 15:if(!le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Ho(n,t,i),l=l.next}while(l!==r)}et(e,t,n);break;case 1:if(!le&&(Yt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){B(n,t,u)}et(e,t,n);break;case 21:et(e,t,n);break;case 22:n.mode&1?(le=(r=le)||n.memoizedState!==null,et(e,t,n),le=r):et(e,t,n);break;default:et(e,t,n)}}function Gu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zd),t.forEach(function(r){var l=Ud.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Te(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=Q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jd(r/1960))-r,10e?16:e,it===null)var r=!1;else{if(e=it,it=null,al=0,R&6)throw Error(g(331));var l=R;for(R|=4,S=e.current;S!==null;){var o=S,i=o.child;if(S.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sQ()-$i?Pt(e,0):Ui|=n),me(e,t)}function cc(e,t){t===0&&(e.mode&1?(t=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):t=1);var n=ue();e=Je(e,t),e!==null&&(or(e,t,n),me(e,n))}function Fd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cc(e,n)}function Ud(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(g(314))}r!==null&&r.delete(t),cc(e,n)}var fc;fc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||de.current)fe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return fe=!1,Cd(e,t,n);fe=!!(e.flags&131072)}else fe=!1,U&&t.flags&1048576&&ma(t,el,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ir(e,t),e=t.pendingProps;var l=rn(t,oe.current);en(t,n),l=Ri(null,t,r,e,l,n);var o=Oi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pe(r)?(o=!0,qr(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Pi(t),l.updater=wl,t.stateNode=l,l._reactInternals=t,Fo(t,r,e,n),t=Ao(null,t,r,!0,o,n)):(t.tag=0,U&&o&&ki(t),ie(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ir(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Ad(r),e=Le(r,e),l){case 0:t=$o(null,t,r,e,n);break e;case 1:t=Hu(null,t,r,e,n);break e;case 11:t=Bu(null,t,r,e,n);break e;case 14:t=Wu(null,t,r,Le(r.type,e),n);break e}throw Error(g(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Le(r,l),$o(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Le(r,l),Hu(e,t,r,l,n);case 3:e:{if(Xa(t),e===null)throw Error(g(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ga(e,t),rl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=sn(Error(g(423)),t),t=Qu(e,t,r,n,l);break e}else if(r!==l){l=sn(Error(g(424)),t),t=Qu(e,t,r,n,l);break e}else for(ve=ct(t.stateNode.containerInfo.firstChild),ge=t,U=!0,Re=null,n=_a(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ln(),r===l){t=qe(e,t,n);break e}ie(e,t,r,n)}t=t.child}return t;case 5:return xa(t),e===null&&Mo(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,To(r,l)?i=null:o!==null&&To(r,o)&&(t.flags|=32),Ya(e,t),ie(e,t,i,n),t.child;case 6:return e===null&&Mo(t),null;case 13:return Ga(e,t,n);case 4:return zi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=on(t,null,r,n):ie(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Le(r,l),Bu(e,t,r,l,n);case 7:return ie(e,t,t.pendingProps,n),t.child;case 8:return ie(e,t,t.pendingProps.children,n),t.child;case 12:return ie(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,M(tl,r._currentValue),r._currentValue=i,o!==null)if(De(o.value,i)){if(o.children===l.children&&!de.current){t=qe(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=Xe(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var h=a.pending;h===null?s.next=s:(s.next=h.next,h.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Do(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(g(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Do(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}ie(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,en(t,n),l=Ne(l),r=r(l),t.flags|=1,ie(e,t,r,n),t.child;case 14:return r=t.type,l=Le(r,t.pendingProps),l=Le(r.type,l),Wu(e,t,r,l,n);case 15:return Qa(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Le(r,l),Ir(e,t),t.tag=1,pe(r)?(e=!0,qr(t)):e=!1,en(t,n),ka(t,r,l),Fo(t,r,l,n),Ao(null,t,r,!0,e,n);case 19:return Za(e,t,n);case 22:return Ka(e,t,n)}throw Error(g(156,t.tag))};function dc(e,t){return Us(e,t)}function $d(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ee(e,t,n,r){return new $d(e,t,n,r)}function Wi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ad(e){if(typeof e=="function")return Wi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===si)return 11;if(e===ai)return 14}return 2}function mt(e,t){var n=e.alternate;return n===null?(n=Ee(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $r(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Wi(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ut:return zt(n.children,l,o,t);case ui:i=8,l|=8;break;case io:return e=Ee(12,n,t,l|2),e.elementType=io,e.lanes=o,e;case uo:return e=Ee(13,n,t,l),e.elementType=uo,e.lanes=o,e;case so:return e=Ee(19,n,t,l),e.elementType=so,e.lanes=o,e;case Ss:return xl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ws:i=10;break e;case ks:i=9;break e;case si:i=11;break e;case ai:i=14;break e;case tt:i=16,r=null;break e}throw Error(g(130,e==null?e:typeof e,""))}return t=Ee(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function zt(e,t,n,r){return e=Ee(7,e,r,t),e.lanes=n,e}function xl(e,t,n,r){return e=Ee(22,e,r,t),e.elementType=Ss,e.lanes=n,e.stateNode={isHidden:!1},e}function to(e,t,n){return e=Ee(6,e,null,t),e.lanes=n,e}function no(e,t,n){return t=Ee(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vd(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Il(0),this.expirationTimes=Il(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Il(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Hi(e,t,n,r,l,o,i,u,s){return e=new Vd(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ee(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pi(o),e}function Bd(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vc)}catch(e){console.error(e)}}vc(),ms.exports=ke;var Yd=ms.exports,rs=Yd;lo.createRoot=rs.createRoot,lo.hydrateRoot=rs.hydrateRoot;function Xd(e){let t=ye.useRef(null),[n,r]=ye.useState(!1),[l,o]=ye.useState("");n||r(!0);function i(a){return N.jsx("div",{className:"keyboard-key"+(l==a.modifier?" modifier-pressed":""),"data-tokentype":"unit_modifier",onClick:()=>o(l==a.modifier?"":a.modifier),children:`(${a.modifier}*)`})}function u(a){return N.jsx("div",{className:"keyboard-key",onClick:()=>{e.onUiAction(a.action)},children:a.text})}function s(a){let h=a.token;return a.tokentype=="unit"&&(h=l+a.token),N.jsx("div",{className:"keyboard-key","data-tokentype":a.tokentype,onClick:()=>{o(""),e.onToken(h,a.tokentype)},children:a.text||a.token})}return N.jsxs("div",{className:"unitdc-keyboard",id:"unitdc-keyboard",ref:t,children:[N.jsxs("div",{className:"keyboard-col",children:[N.jsx("div",{className:"keyboard-key","data-tokentype":"operator",children:"c"}),["k","c","d"].map(a=>N.jsx(i,{modifier:a},a)),N.jsx(u,{action:"append_space",text:"␣"})]}),N.jsxs("div",{className:"keyboard-col",children:[N.jsx("div",{className:"keyboard-key","data-tokentype":"operator",children:"d"}),["m","u","n"].map(a=>N.jsx(i,{modifier:a},a)),N.jsx(u,{action:"backspace",text:"←"})]}),N.jsxs("div",{className:"keyboard-col",children:[N.jsx(s,{token:"v",tokentype:"operator"}),["7","4","1","."].map(a=>N.jsx(s,{token:a,tokentype:"literal_num"},a))]}),N.jsxs("div",{className:"keyboard-col",children:[N.jsx(s,{token:"p",tokentype:"operator"}),["8","5","2","0"].map(a=>N.jsx(s,{token:a,tokentype:"literal_num"},a))]}),N.jsxs("div",{className:"keyboard-col",children:[N.jsx(s,{token:"n",tokentype:"operator"}),["9","6","3","e"].map(a=>N.jsx(s,{token:a,tokentype:"literal_num"},a)),N.jsx(u,{action:"append_newline",text:"↩"})]}),N.jsxs("div",{className:"keyboard-col",children:[["f","+","-","*","/"].map(a=>N.jsx(s,{token:a,tokentype:"operator"},a)),N.jsx(u,{action:"submit",text:"✓"})]}),N.jsxs("div",{className:"keyboard-col",children:[N.jsx(s,{token:"r",tokentype:"operator"}),N.jsx(s,{token:"s",tokentype:"operator"}),["1","g","l","iu"].map(a=>N.jsx(s,{token:a,tokentype:"unit",text:`(${a})`},a))]}),N.jsxs("div",{className:"keyboard-col",children:[N.jsx(u,{action:"clear",text:"CLR"}),N.jsx(s,{token:"U",tokentype:"operator"}),["m","mol","M","Da"].map(a=>N.jsx(s,{token:a,tokentype:"unit",text:`(${a})`},a))]})]})}function Gd(e){const t=ye.useRef(null);ye.useEffect(()=>{var l;function r(o){var i;o.key==="Enter"&&o.shiftKey&&(o.preventDefault(),e.onsubmit&&e.onsubmit(((i=t.current)==null?void 0:i.value)||""))}return e.active?((l=t.current)==null||l.focus(),document.addEventListener("keydown",r)):document.removeEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e.active]);const n=()=>{var r;t.current.style.height="auto",t.current.style.height=t.current.scrollHeight+"px",e.onchange&&e.onchange(((r=t.current)==null?void 0:r.value)||"")};return ye.useEffect(()=>(t.current.value=e.text,t.current.addEventListener("input",n),()=>{t.current.removeEventListener("input",n)}),[e.text]),N.jsxs("div",{className:"unitdc-io input"+(e.active?" input-active":""),children:[N.jsxs("label",{className:"prompt",children:[`In [${e.number}]:`," ",N.jsx("span",{className:"submit-hint",children:"Shift-Enter to Submit"})]}),N.jsx("textarea",{className:"input-text",ref:t,readOnly:!e.active})]})}let X;const Qe=new Array(128).fill(void 0);Qe.push(void 0,null,!0,!1);function Fe(e){return Qe[e]}let $n=Qe.length;function Zd(e){e<132||(Qe[e]=$n,$n=e)}function Pn(e){const t=Fe(e);return Zd(e),t}const yc=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yc.decode();let zn=null;function Ar(){return(zn===null||zn.byteLength===0)&&(zn=new Uint8Array(X.memory.buffer)),zn}function ro(e,t){return e=e>>>0,yc.decode(Ar().subarray(e,e+t))}function We(e){$n===Qe.length&&Qe.push(Qe.length+1);const t=$n;return $n=Qe[t],Qe[t]=e,t}function qo(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const l=e.description;return l==null?"Symbol":`Symbol(${l})`}if(t=="function"){const l=e.name;return typeof l=="string"&&l.length>0?`Function(${l})`:"Function"}if(Array.isArray(e)){const l=e.length;let o="[";l>0&&(o+=qo(e[0]));for(let i=1;i1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} -${e.stack}`:r}let rr=0;const Vr=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Jd=typeof Vr.encodeInto=="function"?function(e,t){return Vr.encodeInto(e,t)}:function(e,t){const n=Vr.encode(e);return t.set(n),{read:e.length,written:n.length}};function bo(e,t,n){if(n===void 0){const u=Vr.encode(e),s=t(u.length,1)>>>0;return Ar().subarray(s,s+u.length).set(u),rr=u.length,s}let r=e.length,l=t(r,1)>>>0;const o=Ar();let i=0;for(;i127)break;o[l+i]=u}if(i!==r){i!==0&&(e=e.slice(i)),l=n(l,r,r=i+e.length*3,1)>>>0;const u=Ar().subarray(l+i,l+r),s=Jd(e,u);i+=s.written}return rr=i,l}let Tn=null;function Gt(){return(Tn===null||Tn.byteLength===0)&&(Tn=new Int32Array(X.memory.buffer)),Tn}function qd(e){try{const r=X.__wbindgen_add_to_stack_pointer(-16),l=bo(e,X.__wbindgen_malloc,X.__wbindgen_realloc),o=rr;X.unitdc_input(r,l,o);var t=Gt()[r/4+0],n=Gt()[r/4+1];if(n)throw Pn(t)}finally{X.__wbindgen_add_to_stack_pointer(16)}}function bd(e){X.unitdc_init(We(e))}function ep(e,t){try{return e.apply(this,t)}catch(n){X.__wbindgen_exn_store(We(n))}}async function tp(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function np(){const e={};return e.wbg={},e.wbg.__wbindgen_object_drop_ref=function(t){Pn(t)},e.wbg.__wbindgen_string_new=function(t,n){const r=ro(t,n);return We(r)},e.wbg.__wbindgen_number_new=function(t){return We(t)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=Fe(t);return We(n)},e.wbg.__wbg_set_841ac57cff3d672b=function(t,n,r){Fe(t)[Pn(n)]=Pn(r)},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return We(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const r=Fe(n).stack,l=bo(r,X.__wbindgen_malloc,X.__wbindgen_realloc),o=rr;Gt()[t/4+1]=o,Gt()[t/4+0]=l},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let r,l;try{r=t,l=n,console.error(ro(t,n))}finally{X.__wbindgen_free(r,l,1)}},e.wbg.__wbg_new_898a68150f225f2e=function(){const t=new Array;return We(t)},e.wbg.__wbg_new_b51585de1b234aff=function(){const t=new Object;return We(t)},e.wbg.__wbg_set_502d29070ea18557=function(t,n,r){Fe(t)[n>>>0]=Pn(r)},e.wbg.__wbg_call_4c92f6aec1e1d6e6=function(){return ep(function(t,n,r,l){const o=Fe(t).call(Fe(n),Fe(r),Fe(l));return We(o)},arguments)},e.wbg.__wbindgen_debug_string=function(t,n){const r=qo(Fe(n)),l=bo(r,X.__wbindgen_malloc,X.__wbindgen_realloc),o=rr;Gt()[t/4+1]=o,Gt()[t/4+0]=l},e.wbg.__wbindgen_throw=function(t,n){throw new Error(ro(t,n))},e}function rp(e,t){return X=e.exports,gc.__wbindgen_wasm_module=t,Tn=null,zn=null,X.__wbindgen_start(),X}async function gc(e){if(X!==void 0)return X;typeof e>"u"&&(e=new URL(""+new URL("unitdc_web_bg-6e02e78a.wasm",import.meta.url).href,self.location));const t=np();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await tp(await e,t);return rp(n,r)}function lp(e){return N.jsxs("div",{className:"unitdc-io error",children:[N.jsx("label",{className:"prompt",children:"Error:"}),N.jsx("div",{className:"error-text",children:e.text})]})}function op(e){return N.jsxs("div",{className:"unitdc-io output",children:[N.jsx("label",{className:"prompt",children:"Out:"}),N.jsx("div",{className:"output-text",style:{paddingLeft:"2em"},children:e.quantities.map((t,n)=>`[${e.quantities.length-1-n}]: ${t._str}`).reverse().join(`\r +${e.stack}`:r}let rr=0;const Vr=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Jd=typeof Vr.encodeInto=="function"?function(e,t){return Vr.encodeInto(e,t)}:function(e,t){const n=Vr.encode(e);return t.set(n),{read:e.length,written:n.length}};function bo(e,t,n){if(n===void 0){const u=Vr.encode(e),s=t(u.length,1)>>>0;return Ar().subarray(s,s+u.length).set(u),rr=u.length,s}let r=e.length,l=t(r,1)>>>0;const o=Ar();let i=0;for(;i127)break;o[l+i]=u}if(i!==r){i!==0&&(e=e.slice(i)),l=n(l,r,r=i+e.length*3,1)>>>0;const u=Ar().subarray(l+i,l+r),s=Jd(e,u);i+=s.written}return rr=i,l}let Tn=null;function Gt(){return(Tn===null||Tn.byteLength===0)&&(Tn=new Int32Array(X.memory.buffer)),Tn}function qd(e){try{const r=X.__wbindgen_add_to_stack_pointer(-16),l=bo(e,X.__wbindgen_malloc,X.__wbindgen_realloc),o=rr;X.unitdc_input(r,l,o);var t=Gt()[r/4+0],n=Gt()[r/4+1];if(n)throw Pn(t)}finally{X.__wbindgen_add_to_stack_pointer(16)}}function bd(e){X.unitdc_init(We(e))}function ep(e,t){try{return e.apply(this,t)}catch(n){X.__wbindgen_exn_store(We(n))}}async function tp(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function np(){const e={};return e.wbg={},e.wbg.__wbindgen_object_drop_ref=function(t){Pn(t)},e.wbg.__wbindgen_string_new=function(t,n){const r=ro(t,n);return We(r)},e.wbg.__wbindgen_number_new=function(t){return We(t)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=Fe(t);return We(n)},e.wbg.__wbg_set_841ac57cff3d672b=function(t,n,r){Fe(t)[Pn(n)]=Pn(r)},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return We(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const r=Fe(n).stack,l=bo(r,X.__wbindgen_malloc,X.__wbindgen_realloc),o=rr;Gt()[t/4+1]=o,Gt()[t/4+0]=l},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let r,l;try{r=t,l=n,console.error(ro(t,n))}finally{X.__wbindgen_free(r,l,1)}},e.wbg.__wbg_new_898a68150f225f2e=function(){const t=new Array;return We(t)},e.wbg.__wbg_new_b51585de1b234aff=function(){const t=new Object;return We(t)},e.wbg.__wbg_set_502d29070ea18557=function(t,n,r){Fe(t)[n>>>0]=Pn(r)},e.wbg.__wbg_call_4c92f6aec1e1d6e6=function(){return ep(function(t,n,r,l){const o=Fe(t).call(Fe(n),Fe(r),Fe(l));return We(o)},arguments)},e.wbg.__wbindgen_debug_string=function(t,n){const r=qo(Fe(n)),l=bo(r,X.__wbindgen_malloc,X.__wbindgen_realloc),o=rr;Gt()[t/4+1]=o,Gt()[t/4+0]=l},e.wbg.__wbindgen_throw=function(t,n){throw new Error(ro(t,n))},e}function rp(e,t){return X=e.exports,gc.__wbindgen_wasm_module=t,Tn=null,zn=null,X.__wbindgen_start(),X}async function gc(e){if(X!==void 0)return X;typeof e>"u"&&(e=new URL(""+new URL("unitdc_web_bg-3880ae7d.wasm",import.meta.url).href,self.location));const t=np();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await tp(await e,t);return rp(n,r)}function lp(e){return N.jsxs("div",{className:"unitdc-io error",children:[N.jsx("label",{className:"prompt",children:"Error:"}),N.jsx("div",{className:"error-text",children:e.text})]})}function op(e){return N.jsxs("div",{className:"unitdc-io output",children:[N.jsx("label",{className:"prompt",children:"Out:"}),N.jsx("div",{className:"output-text",style:{paddingLeft:"2em"},children:e.quantities.map((t,n)=>`[${e.quantities.length-1-n}]: ${t._str}`).reverse().join(`\r `)})]})}function ip(){const[e,t]=ye.useState(0);return()=>t(()=>e+1)}function up(e,t){switch(t.type){case"add":return[...e,t.cell];case"updateText":const n=[...e];return n[t.index].text=t.text,n;default:throw new Error}}function sp(){const[e,t]=ye.useReducer(up,[]),[n,r]=ye.useState(!1),[l,o]=ye.useState(""),i=ip(),u=p=>{p.forEach(v=>{t({type:"add",cell:v})})},s=()=>e.filter(p=>p.type==="input").slice(-1)[0],a=(p,v)=>{let w=s();l!=v&&(w.text+=" "),v==="unit"&&(p="("+p+")"),w.text+=p,o(v),i()},h=(p,v)=>{p==="quantity"?u([{type:"output",quantity:[v]}]):p==="quantity_list"?u([{type:"output",quantity:v}]):p==="message"&&u([{type:"message",text:v}])},m=()=>{let p=!1,v=s().text;console.log("submit",v);try{qd(v),p=!0}catch(w){u([{type:"error",text:w.toString()}])}u([{type:"input",text:p?"":v}])};return n||(r(!0),gc().then(()=>{bd(h),u([{type:"input",text:""}])})),N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"unitdc-container",children:[N.jsxs("h1",{style:{whiteSpace:"nowrap"},children:["UnitDC",N.jsx("span",{style:{fontStyle:"italic",fontWeight:"lighter",fontSize:"smaller"},id:"unitdc-description",children:"Unit-aware Desk Calculator"})]}),N.jsx("div",{id:"unitdc-dialog",children:e.map((p,v)=>{switch(p.type){case"output":return N.jsx(op,{quantities:p.quantity},v);case"input":return N.jsx(Gd,{number:v,text:p.text,active:v==e.length-1,onchange:w=>{console.log("onchange",w),t({type:"updateText",index:v,text:w})},onsubmit:m},v);case"error":return N.jsx(lp,{text:p.text},v);case"message":return N.jsx("pre",{children:p.text},v)}})}),N.jsx("div",{className:"unitdc-keyboard-spacer"})]}),N.jsx(Xd,{onToken:a,onUiAction:p=>{switch(p){case"append_space":s().text+=" ",i();break;case"append_newline":s().text+=` `,i();break;case"clear":s().text="",i();break;case"backspace":s().text=s().text.slice(0,-1),i();break;case"submit":m();break}}})]})}lo.createRoot(document.getElementById("root")).render(N.jsx(Ic.StrictMode,{children:N.jsx(sp,{})})); diff --git a/assets/unitdc_web_bg-6e02e78a.wasm b/assets/unitdc_web_bg-3880ae7d.wasm similarity index 99% rename from assets/unitdc_web_bg-6e02e78a.wasm rename to assets/unitdc_web_bg-3880ae7d.wasm index b8de277..5f7514c 100644 Binary files a/assets/unitdc_web_bg-6e02e78a.wasm and b/assets/unitdc_web_bg-3880ae7d.wasm differ diff --git a/index.html b/index.html index 4072a8a..6e2638d 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ UnitDC - Unit-aware Desk Calculator - +