"use strict";(()=>{var U0=Object.create;var gs=Object.defineProperty;var q0=Object.getOwnPropertyDescriptor;var B0=Object.getOwnPropertyNames;var k0=Object.getPrototypeOf,Y0=Object.prototype.hasOwnProperty;var Qe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(l){throw e=0,l}};var L0=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of B0(e))!Y0.call(t,a)&&a!==l&&gs(t,a,{get:()=>e[a],enumerable:!(n=q0(e,a))||n.enumerable});return t};var Ei=(t,e,l)=>(l=t!=null?U0(k0(t)):{},L0(e||!t||!t.__esModule?gs(l,"default",{value:t,enumerable:!0}):l,t));var Ms=Qe(X=>{"use strict";var zo=Symbol.for("react.transitional.element"),X0=Symbol.for("react.portal"),Q0=Symbol.for("react.fragment"),V0=Symbol.for("react.strict_mode"),Z0=Symbol.for("react.profiler"),K0=Symbol.for("react.consumer"),$0=Symbol.for("react.context"),J0=Symbol.for("react.forward_ref"),W0=Symbol.for("react.suspense"),F0=Symbol.for("react.memo"),As=Symbol.for("react.lazy"),P0=Symbol.for("react.activity"),vs=Symbol.iterator;function I0(t){return t===null||typeof t!="object"?null:(t=vs&&t[vs]||t["@@iterator"],typeof t=="function"?t:null)}var xs={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ds=Object.assign,Es={};function En(t,e,l){this.props=t,this.context=e,this.refs=Es,this.updater=l||xs}En.prototype.isReactComponent={};En.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};En.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Os(){}Os.prototype=En.prototype;function Ao(t,e,l){this.props=t,this.context=e,this.refs=Es,this.updater=l||xs}var xo=Ao.prototype=new Os;xo.constructor=Ao;Ds(xo,En.prototype);xo.isPureReactComponent=!0;var Ss=Array.isArray;function To(){}var ft={H:null,A:null,T:null,S:null},Cs=Object.prototype.hasOwnProperty;function Do(t,e,l){var n=l.ref;return{$$typeof:zo,type:t,key:e,ref:n!==void 0?n:null,props:l}}function ty(t,e){return Do(t.type,e,t.props)}function Eo(t){return typeof t=="object"&&t!==null&&t.$$typeof===zo}function ey(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(l){return e[l]})}var Ts=/\/+/g;function So(t,e){return typeof t=="object"&&t!==null&&t.key!=null?ey(""+t.key):e.toString(36)}function ly(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(To,To):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Dn(t,e,l,n,a){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var u=!1;if(t===null)u=!0;else switch(i){case"bigint":case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case zo:case X0:u=!0;break;case As:return u=t._init,Dn(u(t._payload),e,l,n,a)}}if(u)return a=a(t),u=n===""?"."+So(t,0):n,Ss(a)?(l="",u!=null&&(l=u.replace(Ts,"$&/")+"/"),Dn(a,e,l,"",function(r){return r})):a!=null&&(Eo(a)&&(a=ty(a,l+(a.key==null||t&&t.key===a.key?"":(""+a.key).replace(Ts,"$&/")+"/")+u)),e.push(a)),1;u=0;var o=n===""?".":n+":";if(Ss(t))for(var c=0;c{"use strict";Ns.exports=Ms()});var ks=Qe(bt=>{"use strict";function No(t,e){var l=t.length;t.push(e);t:for(;0>>1,a=t[n];if(0>>1;nMi(o,l))cMi(r,o)?(t[n]=r,t[c]=l,n=c):(t[n]=o,t[u]=l,n=u);else if(cMi(r,l))t[n]=r,t[c]=l,n=c;else break t}}return e}function Mi(t,e){var l=t.sortIndex-e.sortIndex;return l!==0?l:t.id-e.id}bt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Rs=performance,bt.unstable_now=function(){return Rs.now()}):(Oo=Date,js=Oo.now(),bt.unstable_now=function(){return Oo.now()-js});var Rs,Oo,js,Ie=[],Al=[],iy=1,De=null,$t=3,Ro=!1,Sa=!1,Ta=!1,jo=!1,_s=typeof setTimeout=="function"?setTimeout:null,Hs=typeof clearTimeout=="function"?clearTimeout:null,ws=typeof setImmediate<"u"?setImmediate:null;function Ni(t){for(var e=Ve(Al);e!==null;){if(e.callback===null)Ri(Al);else if(e.startTime<=t)Ri(Al),e.sortIndex=e.expirationTime,No(Ie,e);else break;e=Ve(Al)}}function wo(t){if(Ta=!1,Ni(t),!Sa)if(Ve(Ie)!==null)Sa=!0,Cn||(Cn=!0,On());else{var e=Ve(Al);e!==null&&Go(wo,e.startTime-t)}}var Cn=!1,za=-1,Us=5,qs=-1;function Bs(){return jo?!0:!(bt.unstable_now()-qst&&Bs());){var n=De.callback;if(typeof n=="function"){De.callback=null,$t=De.priorityLevel;var a=n(De.expirationTime<=t);if(t=bt.unstable_now(),typeof a=="function"){De.callback=a,Ni(t),e=!0;break e}De===Ve(Ie)&&Ri(Ie),Ni(t)}else Ri(Ie);De=Ve(Ie)}if(De!==null)e=!0;else{var i=Ve(Al);i!==null&&Go(wo,i.startTime-t),e=!1}}break t}finally{De=null,$t=l,Ro=!1}e=void 0}}finally{e?On():Cn=!1}}}var On;typeof ws=="function"?On=function(){ws(Co)}:typeof MessageChannel<"u"?(Mo=new MessageChannel,Gs=Mo.port2,Mo.port1.onmessage=Co,On=function(){Gs.postMessage(null)}):On=function(){_s(Co,0)};var Mo,Gs;function Go(t,e){za=_s(function(){t(bt.unstable_now())},e)}bt.unstable_IdlePriority=5;bt.unstable_ImmediatePriority=1;bt.unstable_LowPriority=4;bt.unstable_NormalPriority=3;bt.unstable_Profiling=null;bt.unstable_UserBlockingPriority=2;bt.unstable_cancelCallback=function(t){t.callback=null};bt.unstable_forceFrameRate=function(t){0>t||125n?(t.sortIndex=l,No(Al,t),Ve(Ie)===null&&t===Ve(Al)&&(Ta?(Hs(za),za=-1):Ta=!0,Go(wo,l-n))):(t.sortIndex=a,No(Ie,t),Sa||Ro||(Sa=!0,Cn||(Cn=!0,On()))),t};bt.unstable_shouldYield=Bs;bt.unstable_wrapCallback=function(t){var e=$t;return function(){var l=$t;$t=e;try{return t.apply(this,arguments)}finally{$t=l}}}});var Ls=Qe((U1,Ys)=>{"use strict";Ys.exports=ks()});var Qs=Qe(ee=>{"use strict";var uy=Ci();function Xs(t){var e="https://react.dev/errors/"+t;if(1{"use strict";function Vs(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vs)}catch(t){console.error(t)}}Vs(),Zs.exports=Qs()});var uh=Qe(no=>{"use strict";var wt=Ls(),Sm=Ci(),ry=Ks();function A(t){var e="https://react.dev/errors/"+t;if(1_n||(t.current=vc[_n],vc[_n]=null,_n--)}function rt(t,e){_n++,vc[_n]=t.current,t.current=e}var Je=We(null),Ja=We(null),Hl=We(null),mu=We(null);function du(t,e){switch(rt(Hl,e),rt(Ja,t),rt(Je,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?nm(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=nm(e),t=Zp(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}qt(Je),rt(Je,t)}function In(){qt(Je),qt(Ja),qt(Hl)}function Sc(t){t.memoizedState!==null&&rt(mu,t);var e=Je.current,l=Zp(e,t.type);e!==l&&(rt(Ja,t),rt(Je,l))}function pu(t){Ja.current===t&&(qt(Je),qt(Ja)),mu.current===t&&(qt(mu),ui._currentValue=an)}var _o,Ws;function tn(t){if(_o===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);_o=e&&e[1]||"",Ws=-1)":-1a||c[n]!==r[a]){var s=` `+c[n].replace(" at new "," at ");return t.displayName&&s.includes("")&&(s=s.replace("",t.displayName)),s}while(1<=n&&0<=a);break}}}finally{Ho=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?tn(l):""}function py(t,e){switch(t.tag){case 26:case 27:case 5:return tn(t.type);case 16:return tn("Lazy");case 13:return t.child!==e&&e!==null?tn("Suspense Fallback"):tn("Suspense");case 19:return tn("SuspenseList");case 0:case 15:return Uo(t.type,!1);case 11:return Uo(t.type.render,!1);case 1:return Uo(t.type,!0);case 31:return tn("Activity");default:return""}}function Fs(t){try{var e="",l=null;do e+=py(t,l),l=t,t=t.return;while(t);return e}catch(n){return` Error generating stack: `+n.message+` `+n.stack}}var Tc=Object.prototype.hasOwnProperty,fr=wt.unstable_scheduleCallback,qo=wt.unstable_cancelCallback,hy=wt.unstable_shouldYield,yy=wt.unstable_requestPaint,ye=wt.unstable_now,by=wt.unstable_getCurrentPriorityLevel,Om=wt.unstable_ImmediatePriority,Cm=wt.unstable_UserBlockingPriority,hu=wt.unstable_NormalPriority,gy=wt.unstable_LowPriority,Mm=wt.unstable_IdlePriority,vy=wt.log,Sy=wt.unstable_setDisableYieldValue,si=null,be=null;function Rl(t){if(typeof vy=="function"&&Sy(t),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(si,t)}catch{}}var ge=Math.clz32?Math.clz32:Ay,Ty=Math.log,zy=Math.LN2;function Ay(t){return t>>>=0,t===0?32:31-(Ty(t)/zy|0)|0}var Gi=256,_i=262144,Hi=4194304;function en(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Yu(t,e,l){var n=t.pendingLanes;if(n===0)return 0;var a=0,i=t.suspendedLanes,u=t.pingedLanes;t=t.warmLanes;var o=n&134217727;return o!==0?(n=o&~i,n!==0?a=en(n):(u&=o,u!==0?a=en(u):l||(l=o&~t,l!==0&&(a=en(l))))):(o=n&~i,o!==0?a=en(o):u!==0?a=en(u):l||(l=n&~t,l!==0&&(a=en(l)))),a===0?0:e!==0&&e!==a&&(e&i)===0&&(i=a&-a,l=e&-e,i>=l||i===32&&(l&4194048)!==0)?e:a}function fi(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function xy(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nm(){var t=Hi;return Hi<<=1,(Hi&62914560)===0&&(Hi=4194304),t}function Bo(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function mi(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Dy(t,e,l,n,a,i){var u=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var o=t.entanglements,c=t.expirationTimes,r=t.hiddenUpdates;for(l=u&~l;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ry=/[\n"\\]/g;function Ne(t){return t.replace(Ry,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function xc(t,e,l,n,a,i,u,o){t.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?t.type=u:t.removeAttribute("type"),e!=null?u==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Oe(e)):t.value!==""+Oe(e)&&(t.value=""+Oe(e)):u!=="submit"&&u!=="reset"||t.removeAttribute("value"),e!=null?Dc(t,u,Oe(e)):l!=null?Dc(t,u,Oe(l)):n!=null&&t.removeAttribute("value"),a==null&&i!=null&&(t.defaultChecked=!!i),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+Oe(o):t.removeAttribute("name")}function Bm(t,e,l,n,a,i,u,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.type=i),e!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||e!=null)){Ac(t);return}l=l!=null?""+Oe(l):"",e=e!=null?""+Oe(e):l,o||e===t.value||(t.value=e),t.defaultValue=e}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=o?t.checked:!!n,t.defaultChecked=!!n,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.name=u),Ac(t)}function Dc(t,e,l){e==="number"&&yu(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Kn(t,e,l,n){if(t=t.options,e){e={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oc=!1;if(dl)try{Mn={},Object.defineProperty(Mn,"passive",{get:function(){Oc=!0}}),window.addEventListener("test",Mn,Mn),window.removeEventListener("test",Mn,Mn)}catch{Oc=!1}var Mn,jl=null,br=null,Ii=null;function Qm(){if(Ii)return Ii;var t,e=br,l=e.length,n,a="value"in jl?jl.value:jl.textContent,i=a.length;for(t=0;t=Ha),rf=" ",sf=!1;function Zm(t,e){switch(t){case"keyup":return ib.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Km(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qn=!1;function ob(t,e){switch(t){case"compositionend":return Km(e);case"keypress":return e.which!==32?null:(sf=!0,rf);case"textInput":return t=e.data,t===rf&&sf?null:t;default:return null}}function cb(t,e){if(qn)return t==="compositionend"||!vr&&Zm(t,e)?(t=Qm(),Ii=br=jl=null,qn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:l,offset:e-t};t=n}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=pf(l)}}function Fm(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Fm(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Pm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=yu(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=yu(t.document)}return e}function Sr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var yb=dl&&"documentMode"in document&&11>=document.documentMode,Bn=null,Cc=null,qa=null,Mc=!1;function yf(t,e,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mc||Bn==null||Bn!==yu(n)||(n=Bn,"selectionStart"in n&&Sr(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qa&&Pa(qa,n)||(qa=n,n=Gu(Cc,"onSelect"),0>=u,a-=u,Ze=1<<32-ge(e)+a|l<N?(C=x,x=null):C=x.sibling;var j=f(y,x,b[N],S);if(j===null){x===null&&(x=C);break}t&&x&&j.alternate===null&&e(y,x),p=i(j,p,N),w===null?D=j:w.sibling=j,w=j,x=C}if(N===b.length)return l(y,x),W&&il(y,N),D;if(x===null){for(;NN?(C=x,x=null):C=x.sibling;var ct=f(y,x,j.value,S);if(ct===null){x===null&&(x=C);break}t&&x&&ct.alternate===null&&e(y,x),p=i(ct,p,N),w===null?D=ct:w.sibling=ct,w=ct,x=C}if(j.done)return l(y,x),W&&il(y,N),D;if(x===null){for(;!j.done;N++,j=b.next())j=m(y,j.value,S),j!==null&&(p=i(j,p,N),w===null?D=j:w.sibling=j,w=j);return W&&il(y,N),D}for(x=n(x);!j.done;N++,j=b.next())j=d(x,y,N,j.value,S),j!==null&&(t&&j.alternate!==null&&x.delete(j.key===null?N:j.key),p=i(j,p,N),w===null?D=j:w.sibling=j,w=j);return t&&x.forEach(function(xe){return e(y,xe)}),W&&il(y,N),D}function T(y,p,b,S){if(typeof b=="object"&&b!==null&&b.type===Gn&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case wi:t:{for(var D=b.key;p!==null;){if(p.key===D){if(D=b.type,D===Gn){if(p.tag===7){l(y,p.sibling),S=a(p,b.props.children),S.return=y,y=S;break t}}else if(p.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===Dl&&ln(D)===p.type){l(y,p.sibling),S=a(p,b.props),Ea(S,b),S.return=y,y=S;break t}l(y,p);break}else e(y,p);p=p.sibling}b.type===Gn?(S=un(b.props.children,y.mode,S,b.key),S.return=y,y=S):(S=eu(b.type,b.key,b.props,null,y.mode,S),Ea(S,b),S.return=y,y=S)}return u(y);case Ra:t:{for(D=b.key;p!==null;){if(p.key===D)if(p.tag===4&&p.stateNode.containerInfo===b.containerInfo&&p.stateNode.implementation===b.implementation){l(y,p.sibling),S=a(p,b.children||[]),S.return=y,y=S;break t}else{l(y,p);break}else e(y,p);p=p.sibling}S=Ko(b,y.mode,S),S.return=y,y=S}return u(y);case Dl:return b=ln(b),T(y,p,b,S)}if(ja(b))return h(y,p,b,S);if(xa(b)){if(D=xa(b),typeof D!="function")throw Error(A(150));return b=D.call(b),v(y,p,b,S)}if(typeof b.then=="function")return T(y,p,Li(b),S);if(b.$$typeof===ol)return T(y,p,Yi(y,b),S);Xi(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,p!==null&&p.tag===6?(l(y,p.sibling),S=a(p,b),S.return=y,y=S):(l(y,p),S=Zo(b,y.mode,S),S.return=y,y=S),u(y)):l(y,p)}return function(y,p,b,S){try{ei=0;var D=T(y,p,b,S);return Wn=null,D}catch(x){if(x===da||x===Ku)throw x;var w=pe(29,x,null,y.mode);return w.lanes=S,w.return=y,w}}}var mn=dd(!0),pd=dd(!1),El=!1;function Mr(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ql(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Bl(t,e,l){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(I&2)!==0){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,e=gu(t),id(t,null,l),e}return Zu(t,n,e,l),gu(t)}function ka(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,jm(t,l)}}function Jo(t,e){var l=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var u={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?a=i=u:i=i.next=u,l=l.next}while(l!==null);i===null?a=i=e:i=i.next=e}else a=i=e;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var Uc=!1;function Ya(){if(Uc){var t=Jn;if(t!==null)throw t}}function La(t,e,l,n){Uc=!1;var a=t.updateQueue;El=!1;var i=a.firstBaseUpdate,u=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,r=c.next;c.next=null,u===null?i=r:u.next=r,u=c;var s=t.alternate;s!==null&&(s=s.updateQueue,o=s.lastBaseUpdate,o!==u&&(o===null?s.firstBaseUpdate=r:o.next=r,s.lastBaseUpdate=c))}if(i!==null){var m=a.baseState;u=0,s=r=c=null,o=i;do{var f=o.lane&-536870913,d=f!==o.lane;if(d?(J&f)===f:(n&f)===f){f!==0&&f===la&&(Uc=!0),s!==null&&(s=s.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});t:{var h=t,v=o;f=e;var T=l;switch(v.tag){case 1:if(h=v.payload,typeof h=="function"){m=h.call(T,m,f);break t}m=h;break t;case 3:h.flags=h.flags&-65537|128;case 0:if(h=v.payload,f=typeof h=="function"?h.call(T,m,f):h,f==null)break t;m=pt({},m,f);break t;case 2:El=!0}}f=o.callback,f!==null&&(t.flags|=64,d&&(t.flags|=8192),d=a.callbacks,d===null?a.callbacks=[f]:d.push(f))}else d={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},s===null?(r=s=d,c=m):s=s.next=d,u|=f;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;d=o,o=d.next,d.next=null,a.lastBaseUpdate=d,a.shared.pending=null}}while(!0);s===null&&(c=m),a.baseState=c,a.firstBaseUpdate=r,a.lastBaseUpdate=s,i===null&&(a.shared.lanes=0),$l|=u,t.lanes=u,t.memoizedState=m}}function hd(t,e){if(typeof t!="function")throw Error(A(191,t));t.call(e)}function yd(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;ti?i:8;var u=L.T,o={};L.T=o,Lr(t,!1,e,l);try{var c=a(),r=L.S;if(r!==null&&r(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var s=Db(c,n);Xa(t,e,s,ve(t))}else Xa(t,e,n,ve(t))}catch(m){Xa(t,e,{then:function(){},status:"rejected",reason:m},ve())}finally{tt.p=i,u!==null&&o.types!==null&&(u.types=o.types),L.T=u}}function Rb(){}function Lc(t,e,l,n){if(t.tag!==5)throw Error(A(476));var a=Yd(t).queue;kd(t,a,e,an,l===null?Rb:function(){return Ld(t),l(n)})}function Yd(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:an,baseState:an,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:an},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Ld(t){var e=Yd(t);e.next===null&&(e=t.alternate.memoizedState),Xa(t,e.next.queue,{},ve())}function Yr(){return Lt(ui)}function Xd(){return Dt().memoizedState}function Qd(){return Dt().memoizedState}function jb(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=ve();t=ql(l);var n=Bl(e,t,l);n!==null&&(re(n,e,l),ka(n,e,l)),e={cache:Er()},t.payload=e;return}e=e.return}}function wb(t,e,l){var n=ve();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fu(t)?Zd(e,l):(l=zr(t,e,l,n),l!==null&&(re(l,t,n),Kd(l,e,n)))}function Vd(t,e,l){var n=ve();Xa(t,e,l,n)}function Xa(t,e,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fu(t))Zd(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var u=e.lastRenderedState,o=i(u,l);if(a.hasEagerState=!0,a.eagerState=o,Se(o,u))return Zu(t,e,a,0),ot===null&&Vu(),!1}catch{}if(l=zr(t,e,a,n),l!==null)return re(l,t,n),Kd(l,e,n),!0}return!1}function Lr(t,e,l,n){if(n={lane:2,revertLane:Fr(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fu(t)){if(e)throw Error(A(479))}else e=zr(t,l,n,2),e!==null&&re(e,t,2)}function Fu(t){var e=t.alternate;return t===Q||e!==null&&e===Q}function Zd(t,e){Fn=xu=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function Kd(t,e,l){if((l&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,jm(t,l)}}var ni={readContext:Lt,use:Ju,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};ni.useEffectEvent=Tt;var $d={readContext:Lt,use:Ju,useCallback:function(t,e){return le().memoizedState=[t,e===void 0?null:e],t},useContext:Lt,useEffect:Rf,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,au(4194308,4,_d.bind(null,e,t),l)},useLayoutEffect:function(t,e){return au(4194308,4,t,e)},useInsertionEffect:function(t,e){au(4,2,t,e)},useMemo:function(t,e){var l=le();e=e===void 0?null:e;var n=t();if(dn){Rl(!0);try{t()}finally{Rl(!1)}}return l.memoizedState=[n,e],n},useReducer:function(t,e,l){var n=le();if(l!==void 0){var a=l(e);if(dn){Rl(!0);try{l(e)}finally{Rl(!1)}}}else a=e;return n.memoizedState=n.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},n.queue=t,t=t.dispatch=wb.bind(null,Q,t),[n.memoizedState,t]},useRef:function(t){var e=le();return t={current:t},e.memoizedState=t},useState:function(t){t=kc(t);var e=t.queue,l=Vd.bind(null,Q,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:Br,useDeferredValue:function(t,e){var l=le();return kr(l,t,e)},useTransition:function(){var t=kc(!1);return t=kd.bind(null,Q,t.queue,!0,!1),le().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var n=Q,a=le();if(W){if(l===void 0)throw Error(A(407));l=l()}else{if(l=e(),ot===null)throw Error(A(349));(J&127)!==0||Td(n,e,l)}a.memoizedState=l;var i={value:l,getSnapshot:e};return a.queue=i,Rf(Ad.bind(null,n,i,t),[t]),n.flags|=2048,aa(9,{destroy:void 0},zd.bind(null,n,i,l,e),null),l},useId:function(){var t=le(),e=ot.identifierPrefix;if(W){var l=Ke,n=Ze;l=(n&~(1<<32-ge(n)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Du++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?u.createElement("select",{is:n.is}):u.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?u.createElement(a,{is:n.is}):u.createElement(a)}}i[kt]=e,i[se]=n;t:for(u=e.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break t;for(;u.sibling===null;){if(u.return===null||u.return===e)break t;u=u.return}u.sibling.return=u.return,u=u.sibling}e.stateNode=i;t:switch(Xt(i,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break t;case"img":n=!0;break t;default:n=!1}n&&el(e)}}return mt(e),nc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&el(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(A(166));if(t=Hl.current,Nn(e)){if(t=e.stateNode,l=e.memoizedProps,n=null,a=Yt,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}t[kt]=e,t=!!(t.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Vp(t.nodeValue,l)),t||Zl(e,!0)}else t=_u(t).createTextNode(n),t[kt]=e,e.stateNode=t}return mt(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(n=Nn(e),l!==null){if(t===null){if(!n)throw Error(A(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(A(557));t[kt]=e}else sn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;mt(e),t=!1}else l=$o(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(de(e),e):(de(e),null);if((e.flags&128)!==0)throw Error(A(558))}return mt(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=Nn(e),n!==null&&n.dehydrated!==null){if(t===null){if(!a)throw Error(A(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(A(317));a[kt]=e}else sn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;mt(e),a=!1}else a=$o(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(de(e),e):(de(e),null)}return de(e),(e.flags&128)!==0?(e.lanes=l,e):(l=n!==null,t=t!==null&&t.memoizedState!==null,l&&(n=e.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==a&&(n.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),Qi(e,e.updateQueue),mt(e),null);case 4:return In(),t===null&&Pr(e.stateNode.containerInfo),mt(e),null;case 10:return fl(e.type),mt(e),null;case 19:if(qt(xt),n=e.memoizedState,n===null)return mt(e),null;if(a=(e.flags&128)!==0,i=n.rendering,i===null)if(a)Oa(n,!1);else{if(zt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=Au(t),i!==null){for(e.flags|=128,Oa(n,!1),t=i.updateQueue,e.updateQueue=t,Qi(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)ud(l,t),l=l.sibling;return rt(xt,xt.current&1|2),W&&il(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&ye()>Mu&&(e.flags|=128,a=!0,Oa(n,!1),e.lanes=4194304)}else{if(!a)if(t=Au(i),t!==null){if(e.flags|=128,a=!0,t=t.updateQueue,e.updateQueue=t,Qi(e,t),Oa(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!W)return mt(e),null}else 2*ye()-n.renderingStartTime>Mu&&l!==536870912&&(e.flags|=128,a=!0,Oa(n,!1),e.lanes=4194304);n.isBackwards?(i.sibling=e.child,e.child=i):(t=n.last,t!==null?t.sibling=i:e.child=i,n.last=i)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=ye(),t.sibling=null,l=xt.current,rt(xt,a?l&1|2:l&1),W&&il(e,n.treeForkCount),t):(mt(e),null);case 22:case 23:return de(e),Nr(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(l&536870912)!==0&&(e.flags&128)===0&&(mt(e),e.subtreeFlags&6&&(e.flags|=8192)):mt(e),l=e.updateQueue,l!==null&&Qi(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==l&&(e.flags|=2048),t!==null&&qt(on),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),fl(Ct),mt(e),null;case 25:return null;case 30:return null}throw Error(A(156,e.tag))}function qb(t,e){switch(Dr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return fl(Ct),In(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return pu(e),null;case 31:if(e.memoizedState!==null){if(de(e),e.alternate===null)throw Error(A(340));sn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(de(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(A(340));sn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return qt(xt),null;case 4:return In(),null;case 10:return fl(e.type),null;case 22:case 23:return de(e),Nr(),t!==null&&qt(on),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return fl(Ct),null;case 25:return null;default:return null}}function up(t,e){switch(Dr(e),e.tag){case 3:fl(Ct),In();break;case 26:case 27:case 5:pu(e);break;case 4:In();break;case 31:e.memoizedState!==null&&de(e);break;case 13:de(e);break;case 19:qt(xt);break;case 10:fl(e.type);break;case 22:case 23:de(e),Nr(),t!==null&&qt(on);break;case 24:fl(Ct)}}function bi(t,e){try{var l=e.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&t)===t){n=void 0;var i=l.create,u=l.inst;n=i(),u.destroy=n}l=l.next}while(l!==a)}}catch(o){lt(e,e.return,o)}}function Kl(t,e,l){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&t)===t){var u=n.inst,o=u.destroy;if(o!==void 0){u.destroy=void 0,a=e;var c=l,r=o;try{r()}catch(s){lt(a,c,s)}}}n=n.next}while(n!==i)}}catch(s){lt(e,e.return,s)}}function op(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{yd(e,l)}catch(n){lt(t,t.return,n)}}}function cp(t,e,l){l.props=pn(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(n){lt(t,e,n)}}function Qa(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof l=="function"?t.refCleanup=l(n):l.current=n}}catch(a){lt(t,e,a)}}function $e(t,e){var l=t.ref,n=t.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){lt(t,e,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){lt(t,e,a)}else l.current=null}function rp(t){var e=t.type,l=t.memoizedProps,n=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break t;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){lt(t,t.return,a)}}function ac(t,e,l){try{var n=t.stateNode;ag(n,t.type,l,e),n[se]=e}catch(a){lt(t,t.return,a)}}function sp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Wl(t.type)||t.tag===4}function ic(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||sp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Wl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Kc(t,e,l){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=cl));else if(n!==4&&(n===27&&Wl(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(Kc(t,e,l),t=t.sibling;t!==null;)Kc(t,e,l),t=t.sibling}function Cu(t,e,l){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(n!==4&&(n===27&&Wl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Cu(t,e,l),t=t.sibling;t!==null;)Cu(t,e,l),t=t.sibling}function fp(t){var e=t.stateNode,l=t.memoizedProps;try{for(var n=t.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);Xt(e,n,l),e[kt]=t,e[se]=l}catch(i){lt(t,t.return,i)}}var ul=!1,Ot=!1,uc=!1,Qf=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function Bb(t,e){if(t=t.containerInfo,tr=Bu,t=Pm(t),Sr(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break t}var u=0,o=-1,c=-1,r=0,s=0,m=t,f=null;e:for(;;){for(var d;m!==l||a!==0&&m.nodeType!==3||(o=u+a),m!==i||n!==0&&m.nodeType!==3||(c=u+n),m.nodeType===3&&(u+=m.nodeValue.length),(d=m.firstChild)!==null;)f=m,m=d;for(;;){if(m===t)break e;if(f===l&&++r===a&&(o=u),f===i&&++s===n&&(c=u),(d=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=d}l=o===-1||c===-1?null:{start:o,end:c}}else l=null}l=l||{start:0,end:0}}else l=null;for(er={focusedElem:t,selectionRange:l},Bu=!1,Ht=e;Ht!==null;)if(e=Ht,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ht=t;else for(;Ht!==null;){switch(e=Ht,i=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l title"))),Xt(i,n,l),i[kt]=t,Ut(i),n=i;break t;case"link":var u=mm("link","href",a).get(n+(l.href||""));if(u){for(var o=0;oT&&(u=T,T=v,v=u);var y=hf(o,v),p=hf(o,T);if(y&&p&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==p.node||d.focusOffset!==p.offset)){var b=m.createRange();b.setStart(y.node,y.offset),d.removeAllRanges(),v>T?(d.addRange(b),d.extend(p.node,p.offset)):(b.setEnd(p.node,p.offset),d.addRange(b))}}}}for(m=[],d=o;d=d.parentNode;)d.nodeType===1&&m.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;ol?32:l,L.T=null,l=Wc,Wc=null;var i=Yl,u=ml;if(jt=0,ua=Yl=null,ml=0,(I&6)!==0)throw Error(A(331));var o=I;if(I|=4,zp(i.current),vp(i,i.current,u,l),I=o,gi(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(si,i)}catch{}return!0}finally{tt.p=a,L.T=n,Up(t,e)}}function $f(t,e,l){e=Re(l,e),e=Qc(t.stateNode,e,2),t=Bl(t,e,2),t!==null&&(mi(t,2),Fe(t))}function lt(t,e,l){if(t.tag===3)$f(t,t,l);else for(;e!==null;){if(e.tag===3){$f(e,t,l);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(kl===null||!kl.has(n))){t=Re(l,t),l=Id(2),n=Bl(e,l,2),n!==null&&(tp(l,n,e,t),mi(n,2),Fe(n));break}}e=e.return}}function cc(t,e,l){var n=t.pingCache;if(n===null){n=t.pingCache=new Lb;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(l)||($r=!0,a.add(l),t=Kb.bind(null,t,e,l),e.then(t,t))}function Kb(t,e,l){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ot===t&&(J&l)===l&&(zt===4||zt===3&&(J&62914560)===J&&300>ye()-Pu?(I&2)===0&&oa(t,0):Jr|=l,ia===J&&(ia=0)),Fe(t)}function Bp(t,e){e===0&&(e=Nm()),t=gn(t,e),t!==null&&(mi(t,e),Fe(t))}function $b(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),Bp(t,l)}function Jb(t,e){var l=0;switch(t.tag){case 31:case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(A(314))}n!==null&&n.delete(e),Bp(t,l)}function Wb(t,e){return fr(t,e)}var ju=null,wn=null,Pc=!1,wu=!1,rc=!1,_l=0;function Fe(t){t!==wn&&t.next===null&&(wn===null?ju=wn=t:wn=wn.next=t),wu=!0,Pc||(Pc=!0,Pb())}function gi(t,e){if(!rc&&wu){rc=!0;do for(var l=!1,n=ju;n!==null;){if(!e)if(t!==0){var a=n.pendingLanes;if(a===0)var i=0;else{var u=n.suspendedLanes,o=n.pingedLanes;i=(1<<31-ge(42|t)+1)-1,i&=a&~(u&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,Jf(n,i))}else i=J,i=Yu(n,n===ot?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||fi(n,i)||(l=!0,Jf(n,i));n=n.next}while(l);rc=!1}}function Fb(){kp()}function kp(){wu=Pc=!1;var t=0;_l!==0&&ug()&&(t=_l);for(var e=ye(),l=null,n=ju;n!==null;){var a=n.next,i=Yp(n,e);i===0?(n.next=null,l===null?ju=a:l.next=a,a===null&&(wn=l)):(l=n,(t!==0||(i&3)!==0)&&(wu=!0)),n=a}jt!==0&&jt!==5||gi(t,!1),_l!==0&&(_l=0)}function Yp(t,e){for(var l=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,i=t.pendingLanes&-62914561;0o)break;var s=c.transferSize,m=c.initiatorType;s&&lm(m)&&(c=c.responseEnd,u+=s*(c"u"?null:document;function Wp(t,e,l){var n=ha;if(n&&typeof e=="string"&&e){var a=Ne(e);a='link[rel="'+t+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),rm.has(a)||(rm.add(a),t={rel:t,crossOrigin:l,href:e},n.querySelector(a)===null&&(e=n.createElement("link"),Xt(e,"link",t),Ut(e),n.head.appendChild(e)))}}function hg(t){gl.D(t),Wp("dns-prefetch",t,null)}function yg(t,e){gl.C(t,e),Wp("preconnect",t,e)}function bg(t,e,l){gl.L(t,e,l);var n=ha;if(n&&t&&e){var a='link[rel="preload"][as="'+Ne(e)+'"]';e==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+Ne(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+Ne(l.imageSizes)+'"]')):a+='[href="'+Ne(t)+'"]';var i=a;switch(e){case"style":i=ca(t);break;case"script":i=ya(t)}_e.has(i)||(t=pt({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),_e.set(i,t),n.querySelector(a)!==null||e==="style"&&n.querySelector(vi(i))||e==="script"&&n.querySelector(Si(i))||(e=n.createElement("link"),Xt(e,"link",t),Ut(e),n.head.appendChild(e)))}}function gg(t,e){gl.m(t,e);var l=ha;if(l&&t){var n=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+Ne(n)+'"][href="'+Ne(t)+'"]',i=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=ya(t)}if(!_e.has(i)&&(t=pt({rel:"modulepreload",href:t},e),_e.set(i,t),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Si(i)))return}n=l.createElement("link"),Xt(n,"link",t),Ut(n),l.head.appendChild(n)}}}function vg(t,e,l){gl.S(t,e,l);var n=ha;if(n&&t){var a=Zn(n).hoistableStyles,i=ca(t);e=e||"default";var u=a.get(i);if(!u){var o={loading:0,preload:null};if(u=n.querySelector(vi(i)))o.loading=5;else{t=pt({rel:"stylesheet",href:t,"data-precedence":e},l),(l=_e.get(i))&&Ir(t,l);var c=u=n.createElement("link");Ut(c),Xt(c,"link",t),c._p=new Promise(function(r,s){c.onload=r,c.onerror=s}),c.addEventListener("load",function(){o.loading|=1}),c.addEventListener("error",function(){o.loading|=2}),o.loading|=4,cu(u,e,n)}u={type:"stylesheet",instance:u,count:1,state:o},a.set(i,u)}}}function Sg(t,e){gl.X(t,e);var l=ha;if(l&&t){var n=Zn(l).hoistableScripts,a=ya(t),i=n.get(a);i||(i=l.querySelector(Si(a)),i||(t=pt({src:t,async:!0},e),(e=_e.get(a))&&ts(t,e),i=l.createElement("script"),Ut(i),Xt(i,"link",t),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(a,i))}}function Tg(t,e){gl.M(t,e);var l=ha;if(l&&t){var n=Zn(l).hoistableScripts,a=ya(t),i=n.get(a);i||(i=l.querySelector(Si(a)),i||(t=pt({src:t,async:!0,type:"module"},e),(e=_e.get(a))&&ts(t,e),i=l.createElement("script"),Ut(i),Xt(i,"link",t),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(a,i))}}function sm(t,e,l,n){var a=(a=Hl.current)?Hu(a):null;if(!a)throw Error(A(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=ca(l.href),l=Zn(a).hoistableStyles,n=l.get(e),n||(n={type:"style",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=ca(l.href);var i=Zn(a).hoistableStyles,u=i.get(t);if(u||(a=a.ownerDocument||a,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,u),(i=a.querySelector(vi(t)))&&!i._p&&(u.instance=i,u.state.loading=5),_e.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},_e.set(t,l),i||zg(a,t,l,u.state))),e&&n===null)throw Error(A(528,""));return u}if(e&&n!==null)throw Error(A(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ya(l),l=Zn(a).hoistableScripts,n=l.get(e),n||(n={type:"script",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(A(444,t))}}function ca(t){return'href="'+Ne(t)+'"'}function vi(t){return'link[rel="stylesheet"]['+t+"]"}function Fp(t){return pt({},t,{"data-precedence":t.precedence,precedence:null})}function zg(t,e,l,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),Xt(e,"link",l),Ut(e),t.head.appendChild(e))}function ya(t){return'[src="'+Ne(t)+'"]'}function Si(t){return"script[async]"+t}function fm(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+Ne(l.href)+'"]');if(n)return e.instance=n,Ut(n),n;var a=pt({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Ut(n),Xt(n,"style",a),cu(n,l.precedence,t),e.instance=n;case"stylesheet":a=ca(l.href);var i=t.querySelector(vi(a));if(i)return e.state.loading|=4,e.instance=i,Ut(i),i;n=Fp(l),(a=_e.get(a))&&Ir(n,a),i=(t.ownerDocument||t).createElement("link"),Ut(i);var u=i;return u._p=new Promise(function(o,c){u.onload=o,u.onerror=c}),Xt(i,"link",n),e.state.loading|=4,cu(i,l.precedence,t),e.instance=i;case"script":return i=ya(l.src),(a=t.querySelector(Si(i)))?(e.instance=a,Ut(a),a):(n=l,(a=_e.get(i))&&(n=pt({},l),ts(n,a)),t=t.ownerDocument||t,a=t.createElement("script"),Ut(a),Xt(a,"link",n),t.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(A(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,cu(n,l.precedence,t));return e.instance}function cu(t,e,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,i=a,u=0;u title"):null)}function Ag(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Pp(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function xg(t,e,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var a=ca(n.href),i=e.querySelector(vi(a));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Uu.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=i,Ut(i);return}i=e.ownerDocument||e,n=Fp(n),(a=_e.get(a))&&Ir(n,a),i=i.createElement("link"),Ut(i);var u=i;u._p=new Promise(function(o,c){u.onload=o,u.onerror=c}),Xt(i,"link",n),l.instance=i}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Uu.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var dc=0;function Dg(t,e){return t.stylesheets&&t.count===0&&su(t,t.stylesheets),0dc?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function Uu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)su(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var qu=null;function su(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,qu=new Map,e.forEach(Eg,t),qu=null,Uu.call(t))}function Eg(t,e){if(!(e.state.loading&4)){var l=qu.get(t);if(l)var n=l.get(null);else{l=new Map,qu.set(t,l);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i{"use strict";function oh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oh)}catch(t){console.error(t)}}oh(),ch.exports=uh()});var S0=Qe(yo=>{"use strict";var g1=Symbol.for("react.transitional.element"),v1=Symbol.for("react.fragment");function v0(t,e,l){var n=null;if(l!==void 0&&(n=""+l),e.key!==void 0&&(n=""+e.key),"key"in e){l={};for(var a in e)a!=="key"&&(l[a]=e[a])}else l=e;return e=l.ref,{$$typeof:g1,type:t,key:n,ref:e!==void 0?e:null,props:l}}yo.Fragment=v1;yo.jsx=v0;yo.jsxs=v0});var ds=Qe((Ev,T0)=>{"use strict";T0.exports=S0()});var Y=Ei(Ci()),x0=Ei(rh());function is(t){let e=t>>>0;return function(){e|=0,e=e+1831565813|0;let l=Math.imul(e^e>>>15,1|e);return l=l+Math.imul(l^l>>>7,61|l)^l,((l^l>>>14)>>>0)/4294967296}}function ao(...t){let e=t.join("|"),l=2166136261;for(let n=0;n>>0}function z(t,e,l){return e+Math.floor(t()*(l-e+1))}function O(t,e){return e[Math.floor(t()*e.length)]}function sh(t,e){let l=[...e];for(let n=l.length-1;n>0;n--){let a=Math.floor(t()*(n+1));[l[n],l[a]]=[l[a],l[n]]}return l}function B(t,e){return t()[...e])}function M(t,e,l=0){return Array.from({length:t},()=>Array(e).fill(l))}function vt(t){return{h:t.length,w:t[0]?.length??0}}function Jt(t,e){if(t.length!==e.length)return!1;for(let l=0;la-i):n.filter(a=>a!==0).sort((a,i)=>a-i)}var mh=[{id:0,hex:"#000000",name:"black"},{id:1,hex:"#0074D9",name:"blue"},{id:2,hex:"#FF4136",name:"red"},{id:3,hex:"#2ECC40",name:"green"},{id:4,hex:"#FFDC00",name:"yellow"},{id:5,hex:"#AAAAAA",name:"gray"},{id:6,hex:"#F012BE",name:"magenta"},{id:7,hex:"#FF851B",name:"orange"},{id:8,hex:"#7FDBFF",name:"cyan"},{id:9,hex:"#870C25",name:"maroon"}],Gg=mh.map(t=>t.hex);function uo(t){return Gg[t]??"#000000"}function R(t){return mh[t]?.name??`color ${t}`}var _g=["","repeating-linear-gradient(45deg, rgba(255,255,255,.85) 0 1px, transparent 1px 4px)","radial-gradient(circle at 50% 50%, rgba(255,255,255,.9) 0 1px, transparent 1.6px)","repeating-linear-gradient(0deg, rgba(0,0,0,.55) 0 1px, transparent 1px 4px)","repeating-linear-gradient(90deg, rgba(0,0,0,.45) 0 1px, transparent 1px 4px)","repeating-linear-gradient(135deg, rgba(255,255,255,.5) 0 1.5px, transparent 1.5px 5px)","repeating-linear-gradient(45deg, rgba(0,0,0,.5) 0 1px, transparent 1px 3px), repeating-linear-gradient(-45deg, rgba(0,0,0,.5) 0 1px, transparent 1px 3px)","radial-gradient(circle at 50% 50%, rgba(0,0,0,.6) 0 1.5px, transparent 2.2px)","repeating-linear-gradient(90deg, rgba(0,0,0,.5) 0 2px, transparent 2px 5px)","repeating-linear-gradient(0deg, rgba(255,255,255,.35) 0 1.5px, transparent 1.5px 4px)"];function us(t){return _g[t]??""}function ht(t){let e=t.length,l=t[0]?.length??0,n=M(l,e);for(let a=0;a[...e].reverse())}function Qt(t){return[...t].reverse().map(e=>[...e])}function Wt(t){let e=t.length,l=t[0]?.length??0,n=M(l,e);for(let a=0;a=0&&r=0&&sl.map(n=>n in e?e[n]:n))}function co(t,e){let{h:l,w:n}=vt(t),a=M(l+2,n+2,e);for(let i=0;ii&&(i=r),so&&(o=s));if(i<0)return[[0]];let c=M(i-a+1,o-u+1);for(let r=a;r<=i;r++)for(let s=u;s<=o;s++)c[r-a][s-u]=t[r][s];return c}function ro(t){let{h:e,w:l}=vt(t),n=M(e,l*2);for(let a=0;a0;){let[y,p]=v.pop();h.push([y,p]);for(let[b,S]of r){let D=y+b,w=p+S;D<0||D>=a||w<0||w>=i||u[D][w]===0&&t[D][w]===d&&(u[D][w]=f,v.push([D,w]))}}let T=Pe(h);o.push({id:f,color:d,cells:h,size:h.length,bbox:T,height:T.maxR-T.minR+1,width:T.maxC-T.minC+1,symmetricH:Hg(h),symmetricV:Ug(h),touchesBorder:T.minR===0||T.minC===0||T.maxR===a-1||T.maxC===i-1})}return{objects:o,overlay:u}}function Pe(t){let e=1/0,l=1/0,n=-1/0,a=-1/0;for(let[i,u]of t)in&&(n=i),u>a&&(a=u);return{minR:e,minC:l,maxR:n,maxC:a}}function Hg(t){let e=Pe(t),l=new Set(t.map(([n,a])=>`${n},${a}`));for(let[n,a]of t)if(!l.has(`${n},${e.minC+e.maxC-a}`))return!1;return!0}function Ug(t){let e=Pe(t),l=new Set(t.map(([n,a])=>`${n},${a}`));for(let[n,a]of t)if(!l.has(`${e.minR+e.maxR-n},${a}`))return!1;return!0}function Vt(t){return t.reduce((e,l)=>l.size>e.size?l:e,t[0])}function so(t){return t.reduce((e,l)=>l.size{let v=d+1;if(v>=l)return!1;let T=`${v},${h}`;return!(c.has(T)&&!m.cells.some(([y,p])=>y===v&&p===h))})?(o=!0,r.push({cells:m.cells.map(([d,h])=>[d+1,h]),color:m.color})):r.push({cells:m.cells,color:m.color});if(!o)break;let s=M(l,n,e);for(let m of r)for(let[f,d]of m.cells)s[f][d]=m.color;a=s}return a}function fo(t,e=0){let{h:l,w:n}=vt(t),a=M(l,n,e),i=nt(t,{bg:e,connectivity:4});for(let u of i.objects)for(let[o,c]of u.cells)a[o][u.bbox.minC+u.bbox.maxC-c]=u.color;return a}function Ai(t,e,l=0){let{h:n,w:a}=vt(t),i=Gt(t),u=nt(t,{bg:l,connectivity:4});for(let o of u.objects){for(let c=o.bbox.minC-1;c<=o.bbox.maxC+1;c++)for(let r of[o.bbox.minR-1,o.bbox.maxR+1])r>=0&&r=0&&c=0&&c=0&&r!l.includes(a));return sh(t,n).slice(0,Math.min(e,n.length))}function Nt(t,e,l,n,a){let i=a?.colorPool??E(t,Math.max(n,1)),u=a?.minSize??1,o=a?.maxSize??4,c=a?.margin??0,r=new Set,s=[],m=0;for(;s.length0;){let D=z(t,0,S.length-1),[w,x]=S.splice(D,1)[0];for(let[N,C]of[[1,0],[-1,0],[0,1],[0,-1]]){let j=w+N,ct=x+C;if(j=e-c||ct=l-c)continue;let xe=`${j},${ct}`;!b.has(xe)&&b.size{let[w,x]=D.split(",").map(Number);return[w,x]})}let T=v.length>0;for(let[y,p]of v)(y=e-c||p=l-c)&&(T=!1),r.has(`${y},${p}`)&&(T=!1);if(T){for(let[y,p]of v)r.add(`${y},${p}`);s.push({cells:v,color:d})}}return s}function _t(t,e,l,n=0){let a=M(t,e,n);for(let i of l)for(let[u,o]of i.cells)a[u][o]=i.color;return a}function Ft(t,e,l,n){let a=[],i=new Set,u=0;for(;a.length0&&n.alts.some(s=>a.concat(o).every(m=>{try{return Jt(s(m.input),m.output)}catch{return!1}}))||(i.add(c),a.push(o))}return a}function G(t,e){return JSON.stringify(t)===JSON.stringify(e)}function k(t,e,l){let n=[],a=0;for(;n.lengthG(a.input,n.input)))return n}return t()}function H(t,e,l,n){return{train:t,testInput:e.input,testOutput:e.output,hints:l,explanation:n}}function q(t,e,l,n){let a=l,i=Math.round(l+(n-l)*e),u=z(t,a,Math.max(a,i)),o=z(t,a,Math.max(a,i));return{h:u,w:o}}var cs=[ht,ze,Ae,yt,Qt,Wt];function Bg(t,e){let{h:l,w:n}=q(t,e,4,10),a=E(t,z(t,2,3)),i=()=>{let c=M(l,n,0);for(let r=0;r!r.some(s=>G(s.input,c.input))),o=_(i,u);return H(u,o,["Compare each example side by side \u2014 what exactly changes from input to output?","Nothing changes at all. The output keeps the exact size, colors and positions of the input.","The rule is the identity transformation: copy every cell of the input exactly. Reproduce the challenge grid cell for cell, same dimensions and same colors."],"The transformation is the identity: the output is an exact copy of the input grid. This is the simplest possible ARC rule and a sanity check for the editor.")}function ph(t,e){let{h:l,w:n}=q(t,e,4,9),a=O(t,E(t,4)),i=()=>{let c=M(l,n,0);for(let r=0;r!r.some(s=>G(s.input,c.input))),o=_(i,u);return H(u,o,["The shape of the grid stays the same \u2014 but what happens to the colors?",`Every cell, including the background, becomes ${R(a)} (color ${a}).`,`The rule: paint the entire output grid with ${R(a)} (color ${a}) \u2014 the single color used by the object in the input. Output dims equal input dims.`],`Every example fills the whole grid with ${R(a)} \u2014 the one color the input pattern uses. The output size matches the input size.`)}function hh(t,e){let{h:l,w:n}=q(t,e,4,10),[a,i,u]=E(t,3),o=()=>{let s=M(l,n,0);for(let m=0;m!m.some(f=>G(f.input,s.input))),r=_(o,c);return H(c,r,["One color is not acting like the others. Which cells are different in the output?",`Every ${R(a)} (color ${a}) cell becomes ${R(i)} (color ${i}). Nothing else moves.`,`The rule is a color mapping: ${R(a)} (${a}) \u2192 ${R(i)} (${i}), all other cells unchanged.`],`A simple substitution rule: recolor every ${R(a)} cell to ${R(i)}. Grid size and all other colors are preserved.`)}function kg(t,e){let{h:l,w:n}=q(t,e,5,10),[a,i,u,o,c]=E(t,5),r=()=>{let f=M(l,n,0);for(let d=0;d!d.some(h=>G(h.input,f.input))),m=_(r,s);return H(s,m,["Two colors are being rewritten. Track each one separately.",`${R(a)} (${a}) \u2192 ${R(i)} (${i}) AND ${R(u)} (${u}) \u2192 ${R(o)} (${o}).`,"Two independent substitutions are applied at once. Build the output by replacing each mapped color with its target; everything else is copied."],`Two simultaneous color mappings: ${R(a)}\u2192${R(i)} and ${R(u)}\u2192${R(o)}. Apply both mappings in one pass.`)}function yh(t,e){let{h:l,w:n}=q(t,e,5,10),[a,i,u]=E(t,3),o=()=>{let s=M(l,n,0);for(let m=0;m!m.some(f=>G(f.input,s.input))),r=_(o,c);return H(c,r,["Colors are trading places. Which pairs exchange?",`${R(a)} (${a}) becomes ${R(i)} (${i}) and ${R(i)} becomes ${R(a)} \u2014 a symmetric swap.`,`The rule is a two-way color swap: ${a} \u2194 ${i}. Replace both colors simultaneously (do not apply the map twice).`],`A color exchange: ${R(a)} \u2194 ${R(i)}. Apply the swap in a single pass so cells are not swapped back.`)}function bh(t,e){let{h:l,w:n}=q(t,e,5,10),[a,i,u]=E(t,3),o=()=>{let s=M(l,n,0);for(let m=0;m!m.some(f=>G(f.input,s.input))),r=_(o,c);return H(c,r,["Most of the drawing disappears. What survives?",`Only ${R(a)} (color ${a}) cells remain \u2014 every other color is erased to black (0).`,`The rule is a filter: keep only ${R(a)} (${a}) cells; recolor everything else (except the background) to 0.`],`A selection rule: the output keeps only the ${R(a)} cells and erases all other colors to background 0. Positions and size of kept cells are unchanged.`)}function Yg(t,e){let l=O(t,E(t,3)),n=O(t,E(t,2,[l])),a=()=>{let{h:o,w:c}=q(t,e,3,5),r=M(o,c,0);for(let m=0;mm===l).length;return{input:r,output:[[s]]}},i=k(3,a,(o,c)=>{let r=o.output[0][0];return r>=1&&r<=9&&!c.some(s=>G(s.input,o.input))}),u=_(a,i);return H(i,u,["The output is a single cell. What could one cell encode about the input?",`The single cell equals how many ${R(l)} (color ${l}) cells the input contains.`,"Count the cells of the target color and output a 1\xD71 grid whose value is that count. E.g. 6 cells of the color \u2192 output [[6]]."],`The output is a 1\xD71 grid containing the number of ${R(l)} (color ${l}) cells in the input. Counting becomes a color value.`)}function Lg(t,e){let l=z(t,2,e<.5?3:4),n=()=>{let{h:u,w:o}=q(t,e,4,8),c=E(t,l),r=M(u,o,0);for(let m=0;mm!==0))].sort((m,f)=>m-f);return{input:r,output:[s]}},a=k(3,n,(u,o)=>u.output[0].length>=2&&!o.some(c=>G(c.input,u.input))),i=_(n,a);return H(a,i,["The output is one row of colors. Where does its order come from?","The row lists every distinct non-black color in the input, sorted from smallest to largest number.","Collect the distinct non-zero colors of the input, sort them ascending, and output them as a single 1\xD7N row."],"The output is a 1\xD7N row containing the distinct non-zero colors of the input in ascending numeric order.")}function Xg(t,e){let{h:l,w:n}=q(t,e,4,9),a=()=>{let[o,c,r]=E(t,3),s=M(l,n,0);for(let f=0;ff.map(d=>d===0?r:0));return{input:s,output:m}},i=k(3,a,(o,c)=>!c.some(r=>G(r.input,o.input))),u=_(a,i);return H(i,u,["Background and drawing have traded places. What is the new background color?","Every black (0) cell becomes the SAME new color; every previously colored cell becomes black.","The rule is foreground/background inversion: all 0 cells \u2192 the new color, all non-zero cells \u2192 0. The new color is the one that fills most of the output."],"Foreground/background inversion: non-zero cells become 0 and 0 cells become the replacement color. Grid size is unchanged.")}function Qg(t,e){return O(t,[hh,yh,bh,ph])(t,e)}function gh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,6,12),o=z(t,2,Math.min(9,2+Math.round(e*6))),c=E(t,o),r=Nt(t,i,u,o,{colorPool:c,minSize:1,maxSize:4,margin:0});return{input:_t(i,u,r),output:[[Math.min(r.length,9)]]}},n=k(3,l,(i,u)=>i.output[0][0]>=2&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The answer is a single cell again. What quantity changes with each example?","It is the number of separate objects (groups of touching cells of one color).","Count the connected objects (4-direction adjacency, one color each) and output a 1\xD71 grid holding that count."],"The output is a 1\xD71 grid with the number of objects. Objects are connected groups of same-colored cells (adjacent up/down/left/right).")}function vh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,13),o=z(t,2,4),c=Nt(t,i,u,o,{colorPool:E(t,o),minSize:1,maxSize:6,margin:0}),r=c.map(f=>f.cells.length);if(new Set(r).size!==r.length)return{input:[[0]],output:[[1]]};let s=_t(i,u,c),m=nt(s);return{input:s,output:Zt(s,[Vt(m.objects)])}},n=k(3,l,(i,u)=>i.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Only one shape survives. What decides the winner?","The largest object (most cells) stays; all other objects are erased.","Find the object with the most cells (4-adjacency, single color) and erase every other object to 0. The winner keeps its color and position."],"A size-selection rule: keep only the largest object by cell count; everything else becomes background 0.")}function Vg(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,13),o=z(t,2,4),c=Nt(t,i,u,o,{colorPool:E(t,o),minSize:1,maxSize:6,margin:0}),r=c.map(f=>f.cells.length);if(new Set(r).size!==r.length)return{input:[[0]],output:[[1]]};let s=_t(i,u,c),m=nt(s);return{input:s,output:Zt(s,[so(m.objects)])}},n=k(3,l,(i,u)=>i.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["This time the survivor is tiny. Which object remains?","The smallest object (fewest cells) stays; the rest are erased.","Find the object with the fewest cells and erase every other object to 0."],"Selection by minimum: keep only the smallest object (fewest cells); all other objects become background.")}function Zg(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,12),o=z(t,2,4),c=E(t,o),[r,s]=E(t,2,c),m=Nt(t,i,u,o,{colorPool:c,minSize:1,maxSize:5,margin:0});if(new Set(m.map(h=>h.cells.length%2)).size<2)return{input:[[0]],output:[[1]]};let f=_t(i,u,m),d=Gt(f);for(let h of m){let v=h.cells.length%2===0?r:s;for(let[T,y]of h.cells)d[T][y]=v}return{input:f,output:d}},n=k(3,l,(i,u)=>i.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Object positions never move \u2014 only colors change. What property sets the new color?","Even-sized objects become one color; odd-sized objects become the other.","Recolor every object by its size parity: an even number of cells \u2192 the first new color, odd \u2192 the second. Shape and position are untouched."],"A property-based recolor: each object is repainted according to whether its cell count is even or odd. Count each object's cells to decide.")}function Sh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,6,11),o=M(i,u,0),c=E(t,z(t,1,3)),r=z(t,1,2),s=z(t,1,2),m=z(t,3,Math.max(3,i-r-1)),f=z(t,3,Math.max(3,u-s-1));for(let h=r;h{let o=vt(i.output);return o.hG(c.input,i.input))}),a=_(l,n);return H(n,a,["The output is a smaller grid. What part of the input does it keep?","It is the tight box around all the drawing \u2014 the surrounding empty border is cut away.","Crop the input to the bounding rectangle of all non-zero cells: delete empty rows/columns around the content."],"Cropping: the output is the smallest rectangle containing every non-zero cell (the empty margin is removed).")}function Th(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,12),o=z(t,3,5),c=Nt(t,i,u,o-1,{colorPool:E(t,o),minSize:1,maxSize:3,margin:2}),r=O(t,E(t,1)),s=[],m=z(t,1,u-2),f=z(t,2,3);for(let p=0;pp.color))),v=_t(i,u,d),T=nt(v),y=Gt(v);for(let p of T.objects)if(p.touchesBorder)for(let[b,S]of p.cells)y[b][S]=h;return!T.objects.some(p=>!p.touchesBorder)||!T.objects.some(p=>p.touchesBorder)?{input:[[0]],output:[[1]]}:{input:v,output:y}},n=k(3,l,(i,u)=>i.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Some shapes change color and some do not. What distinguishes them?","Objects touching the grid border are repainted; interior objects keep their color.","Detect which objects touch any edge of the grid and recolor those to the new color; leave interior objects alone."],"A positional rule: objects that touch the grid boundary are recolored; interior objects are unchanged.")}function Kg(t,e){let l=()=>{let{h:i,w:u}=q(t,e,5,10),o=z(t,2,5),c=E(t,o),r=M(i,u,0);for(let m=0;mm!==0)).size;return{input:r,output:[[s]]}},n=k(3,l,(i,u)=>i.output[0][0]>=2&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["One cell again \u2014 but this time it counts variety, not quantity.","The single cell is how many DIFFERENT non-black colors appear in the input.","Count the distinct non-zero colors and output a 1\xD71 grid with that number."],"The output is a 1\xD71 grid holding the number of distinct non-zero colors in the input.")}function $g(t,e){return O(t,[gh,vh,Sh,Th])(t,e)}function zh(t,e){let l=e<.2?1:e<.5?2:3,n=[ht,ze,Ae][l-1],a=cs.filter(c=>c!==n),i=()=>{let{h:c,w:r}=q(t,e,4,9),s=M(c,r,0),m=E(t,z(t,2,3));for(let f=0;fc!==n),i=()=>{let{h:c,w:r}=q(t,e,4,9),s=M(c,r,0),m=E(t,z(t,2,3));for(let f=0;fu!==Wt),n=()=>{let{h:u,w:o}=q(t,e,4,9),c=M(u,o,0),r=E(t,z(t,2,3));for(let s=0;s{let{h:c,w:r}=q(t,e,5,10),s=M(c,r,0),m=E(t,2),f=l>0?c-l:c-1,d=l<0?-l:0,h=n>0?r-n:r-1,v=n<0?-n:0;for(let T=d;T<=f;T++)for(let y=v;y<=h;y++)B(t,.4)&&(s[T][y]=O(t,m));return{input:s,output:vl(s,l,n)}},i=k(3,a,(c,r)=>!r.some(s=>G(s.input,c.input))&&!G(vl(c.input,l,n),c.input)),u=_(a,i),o=`${l===0?"":l>0?`down ${l}, `:`up ${-l}, `}right ${n}`;return H(i,u,["The drawing keeps its shape but slides. In which direction and how far?",`Every example shifts the content ${o}. Vacated cells become black.`,`The rule is a translation: shift all content ${o} (positive = down/right). Cells pushed out of the grid are lost; the rest of the grid fills with 0.`],`A pure translation by (${l}, ${n}) \u2014 down ${l}, right ${n}. The grid size never changes; exposed cells become background.`)}function Eh(t,e){let l=o=>ht(yt(o)),n=[yt,ht,Qt,Ae,Wt],a=()=>{let{h:o,w:c}=q(t,e,4,8),r=M(o,c,0),s=E(t,2);for(let m=0;m{let i=z(t,4,Math.max(5,Math.round(6+e*4))),u=z(t,3,Math.max(3,Math.round(4+e*3))),o=M(i,u,0),c=E(t,2);for(let r=0;r!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The output is twice as wide. What fills the new columns?","The right half is the mirror image of the input \u2014 together they form a horizontally symmetric grid.","The rule: append the horizontal mirror of the input. output[r][W-1-c] = input[r][c] for the second half, producing a left-right symmetric grid."],"Symmetry completion: the input is the LEFT half of a symmetric picture. Mirror it onto the right to complete the pattern (output width = 2 \xD7 input width).")}function Ch(t,e){let l=()=>{let i=z(t,3,Math.max(3,Math.round(4+e*3))),u=z(t,4,Math.max(5,Math.round(6+e*4))),o=M(i,u,0),c=E(t,2);for(let r=0;r!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The output is twice as tall this time. What fills the new rows?","The bottom half is the upside-down mirror of the input \u2014 a vertically symmetric grid.","The rule: append the vertical mirror of the input below it, producing a top-bottom symmetric grid (output height = 2 \xD7 input height)."],"Symmetry completion (vertical): the input is the TOP half. Mirror it downward to complete the picture.")}function Mh(t,e){let l=()=>{let i=z(t,4,8),u=z(t,4,8)*2,o=M(i,u/2,0),c=E(t,2);for(let f=0;fv!==r[d][h])])}return{input:s,output:r}},n=k(3,l,(i,u)=>!G(i.input,i.output)&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The grid is *almost* symmetric. What is the output doing about the flaws?","The output is the perfectly mirrored version \u2014 the mismatched cells are repaired to match their mirror partner.","Find cells that break the left-right symmetry and set them to the color of their mirror counterpart. The output is fully symmetric."],"Symmetry repair: the input is a symmetric grid with 1\u20133 damaged cells. The output restores the exact mirror image.")}function Nh(t,e){let l=()=>{let i=z(t,3,Math.max(3,Math.round(4+e*2))),u=M(i,i,0),o=E(t,2);for(let c=0;c!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The output repeats something. What and how many times?","The entire input tile is repeated 2\xD72 \u2014 four copies in a square arrangement.","The rule is 2\xD72 tiling: the output is the input repeated twice horizontally and twice vertically (dims double)."],"Tiling: the input is a motif repeated in a 2\xD72 arrangement. Output dimensions are exactly double.")}function Wg(t,e){let l=B(t,.5),n=()=>{let{h:u,w:o}=q(t,e,3,6),c=M(u,o,0),r=E(t,2);for(let s=0;s!o.some(c=>G(c.input,u.input))),i=_(n,a);return H(a,i,["The tile repeats \u2014 but in which direction this time?",l?"Two copies stacked vertically.":"Two copies placed side by side horizontally.",l?"The rule: stack the input twice vertically (output height doubles, width unchanged).":"The rule: repeat the input twice horizontally (output width doubles, height unchanged)."],l?"A 2\xD71 tiling: the motif repeats top-to-bottom.":"A 1\xD72 tiling: the motif repeats left-to-right.")}function Rh(t,e){let[l,n]=E(t,2),a=()=>{let o=z(t,4,7),c=z(t,4,7),r=M(o,c,0);for(let m=0;mo.input.flat().filter(s=>s===0).length>=2&&!c.some(s=>G(s.input,o.input))),u=_(a,i);return H(i,u,["Some cells went missing. What pattern decides their color?","It is a checkerboard: cells alternate between the two colors like a chess board \u2014 color depends on (row + column) parity.",`The rule: fill every black cell so that (row+column) even \u2192 ${R(l)} (${l}) and odd \u2192 ${R(n)} (${n}). Existing cells never change.`],"Checkerboard completion: the two colors alternate by (row + column) parity. Restore the erased cells without touching the rest.")}function jh(t,e){let l=()=>{let i=z(t,2,4),u=z(t,2,4),o=M(i,u,0),c=E(t,2);for(let f=0;f!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The quadrant grows into a full picture with four-way symmetry. What are the rules for each quarter?","Top-right mirrors the input horizontally; bottom-left mirrors it vertically; bottom-right mirrors both.","The rule: place the input top-left; fill top-right with its horizontal mirror, bottom-left with its vertical mirror, bottom-right with the double-mirrored copy."],"Four-way symmetry completion: the input is the top-left quadrant; the other three quadrants are its mirror images.")}function Fg(t,e){let l=()=>{let i=z(t,2,3),u=E(t,i),o=Array.from({length:i*3},(r,s)=>u[s%i]),c=i+z(t,0,1);return{input:[o.slice(0,c)],output:[o]}},n=k(3,l,(i,u)=>!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The input is a short fragment of a longer row. How does it continue?","The row is a repeating pattern \u2014 the fragment you see repeats over and over.","The rule: detect the repeating period in the row and repeat it to fill a row three periods long."],"Periodic continuation: the input shows the start of a repeating 1D pattern; the output extends it to three full periods.")}function Pg(t,e){let l=()=>{let i=z(t,4,7),u=z(t,4,7),[o,c]=E(t,2),r=M(i,u,0);for(let d=0;dt()-.5).slice(0,m);for(let d of f)for(let h=0;hi.input.filter(c=>c.every(r=>r===0)).length>=1&&!u.some(c=>G(c.input,i.input))),a=_(l,n);return H(n,a,["Whole rows are blank. What fills them in?","The visible rows alternate between two colors \u2014 the blank rows continue that stripe pattern.","The rule: rows alternate between the two stripe colors; fill every blank row according to its position in the alternation."],"Stripe completion: rows alternate between two colors. Missing rows are restored by continuing the alternation.")}function Ig(t,e){return O(t,[Oh,Ch,Mh,Nh,Rh,jh])(t,e)}function wh(t,e){let l=e<.5?3:4,n=E(t,l),a={};for(let c=0;c{let{h:c,w:r}=q(t,e,4,9),s=M(c,r,0);for(let m=0;ms.flat().includes(m))||(s[0][0]=n[0],s[0][1%r]=n[1%l],l>2&&(s[0][2%r]=n[2])),{input:s,output:F(s,a)}},u=k(3,i,(c,r)=>!r.some(s=>G(s.input,c.input))),o=_(i,u);return H(u,o,["Every color moves to a new value. Is there a cycle?",`Yes \u2014 follow the chain: ${n.map((c,r)=>`${R(c)} (${c}) \u2192 ${R(n[(r+1)%l])} (${n[(r+1)%l]})`).join(", ")}.`,"The rule is a cyclic substitution: each color in the chain becomes the next one, and the last wraps around to the first."],"A cyclic color rotation: c\u2081\u2192c\u2082\u2192\u2026\u2192c\u2096\u2192c\u2081. Apply the whole cycle simultaneously.")}function Gh(t,e){let l=e<.5?3:4,n=E(t,l*2),a={};for(let r=0;r{let{h:r,w:s}=q(t,e,5,10),m=M(r,s,0);for(let f=0;f!s.some(m=>G(m.input,r.input))),c=_(u,o);return H(o,c,[`Several colors are rewritten at once. Build the full table from the ${o.length} examples.`,"Each source color consistently maps to one target color across every example.","The rule is a many-entry color table: look up each cell's color in the mapping and write its target; unmapped cells stay."],"A multi-entry substitution table learned from the examples. Apply all mappings in one pass.")}function _h(t,e){let l=()=>{let{h:i,w:u}=q(t,e,6,10),[o,c]=E(t,2),[r]=E(t,1,[o,c]),s=M(i,u,0),m=Nt(t,i,u,z(t,1,3),{colorPool:[o],minSize:1,maxSize:3,margin:1});for(let d=0;d{let p=d+T,b=h+y;return p>=0&&p=0&&bd!==0&&d!==o&&f.flat()[h]===r)?{input:s,output:f}:{input:[[0]],output:[[1]]}},n=k(3,l,(i,u)=>i.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Only some cells change color. What do they have in common?","They are the cells that directly touch the special-color object (up, down, left or right).","The rule: any non-background cell that is 4-adjacent to the object color becomes the highlight color. The object itself and the background never change."],"Neighborhood rule: cells orthogonally adjacent to the target-color object are repainted with the highlight color.")}function Hh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,6,10),o=z(t,2,e<.5?3:4),c=E(t,o),r=M(i,u,0);for(let h=0;hh[1]-v[1]),d={};return f.forEach(([h],v)=>{d[h]=v+1}),{input:r,output:F(r,d)}},n=k(3,l,(i,u)=>i.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Colors are renumbered. Does rarity decide the new value?","Count each color: the rarest becomes 1, the next rarest 2, and so on.","The rule: rank the input colors by how often they appear (ascending) and recolor each cell with its color's rank (1-based)."],"Frequency ranking: each color is replaced by its rank when the colors are sorted by frequency, rarest first.")}function Uh(t,e){let n=E(t,3),a=O(t,E(t,2,n)),i=()=>{let c=z(t,4,Math.max(4,Math.round(6+e*4))),r=z(t,4,8),s=M(c,r,a),m=M(c,r,0);for(let f=0;f!r.some(s=>G(s.input,c.input))),o=_(i,u);return H(u,o,["Rows are repainted with a repeating sequence. What is the order?",`Reading top to bottom, rows cycle through ${n.map(c=>R(c)).join(" \u2192 ")} and then repeat.`,`The rule: row r gets seq[r % 3] where the sequence is [${n.map(c=>R(c)).join(", ")}]. The cycle repeats for taller grids.`],"Row-cycle repaint: each row is filled with the next color of a fixed 3-color sequence that repeats down the grid.")}function qh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,5,9),o=u%2===0?u:u-1;if(o<4)return{input:[[0]],output:[[1]]};let c=M(i,o,0),r=E(t,2),[s]=E(t,1,r);for(let d=0;di.input.length>1&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Some cells get a marker color. What did those cells do wrong?","They disagree with their horizontal mirror partner \u2014 the un-symmetric cells are flagged.","The rule: every non-background cell whose horizontal mirror has a different color is repainted with the marker color; symmetric cells stay."],"Asymmetry detector: cells that differ from their left-right mirror partner are highlighted with the marker color.")}function t1(t,e){return O(t,[wh,Gh,_h,Hh,Uh,qh])(t,e)}var Bh={identity:Bg,"fill-constant":ph,"map-one":hh,"map-two":kg,"swap-two":yh,"keep-one":bh,"count-cells":Yg,"unique-colors":Lg,"invert-fg":Xg,"w1-trial":Qg,"count-objects":gh,"keep-largest":vh,"keep-smallest":Vg,"size-parity-recolor":Zg,"crop-content":Sh,"border-objects":Th,"count-colors":Kg,"w2-trial":$g,"rotate-k":zh,"flip-axis":Ah,transpose:xh,"shift-dxdy":Dh,"flip-then-rotate":Eh,"w3-trial":Jg,"complete-h":Oh,"complete-v":Ch,"fix-symmetry":Mh,"tile-2x2":Nh,"tile-1x2":Wg,"checker-complete":Rh,"quad-complete":jh,"extend-1d":Fg,"stripes-complete":Pg,"w4-trial":Ig,"cycle-colors":wh,"map-many":Gh,"adjacent-highlight":_h,"frequency-rank":Hh,"row-gradient":Uh,"mirror-diff":qh,"w5-trial":t1};var rs=[ht,ze,Ae,yt,Qt,Wt];function kh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,12),o=z(t,2,4),c=Nt(t,i,u,o,{colorPool:E(t,o),minSize:1,maxSize:4,margin:0}),r=_t(i,u,c),s=zi(r);return{input:r,output:s}},n=k(3,l,(i,u)=>!G(i.input,i.output)&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The shapes are identical \u2014 only their positions changed. In which direction, and what stopped them?","Every object falls straight down until it lands on the floor or on top of another object.","The rule is gravity: each object slides down as far as possible without overlapping others or leaving the grid. Columns are independent."],"Gravity: every object drops to the lowest position it can occupy, stacking on top of other objects.")}function e1(t,e){let n=()=>{let{h:u,w:o}=q(t,e,7,11),c=O(t,E(t,2,[6])),r=[],s=z(t,2,4),m=z(t,0,Math.max(0,Math.floor(u/2)-1)),f=z(t,0,Math.max(0,Math.floor(o/2)-1));for(let S=0;S!o.some(c=>G(c.input,u.input))),i=_(n,a);return H(a,i,["One object ends up somewhere new \u2014 and one cell disappears from the output. What is the marker cell doing?",`The single ${R(6)} (6) cell is the destination: the object's top-left corner moves exactly onto it, and the marker is consumed.`,`The rule: translate the non-marker object so its bounding-box top-left lands on the ${R(6)} cell. The marker itself does not appear in the output.`],"Marker-directed translation: the magenta (6) cell marks where the object's top-left corner must go. The marker is removed after the move.")}function Yh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,12),o=z(t,1,3),c=E(t,o),[r]=E(t,1,c),s=Nt(t,i,u,o,{colorPool:c,minSize:1,maxSize:3,margin:1}),m=_t(i,u,s),f=Ai(m,r);return{input:m,output:f}},n=k(3,l,(i,u)=>!G(i.input,i.output)&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Every shape gained a border. What color and what shape is it?","A 1-cell rectangle of one new color is drawn tightly around each object's bounding box.","The rule: draw a rectangular frame (1 cell thick) of the frame color around each object's bounding box, only on background cells."],"Object framing: each object gets a 1-cell rectangular border of a single frame color around its bounding box.")}function Lh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,12),o=z(t,2,3),c=Nt(t,i,u,o,{colorPool:E(t,o),minSize:2,maxSize:4,margin:0});if(c=c.filter(m=>{let f=new Set(m.cells.map(([h,v])=>`${h},${v}`)),d=Pe(m.cells);return!m.cells.every(([h,v])=>f.has(`${h},${d.minC+d.maxC-v}`))}),c.length<1)return{input:[[0]],output:[[1]]};let r=_t(i,u,c),s=fo(r);return{input:r,output:s}},n=k(3,l,(i,u)=>!G(i.input,i.output)&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["Each object flipped \u2014 but the grid border stayed put. How?","Every object is mirrored left-right inside its own bounding box, without moving.","The rule: mirror each object horizontally in place \u2014 reflect the object's cells across the vertical center of its own bounding box."],"In-place mirroring: every object is flipped horizontally within its own bounding box; objects keep their position and color.")}function Xh(t,e){let l=()=>{let{h:i,w:u}=q(t,e,7,12),o=z(t,2,3),c=Math.floor(i/3);if(ct()-.5).slice(0,o);for(let v=0;vu)return{input:[[0]],output:[[1]]};let S=[];for(let D=0;D!G(i.input,i.output)&&!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The objects slid sideways. Where do they stop?","Each object moves left until it touches the left edge of the grid.","The rule: translate every object horizontally so its leftmost cell is in column 0, keeping its rows unchanged."],"Left alignment: each object is shifted horizontally until it hugs the left wall, preserving its vertical position.")}function l1(t,e){let l=()=>{let i=z(t,2,Math.max(2,Math.round(3+e*2))),u=O(t,E(t,1)),o=O(t,["rect","line","any"]),c=Nt(t,i,i,1,{colorPool:[u],minSize:Math.max(2,i-1),maxSize:i*i,shapes:o,margin:0});if(c.length===0)return{input:[[0]],output:[[1]]};let r=_t(i,i,c),s=ke(r);return{input:r,output:oo(s,2)}},n=k(3,l,(i,u)=>!u.some(o=>G(o.input,i.input))),a=_(l,n);return H(n,a,["The shape came back bigger. How much bigger, and where does it sit?","Every cell of the shape becomes a 2\xD72 block \u2014 the object is magnified 2\xD7, anchored at the top-left of the output.","The rule: crop the object to its bounding box, then scale it \xD72 (each cell becomes a 2\xD72 square). Output dims = 2 \xD7 cropped dims."],"Magnification: the single object is cropped and scaled \xD72 \u2014 every cell expands into a 2\xD72 block.")}function n1(t,e){return O(t,[kh,Yh,Lh,Xh])(t,e)}function Qh(t,e){let l=O(t,[ht,ze,Ae,yt,Qt,Wt]),n=O(t,["map","swap","keep"]),[a,i,u]=E(t,3),o,c;n==="map"?(o=h=>F(h,{[a]:i}),c=`${R(a)} (${a}) \u2192 ${R(i)} (${i})`):n==="swap"?(o=h=>F(h,{[a]:i,[i]:a}),c=`swap ${R(a)} (${a}) \u2194 ${R(i)} (${i})`):(o=h=>F(h,{[u]:0,[i]:0}),c=`erase everything except ${R(a)} (${a})`);let r=h=>o(l(h)),s=rs.filter(h=>h!==l).map(h=>v=>o(h(v))),m=()=>{let{h,w:v}=q(t,e,4,8),T=M(h,v,0),y=n==="map"?[a,u]:n==="swap"?[a,i,u]:[a,u,i];for(let p=0;pco(vl(c,l,n),a),u=()=>{let{h:c,w:r}=q(t,e,5,8),s=M(c,r,0),m=E(t,2);for(let f=0;f!r.some(s=>G(s.input,c.input)));return H(o,_(u,o),["The drawing moved AND gained a border. Find both steps.",`The content shifts ${l===0?"":`down ${l} and `}right ${n}; then a 1-cell frame of one color wraps the whole grid.`,`The rule: shift the content by (${l}, ${n}), then wrap the result in a 1-cell border of color ${a}. Output dims are +2 in both directions.`],`Composition: translate by (${l}, ${n}), then add a ${R(a)} (${a}) border around the entire grid.`)}function a1(t,e){let l=O(t,[0,1]),n=z(t,1,2),[a,i]=E(t,2),u=r=>F(vl(r,l,n),{[a]:i}),o=()=>{let{h:r,w:s}=q(t,e,5,9),m=M(r,s,0),f=[a,...E(t,1,[a,i])];for(let d=0;d!s.some(m=>G(m.input,r.input)));return H(c,_(o,c),["Two changes again: position and color.",`Content shifts (down ${l}, right ${n}) and ${R(a)} (${a}) becomes ${R(i)} (${i}).`,`The rule: first translate by (${l}, ${n}), then recolor ${a} \u2192 ${i}.`],`Composition: shift by (${l}, ${n}), then substitute color ${R(a)} \u2192 ${R(i)}.`)}function Zh(t,e){let[l,n]=E(t,2),a=o=>F(zi(o),{[l]:n}),i=()=>{let{h:o,w:c}=q(t,e,7,11),r=z(t,2,3),s=Nt(t,o,c,r,{colorPool:[l,...E(t,1,[l,n])],minSize:1,maxSize:3,margin:0}),m=_t(o,c,s);return{input:m,output:a(m)}},u=k(3,i,(o,c)=>!G(o.input,o.output)&&!c.some(r=>G(r.input,o.input)));return H(u,_(i,u),["Objects fall AND colors change. Order the two steps.","Gravity acts first; the color substitution is applied to the settled result.",`The rule: let every object fall to the bottom, then recolor ${R(l)} (${l}) \u2192 ${R(n)} (${n}).`],`Composition: gravity first, then the color mapping ${l} \u2192 ${n}.`)}function Kh(t,e){let l=O(t,[yt,ht]),n=u=>l(ke(u)),a=()=>{let{h:u,w:o}=q(t,e,6,10),c=M(u,o,0),r=E(t,2),s=z(t,1,2),m=z(t,1,2),f=z(t,3,u-s-1),d=z(t,3,o-m-1);for(let h=s;h!o.some(c=>G(c.input,u.input)));return H(i,_(a,i),["The result is cropped AND flipped or turned. Which comes first?","Crop to the content box first, then apply the geometric transform to the crop.",`The rule: crop the input to its non-zero bounding box, then ${l===yt?"flip it left-right":"rotate it 90\xB0 clockwise"}.`],`Composition: crop to content, then ${l===yt?"horizontal flip":"90\xB0 rotation"}.`)}function i1(t,e){return O(t,[Qh,Vh,Zh,Kh])(t,e)}function $h(t,e){let[l,n]=E(t,2),a=o=>o.flat().includes(l)?ht(o):yt(o),i=()=>{let{h:o,w:c}=q(t,e,4,8),r=M(o,c,0),s=B(t,.5),m=s?[l,n]:[n];for(let f=0;fG(ht(o.input),yt(o.input))});return H(u,_(i,u),["The geometric move is different from example to example. What signals the change?",`If color ${R(l)} (${l}) is present the grid rotates 90\xB0 cw; otherwise it mirrors left-right.`,`The rule is conditional on content: ${R(l)} present \u2192 rotate 90\xB0 clockwise; absent \u2192 flip horizontally.`],`Context rule: the presence of color ${R(l)} selects the transformation (rotation vs mirror).`)}function Jh(t,e){let[l,n]=E(t,2),a=o=>{let c=nt(o);return c.objects.length>=2?Zt(o,[Vt(c.objects)]):F(o,{[l]:n})},i=()=>{let{h:o,w:c}=q(t,e,6,10);if(B(t,.5)){let s=z(t,2,3),m=Nt(t,o,c,s,{colorPool:E(t,s),minSize:1,maxSize:4,margin:0}),f=m.map(d=>d.cells.length);return new Set(f).size!==f.length?{input:[[0]],output:[[1]]}:{input:_t(o,c,m),output:[[0]]}}let r=M(o,c,0);for(let s=0;s{if(!o.input.flat().some(s=>s!==0))return!1;let r=nt(o.input);return!c.some(s=>G(s.input,o.input))&&(r.objects.length>=2||r.objects.length===1)}).map(o=>({input:o.input,output:nt(o.input).objects.length>=2?Zt(o.input,[Vt(nt(o.input).objects)]):F(o.input,{[l]:n})}));return H(u,_(i,u),["Sometimes the small shapes vanish, sometimes colors change. What decides?","Count the objects: 2 or more \u2192 keep only the largest; exactly 1 \u2192 recolor it.",`The rule depends on the object count: \u22652 objects \u2192 keep the largest; 1 object \u2192 recolor ${R(l)} (${l}) \u2192 ${R(n)} (${n}).`],"Context rule on object count: multiple objects trigger size selection; a single object triggers recoloring.")}function Wh(t,e){let l=()=>{let{h:a,w:i}=q(t,e,4,9),u=M(a,i,0),o=E(t,2);for(let c=0;c{let u=a.input.length%2===0?Qt(a.input):yt(a.input);return G(u,a.input)||G(yt(a.input),Qt(a.input))}});return H(n,_(l,n),["Some grids mirror top-bottom, others left-right. What property of the GRID decides?","The parity of the height: even height \u2192 vertical flip; odd height \u2192 horizontal flip.","The rule: if the number of rows is even, flip top-bottom; if odd, flip left-right."],"Context rule on grid parity: height even \u2192 flipV, height odd \u2192 flipH.")}function Fh(t,e){let[l,n,a]=E(t,3),i=c=>{let r=Math.floor(c.length/2);return c.map((s,m)=>s.map(f=>f===l?m{let c=z(t,6,10),r=z(t,5,9),s=M(c,r,0);for(let m=0;m{let s=Math.floor(c.input.length/2),m=c.input.slice(0,s).flat().includes(l),f=c.input.slice(s).flat().includes(l);return m&&f&&!r.some(d=>G(d.input,c.input))}).map(c=>({input:c.input,output:i(c.input)}));return H(o,_(u,o),["One source color becomes TWO different colors. What distinguishes the two cases?",`Rows matter: ${R(l)} (${l}) becomes ${R(n)} (${n}) in the top half and ${R(a)} (${a}) in the bottom half.`,`The rule is region-based: in the top half of the grid recolor ${l} \u2192 ${n}; in the bottom half recolor ${l} \u2192 ${a}.`],`Region-dependent recoloring of ${R(l)}: top half \u2192 ${R(n)}, bottom half \u2192 ${R(a)}.`)}function Ph(t,e){let n=u=>{let o=nt(u);if(o.objects.length===0)return u;let c=Vt(o.objects);return c.size>=4?Zt(u,[c]):M(vt(u).h,vt(u).w,0)},a=()=>{let{h:u,w:o}=q(t,e,7,11),c=B(t,.5),r=c?z(t,2,3):z(t,2,4),s=c?6:3,m=Nt(t,u,o,r,{colorPool:E(t,r),minSize:1,maxSize:s,margin:0}),f=_t(u,o,m);return{input:f,output:n(f)}},i=k(4,a,(u,o)=>{let c=nt(u.input);if(c.objects.length===0)return!1;let r=Vt(c.objects).size>=4,s=o.some(m=>Vt(nt(m.input).objects).size>=4);return r!==s||o.length===0?!o.some(m=>G(m.input,u.input)):!1}).map(u=>({input:u.input,output:n(u.input)}));return H(i,_(a,i),["Sometimes one shape survives, sometimes the grid empties completely. Why?","It depends on size: if the biggest object has 4 or more cells it is kept; otherwise everything is erased.","The rule: keep the largest object only when its size \u2265 4; otherwise output an all-black grid of the same size."],"Threshold rule on object size: largest object \u2265 4 cells \u2192 keep it; smaller \u2192 the output is empty (all zeros).")}function u1(t,e){let[l,n,a]=E(t,3),i=r=>{let s=Pe(r),m=s.maxR-s.minR+1,f=s.maxC-s.minC+1;if(m!==f)return!1;let d=new Set(r.map(([h,v])=>`${h},${v}`));for(let h=s.minR;h<=s.maxR;h++)for(let v=s.minC;v<=s.maxC;v++)if(!d.has(`${h},${v}`))return!1;return!0},u=r=>nt(r).objects.some(f=>i(f.cells))?Ai(r,l):F(r,{[n]:a}),o=()=>{let{h:r,w:s}=q(t,e,7,11),m=B(t,.5),f=Nt(t,r,s,z(t,1,2),{colorPool:E(t,2,[l]),minSize:1,maxSize:3,margin:1,shapes:"rect"});if(m){let h=z(t,2,3),v=[],T=z(t,1,Math.max(1,r-h-1)),y=z(t,1,Math.max(1,s-h-1));for(let p=T;p{let m=nt(r.input);if(m.objects.length===0)return!1;let f=m.objects.some(h=>i(h.cells)),d=s.some(h=>nt(h.input).objects.some(v=>i(v.cells)));return(f!==d||s.length===0)&&!s.some(h=>G(h.input,r.input))}).map(r=>({input:r.input,output:u(r.input)}));return H(c,_(o,c),["Square shapes trigger something different than non-square drawings.","If ANY object is a perfect square, every object gets a frame; otherwise the color substitution applies.",`The rule: a perfect square object present \u2192 frame every object with color ${R(l)} (${l}); no square \u2192 recolor ${R(n)} (${n}) \u2192 ${R(a)} (${a}).`],"Shape-conditional rule: the presence of a square object selects framing over recoloring.")}function o1(t,e){return O(t,[$h,Jh,Wh,Fh,Ph])(t,e)}function Ih(t,e){let l=O(t,[Wt,Ae,Qt,ze]),[n,a]=E(t,2),i=c=>F(l(c),{[n]:a}),u=()=>{let{h:c,w:r}=q(t,e,4,8),s=M(c,r,0);for(let m=0;mc!==l).map(c=>r=>F(c(r),{[n]:a}))});return H(o,_(u,o),["Only two examples \u2014 make them count. Two operations are composed here.",`Geometry (${Pt(l)}) first, then recolor ${R(n)} (${n}) \u2192 ${R(a)} (${a}).`,`Program: [${Pt(l)}, recolor ${n}\u2192${a}]. Apply the geometry, then substitute the color.`],`Two-op program: ${Pt(l)} \u2192 recolor ${n}\u2192${a}.`)}function t0(t,e){let l=O(t,[ht,yt,Wt]),n=O(t,[0,1]),a=O(t,[1,2]),[i,u]=E(t,2),o=s=>F(vl(l(s),n,a),{[i]:u}),c=()=>{let{h:s,w:m}=q(t,e,5,8),f=M(s,m,0);for(let d=0;do!==n),i=()=>{let{h:o,w:c}=q(t,e,4,8),r=M(o,c,0),s=E(t,2);for(let m=0;m