baesian 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +217 -2
  3. package/dist/agents.js +249 -0
  4. package/dist/api.js +13 -0
  5. package/dist/bin.js +14 -0
  6. package/dist/ci.js +82 -0
  7. package/dist/cite.js +66 -0
  8. package/dist/cli.js +831 -0
  9. package/dist/client/assets/alegreya-cyrillic-ext-wght-italic-DzWRXZb0.woff2 +0 -0
  10. package/dist/client/assets/alegreya-cyrillic-ext-wght-normal-CN0-BfWD.woff2 +0 -0
  11. package/dist/client/assets/alegreya-cyrillic-wght-italic-Dhrv2xfk.woff2 +0 -0
  12. package/dist/client/assets/alegreya-cyrillic-wght-normal-CU5lb38f.woff2 +0 -0
  13. package/dist/client/assets/alegreya-greek-ext-wght-italic-CoUI9EEu.woff2 +0 -0
  14. package/dist/client/assets/alegreya-greek-ext-wght-normal-C8PPRmwJ.woff2 +0 -0
  15. package/dist/client/assets/alegreya-greek-wght-italic-CVt9-Jr4.woff2 +0 -0
  16. package/dist/client/assets/alegreya-greek-wght-normal-BPx8yWcZ.woff2 +0 -0
  17. package/dist/client/assets/alegreya-latin-ext-wght-italic-BIuo_2sR.woff2 +0 -0
  18. package/dist/client/assets/alegreya-latin-ext-wght-normal-o8axeAGu.woff2 +0 -0
  19. package/dist/client/assets/alegreya-latin-wght-italic-Bxkcgmge.woff2 +0 -0
  20. package/dist/client/assets/alegreya-latin-wght-normal-BG9rTJo4.woff2 +0 -0
  21. package/dist/client/assets/alegreya-vietnamese-wght-italic-BAPuWgnQ.woff2 +0 -0
  22. package/dist/client/assets/alegreya-vietnamese-wght-normal-DOV9JYup.woff2 +0 -0
  23. package/dist/client/assets/archivo-latin-ext-wdth-normal-7khWdh9v.woff2 +0 -0
  24. package/dist/client/assets/archivo-latin-wdth-normal-DY7AcnAa.woff2 +0 -0
  25. package/dist/client/assets/archivo-vietnamese-wdth-normal-rJmnGBSt.woff2 +0 -0
  26. package/dist/client/assets/index-9yf70Vqv.css +1 -0
  27. package/dist/client/assets/index-Dwg9e0YR.js +15 -0
  28. package/dist/client/index.html +15 -0
  29. package/dist/facts.js +278 -0
  30. package/dist/folder-storage.js +71 -0
  31. package/dist/frontmatter.js +38 -0
  32. package/dist/gate-paths.js +77 -0
  33. package/dist/gate.js +237 -0
  34. package/dist/git.js +100 -0
  35. package/dist/globs.js +120 -0
  36. package/dist/hookblock.js +146 -0
  37. package/dist/hooks.js +911 -0
  38. package/dist/ids.js +23 -0
  39. package/dist/login.js +301 -0
  40. package/dist/mcp.js +303 -0
  41. package/dist/merges.js +849 -0
  42. package/dist/modes.js +245 -0
  43. package/dist/notify.js +91 -0
  44. package/dist/ops.js +381 -0
  45. package/dist/passkey.js +86 -0
  46. package/dist/personal.js +163 -0
  47. package/dist/practice-answers.js +42 -0
  48. package/dist/proposals.js +197 -0
  49. package/dist/quote.js +28 -0
  50. package/dist/report.js +261 -0
  51. package/dist/routing.js +411 -0
  52. package/dist/schema.js +1178 -0
  53. package/dist/server.js +514 -0
  54. package/dist/similarity.js +45 -0
  55. package/dist/sshsig.js +159 -0
  56. package/dist/state.js +135 -0
  57. package/dist/storage.js +61 -0
  58. package/dist/store.js +2259 -0
  59. package/dist/style.js +408 -0
  60. package/dist/sync.js +797 -0
  61. package/dist/trailers.js +121 -0
  62. package/dist/trust.js +222 -0
  63. package/dist/usage-fields.js +161 -0
  64. package/dist/vault.js +849 -0
  65. package/dist/verify.js +443 -0
  66. package/dist/version.js +70 -0
  67. package/dist/wait.js +449 -0
  68. package/dist/wikilinks.js +25 -0
  69. package/package.json +71 -4
@@ -0,0 +1,15 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function ee(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ee,ee):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ie(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var A=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function se(e){var t=w.T,n={};n.types=t===null?null:t.types,w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(ee,A)}catch(e){A(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}}function ce(e){var t=w.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else se(ce.bind(null,e))}var le={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=le,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.addTransitionType=ce,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=se,e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}}var S=!1,C=-1,ee=5,w=-1;function T(){return g?!0:!(e.unstable_now()-w<ee)}function E(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){_(E,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function ee(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function T(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),te=Symbol.for(`react.fragment`),ne=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),ae=Symbol.for(`react.context`),oe=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.suspense`),se=Symbol.for(`react.suspense_list`),ce=Symbol.for(`react.memo`),le=Symbol.for(`react.lazy`),ue=Symbol.for(`react.activity`),de=Symbol.for(`react.legacy_hidden`),fe=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function _e(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case te:return`Fragment`;case re:return`Profiler`;case ne:return`StrictMode`;case A:return`Suspense`;case se:return`SuspenseList`;case ue:return`Activity`;case j:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case ae:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ce:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case le:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ve=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function P(e,t){xe++,be[xe]=e.current,e.current=t}var we=Se(null),F=Se(null),Te=Se(null),Ee=Se(null);function I(e,t){switch(P(Te,t),P(F,e),P(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(we),P(we,e)}function De(){Ce(we),Ce(F),Ce(Te)}function Oe(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,P(Ee,e)),t=we.current;var n=dp(t,e.type);t!==n&&(P(F,e),P(we,n))}function ke(e){F.current===e&&(Ce(we),Ce(F)),Ee.current===e&&(Ce(Ee),sh._currentValue=ye)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,L=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,R=null,Xe=null;function z(e){if(typeof Je==`function`&&Ye(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(R,e)}catch{}}var Ze=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function at(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function st(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ze(n),i=1<<r;t|=e[r],n&=~i}return t}function ct(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 lt(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ft(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&pt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function pt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=n&42?1:gt(n),(n&(e.suspendedLanes|t))===0?n:0}function gt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _t(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function yt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var bt=Math.random().toString(36).slice(2),xt=`__reactFiber$`+bt,B=`__reactProps$`+bt,St=`__reactContainer$`+bt,Ct=`__reactEvents$`+bt,wt=`__reactListeners$`+bt,Tt=`__reactHandles$`+bt,Et=`__reactResources$`+bt,Dt=`__reactMarker$`+bt,Ot=`__reactLoad$`+bt;function kt(e){delete e[xt],delete e[B],delete e[wt],delete e[Tt]}function At(e){var t;if(t=e[xt])return t;for(var n=e.parentNode;n;){if(t=n[St]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[xt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function jt(e){if(e=e[xt]||e[St]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Nt(e){var t=e[Et];return t||=e[Et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Pt(e){e[Dt]=!0}function Ft(e){e[Ot]=void 0}var It=new Set,Lt={};function Rt(e,t){zt(e,t),zt(e+`Capture`,t)}function zt(e,t){for(Lt[e]=t,e=0;e<t.length;e++)It.add(t[e])}var Bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Vt={},V={};function Ht(e){return Le.call(V,e)?!0:Le.call(Vt,e)?!1:Bt.test(e)?V[e]=!0:(Vt[e]=!0,!1)}var H=!1;function Ut(){var e=H;return H=!1,e}function Wt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ve(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,H=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(ln(e,a,r),H=!0)}else for(var o in t)t.hasOwnProperty(o)&&ln(e,o,t[o])}function dn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var fn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),pn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=jt(e);if(t&&(e=t.stateNode)){var n=e[B]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[B]||null;if(!a)throw Error(i(90));en(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Rd(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[B]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=E({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=E({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(E({},Hn,{dataTransfer:0})),Gn=Pn(E({},Ln,{relatedTarget:0})),Kn=Pn(E({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(E({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(E({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(E({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(E({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(E({},Fn,{submitter:0})),rr=Pn(E({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(E({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(E({},Hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),or=Pn(E({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=qf(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Bf(e,0)}function Tr(e){if(Zt(Mt(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(wn){var Or;if(wn){var kr=`oninput`in document;if(!kr){var Ar=document.createElement(`div`);Ar.setAttribute(`oninput`,`return;`),kr=typeof Ar.oninput==`function`}Or=kr}else Or=!1;Dr=Or&&(!document.documentMode||9<document.documentMode)}function jr(){Sr&&(Sr.detachEvent(`onpropertychange`,Mr),Cr=Sr=null)}function Mr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,_n(e)),Sn(wr,t)}}function Nr(e,t,n){e===`focusin`?(jr(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,Mr)):e===`focusout`&&jr()}function Pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Fr(e,t){if(e===`click`)return Tr(t)}function Ir(e,t){if(e===`input`||e===`change`)return Tr(t)}function Lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Rr=typeof Object.is==`function`?Object.is:Lr;function zr(e,t){if(Rr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Le.call(t,i)||!Rr(e[i],t[i]))return!1}return!0}function Br(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hr(e,t){var n=Vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Vr(n)}}function Ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ur(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Br(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Br(e.document)}return t}function Gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Kr=wn&&`documentMode`in document&&11>=document.documentMode,qr=null,Jr=null,Yr=null,Xr=!1;function Zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xr||qr==null||qr!==Br(r)||(r=qr,`selectionStart`in r&&Gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yr&&zr(Yr,r)||(Yr=r,r=qf(Jr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=qr)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var $r={animationend:Qr(`Animation`,`AnimationEnd`),animationiteration:Qr(`Animation`,`AnimationIteration`),animationstart:Qr(`Animation`,`AnimationStart`),transitionrun:Qr(`Transition`,`TransitionRun`),transitionstart:Qr(`Transition`,`TransitionStart`),transitioncancel:Qr(`Transition`,`TransitionCancel`),transitionend:Qr(`Transition`,`TransitionEnd`)},ei={},ti={};wn&&(ti=document.createElement(`div`).style,`AnimationEvent`in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),`TransitionEvent`in window||delete $r.transitionend.transition);function ni(e){if(ei[e])return ei[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ti)return ei[e]=t[n];return e}var ri=ni(`animationend`),ii=ni(`animationiteration`),ai=ni(`animationstart`),oi=ni(`transitionrun`),si=ni(`transitionstart`),ci=ni(`transitioncancel`),li=ni(`transitionend`),ui=new Map,di=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);di.push(`scrollEnd`);function fi(e,t){ui.set(e,t),Rt(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(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.refCleanup=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 ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var n=e.alternate;return n===null?(n=ki(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&1206910976,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.refCleanup=e.refCleanup,n}function Mi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ni(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ai(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ue:return e=ki(31,n,t,a),e.elementType=ue,e.lanes=o,e;case te:return Pi(n.children,a,o,t);case ne:s=8,a|=24;break;case re:return e=ki(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case A:return e=ki(13,n,t,a),e.elementType=A,e.lanes=o,e;case se:return e=ki(19,n,t,a),e.elementType=se,e.lanes=o,e;case de:case j:return e=a|32,e=ki(30,n,t,e),e.elementType=j,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ae:s=10;break a;case ie:s=9;break a;case oe:s=11;break a;case ce:s=14;break a;case le:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Pi(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Fi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Ii(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Li(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ri=new WeakMap;function zi(e,t){if(typeof e==`object`&&e){var n=Ri.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Ri.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Bi=[],Vi=0,Hi=null,Ui=0,Wi=[],Gi=0,Ki=null,qi=1,Ji=``;function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e,Ui=t}function Xi(e,t,n){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,Ki=e;var r=qi;e=Ji;var i=32-Ze(r)-1;r&=~(1<<i),n+=1;var a=32-Ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,qi=1<<32-Ze(t)+i|n<<i|r,Ji=a+e}else qi=1<<a|n<<i|r,Ji=e}function Zi(e){e.return!==null&&(Yi(e,1),Xi(e,1,0))}function Qi(e){for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null;for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,Ji=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null}function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,qi=t.id,Ji=t.overflow,Ki=e}var ea=null,ta=null,U=!1,na=null,ra=!1,ia=Error(i(519));function aa(e){throw da(zi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[xt]=e,t[B]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for(ea=e.return;ea;)switch(ea.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:ea=ea.return}}function ca(e){if(e!==ea)return!1;if(!U)return sa(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ta&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ta=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ta=dm(e)}else t===27?(t=ta,Sp(e.type)?(e=um,um=null,ta=e):ta=t):ta=ea?lm(e.stateNode.nextSibling):null;return!0}function la(){ta=ea=null,U=!1}function ua(){var e=na;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=Se(null),pa=null,ma=null;function ha(e,t,n){P(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,Ce(fa)}function _a(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function va(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),_a(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),_a(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),_a(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ya(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Rr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(i(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Nf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Va=M.S;M.S=function(e,t){if(md=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=yf;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=Se(null);function Ua(){var e=Ha.current;return e===null?Qu.pooledCache:e}function Wa(e,t){t===null?P(Ha,Ha.current):P(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=Qu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(e,t){throw t.$$typeof===D?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function so(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ji(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Fi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===te?(e=d(e,t,n.props.children,r,n.key),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===le&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Ni(n.type,n.key,n.props,null,e.mode,r),ao(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Pi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=Ni(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case k:return t=Li(t,e.mode,n),t.return=e,t;case le:return t=Qa(t),f(e,t,n)}if(ve(t)||he(t))return t=Pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===ae)return f(e,Ca(e,t),n);oo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case O:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case le:return n=Qa(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===ae)return p(e,t,Ca(e,n),r);oo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case le:return r=Qa(r),m(e,t,n,r,i)}if(ve(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===ae)return m(e,t,n,Ca(t,r),i);oo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&Yi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return U&&Yi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&Yi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),U&&Yi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&Yi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),U&&Yi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===te&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===te){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ao(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===le&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===te?(c=Pi(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Ni(o.type,o.key,o.props,null,e.mode,c),ao(c,o),c.return=e,e=c)}return s(e);case k:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Li(o,e.mode,c),c.return=e,e=c}return s(e);case le:return o=Qa(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,io(o),c);if(o.$$typeof===ae)return _(e,r,Ca(e,o),c);oo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}function _o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(X&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:uo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ad|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=Se(null),wo=Se(0);function To(e,t){e=rd,P(wo,e),P(Co,t),rd=e|t.baseLanes}function Eo(){P(wo,rd),P(Co,Co.current)}function Do(){rd=wo.current,Ce(Co),Ce(wo)}var Oo=Se(null),ko=null;function Ao(e){var t=e.alternate;P(Fo,Fo.current&1),P(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){P(Fo,Fo.current),P(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(P(Fo,Fo.current),P(Oo,e),ko===null&&(ko=e)):No()}function No(){P(Fo,Fo.current),P(Oo,Oo.current)}function Po(e){Ce(Oo),ko===e&&(ko=null),Ce(Fo)}var Fo=Se(0);function Io(e,t){P(Oo,Oo.current),P(Fo,t)}function Lo(e){Ce(Fo),Ce(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 zo=0,W=null,G=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return zo=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){M.H=fc;var t=G!==null&&G.next!==null;if(zo=0,Bo=G=W=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&ba(e)&&(jc=!0))}function Qo(e,t,n,r){W=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=G=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=hc,o=t(n,r)}while(Ho);return o}function $o(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}zo=0,Bo=G=W=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?W.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=Bo===null?W.memoizedState:Bo.next;if(t!==null)Bo=t,G=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},Bo===null?W.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Za(Ko,e,t),t=W,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===pe)return;if(e.$$typeof===ae)return Sa(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=fe;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),G,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(zo&f)===f:(X&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ia&&(d=!0);else if((zo&p)===p){u=u.next,p===Ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,ad|=p;f=u.action,Uo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Rr(o,e.memoizedState)&&(jc=!0,d&&(n=La,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Rr(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=W,a=is(),o=U;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Rr((G||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Rs(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Qu===null)throw Error(i(349));o||zo&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=as(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function vs(e){var t=wi(e,2);t!==null&&Nd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){z(!0);try{n()}finally{z(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,G,typeof r==`function`?r:ls)}function xs(e,t,n,r,a){if(lc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ss(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(U){var n=Qu.formState;if(n!==null){a:{var r=W;if(U){if(ta){b:{for(var i=ta,a=ra;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ta=lm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,W,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,W,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),G,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=G;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=as(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();W.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&Yo(r,G.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(W.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=as(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if(J&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){z(!0);try{e()}finally{z(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||zo&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),W.lanes|=e,ad|=e,n)}function Ys(e,t,n,r){return Rr(n,t)?n:Co.current===null?!(zo&106)||zo&1073741824&&!(X&261930)?(jc=!0,e.memoizedState=n):(e=jd(),W.lanes|=e,ad|=e,t):(e=Js(e,n,r),Rr(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,cc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Ba(c,r),Ad(e)):sc(e,t,r,Ad(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,ye,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Ad())}function tc(){return Sa(sh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=mo(n);var r=ho(t,e,n);r!==null&&(Nd(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Ci(e,t,n,r),n!==null&&(Nd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Ad())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Rr(s,o))return Si(e,t,i,0),Qu===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Nd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=Ci(e,n,r,2),t!==null&&Nd(t,e,2)}function lc(e){var t=e.alternate;return e===W||t!==null&&t===W}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}var fc={readContext:Sa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:Sa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){z(!0);try{e()}finally{z(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){z(!0);try{n(t)}finally{z(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,W,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=rs();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qu===null)throw Error(i(349));X&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ls(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=Qu.identifierPrefix;if(U){var n=Ji,r=qi;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,W)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(J&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:Sa,use:ss,useCallback:Ks,useContext:Sa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),G.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),G,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:Sa,use:ss,useCallback:Ks,useContext:Sa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return G===null?Js(n,e,t):Ys(n,G.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return G===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,G,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Nd(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Nd(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Nd(t,e,n),go(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!zr(n,r)||!zr(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){_i(e)}function Sc(e){console.error(e)}function Cc(e){_i(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=mo(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Gd(),!1}if(U)return t=Oo.current,t===null?(r!==ia&&(t=Error(i(423),{cause:r}),da(zi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=zi(r,n),a=Ec(e.stateNode,r,a),_o(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ia&&(e=Error(i(422),{cause:r}),da(zi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=zi(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),_o(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),_o(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return xa(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(U&&s&&Zi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?zr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(zr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return co(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(jo(t),(e=ta)?(e=am(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(jo(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(Co.current===null){if(r=Qu,r!==null&&(s=ht(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,wi(e,s),Nd(r,e,s),Ac;Gd()}t=Bc(e,t,n)}else e=o.treeContext,ta=lm(s.nextSibling),ea=t,U=!0,na=null,ra=!1,e!==null&&$i(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=ji(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return xa(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(U&&r&&Zi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),sl(e,t,a)):(U&&r&&Zi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=Sa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=uo||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,po(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=Sa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=uo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=co(t,e.child,null,i),t.child=co(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return la(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Ga()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(U){if(i?Ao(t):No(),(e=ta)?(e=am(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw aa(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Pi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(Ao(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ji(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Pi(i,a,n,null),i.flags|=2):i=ji(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=ji(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return co(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(No(),o=a.fallback,s=t.mode,a=Qc({mode:`visible`,children:a.children},s),o=Pi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,co(t,e.child,null,c),a=t.child,a.memoizedState=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,da({value:a,source:null,stack:null})),$c(e,t,c)}if(jc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(Co.current!==null)return $c(e,t,c);if(r=Qu,r!==null&&(a=ht(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,wi(e,a),Nd(r,e,a),Ac;return om(o)||Gd(),$c(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ta=lm(o.nextSibling),ea=t,U=!0,na=null,ra=!1,e!==null&&$i(t,e),t=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=U?Ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function ll(e,t,n){switch(t.tag){case 3:I(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:Oe(t);break;case 4:I(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(Ao(t),e=sl(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,U&&t.flags&1048576&&Xi(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===oe){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===ce){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===ae){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=_e(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Gc(e,t,r,a,n);case 3:a:{if(I(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),yo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==a){a=zi(Error(i(424)),t),da(a),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ta=lm(e.firstChild),ea=t,U=!0,na=null,ra=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===a){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(t.stateNode=fp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&U&&(r=t.stateNode=hm(t.type,t.pendingProps,Te.current),ea=t,ra=!0,a=ta,Sp(t.type)?(um=a,ta=lm(r.firstChild)):ta=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((a=r=ta)&&(r=rm(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,ea=t,ta=lm(r.firstChild),ra=!1,a=!0)),a||aa(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Xo(e,t,$o,null,null,n),sh._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=ta)&&(n=im(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,ea=t,ta=null,e=!0)),e||aa(t)),null;case 13:return Xc(e,t,n);case 4:return I(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,xa(t),a=Sa(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=Qu,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},fo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ha(t,Oa,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:U&&Zi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Hd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Hd())e.flags|=8192;else throw $a=Ya,qa}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,ld|=t)}function hl(e,t){if(!U)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function gl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _l(e,t,n){var r=t.pendingProps;switch(Qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return gl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),gl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(dl(t),o===null?(gl(t),fl(t,a,null,r,n)):(gl(t),pl(t,o))):o?o===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,o)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(t,a,e,r,n)),null;case 27:if(ke(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}e=we.current,ca(t)?oa(t,e):(e=hm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}if(o=we.current,ca(t))oa(t,o);else{var s=lp(Te.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[xt]=t,o[B]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ea,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[xt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||aa(t,!0)}else e=lp(e).createTextNode(r),e[xt]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[xt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(i(558))}return gl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ca(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[xt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ml(t,t.updateQueue),gl(t),null);case 4:return De(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ga(t.type),gl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return gl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)hl(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ro(e),o!==null){for(t.flags|=128,hl(r,!1),e=o.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mi(n,e),n=n.sibling;return Io(t,Fo.current&1|2),U&&Yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>hd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!U)return gl(t),null}else 2*He()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=Fo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||U?Io(t,o):(n=o,P(Oo,t),P(Fo,n),ko===null&&(ko=t)),U&&Yi(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ce(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(i(156,t.tag))}function vl(e,t){switch(Qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Po(t),t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return ga(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&Ce(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;case 25:return null;default:return null}}function yl(e,t){switch(Qi(t),t.tag){case 3:ga(Oa),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:ga(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&Ce(Ha);break;case 24:ga(Oa)}}function bl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function xl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){Q(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=mi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}}function El(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&em(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&tm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[B]=t}catch(t){Q(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(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.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),El(e,r),H=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),H=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[xt]=e,t[B]=n}catch(t){Q(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Rl=!0,Tp(o,Ul===0?t:t+`_`+Ul,n),Ul++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Kl(e.child,t),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=gi(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Md(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=gi(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Md(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,K=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,sp=gh,e=Wr(e),Gr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Zl(e),pu(n))}}zl=null}function pu(e){for(;su!==null;){var t=su,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Q(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=mi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=gi(a.default,a.update),a!==`none`&&Wl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Nu(e,n),r&4&&bl(5,n);break;case 1:if(Nu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Nu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{So(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Nu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Nu(e,n);break;case 31:Nu(e,n),r&4&&Cu(e,n);break;case 13:Nu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||K;t=ru,i=K,ru=r,(K=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Fu(e,n,r)):Nu(e,n),ru=t,K=i}break;case 30:Nu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Nu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Q(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,H=!0}catch(t){Q(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Q(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(R,n)}catch{}switch(n.tag){case 26:K||Tl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!K&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:K||Tl(n,t),Ol(n);var r=yu,i=bu;Sp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:K||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),H=!0}catch(e){Q(n,t,e)}else try{yu.removeChild(n.stateNode),H=!0}catch(e){Q(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),K||xl(4,n,t),xu(e,t,n);break;case 1:K||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:K=(r=K)||n.memoizedState!==null,xu(e,t,n),K=r;break;case 30:Tl(n,t),xu(e,t,n);break;case 7:K||Tl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Q(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Q(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(i(435,e.tag))}}function q(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function Eu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ou(t,e,n),t=t.sibling}var Du=null;function Ou(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Eu(t,e,n),ku(e),a&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Eu(t,e,n),ku(e),a&512&&(K||r===null||Tl(r,r.return)),a&64&&ru&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Du,Eu(t,e,n),ku(e),a&512&&(K||r===null||Tl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ru)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Dt]||r[xt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[xt]=e,Pt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[xt]=e,Pt(r),t=r}e.stateNode=t}}else ru||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||K||t.parentNode.removeChild(t)):a.count--,n===null?ru||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Eu(t,e,n),ku(e),a&512&&(K||r===null||Tl(r,r.return)),r!==null&&a&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=iu,iu=!1,Eu(t,e,n),iu=o,ku(e),a&512&&(K||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),H=!0}catch(t){Q(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),a&1024&&(au=!0);break;case 6:if(Eu(t,e,n),ku(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,H=!0}catch(t){Q(e,e.return,t)}}break;case 3:if(H=!1,Wm=null,o=Du,Du=bm(t.containerInfo),Eu(t,e,n),Du=o,ku(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Q(e,e.return,t)}au&&(au=!1,Au(e)),H=!1;break;case 4:a=iu,iu=ru,r=Ut(),o=Du,Du=bm(e.stateNode.containerInfo),Eu(t,e,n),ku(e),Du=o,H&&lu&&(uu=!0),H=r,iu=a;break;case 12:Eu(t,e,n),ku(e);break;case 31:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,q(e,t)));break;case 13:Eu(t,e,n),ku(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,q(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=K,u=iu;ru=c||o,iu=u||o,K=l||s,Eu(t,e,n),K=l,iu=u,ru=c,ku(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||K||(t=s||K,n=ru,r=K,ru=o||ru,K=t,Pu(e,2),ru=n,K=r),!o&&iu||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,q(e,n))));break;case 19:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,q(e,t)));break;case 30:a&512&&(K||r===null||Tl(r,r.return)),a=Ut(),o=lu,s=(n&335544064)===n,c=e.memoizedProps,lu=s&&gi(c.default,c.update)!==`none`,Eu(t,e,n),ku(e),s&&r!==null&&H&&(e.flags|=4),lu=o,H=a;break;case 21:break;case 7:a&512&&(K||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Eu(t,e,n),ku(e)}}function ku(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Al(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(kl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Il(e,Pl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,s);break;default:throw Error(i(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Au(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Au(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ju(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Mu(t,e),t=t.sibling;else nu(t,!1)}function Mu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Hl(),ju(t,e),!cu&&!uu){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),du=!0}Vl=null;break;case 5:ju(t,e);break;case 4:r=cu,cu=!1,ju(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ju(t,e):Jl(e,!1));break;case 30:r=cu,i=Hl(),cu=!1,ju(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),cu=e.flags&32?!0:r;break;default:ju(t,e)}}function Nu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Pu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Pu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Pu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Pu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||K||i.parentNode.removeChild(i),Pu(n,r);break;case 22:n.memoizedState===null&&Pu(n,r);break;case 30:Tl(n,n.return),Pu(n,r);break;case 7:Tl(n,n.return);default:Pu(n,r)}e=e.sibling}}function Fu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Fu(i,a,n),bl(4,a);break;case 1:if(Fu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)xo(l[i],c)}catch(e){Q(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Fu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||Km(bm(c.ownerDocument),a.type,c),Fu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Fu(i,a,n);break;case 31:Fu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Fu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Fu(i,a,n),wl(a,a.return);break;case 30:Fu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Fu(i,a,n)}t=t.sibling}}function Iu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function Lu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Ru(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)zu(e,t,n,r),t=t.sibling;else i&&eu(t)}function zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ru(e,t,n,r),a&2048&&bl(9,t);break;case 1:Ru(e,t,n,r);break;case 3:Ru(e,t,n,r),i&&du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){Ru(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Q(t,t.return,e)}}else Ru(e,t,n,r);break;case 31:Ru(e,t,n,r);break;case 13:Ru(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?Ru(e,t,n,r):(o._visibility|=2,Bu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?Ru(e,t,n,r):Vu(e,t)),a&2048&&Iu(s,t);break;case 24:Ru(e,t,n,r),a&2048&&Lu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),Ru(e,t,n,r);break;default:Ru(e,t,n,r)}}function Bu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Bu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Bu(a,o,s,c,i)):u._visibility&2?Bu(a,o,s,c,i):Vu(a,o),i&&l&2048&&Iu(o.alternate,o);break;case 24:Bu(a,o,s,c,i),i&&l&2048&&Lu(o.alternate,o);break;default:Bu(a,o,s,c,i)}t=t.sibling}}function Vu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Vu(n,r),i&2048&&Iu(r.alternate,r);break;case 24:Vu(n,r),i&2048&&Lu(r.alternate,r);break;default:Vu(n,r)}t=t.sibling}}var Hu=8192;function Uu(e,t,n){if(e.subtreeFlags&Hu)for(e=e.child;e!==null;)Wu(e,t,n),e=e.sibling}function Wu(e,t,n){switch(e.tag){case 26:Uu(e,t,n),e.flags&Hu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Du,e.memoizedState,e.memoizedProps));break;case 5:Uu(e,t,n),e.flags&Hu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Du;Du=bm(e.stateNode.containerInfo),Uu(e,t,n),Du=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Hu,Hu=16777216,Uu(e,t,n),Hu=r):Uu(e,t,n));break;case 30:if((e.flags&Hu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Uu(e,t,n);break;default:Uu(e,t,n)}}function Gu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Yu(r,e)}Gu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qu(e),e=e.sibling}function qu(e){switch(e.tag){case 0:case 11:case 15:Ku(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Ku(e);break;case 12:Ku(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ju(e)):Ku(e);break;default:Ku(e)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Yu(r,e)}Gu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Ju(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ju(t));break;default:Ju(t)}e=e.sibling}}function Yu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Xu={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},Zu=typeof WeakMap==`function`?WeakMap:Map,J=0,Qu=null,Y=null,X=0,Z=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return J&2&&X!==0?X&-X:M.T===null?vt():Nf()}function jd(){if(cd===0){if(!(X&536870912)||U){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),cd=e}else cd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(mi(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Qu&&(Z===2||Z===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,X,cd,!1)),dt(e,n),J&2&&e===Qu||(e===Qu&&(!(J&2)&&(od|=n),id===4&&Ld(e,X,cd,!1)),Tf(e))}function Pd(e,t,n){if(J&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ot(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-He(),10<a)){if(Ld(r,t,cd,!ed),at(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=gp(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Tf(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},zl=null,Wu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-He():(a&4194048)===a?md-He():0,m=eh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Rr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ld(e,t,n,r){t=st(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&pt(e,n,t)}function Rd(){return J&6?!0:(Ef(0,!1),!1)}function zd(){if(Y!==null){if(Z===0)var e=Y.return;else e=Y,ma=pa=null,ns(e),no=null,ro=0,e=Y;for(;e!==null;)yl(e.alternate,e),e=e.return;Y=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Qu=e,Y=n=ji(e.current,null),X=t,Z=0,$u=null,ed=!1,td=ot(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=st(e,t),xi(),n}function Vd(e,t){W=null,M.H=fc,t===Ka||t===Ja?(t=eo(),Z=3):t===qa?(t=eo(),Z=4):Z=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,Y===null&&(id=1,wc(e,zi(t,e.current)))}function Hd(){var e=Oo.current;return e===null?!0:(X&4194048)===X?ko===null:(X&62914560)===X||X&536870912?e===ko:!1}function Ud(){var e=M.H;return M.H=fc,e===null?fc:e}function Wd(){var e=M.A;return M.A=Xu,e}function Gd(){id=4,ed||(X&4194048)!==X&&Oo.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Qu===null||Ld(Qu,X,cd,!1)}function Kd(e,t,n){var r=J;J|=2;var i=Ud(),a=Wd();(Qu!==e||X!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Z!==0&&Y!==null){var s=Y,c=$u;switch(Z){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=Z;if(Z=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Z,Z=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,J=r,M.H=i,M.A=a,Y===null&&(Qu=null,X=0,xi()),o}function qd(){for(;Y!==null;)Xd(Y)}function Jd(e,t){var n=J;J|=2;var r=Ud(),a=Wd();Qu!==e||X!==t?(gd=null,hd=He()+500,Bd(e,t)):td=ot(e,t);a:do try{if(Z!==0&&Y!==null){t=Y;var o=$u;b:switch(Z){case 1:Z=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(Xa(o)){Z=0,$u=null,Zd(t);break}t=function(){Z!==2&&Z!==9||Qu!==e||(Z=7),Tf(e)},o.then(t,t);break a;case 3:Z=7;break a;case 4:Z=5;break a;case 7:Xa(o)?(Z=0,$u=null,Zd(t)):(Z=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Ym(s):c.stateNode.complete){Z=0,$u=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,$d(u))}break b}}Z=0,$u=null,Qd(e,t,o,5);break;case 6:Z=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return ma=pa=null,M.H=r,M.A=a,J=n,Y===null?(Qu=null,X=0,xi(),id):0}function Yd(){for(;Y!==null&&!Be();)Xd(Y)}function Xd(e){var t=ul(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):Y=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:ns(t);var r=t;r===ea&&(U?(sa(r),r.tag===5&&r.stateNode!=null&&(ta=r.stateNode)):(sa(r),U=!0));default:yl(n,t),t=Y=Mi(t,rd),t=ul(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):Y=t}function Qd(e,t,n,r){ma=pa=null,ns(t),no=null,ro=0;var i=t.return;try{if(kc(e,i,t,n,X)){id=1,wc(e,zi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;id=1,wc(e,zi(n,e.current)),Y=null;return}t.flags&32768?(U||r===1?e=!0:td||X&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=_l(t.alternate,t,rd);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);id=6,Y=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(J&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Qu&&(Y=Qu=null,X=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=bi,ft(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Na(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(L,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=J,J|=4;try{fu(e,t,n)}finally{J=a,N.p=i,M.T=r}}vd=1,Rl?Td=Mp(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,Mu(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=J;J|=4;try{lu=uu=!1,Ou(t,e,n),n=cp;var o=Wr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ur(s.ownerDocument.documentElement,s)){if(c!==null&&Gr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Hr(s,h),v=Hr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{J=a,N.p=i,M.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=J;J|=4;try{mu(e,t.alternate,t)}finally{J=i,N.p=r,M.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Ve();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),_t(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(R,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{M.T=n,N.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);xd&3&&uf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Ef(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=_t(xd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,J&6)throw Error(i(331));var c=J;if(J|=4,qu(o.current),zu(o,o.current,s,n),J=c,Ef(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(R,o)}catch{}return!0}finally{N.p=a,M.T=r,lf(e,t)}}function ff(e,t,n){t=zi(n,t),t=Ec(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(dt(e,2),Tf(e))}function Q(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=zi(n,e),n=Dc(2),r=ho(t,n,2),r!==null&&(Oc(n,r,t,e),dt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(nd=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qu===e&&(X&n)===n&&(id===4||id===3&&(X&62914560)===X&&300>He()-pd?J&2?sd|=n:Bd(e,0):sd|=n,ld===X&&(ld=0)),Tf(e)}function hf(e,t){t===0&&(t=lt()),e=wi(e,t),e!==null&&(dt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Re(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=X,a=at(r,r===Qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ot(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=He(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}vd!==0&&vd!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ct(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Qu,n=X,n=at(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Z===2||Z===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),_t(n)){case 2:case 8:n=Ge;break;case 32:n=L;break;case 268435456:n=qe;break;default:n=L}return r=Af.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=X;return r=at(e,e===Qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),kf(e,He()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(uf())return null;Pd(e,t,!0)}function Mf(){bp(function(){J&6?Re(We,Df):Of()})}function Nf(){if(wf===0){var e=Ia;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[B]||null).action),o=r.submitter;o&&(t=(t=o[B]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<di.length;If++){var Lf=di[If];fi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}fi(ri,`onAnimationEnd`),fi(ii,`onAnimationIteration`),fi(ai,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(oi,`onTransitionRun`),fi(si,`onTransitionStart`),fi(ci,`onTransitionCancel`),fi(li,`onTransitionEnd`),zt(`onMouseEnter`,[`mouseout`,`mouseover`]),zt(`onMouseLeave`,[`mouseout`,`mouseover`]),zt(`onPointerEnter`,[`pointerout`,`pointerover`]),zt(`onPointerLeave`,[`pointerout`,`pointerover`]),Rt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Rt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Rt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Rt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Ct];n===void 0&&(n=t[Ct]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,It.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=At(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Sn(function(){var r=a,i=_n(n),s=[];a:{var c=ui.get(e);if(c!==void 0){var l=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=Gn;break;case`focusout`:u=`blur`,l=Gn;break;case`beforeblur`:case`afterblur`:l=Gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=rr;break;case ri:case ii:case ai:l=Kn;break;case li:l=ir;break;case`scroll`:case`scrollend`:l=Rn;break;case`wheel`:l=ar;break;case`copy`:case`cut`:case`paste`:l=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=tr;break;case`submit`:l=nr;break;case`toggle`:case`beforetoggle`:l=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Cn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(At(u)||u[St]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?At(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Mt(c),h=l==null?u:Mt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,At(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?T(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Er;else if(br(c)){if(Dr)_=Ir;else{_=Pr;var v=Nr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&dn(r.elementType)&&(_=Er):_=Fr;if(_&&=_(e,r)){xr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Mt(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(qr=v,Jr=r,Yr=null);break;case`focusout`:Yr=Jr=qr=null;break;case`mousedown`:Xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Xr=!1,Zr(s,n,i);break;case`selectionchange`:if(Kr)break;case`keydown`:case`keyup`:Zr(s,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=qf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Cn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
+ `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,o);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=mn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}H=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:un(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Lt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[B]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}H=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}H=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ep(e,t,r,d,n,null)}}tn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ep(e,t,s,c,n,null)}on(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(H=!0),o=m;break;case`name`:m!==f&&(H=!0),a=m;break;case`checked`:m!==f&&(H=!0),u=m;break;case`defaultChecked`:m!==f&&(H=!0),d=m;break;case`value`:m!==f&&(H=!0),s=m;break;case`defaultValue`:m!==f&&(H=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}en(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(H=!0),p=o;break;case`defaultValue`:o!==l&&(H=!0),c=o;break;case`multiple`:o!==l&&(H=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(H=!0),p=a;break;case`defaultValue`:a!==o&&(H=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(H=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[xt]=r,n[B]=t,np(n,e,t),Pt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=At(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=T(n,a,w),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=T(r,a,w),t===null?t=!1:(h(t,!0,ee,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),kt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Dt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),kt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=N.d;N.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Rd();return e||t}function Cm(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Pt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=E({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Pt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Nt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Pt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Te.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Nt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Nt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Nt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+$t(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),np(t,`link`,n),Pt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+$t(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Pt(r),r;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Pt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Pt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Pt(a),a):(r=n,(a=vm.get(o))&&(r=E({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Pt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Dt]||a[xt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Pt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:ae,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function uh(e){return e?(e=Di,e):Di}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Nd(n,e,t),go(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Nd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Ad();t=gt(t);var n=wi(e,t);n!==null&&Nd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,yh(e,t,n,r)}finally{N.p=a,M.T=i}}function vh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,yh(e,t,n,r)}finally{N.p=a,M.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(J&6)&&(hd=He()+500,Ef(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Nd(s,a,2),Rd(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=_n(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=At(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case L:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=jt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=At(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=jt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=jt(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[B]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[B]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Ad(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Rd(),t[St]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{R=Jh.inject(qh),Xe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[St]=t.current,Uf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=o(((e,t)=>{t.exports=_()})),y=c(u(),1),b=(0,y.createContext)({});function x(e){let t=(0,y.useRef)(null);return t.current===null&&(t.current=e()),t.current}var S=typeof window<`u`?y.useLayoutEffect:y.useEffect,C=(0,y.createContext)(null);function ee(e,t){e.indexOf(t)===-1&&e.push(t)}function w(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var T=(e,t,n)=>n>t?t:n<e?e:n,E={},D=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),O=e=>typeof e==`object`&&!!e,k=e=>/^0[^.\s]+$/u.test(e);function te(e){let t;return()=>(t===void 0&&(t=e()),t)}var ne=e=>e,re=(...e)=>e.reduce((e,t)=>n=>t(e(n))),ie=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ae=class{constructor(){this.subscriptions=[]}add(e){return ee(this.subscriptions,e),()=>this.remove(e)}remove(e){w(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},oe=e=>e*1e3,A=e=>e/1e3,se=(e,t)=>t?1e3/t*e:0,ce=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},le=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function ue(e,t,n,r){return e===t&&n===r?ne:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=le(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(le(s+1e-7,e,n)-i-r)}return le(s,t,r)}}var de=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fe=e=>t=>1-e(1-t),j=ue(.33,1.53,.69,.99),pe=fe(j),me=de(pe),he=e=>e>=1?1:(e*=2)<1?.5*pe(e):.5*(2-2**(-10*(e-1))),ge=e=>1-Math.sin(Math.acos(e)),_e=fe(ge),ve=de(ge),M=ue(.42,0,1,1),N=ue(0,0,.58,1),ye=ue(.42,0,.58,1),be=e=>Array.isArray(e)&&typeof e[0]!=`number`;function xe(e,t){return be(e)?e[ce(0,e.length,t)]:e}var Se=e=>Array.isArray(e)&&typeof e[0]==`number`,Ce={linear:ne,easeIn:M,easeInOut:ye,easeOut:N,circIn:ge,circInOut:ve,circOut:_e,backIn:pe,backInOut:me,backOut:j,anticipate:he},P=e=>typeof e==`string`,we=e=>{if(Se(e)){let[t,n,r,i]=e;return ue(t,n,r,i)}return P(e)?Ce[e]:e},F={delta:0,timestamp:0,isProcessing:!1},Te;function Ee(){Te=void 0}var I={now:()=>(Te===void 0&&I.set(F.isProcessing||E.useManualTiming?F.timestamp:performance.now()),Te),set:e=>{Te=e,queueMicrotask(Ee)}},De=e=>Math.round(e*1e5)/1e5,Oe=e=>t=>typeof t==`string`&&t.startsWith(e),ke=Oe(`--`),Ae=Oe(`var(--`),je=e=>Ae(e)?Me.test(e.split(`/*`)[0].trim()):!1,Me=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ne(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Pe={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Fe={...Pe,transform:e=>T(0,1,e)},Ie={...Pe,default:1},Le=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Re(e){return e==null}var ze=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Be=(e,t)=>n=>!!(typeof n==`string`&&ze.test(n)&&n.startsWith(e)||t&&!Re(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ve=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Le);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},He=e=>T(0,255,e),Ue={...Pe,transform:e=>Math.round(He(e))},We={test:Be(`rgb`,`red`),parse:Ve(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ue.transform(e)+`, `+Ue.transform(t)+`, `+Ue.transform(n)+`, `+De(Fe.transform(r))+`)`},Ge=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function L(e){let t=e.length>5?2:1,n=Ge(e,3,t);return{red:parseInt(Ge(e,0,t),16),green:parseInt(Ge(e,1,t),16),blue:parseInt(Ge(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var Ke={test:Be(`#`),parse:L,transform:We.transform},qe=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Je=qe(`deg`),Ye=qe(`%`),R=qe(`px`),Xe=qe(`vh`),z=qe(`vw`),Ze={...Ye,parse:e=>Ye.parse(e)/100,transform:e=>Ye.transform(e*100)},Qe={test:Be(`hsl`,`hue`),parse:Ve(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ye.transform(De(t))+`, `+Ye.transform(De(n))+`, `+De(Fe.transform(r))+`)`},$e={test:e=>We.test(e)||Ke.test(e)||Qe.test(e),parse:e=>We.test(e)?We.parse(e):Qe.test(e)?Qe.parse(e):Ke.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?We.transform(e):Qe.transform(e),getAnimatableNone:e=>{let t=$e.parse(e);return t.alpha=0,$e.transform(t)}},et=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tt=new RegExp(Le.source),nt=new RegExp(et.source,`i`);function rt(e){return isNaN(e)&&typeof e==`string`&&(tt.test(e)||nt.test(e))}var it=`number`,at=`color`,ot=`var`,st=`var(`,ct="${}",lt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function ut(e){let t=e.toString();return tt.test(t)||nt.test(t)}function dt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(lt,e=>($e.test(e)?(r.color.push(a),i.push(at),n.push($e.parse(e))):e.startsWith(st)?(r.var.push(a),i.push(ot),n.push(e)):(r.number.push(a),i.push(it),n.push(parseFloat(e))),++a,ct)).split(ct),indexes:r,types:i}}function ft(e){return dt(e).values}function pt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===it?De(r[a]):e===at?$e.transform(r[a]):r[a]}return i}}function mt(e){return pt(dt(e))}var ht=e=>typeof e==`number`?0:$e.test(e)?$e.getAnimatableNone(e):e,gt=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:ht(e);function _t(e){let t=dt(e);return pt(t)(t.values.map((e,n)=>gt(e,t.split[n])))}var vt={test:rt,parse:ft,createTransformer:mt,getAnimatableNone:_t};function yt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function bt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=yt(s,r,e+1/3),a=yt(s,r,e),o=yt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function xt(e,t){return n=>n>0?t:e}var B=(e,t,n)=>e+(t-e)*n,St=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ct=[Ke,We,Qe],wt=e=>Ct.find(t=>t.test(e));function Tt(e){let t=wt(e);if(!t)return!1;let n=t.parse(e);return t===Qe&&(n=bt(n)),n}var Et=(e,t)=>{let n=Tt(e),r=Tt(t);if(!n||!r)return xt(e,t);let i={...n};return e=>(i.red=St(n.red,r.red,e),i.green=St(n.green,r.green,e),i.blue=St(n.blue,r.blue,e),i.alpha=B(n.alpha,r.alpha,e),We.transform(i))},Dt=new Set([`none`,`hidden`]);function Ot(e,t){return Dt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kt(e,t){return n=>B(e,t,n)}function At(e){return typeof e==`number`?kt:typeof e==`string`?je(e)?xt:$e.test(e)?Et:Pt:Array.isArray(e)?jt:typeof e==`object`?$e.test(e)?Et:Mt:xt}function jt(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>At(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Mt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=At(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Nt(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Pt=(e,t)=>{let n=dt(e),r=dt(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Dt.has(e)&&!r.values.length||Dt.has(t)&&!n.values.length?Ot(e,t):re(jt(Nt(n,r),r.values),pt(r)):xt(e,t)},Ft=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function It(e,t){let n=Ft.exec(e);if(!n)return;let r=Ft.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>De(B(a,o,e))+i}function Lt(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return B(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=It(e,t);if(n)return n}return At(e)(e,t)}var Rt=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function zt(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Bt=40;function Vt(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Rt.reduce((e,t)=>(e[t]=zt(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=E.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Bt),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Rt.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Rt.length;t++)o[Rt[t]].cancel(e)},state:n,steps:o}}var{schedule:V,cancel:Ht,steps:H}=Vt(typeof requestAnimationFrame<`u`?requestAnimationFrame:ne,!0,F),Ut=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>V.update(t,e),stop:()=>Ht(t),now:()=>F.isProcessing?F.timestamp:I.now()}},Wt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Gt=2e4;function Kt(e,t=50,n=Gt,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function qt(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Kt(o),Gt);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:A(s)}}var Jt=100,Yt=10,Xt=1,Zt=800,Qt=.3,$t=.3,en=.01,tn=2,nn=.005,rn=.5,an=.01,on=10,sn=.05,cn=e=>e<0?1/Math.max(1+e,sn):Math.max(1-e,sn);function ln(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return fn(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function un(e,t){return e*Math.sqrt(1-t*t)}var dn=12;function fn(e,t,n){let r=n;for(let n=1;n<dn;n++)r-=e(r)/t(r);return r}var pn=.001;function mn({duration:e=Zt,bounce:t=Qt}){let n,r,i=cn(t);e=T(an,on,A(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=un(t,i),o=Math.exp(-r);return pn-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=un(t*t,i);return(-n(t)+pn>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=fn(n,r,a),s=o*ln(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:oe(e)}}var hn=(e,t)=>(t?e>=0:e>0)&&e<1/0;function gn(e,t){if(hn(e,t))return e}function _n(e){let t=gn(e.stiffness),n=gn(e.damping,!0),r=gn(e.mass),i={...e,stiffness:t??Jt,damping:n??Yt,mass:r??Xt,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=cn(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*ln(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,mn(i)),i.isResolvedFromDuration=!0;hn(i.stiffness)&&hn(i.damping,!0)||(i.stiffness=Jt,i.damping=Yt)}return i}function vn(e=$t,t=Qt){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=_n({...n}),f=e=>d?0:-A(e),p=s/(2*Math.sqrt(o*c)),m=A(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?en:tn),g.restDelta=n.restDelta||(e?nn:rn)};_();let v,y,b;if(p<1){let e=un(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>oe(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=oe(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Kt(S),Gt),t=Wt(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var yn=Object.assign(vn,{applyToOptions:e=>{let t=qt(e,100,vn);return e.ease=t.ease,e.duration=oe(t.duration),e.type=`keyframes`,e}});function bn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=yn({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function xn(e,t,n){let r=[],i=E.mix||Lt,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=re(Array.isArray(t)?t[o]||ne:t,a)),r.push(a)}return r}function Sn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=xn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ie(e[r],e[r+1],n);return s[r](i)};return n?t=>l(T(e[0],e[a-1],t)):l}function Cn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ie(0,t,r);e.push(B(n,1,i))}}function wn(e){let t=[0];return Cn(t,e.length-1),t}function Tn(e,t){return e.map(e=>e*t)}function En(e,t){return e.map(()=>t||ye).splice(0,e.length-1)}function Dn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=be(r)?r.map(we):we(r)||ye,s={done:!1,value:t[0]};if(!a&&t.length===2&&!Array.isArray(o)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,i=n===r?void 0:(E.mix||Lt)(n,r);return{calculatedDuration:e,next:t=>(s.value=i?i(o(e>0?T(0,1,t/e):1)):r,s.done=t>=e,s)}}let c=Sn(Tn(n&&n.length===t.length?n:wn(t),e),t,{ease:Array.isArray(o)?o:En(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=c(t),s.done=t>=e,s)}}var On=5;function kn(e,t,n){let r=Math.max(t-On,0);return se(n-e(r),t-r)}function An(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):kn(t=>e.next(t).value,t,e.next(t).value)}var jn=e=>e!==null;function Mn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(jn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Nn={decay:bn,inertia:bn,tween:Dn,keyframes:Dn,spring:yn};function Pn(e){typeof e.type==`string`&&(e.type=Nn[e.type])}var Fn=40,In=(e,t)=>t-e>Fn&&!E.useManualTiming?t:e;function Ln(e,t){return{kind:e,animation:t,timestamp:I.now(),frameTimestamp:F.timestamp,frameIsProcessing:F.isProcessing}}function Rn(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Ln(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function zn(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Ln(`layout-animation-start`,e),node:t})}catch{}}var Bn=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Vn=e=>e/100,Hn=e=>Math.round(e*1e4)/1e4,Un=class extends Bn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==I.now()&&this.tick(I.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Rn(this,this.options)}initAnimation(){let{options:e}=this;Pn(e);let{type:t=Dn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Dn;this.mixKeyframes=void 0,s!==Dn&&typeof o[0]!=`number`&&(this.mixKeyframes=re(Vn,e.mixer?.(o[0],o[1])||Lt(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Kt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=In(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==bn&&(f.value=Mn(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??Hn((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==bn?Mn(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=T(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return A(this.calculatedDuration)}get iterationDuration(){return this.duration+A(this.options.delay??0)}get time(){return A(this.currentTime)}set time(e){e=oe(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return An(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(I.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=A(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ut,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(I.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Wn=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Gn(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Le)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Wn.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Kn=/\b([a-z-]*)\(.*?\)/gu,qn={...vt,getAnimatableNone:e=>{let t=e.match(Kn);return t?t.map(Gn).join(` `):e}},Jn={...vt,getAnimatableNone:e=>{let t=vt.parse(e);return vt.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Yn={...Pe,transform:Math.round},Xn={rotate:Je,pathRotation:Je,rotateX:Je,rotateY:Je,rotateZ:Je,scale:Ie,scaleX:Ie,scaleY:Ie,scaleZ:Ie,skew:Je,skewX:Je,skewY:Je,distance:R,translateX:R,translateY:R,translateZ:R,x:R,y:R,z:R,perspective:R,transformPerspective:R,opacity:Fe,originX:Ze,originY:Ze,originZ:R},Zn={borderWidth:R,borderTopWidth:R,borderRightWidth:R,borderBottomWidth:R,borderLeftWidth:R,borderRadius:R,borderTopLeftRadius:R,borderTopRightRadius:R,borderBottomRightRadius:R,borderBottomLeftRadius:R,width:R,maxWidth:R,height:R,maxHeight:R,top:R,right:R,bottom:R,left:R,inset:R,insetBlock:R,insetBlockStart:R,insetBlockEnd:R,insetInline:R,insetInlineStart:R,insetInlineEnd:R,padding:R,paddingTop:R,paddingRight:R,paddingBottom:R,paddingLeft:R,paddingBlock:R,paddingBlockStart:R,paddingBlockEnd:R,paddingInline:R,paddingInlineStart:R,paddingInlineEnd:R,margin:R,marginTop:R,marginRight:R,marginBottom:R,marginLeft:R,marginBlock:R,marginBlockStart:R,marginBlockEnd:R,marginInline:R,marginInlineStart:R,marginInlineEnd:R,fontSize:R,backgroundPositionX:R,backgroundPositionY:R,...Xn,zIndex:Yn,fillOpacity:Fe,strokeOpacity:Fe,numOctaves:Yn},Qn={...Zn,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:qn,WebkitFilter:qn,mask:Jn,WebkitMask:Jn},$n=e=>Qn[e],er=new Set([qn,Jn]);function tr(e,t){let n=$n(e);return er.has(n)||(n=vt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function nr(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var rr=e=>e*180/Math.PI,ir=e=>or(rr(Math.atan2(e[1],e[0]))),ar={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ir,rotateZ:ir,skewX:e=>rr(Math.atan(e[1])),skewY:e=>rr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},or=e=>(e%=360,e<0&&(e+=360),e),sr=ir,cr=e=>Math.hypot(e[0],e[1]),lr=e=>Math.hypot(e[4],e[5]),ur={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:cr,scaleY:lr,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(cr(e)+lr(e))/2,rotateX:e=>or(rr(Math.atan2(e[6],e[5]))),rotateY:e=>or(rr(Math.atan2(-e[2],e[0]))),rotateZ:sr,rotate:sr,skewX:e=>rr(Math.atan(e[4])),skewY:e=>rr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function dr(e){return+!!e.includes(`scale`)}function fr(e,t){if(!e||e===`none`)return dr(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return dr(t);let r=(n[1]?ur:ar)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var pr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return fr(n,t)},mr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],hr=new Set([...mr,`pathRotation`]),gr=e=>e===Pe||e===R,_r=new Set([`x`,`y`,`z`]),vr=mr.filter(e=>!_r.has(e));function yr(e){let t=[];return vr.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var br=new Set([`bottom`,`right`]);function xr(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Sr=({transform:e})=>fr(e,`x`),Cr=({transform:e})=>fr(e,`y`),wr={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>xr(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>xr(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:Sr,y:Cr,translateX:Sr,translateY:Cr},Tr=new Set,Er=!1,Dr=!1,Or=!1;function kr(){if(Dr){let e=[],t=new Set,n=new Set;Tr.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),br.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=yr(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Dr=!1,Er=!1,Tr.forEach(e=>e.complete(Or)),Tr.clear()}function Ar(){Tr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Dr=!0)})}function jr(){Or=!0,Ar(),kr(),Or=!1}function Mr(e,t,n){if(typeof e==`string`){if(D(e)||k(e))return parseFloat(e);if(!vt.test(e)&&vt.test(n))return tr(t,n)}return e??void 0}var Nr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Tr.add(this),Er||(Er=!0,V.read(Ar),V.resolveKeyframes(kr))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Mr(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}nr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Tr.delete(this)}cancel(){this.state===`scheduled`&&(Tr.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Pr=e=>e.startsWith(`--`);function Fr(e,t,n){Pr(t)?e.style.setProperty(t,n):e.style[t]=n}var Ir={};function Lr(e,t){let n=te(e);return()=>Ir[t]??n()}var Rr=Lr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),zr=Lr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Br=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Vr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Br([0,.65,.55,1]),circOut:Br([.55,0,1,.45]),backIn:Br([.31,.01,.66,-.59]),backOut:Br([.33,1.53,.69,.99])};function Hr(e,t){if(e)return typeof e==`function`?zr()?Wt(e,t):`ease-out`:Se(e)?Br(e):Array.isArray(e)?e.map(e=>Hr(e,t)||Vr.easeOut):Vr[e]}function Ur(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Hr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Wr(e){return typeof e==`function`&&`applyToOptions`in e}function Gr({type:e,...t}){return Wr(e)&&zr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Kr=class extends Bn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=Gr(e);this.animation=Ur(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Mn(r,this.options,o,this.speed);this.updateMotionValue?.(e),Fr(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Rn(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return A(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+A(e)}get time(){return A(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=oe(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Rr()?(this.animation.timeline=e,t?.(this.animation),ne):n(this)}},qr={anticipate:he,backInOut:me,circInOut:ve};function Jr(e){return e in qr}function Yr(e){typeof e.ease==`string`&&Jr(e.ease)&&(e.ease=qr[e.ease])}var Xr=class extends Kr{constructor(e){Yr(e),Pn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(I.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new Un({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?T(0,10,a):0,s=this.sample(a);n&&r&&Fr(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},Zr=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(vt.test(e)||e===`0`)&&!e.startsWith(`url(`));function Qr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function $r(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Zr(i,t),s=Zr(a,t);return!o||!s?!1:Qr(e)||(n===`spring`||Wr(n))&&r}function ei(e){e.duration=0,e.type=`keyframes`}var ti=new Set([`opacity`,`clipPath`,`filter`,`transform`]),ni=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ri(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ni.test(e[t]))return!0;return!1}var ii=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),ai=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),oi=()=>!E.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function si(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(ti.has(n)||ai.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return oi()&&(ti.has(n)||ai.has(n)&&ri(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!ii(e)}var ci=(e,t)=>t&&typeof e==`number`?t.transform(e):e,li={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ui=mr.length,di={},fi=(e,t,n=ci(t,Xn[e]))=>(di[e]||(di[e]=(li[e]||e)+`(`))+n+`)`,pi=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function mi(e,t,n){let r=``;for(let i=0;i<ui;i++){let a=mr[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=ci(o,Zn[a]));pi(a,o)||(r+=fi(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=fi(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var hi=new WeakMap,gi=200,_i=.001,vi=.1,yi=.001,bi=100,xi=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Si=(e,t)=>Math.abs(e-t)<=_i,Ci=(e,t)=>e-t,wi=(e,t,n)=>wn(Array(n+1)).map(n=>B(e,t,n)),Ti=e=>e.motionValue.owner,Ei=e=>hi.get(e),Di=({state:e})=>e===`idle`||e===`finished`,Oi=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),ki=({name:e,motionValue:t})=>e&&mr.includes(e)&&t?.owner?.current instanceof HTMLElement&&oi()&&zr();function Ai(e){let t=Ti(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Oi(t,`transform`)||`none`)===`none`&&!Oi(t,`pathRotation`)&&!t.projection?.isProjecting()&&!ii(e)}var ji=class extends Un{constructor(e){let t=Ti(e).current,{driver:n=Ut}=e,r,i=Ai(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Ei(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Ei(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Ei(Ti(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(I.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=Se(n)?Br(n):xi(n)&&Vr[n];if(o&&!i&&!r&&e.length===2&&t===Dn&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Dn)===Dn?u||wn(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=I.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||Mi(Ti(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(I.now())}get time(){return this.isAccelerated()?A(T(0,this.totalDuration,this.at(I.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function Mi(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?mr:a){let a=r.get(s),c=t===void 0?Oi(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&pi(r,i)||(n+=fi(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=I.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),k.schedule(!1)}),e.oncancel=()=>s.includes(r)&&k.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(gi,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=wi(t,n,i).concat(r).sort(Ci),o=e=>ie(t,n,e),s,c;for(let n of e){let e=n.numberAt(t),r=a.map(t=>n.numberAt(t)-e),i=r[r.length-1],o=r.some(e=>Math.abs(e)*_i>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(o&&!s)s=l,c=t=>(n.numberAt(t)-e)/o;else if(l.some((e,t)=>!Si(e,o&&s[t])))return}if(!s||s.every((e,t)=>Si(e,o(a[t]))))return`linear`;let l=[],u=(e,t=c(e))=>l.push(Hn(t)+` `+Hn(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?yi:vi))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=wi(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Ci))e>c&&o(c,e,0),c=e;return i.sort(Ci)},ee=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},w=(e,t,n,r,i={fill:`both`},a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=r||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,a)),u={transform:l};return s||(u.offset=c.map(e=>ie(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,a)),u=null),y(u,{...i,duration:n-t,easing:s||`linear`})},T=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=mr.filter(t=>{if(r.has(t))return!0;let n=i[t]=Oi(e,t);return n!==void 0&&!pi(t,n)}),v(!1);let m=!l&&ee(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(w(d,e,n,r),e-t,n-e)}else c>t&&(b(w(d,t,c),0,c-t),p.forEach(e=>e<c-1&&b(y(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;b(w(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||v(),!0},E=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},D=()=>!n.size&&(u=!0,Ei(t)===k&&hi.delete(t),k.isJS||v(),!0),O=()=>{let t=I.now();if(k.isJS||(k.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=Oi(e,n.name),o.has(n)||(c=!0))}),k.isFinishing=!1),l=!1,u||(n.forEach(e=>Di(e)&&n.delete(e)),D()))return;for(let e of n)if(!e.canAccelerate)return k.demote(!0);k.isJS&&(k.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!E(t)){if(a){if(t-f<bi)return k.demote();f=t}if(!T(t))return k.demote()}},k={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,F.isProcessing?V.render(O,!1,!0):queueMicrotask(O)))},release(e){Di(e)&&n.delete(e),D()||k.schedule(!0)},check(){if(!k.isJS){for(let t in i)if(Oi(e,t)!==i[t]&&!p(t))return k.schedule(!0,!0)}},demote(e){if(!(k.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),k.isJS=!0,o=new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return hi.set(t,k),k}var Ni=class extends Bn{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=I.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Nr;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=I.now();let u=$r(e,i,a,o);u||((E.instantAnimations||!s)&&l?.(Mn(e,n,t)),e[0]=e[e.length-1],ei(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&si(n),p=!f&&ki(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=In(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new Xr(n)}catch{m=new Un(n)}}else m=p?new ji(n):new Un(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),jr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},Pi=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Fi(this.animations,`duration`)}get iterationDuration(){return Fi(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Fi(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Ii=class extends Pi{then(e,t){return this.finished.finally(e).then(()=>{})}};function Li(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Ri=30,zi=e=>!isNaN(parseFloat(e)),Bi={current:void 0},Vi=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=I.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=I.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=zi(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ae)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ae,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){V.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){t&&(this.updatedAt=I.now(),this.stop()),this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Bi.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=I.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ri)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Ri);return se(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Hi(e,t){return new Vi(e,t)}function Ui(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Wi(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Ui(n,e)}var Gi={type:`spring`,stiffness:500,damping:25,restSpeed:10},Ki=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),qi={type:`keyframes`,duration:.8},Ji={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Yi=(e,{keyframes:t})=>t.length>2?qi:hr.has(e)?e.startsWith(`scale`)?Ki(t[1]):Gi:Ji,Xi=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function Zi(e){for(let t in e)if(!Xi.has(t))return!0;return!1}var Qi=(e,t,n,r={},i,a)=>o=>{let s=Wi(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=oe(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};Zi(s)||Object.assign(u,Yi(e,u)),u.duration&&=oe(u.duration),u.repeatDelay&&=oe(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ei(u),u.delay===0&&(d=!0)),(E.instantAnimations||E.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,ei(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Mn(u.keyframes,s);if(e!==void 0){V.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Un(u):new Ni(u)},$i=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ea(e){let t=$i.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function ta(e,t,n=1){let[r,i]=ea(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return D(e)?parseFloat(e):e}return je(i)?ta(i,t,n+1):i}function U(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function na(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...U(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function ra(e,t,n){return na(e.getProps(),t,n,e)}var ia=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,aa=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...mr]),oa=e=>Array.isArray(e);function sa(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hi(n))}function ca(e){return oa(e)?e[e.length-1]||0:e}function la(e,t){let{transitionEnd:n={},transition:r={},...i}=ra(e,t)||{};i={...i,...n};for(let t in i)sa(e,t,ca(i[t]))}var ua=e=>!!(e&&e.getVelocity);function da(e){return!!(ua(e)&&e.add)}function fa(e,t){let n=e.getValue(`willChange`);if(da(n))return n.add(t);if(!n&&E.WillChange){let n=new E.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var pa=`data-framer-appear-id`;function ma(e){return e.props[pa]}var ha=typeof window<`u`;function ga({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function _a(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Ui(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&ga(f,t))continue;let o={delay:n,...Wi(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){V.update(()=>r.set(i));continue}let p=!1;if(ha&&window.MotionHandoffAnimation){let n=ma(e);if(n){let e=window.MotionHandoffAnimation(n,t,V);e!==null&&(o.startTime=e,p=!0)}}fa(e,t);let m=l??e.shouldReduceMotion;r.start(Qi(t,r,i,m&&aa.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>V.update(()=>{o&&la(e,o)});d.length?Promise.all(d).then(t):t()}return d}function va(e,t,n={}){let r=ra(e,t,ia(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?_a(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(va(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Li(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function ya(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>va(e,t,n))):typeof t==`string`?va(e,t,n):Promise.all(_a(e,ra(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var ba={test:e=>e===`auto`,parse:e=>e},xa=e=>t=>t.test(e),Sa=[Pe,R,Ye,Je,z,Xe,ba],Ca=e=>Sa.find(xa(e));function wa(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||k(e)}var Ta=new Set([`auto`,`none`,`0`]);function Ea(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ta.has(t)&&ut(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=tr(n,i))}var Da=class extends Nr{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(Ne(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),je(r))){let i=ta(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!aa.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Ca(r),o=Ca(i);if(Ne(r)!==Ne(i)&&wr[n])this.needsMeasurement=!0;else if(a!==o){if(gr(a)&&gr(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else wr[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||wa(e[t]))&&n.push(t);n.length&&Ea(e,n,t)}measure(){let{element:e,name:t}=this;return wr[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Oa=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],ka=[];function Aa(e){ja(e),ka.unshift(e)}function ja(e){w(ka,e)}function Ma(e){return ka.find(t=>t.test(e))}function Na(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?V.update(()=>l.set(c)):(l.start(Qi(o,l,c,s&&aa.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>V.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function Pa(e,t,n,r,i){return Na(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=Fa(i)??e.read(t,r,i)}a=Hi(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function Fa(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function Ia(e){return O(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function La(e){return O(e)&&`ownerSVGElement`in e}var Ra={};function za(e){return Ra.current?.add(e),e}var Ba=e=>Ra.current?Ra.current.bind(e):e;function Va(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Ra.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Ha=class{constructor(e=V.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Ua(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new Ha(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function Wa(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(pi(i,a)||(t+=(t&&` `)+fi(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+fi(`rotate`,i)),t||`none`}var Ga=new Set([`originX`,`originY`,`originZ`]),Ka=(e,t)=>ci(e.get(t)?.get(),Zn[t]),qa=(e,t,n,r)=>{let i,a;if(hr.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>mr.indexOf(e)-mr.indexOf(t)))}t.get(`transform`)||(!Ia(e)&&!t.get(`transformBox`)&&qa(e,t,`transformBox`,new Vi(`fill-box`)),t.set(`transform`,new Vi(`none`),()=>{hi.get(e)?.check(),e.style.transform=Wa(t)})),a=t.get(`transform`)}else Ga.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new Vi(``),()=>{let n=Ka(t,`originX`)??`50%`,r=Ka(t,`originY`)??`50%`,i=Ka(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Pr(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=ci(r.getCurrent(),Zn[n])};return t.set(n,r,i,a)},Ja=e=>Ia(e)||La(e),Ya=(e,t)=>{if(hr.has(t))return pr(e,t);let n=getComputedStyle(e),r=Pr(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},Xa=Ua(qa,{test:Ja,read:Ya});function Za(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Qa(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(hr.has(e))o=!0;else if(ke(e))i[e]=n;else{let t=ci(n,Zn[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=mi(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var $a={offset:`stroke-dashoffset`,array:`stroke-dasharray`},eo={offset:`strokeDashoffset`,array:`strokeDasharray`};function to(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?$a:eo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var no=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ro(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Qa(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of no)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&to(d,i,a,o,!1)}function io(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var ao=(e,t,n,r,i=n)=>{let a=io(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=Za(i));let o=Zn[n]||Zn[i],s=a?()=>{e[i]=ci(r.get(),Zn[n])}:()=>{let t=ci(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function oo(e,t,n,r){return V.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new Vi(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var so=Ua((e,t,n,r)=>n.startsWith(`path`)&&!hr.has(n)?oo(e,t,n,r):n.startsWith(`attr`)?ao(e,t,n,r,co(n)):n===`d`?t.set(n,r,()=>{let t=r.get()?.replace(/path\(|["')]/g,``);t===void 0?e.removeAttribute(n):e.setAttribute(n,t)}):(hr.has(n)||Ga.has(n)||Pr(n)||n in e.style?qa:ao)(e,t,n,r),{test:La,read:(e,t)=>hr.has(t)?Zn[t]?.default||0:Pr(t)||no.includes(t)?Ya(e,t)||e.getAttribute(Za(t))||0:(t=co(t),e.getAttribute(Za(t))??e.getAttribute(t)??void 0)});function co(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function lo({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function uo({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function fo(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function po(e){return e===void 0||e===1}function mo({scale:e,scaleX:t,scaleY:n}){return!po(e)||!po(t)||!po(n)}var ho=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function go(e){return mo(e)||vo(e)||_o(e)}function _o(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function vo(e){return yo(e.x)||yo(e.y)}function yo(e){return e&&e!==`0%`}function bo(e,t,n){return n+t*(e-n)}function xo(e,t,n,r,i){return i!==void 0&&(e=bo(e,i,r)),bo(e,n,r)+t}function So(e,t=0,n=1,r,i){e.min=xo(e.min,t,n,r,i),e.max=xo(e.max,t,n,r,i)}function Co(e,{x:t,y:n}){So(e.x,t.translate,t.scale,t.originPoint),So(e.y,n.translate,n.scale,n.originPoint)}var wo=.999999999999,To=1.0000000000001;function Eo(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Do(e.x,-a.scroll.offset.x),Do(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Co(e,o)),r&&(r.path?.[s]||r)!==a&&go(a.latestValues)&&Ao(e,a.latestValues,a.layout?.layoutBox));t.x<To&&t.x>wo&&(t.x=1),t.y<To&&t.y>wo&&(t.y=1)}function Do(e,t){e.min+=t,e.max+=t}function Oo(e,t,n,r,i=.5){So(e,t,n,B(e.min,e.max,i),r)}function ko(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ao(e,t,n){let r=n??e;Oo(e.x,ko(t.x,r.x),t.scaleX,t.scale,t.originX),Oo(e.y,ko(t.y,r.y),t.scaleY,t.scale,t.originY)}function jo(e,t){return lo(fo(e.getBoundingClientRect(),t))}function Mo(e,t,n){let r=jo(e,n),{scroll:i}=t;return i&&(Do(r.x,i.offset.x),Do(r.y,i.offset.y)),r}var No=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),Po={},Fo=e=>La(e)?so:Xa,Io=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=Da}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return jo(this.current)}getProps(){return Po}};function Lo(e,t,n,r){if(Ra.current?.track(e),r)return Na(e=>r.getValue(e,null),t,n,r);let i=Fo(e);return Pa(i,e,t,n,new Io(i,e))}var Ro=Ua((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>O(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:zo,cancel:W}=Vt(queueMicrotask,!1);function G(e,t,n){let r=ua(e)?e:Hi(e);return r.start(Qi(``,r,t,n)),r.animation}var Bo={},Vo={value:null,addProjectionMetrics:null,countProjection:void 0};function Ho(e,t){let n=I.now();e=Ba(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(Ht(r),e(a-t))};return V.setup(r,!0),za(()=>Ht(r))}function Uo(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Wo(e){return La(e)&&e.tagName===`svg`}function Go(e){return ua(e)?e.get():e}var Ko=e=>typeof e==`number`?e:parseFloat(e),qo=Oa.length,Jo=e=>typeof e==`number`||R.test(e);function Yo(e,t,n,r,i,a){i?(e.opacity=B(0,n.opacity??1,Zo(r)),e.opacityExit=B(t.opacity??1,0,Qo(r))):a&&(e.opacity=B(t.opacity??1,n.opacity??1,r));for(let i=0;i<qo;i++){let a=Oa[i],o=Xo(t,a),s=Xo(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Jo(o)===Jo(s)?(e[a]=Math.max(B(Ko(o),Ko(s),r),0),(Ye.test(s)||Ye.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<ho.length;i++){let a=ho[i];(t[a]||n[a])&&(e[a]=B(t[a]||0,n[a]||0,r))}}function Xo(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Zo=$o(0,.5,_e),Qo=$o(.5,.95,ne);function $o(e,t,n){return r=>r<e?0:r>t?1:n(ie(e,t,r))}function es(e,t){e.min=t.min,e.max=t.max}function ts(e,t){es(e.x,t.x),es(e.y,t.y)}function ns(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var rs=.9999,is=1.0001,as=-.01,os=.01;function ss(e){return e.max-e.min}function cs(e,t,n){return Math.abs(e-t)<=n}function ls(e,t,n,r=.5){e.origin=r,e.originPoint=B(t.min,t.max,e.origin),e.scale=ss(n)/ss(t),e.translate=B(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rs&&e.scale<=is||isNaN(e.scale))&&(e.scale=1),(e.translate>=as&&e.translate<=os||isNaN(e.translate))&&(e.translate=0)}function us(e,t,n,r){ls(e.x,t.x,n.x,r?.originX),ls(e.y,t.y,n.y,r?.originY)}function ds(e,t,n,r=0){e.min=(r?B(n.min,n.max,r):n.min)+t.min,e.max=e.min+ss(t)}function fs(e,t,n,r){ds(e.x,t.x,n.x,r?.x),ds(e.y,t.y,n.y,r?.y)}function ps(e,t,n,r=0){let i=r?B(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+ss(t)}function ms(e,t,n,r){ps(e.x,t.x,n.x,r?.x),ps(e.y,t.y,n.y,r?.y)}function hs(e,t,n,r,i){return e-=t,e=bo(e,1/n,r),i!==void 0&&(e=bo(e,1/i,r)),e}function gs(e,t=0,n=1,r=.5,i,a=e,o=e){if(Ye.test(t)&&(t=parseFloat(t),t=B(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=B(a.min,a.max,r);e===a&&(s-=t),e.min=hs(e.min,t,n,s,i),e.max=hs(e.max,t,n,s,i)}function _s(e,t,[n,r,i],a,o){gs(e,t[n],t[r],t[i],t.scale,a,o)}var vs=[`x`,`scaleX`,`originX`],ys=[`y`,`scaleY`,`originY`];function bs(e,t,n,r){_s(e.x,t,vs,n?.x,r?.x),_s(e.y,t,ys,n?.y,r?.y)}var xs=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ss=xs(`applewebkit/`)&&!xs(`chrome/`)?Math.round:ne;function Cs(e){e.min=Ss(e.min),e.max=Ss(e.max)}function ws(e){Cs(e.x),Cs(e.y)}var Ts=()=>({translate:0,scale:1,origin:0,originPoint:0}),Es=()=>({x:Ts(),y:Ts()}),Ds=()=>({min:0,max:0}),Os=()=>({x:Ds(),y:Ds()});function ks(e){return e.translate===0&&e.scale===1}function As(e){return ks(e.x)&&ks(e.y)}function js(e,t){return e.min===t.min&&e.max===t.max}function Ms(e,t){return js(e.x,t.x)&&js(e.y,t.y)}function Ns(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ps(e,t){return Ns(e.x,t.x)&&Ns(e.y,t.y)}function Fs(e){return ss(e.x)/ss(e.y)}function Is(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Ls=class{constructor(){this.members=[]}add(e){ee(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(w(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(w(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Rs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var zs={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(R.test(e))e=parseFloat(e);else return e}return`${Rs(e,t.target.x)}% ${Rs(e,t.target.y)}%`}},Bs={borderRadius:Object.assign({},zs,{applyTo:Oa.slice()}),borderTopLeftRadius:zs,borderTopRightRadius:zs,borderBottomLeftRadius:zs,borderBottomRightRadius:zs,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=vt.parse(e);if(i.length>5)return r;let a=vt.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=B(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Vs(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<ho.length;e++){let t=ho[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Hs(e){return[e(`x`),e(`y`)]}var Us=(e,t)=>e.depth-t.depth,Ws=class{constructor(){this.children=[],this.isDirty=!1}add(e){ee(this.children,e),this.isDirty=!0}remove(e){w(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Us),this.isDirty=!1,this.children.forEach(e)}},Gs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ks=[`z`,`skew`,`skewZ`],qs=1e3,Js=0;function Ys(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Xs=e=>e.instance&&hi.get(e.instance)?.demote()&&e.resetSkewAndRotation();function Zs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=ma(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,V,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Zs(r)}function Qs(e){if(e)return e.options.allowProjection===!1?Qs(e.parent):e.projection}function $s({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Bo,{...Bs,...Bo}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:Qs(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&Uo(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=Js++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nc),this.nodes.forEach(pc),this.nodes.forEach(mc),this.nodes.forEach(rc),Vo.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ws)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ae),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=La(t)&&!Wo(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;V.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Ho(i,250),Gs.hasAnimatedSinceResize&&(Gs.hasAnimatedSinceResize=!1,this.nodes.forEach(fc)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||bc,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Ps(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Wi(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||fc(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Ht(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(hc),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Zs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Xs(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Xs(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(oc),this.nodes.forEach(ac);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(sc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lc),this.nodes.forEach(uc),this.nodes.forEach(dc),this.nodes.forEach(ec),this.nodes.forEach(tc)):this.nodes.forEach(sc),this.clearAllSnapshots();let e=I.now();F.delta=T(0,1e3/60,e-F.timestamp),F.timestamp=e,F.isProcessing=!0,H.update.process(F),H.preRender.process(F),H.render.process(F),F.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ic),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!ss(this.snapshot.measuredBox.x)&&!ss(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Os(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Xs(this);let t=this.projectionDelta&&!As(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||go(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),ws(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Os();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Cc))){let{scroll:e}=this.root;e&&(Do(t.x,e.offset.x),Do(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Os();if(ts(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&ts(t,e),Do(t.x,i.offset.x),Do(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||Os();ts(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Do(a.x,-n.scroll.offset.x),Do(a.y,-n.scroll.offset.y)),go(n.latestValues)&&Ao(a,n.latestValues,n.layout?.layoutBox)}return!r&&go(this.latestValues)&&Ao(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=Os();ts(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!go(n.latestValues))continue;let r;n.instance&&(mo(n.latestValues)&&n.updateSnapshot(),r=Os(),ts(r,n.measurePageBox())),bs(t,n.latestValues,n.snapshot?.layoutBox,r)}return go(this.latestValues)&&bs(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==F.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=F.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Os(),this.targetWithTransforms=Os()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fs(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):ts(this.target,this.layout.layoutBox),Co(this.target,this.targetDelta)):ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Vo.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||mo(this.parent.latestValues)||vo(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Os(),this.relativeTargetOrigin=Os(),ms(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),ts(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===F.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;ts(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Eo(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Os());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ns(this.prevProjectionDelta.x,this.projectionDelta.x),ns(this.prevProjectionDelta.y,this.projectionDelta.y)),us(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Is(this.projectionDelta.x,this.prevProjectionDelta.x)&&Is(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Vo.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Es(),this.projectionDelta=Es(),this.projectionDeltaWithTransform=Es()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Es();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Os(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(yc));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);gc(o.x,e.x,n),gc(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ms(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),vc(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Ms(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Os(),ts(f,this.relativeTarget)),c&&(this.animationValues=a,Yo(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Ht(this.pendingAnimation),void 0),this.pendingAnimation=V.update(()=>{Gs.hasAnimatedSinceResize=!0,this.motionValue||=Hi(0),this.motionValue.jump(0,!1),this.currentAnimation=G(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),zn(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(qs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Sc(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||Os(),xc(i.x,t.x,e.x),xc(i.y,t.y,e.y)}ts(t,i),Ao(t,r),us(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ls),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!_o(t))return;let n={};for(let t=0;t<Ks.length;t++)Ys(Ks[t],e,n,this.animationValues);for(let t=0;t<ho.length;t++)Ys(ho[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Go(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Go(t?.pointerEvents)||``),this.hasProjected&&!go(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Vs(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Bo){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Bo[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Go(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ac),this.root.sharedNodes.clear()}}}function ec(e){e.updateLayout(),cc(e)}function tc(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Hs(e=>{let t=ss(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;es(r[e],a[e])}else Sc(i,t.layoutBox,n)&&Hs(t=>{let n=ss(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=Es();us(c,n,t.layoutBox);let l=Es();us(l,a?e.applyTransform(r,!0):n,s);let u=!As(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=Os();ms(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=Os();ms(l,n,i.layoutBox,s),a&&o(c,l),Ps(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function nc(e){Vo.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function rc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ic(e){e.clearSnapshot()}function ac(e){e.clearMeasurements()}function oc(e){e.isLayoutDirty=!0,e.updateLayout()}function sc(e){e.isLayoutDirty=!1}function cc(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Hs(e=>Do(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function lc(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function uc(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function dc(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function fc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pc(e){e.resolveTargetDelta()}function mc(e){e.calcProjection()}function hc(e){e.resetSkewAndRotation()}function gc(e,t,n){e.translate=B(t.translate,0,n),e.scale=B(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function _c(e,t,n,r){e.min=B(t.min,n.min,r),e.max=B(t.max,n.max,r)}function vc(e,t,n,r){_c(e.x,t.x,n.x,r),_c(e.y,t.y,n.y,r)}function yc(e){return e.animationValues?.opacityExit!==void 0}var bc={duration:.45,ease:[.4,0,.1,1]};function xc(e,t,n){e.max=ss(n)+(e.min=t.min)}function Sc(e,t,n){return e===`position`||e===`preserve-aspect`&&!cs(Fs(t),Fs(n),.2)}function Cc(e){return e!==e.root&&e.scroll?.wasRoot}function wc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Tc=$s({attachResizeListener:(e,t)=>wc(e,`resize`,t),measureScroll:No,checkIsScrollRoot:()=>!0}),Ec={current:void 0},Dc=$s({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ec.current){let e=new Tc({});e.mount(window),e.setOptions({layoutScroll:!0}),Ec.current=e}return Ec.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Oc=new WeakMap;function kc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Ac(e){return typeof e==`string`||Array.isArray(e)}var jc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Mc=[`initial`].concat(jc);function Nc(e){if(kc(e.animate))return!0;for(let t=0;t<Mc.length;t++)if(Ac(e[Mc[t]]))return!0;return!1}function Pc(e){return!!(Nc(e)||e.variants)}function Fc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ua(i))e.addValue(r,i);else if(ua(a))e.addValue(r,Hi(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Hi(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ic={current:null},Lc={current:!1},Rc=typeof window<`u`;function zc(){if(Lc.current=!0,Rc){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Ic.current=e.matches;e.addEventListener(`change`,t),t()}else Ic.current=!1}}var Bc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Vc={};function Hc(e){Vc=e}function Uc(){return Vc}var Wc=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Nr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=I.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,V.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Nc(t),this.isVariantNode=Pc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ua(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted&&!this.presenceContext?.keepValuesOnRemount)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Oc.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Lc.current||zc(),this.shouldReduceMotion=Ic.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),Ht(this.notifyUpdate),Ht(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&ti.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Kr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:oe(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=hr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&V.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),hi.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Vc){let t=Vc[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Os()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&hi.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Bc.length;t++){let n=Bc[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Fc(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Hi(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(D(n)||k(n))?n=parseFloat(n):typeof n!=`number`&&!vt.test(n)&&vt.test(t)&&(n=tr(e,t)),this.setBaseTarget(e,ua(n)?n.get():n)),ua(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new ae)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){zo.render(this.render)}},Gc=class extends Wc{constructor(){super(...arguments),this.KeyframeResolver=Da}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ua(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Kc(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function qc(e,{layout:t,layoutId:n}){return hr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Bo[e]||e===`opacity`)}function Jc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ua(r[t])||i&&ua(i[t])||qc(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Yc(e){return window.getComputedStyle(e)}var Xc=class extends Gc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Kc}mount(e){super.mount(e)}readValueFromInstance(e,t){if(hr.has(t))return this.projection?.isProjecting?dr(t):pr(e,t);{let n=Yc(e),r=(ke(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return jo(e,t)}build(e,t,n){Qa(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Jc(e,t,n)}},Zc=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Qc(e){return{point:{x:e.pageX,y:e.pageY}}}var $c=e=>t=>Zc(t)&&e(t,Qc(t));function el(e,t,n,r){return wc(e,t,$c(n),r)}var tl=new WeakMap,nl,rl=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:La(r)&&`getBBox`in r?r.getBBox()[t]:r[n],il=rl(`inline`,`width`,`offsetWidth`),al=rl(`block`,`height`,`offsetHeight`);function ol({target:e,borderBoxSize:t}){tl.get(e)?.forEach(n=>{n(e,{get width(){return il(e,t)},get height(){return al(e,t)}})})}function sl(e){e.forEach(ol)}function cl(){typeof ResizeObserver<`u`&&(nl=new ResizeObserver(sl))}function ll(e,t){nl||cl();let n=Va(e);return n.forEach(e=>{let n=tl.get(e);n||(n=new Set,tl.set(e,n)),n.add(t),nl?.observe(e)}),()=>{n.forEach(e=>{let n=tl.get(e);n?.delete(t),n?.size||nl?.unobserve(e)})}}var ul=new Set,dl;function fl(){dl=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ul.forEach(t=>t(e))},window.addEventListener(`resize`,dl)}function pl(e){return ul.add(e),dl||fl(),()=>{ul.delete(e),!ul.size&&typeof dl==`function`&&(window.removeEventListener(`resize`,dl),dl=void 0)}}function ml(e,t){return za(typeof e==`function`?pl(e):ll(e,t))}var hl=(e,t)=>Math.abs(e-t);function gl(e,t){let n=hl(e.x,t.x),r=hl(e.y,t.y);return Math.sqrt(n**2+r**2)}var _l=new Set([`auto`,`scroll`]),vl=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bl(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Sl(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=gl(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:I.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=bl(t,this.transformPagePoint),this.hasPendingMove=!0,V.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Sl(e.type===`pointercancel`?this.lastMoveEventInfo:bl(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Zc(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=bl(Qc(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:I.now()}];let{onSessionStart:l}=t;l&&l(e,Sl(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=re(el(this.contextWindow,`pointermove`,this.handlePointerMove,u),el(this.contextWindow,`pointerup`,this.handlePointerUp,u),el(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(_l.has(e.overflowX)||_l.has(e.overflowY))&&this.scrollPositions.set(t,yl(t)),t=t.parentElement}this.scrollPositions.set(window,yl(window)),this.removeScrollListeners=re(wc(window,`scroll`,this.onElementScroll,{capture:!0}),wc(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=yl(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),V.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Ht(this.updatePoint)}},yl=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function bl(e,t){return t?{point:t(e.point)}:e}function xl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sl({point:e},t){return{point:e,delta:xl(e,wl(t)),offset:xl(e,Cl(t)),velocity:Tl(t,.1)}}function Cl(e){return e[0]}function wl(e){return e[e.length-1]}function Tl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=wl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>oe(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>oe(t)*2&&(r=e[1]);let a=A(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var El=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Dl(e){return El.has(e.tagName)||e.isContentEditable===!0}var Ol=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function kl(e){return Ol.has(e.tagName)||e.isContentEditable===!0}var Al={x:!1,y:!1};function jl(){return Al.x||Al.y}function Ml(e){return e===`x`||e===`y`?Al[e]?null:(Al[e]=!0,()=>{Al[e]=!1}):Al.x||Al.y?null:(Al.x=Al.y=!0,()=>{Al.x=Al.y=!1})}function Nl(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?B(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?B(n,e,r.max):Math.min(e,n)),e}function Pl(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Fl(e,{top:t,left:n,bottom:r,right:i}){return{x:Pl(e.x,n,i),y:Pl(e.y,t,r)}}function Il(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Ll(e,t){return{x:Il(e.x,t.x),y:Il(e.y,t.y)}}function Rl(e,t){let n=.5,r=ss(e),i=ss(t);return i>r?n=ie(t.min,t.max-r,e.min):r>i&&(n=ie(e.min,e.max-i,t.min)),T(0,1,n)}function zl(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Bl=.35;function Vl(e=Bl){return e===!1?e=0:e===!0&&(e=Bl),{x:Hl(e,`left`,`right`),y:Hl(e,`top`,`bottom`)}}function Hl(e,t,n){return{min:Ul(e,t),max:Ul(e,n)}}function Ul(e,t){return typeof e==`number`?e:e[t]||0}function Wl(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Gl=new WeakMap,Kl=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Os(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=Ml(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),Hs(e=>{let t=this.getAxisMotionValue(e).get()||0;if(je(t)&&(t=ta(t,this.visualElement.current)||0),R.test(t))t=parseFloat(t);else if(Ye.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=ss(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&V.update(()=>a(e,t),!1,!0),fa(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Ql(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&V.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new vl(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&V.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Zl(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Nl(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;ql(e)?this.constraints&&this.scroll===Wl(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Fl(r.layoutBox,e):!1,this.elastic=Vl(t),i!==this.constraints&&!ql(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Hs(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=zl(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!ql(e))return!1;let n=Jl(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Wl(r);let i=Mo(n,r.root,this.visualElement.getTransformPagePoint()),a=Ll(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(uo(a));this.hasMutatedConstraints=!!e,e&&(a=lo(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&Zl(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=Hs(e=>{if(!Zl(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return fa(this.visualElement,e),n.start(Qi(e,n,0,t,this.visualElement,!1))}stopAnimation(){Hs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Hs(e=>{if(!Zl(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-B(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ql(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Hs(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Rl({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Hs(t=>{let n=this.getAxisMotionValue(t);if(!Zl(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(B(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Gl.set(this.visualElement,this);let e=this.visualElement.current,t=el(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&kl(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=ql(t)&&Jl(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Xl(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),V.read(r);let o=wc(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Hs(t=>{if(!Zl(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Bl,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function ql(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Jl=e=>`current`in e?e.current:e;function Yl(e){let t=!0;return()=>{t?t=!1:e()}}function Xl(e,t,n){let r=ml(e,Yl(n)),i=ml(t,Yl(n));return()=>{r(),i()}}function Zl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ql(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function $l(e,t){let n=Va(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},za(()=>r.abort())]}function eu(e){return!(e.pointerType===`touch`||jl())}function tu(e,t,n={}){t=Ba(t);let[r,i,a]=$l(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!eu(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var nu=(e,t)=>t?e===t||nu(e,t.parentElement):!1,ru=new WeakSet;function K(e){return t=>{t.key===`Enter`&&e(t)}}function iu(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var au=(e,t)=>{let n=!1,r=K(()=>{ru.has(e)||(n=!0,iu(e,`down`))}),i=K(()=>{n&&(n=!1,iu(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&iu(e,`cancel`)},{...t,once:!0})};function ou(e){return Zc(e)&&!jl()}var su=new WeakSet;function cu(e,t,n={}){t=Ba(t);let[r,i,a]=$l(e,n),o=e=>{let r=e.currentTarget;if(!ou(e)||su.has(e))return;ru.add(r),n.stopPropagation&&su.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ru.has(r)&&ru.delete(r),ou(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||nu(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Ia(e)&&(e.addEventListener(`focus`,()=>au(e,i),i),!Dl(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function lu(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Sn(i,a,o);return t?s(r):s}var uu=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},du=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),fu=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function pu(e,t,n,r){Kc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(du.has(n)?n:Za(n),t.attrs[n])}function mu(e,t,n){let r=Jc(e,t,n);for(let n in e)if(n!==`children`&&(ua(e[n])||ua(t[n]))){let t=mr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var hu=class extends Gc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Os}getBaseTargetFromProps(e,t){return hr.has(t)?super.getBaseTargetFromProps(e,t)??dr(t):e[t]}getDefaultValue(e){return hr.has(e)?this.latestValues[e]??dr(e):void 0}readValueFromInstance(e,t){if(hr.has(t)){let e=$n(t);return e&&e.default||0}if(no.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=du.has(t)?t:Za(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return mu(e,t,n)}build(e,t,n){ro(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){pu(e,t,n,r)}mount(e){this.isSVGTag=fu(e.tagName),super.mount(e)}};function gu(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var _u=[...jc].reverse(),vu=e=>e?.out===!0?e:e?.out;function yu(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>ya(e,t,n))),n=xu(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&ra(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&vu(f(l??(g&&g.props.initial))?.transition);if(_u.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?Ac(f)||f===!1?f:void 0:l,y=Ac(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||kc(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=bu(i.prevProp,v),C=S||y&&(b&&!x||r>h),ee=!1,w=Array.isArray(v)?v:[v],T={},E;if(b!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=ra(e,n,ia(e,t))||{};T={...T,...a,...i},E=vu(r)||E}let{prevResolvedValues:D}=i;for(let t in{...D,...T}){if(t in m)continue;let n=T[t],r=D[t],a=Array.isArray(n)&&Array.isArray(r)?!gu(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(ee=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=T,i.prevOut=E,i.isActive&&(m={...m,...T}),C&&(!(x&&S)||ee))for(let n of w){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=ra(s,n)?.transition?.delayChildren;r.delay=Li(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!ua(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=xu(),i=!0}}}function bu(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!gu(t,e):!1}function xu(){let e={};for(let t of jc)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var Su=(0,y.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Cu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function wu(...e){return t=>{let n=!1,r=e.map(e=>{let r=Cu(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Cu(e[t],null)}}}}function Tu(...e){return y.useCallback(wu(...e),e)}var q=v(),Eu=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},Du=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=Eu(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=Eu(e.offsetParent);return[t/i,n/a]},Ou=class extends y.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(Ia(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Ia(e)&&e.offsetWidth||0,r=Ia(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=Du(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function ku({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,y.useId)(),c=(0,y.useRef)(null),l=(0,y.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,y.useContext)(Su),d=Tu(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,y.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return zo.setup(()=>{let[e,t]=Du(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),zo.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,q.jsx)(Ou,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:y.cloneElement(e,{ref:d})})}var Au=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=x(ju),d=(0,y.useId)(),f=(0,y.useRef)(),p=(0,y.useRef)(n),m=(0,y.useRef)(r);S(()=>{p.current=n,m.current=r});let h=!0,g=(0,y.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,y.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),y.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,q.jsx)(ku,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,q.jsx)(C.Provider,{value:g,children:e})};function ju(){return new Map}function Mu(e=!0){let t=(0,y.useContext)(C);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,y.useId)();(0,y.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,y.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}function Nu(){return Pu((0,y.useContext)(C))}function Pu(e){return e===null||e.isPresent}var Fu=e=>e.key||``;function Iu(e){let t=[];return y.Children.forEach(e,e=>{(0,y.isValidElement)(e)&&t.push(e)}),t}var Lu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Mu(o),f=(0,y.useMemo)(()=>Iu(e),[e]),p=o&&!u?[]:f.map(Fu),m=(0,y.useRef)(!0),h=x(()=>new Map),g=(0,y.useRef)(new Set),[_,v]=(0,y.useState)(f),[C,ee]=(0,y.useState)(f);S(()=>{o&&!u&&!C.length&&d?.()},[u,o,C.length,d]);let w=(0,y.useRef)();(0,y.useEffect)(()=>()=>{let e=w.current;w.current=void 0,e?.()},[C]),S(()=>{m.current=!1;for(let e=0;e<C.length;e++){let t=Fu(C[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[C,p.length,p.join(`-`)]);let T=[];if(f!==_){let e=[...f],t=0;for(let n of C){let r=p.indexOf(Fu(n));r===-1?(e.splice(t++,0,n),T.push(n)):t=r+T.length+1}return T.every(e=>h.get(Fu(e)))?e=f:a===`wait`&&(e=T),ee(Iu(e)),v(f),null}let{forceRender:E}=(0,y.useContext)(b);return(0,q.jsx)(q.Fragment,{children:C.map(e=>{let _=Fu(e),y=o&&!u?!1:f===C||p.includes(_);return(0,q.jsx)(Au,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(E?.(),v([]),o&&d?.(),w.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Ru=(0,y.createContext)({strict:!1}),zu={animation:[`variants`,...jc],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Bu=!1;function Vu(){if(Bu)return;let e={};for(let t in zu)e[t]={isEnabled:e=>zu[t].some(t=>!!e[t])};Hc(e),Bu=!0}function Hu(){return Vu(),Uc()}function Uu(e){let t=Hu();for(let n in e)t[n]={...t[n],...e[n]};Hc(t)}var Wu=(0,y.createContext)({});function Gu(e,t){if(Nc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Ac(t)?t:void 0,animate:Ac(n)?n:void 0}}return e.inherit===!1?{}:t}function Ku(e){let{initial:t,animate:n}=Gu(e,(0,y.useContext)(Wu));return(0,y.useMemo)(()=>({initial:t,animate:n}),[qu(t),qu(n)])}function qu(e){return Array.isArray(e)?e.join(` `):e}var Ju=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Yu(e,t,n){for(let r in t)!ua(t[r])&&!qc(r,n)&&(e[r]=t[r])}function Xu({transformTemplate:e},t){return(0,y.useMemo)(()=>{let n=Ju();return Qa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Zu(e,t){let n=e.style||{},r={};return Yu(r,n,e),Object.assign(r,Xu(e,t)),r}function J(e,t){let n={},r=Zu(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Qu=()=>({...Ju(),attrs:{}});function Y(e,t,n,r){let i=(0,y.useMemo)(()=>{let n=Qu();return ro(n,t,fu(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return Yu(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var X=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Z(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||X.has(e)}function $u(e,t){return e.startsWith(`on`)?!Z(e):t?.(e)??!Z(e)}function ed(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||ua(e[a])||($u(a,r)||n===!0&&Z(a)||!t&&!Z(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var td=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function nd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(td.indexOf(e)>-1||/[A-Z]/u.test(e))}function rd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??nd(e)?Y:J)(t,r,i,e),l=ed(t,typeof e==`string`,a,s),u=e===y.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,y.useMemo)(()=>ua(d)?d.get():d,[d]);return(0,y.createElement)(e,{...u,children:f})}function id({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ad(n,r,i,e),renderState:t()}}function ad(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Go(a[e]);let{initial:o,animate:s}=e,c=Nc(e),l=Pc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!kc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=na(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var od=e=>(t,n)=>{let r=(0,y.useContext)(Wu),i=(0,y.useContext)(C),a=()=>id(e,t,r,i);return n?a():x(a)},sd=od({scrapeMotionValuesFromProps:Jc,createRenderState:Ju}),cd=od({scrapeMotionValuesFromProps:mu,createRenderState:Qu}),ld=Symbol.for(`motionComponentSymbol`);function ud(e,t,n){let r=(0,y.useRef)(n);(0,y.useInsertionEffect)(()=>{r.current=n});let i=(0,y.useRef)(null);return(0,y.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var dd=(0,y.createContext)({});function fd(e,t,n,r,i,a){let{visualElement:o}=(0,y.useContext)(Wu),s=(0,y.useContext)(Ru),c=(0,y.useContext)(C),l=(0,y.useContext)(Su),u=l.reducedMotion,d=l.skipAnimations,f=(0,y.useRef)(null),p=(0,y.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,y.useContext)(dd);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&i.create(m,n,h),(0,y.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[pa],_=(0,y.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return S(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),S(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,y.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function pd(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Uu(r);let a=n?n===`svg`:nd(e),o=a?cd:sd;function s(n,s){let c,l=md(n);x(()=>!!Ec.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,y.useContext)(Su),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=Ku(n),m=o(n,d);if(!d&&typeof window<`u`){hd(u,r);let t=gd(u);p.visualElement=fd(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,q.jsxs)(Wu.Provider,{value:p,children:[c&&p.visualElement?(0,q.jsx)(c,{visualElement:p.visualElement,...u}):null,rd(e,n,ud(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,y.forwardRef)(s);return c[ld]=e,c}function md({layoutId:e}){let t=(0,y.useContext)(b).id;return t&&e!==void 0?t+`-`+e:e}function hd(e,t){(0,y.useContext)(Ru).strict}function gd(e){let{drag:t,layout:n}=Hu();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function _d(e,t){if(typeof Proxy>`u`)return pd;let n=new Map,r=(n,r)=>pd(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,pd(a,void 0,e,t)),n.get(a))})}var vd=(e,t)=>t.isSVG??nd(e)?new hu(t):new Xc(t,{allowProjection:e!==y.Fragment}),yd=class extends uu{constructor(e){super(e),e.animationState||=yu(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();kc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},bd=0,xd={animation:{Feature:yd},exit:{Feature:class extends uu{constructor(){super(...arguments),this.id=bd++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=ra(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Sd=class extends uu{constructor(e){super(e),this.removeGroupControls=ne,this.removeListeners=ne,this.controls=new Kl(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ne}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Cd=e=>(t,n)=>{e&&V.update(()=>e(t,n),!1,!0)},wd=class extends uu{constructor(){super(...arguments),this.removePointerDownListener=ne}onPointerDown(e){this.session=new vl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Cd(e),onStart:Cd(t),onMove:Cd(n),onEnd:(e,t)=>{delete this.session,r&&V.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=el(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},Td=!1,Ed=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Dd=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Od=class extends y.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),Td&&i.root.didUpdate(),i.options.layoutId!==r&&Dd(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Ed(this.props),onExitComplete:()=>this.safeToRemove()})),Gs.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Dd(o,n)),o.setOptions({...o.options,...Ed(this.props)}),Td=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||V.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),zo.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Td=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function kd(e){let[t,n]=Mu(),r=(0,y.useContext)(b);return(0,q.jsx)(Od,{...e,layoutGroup:r,switchLayoutGroup:(0,y.useContext)(dd),isPresent:t,safeToRemove:n})}var Ad={pan:{Feature:wd},drag:{Feature:Sd,ProjectionNode:Dc,MeasureLayout:kd}};function jd(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&V.postRender(()=>o(t,Qc(t)))}var Md=class extends uu{mount(){let{current:e}=this.node;e&&(this.unmount=tu(e,(e,t)=>(jd(this.node,t,`Hover`,`Start`),e=>jd(this.node,e,`Hover`,`End`))))}unmount(){}},Nd=class extends uu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=re(wc(this.node.current,`focus`,()=>this.onFocus()),wc(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Pd(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||jd(e,t,`Tap`,n)}var Fd=class extends uu{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=cu(e,(e,t)=>(Pd(this.node,t,`Start`),(e,{success:t})=>Pd(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Id=new WeakMap,Ld=new WeakMap,Rd=e=>{let t=Id.get(e.target);t&&t(e)},zd=e=>{e.forEach(Rd)};function Bd({root:e,...t}){let n=e||document;Ld.has(n)||Ld.set(n,{});let r=Ld.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(zd,{root:e,...t})),r[i]}function Vd(e,t,n){let r=Bd(t);return Id.set(e,n),r.observe(e),()=>{Id.delete(e),r.unobserve(e)}}var Hd={some:0,all:1},Ud=class extends uu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Hd[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Vd(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Wd(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Wd({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Gd=_d(Object.assign({},xd,{inView:{Feature:Ud},tap:{Feature:Fd},focus:{Feature:Nd},hover:{Feature:Md}},Ad,{layout:{ProjectionNode:Dc,MeasureLayout:kd}}),vd);function Kd(e){let t=x(()=>Hi(e)),{isStatic:n}=(0,y.useContext)(Su);if(n){let[,n]=(0,y.useState)(e);(0,y.useEffect)(()=>t.on(`change`,n),[])}return t}function qd(e,t){let n=Kd(t()),r=()=>n.set(t());return r(),S(()=>{let t=()=>V.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),Ht(r)}}),n}function Jd(e){Bi.current=[],e();let t=qd(Bi.current,e);return Bi.current=void 0,t}function Yd(e,t,n,r){if(typeof e==`function`)return Jd(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Zd(e,t,n,r);let i=typeof t==`function`?t:lu(t,n,r),a=Array.isArray(e)?Xd(e,i):Xd([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function Xd(e,t){let n=x(()=>[]);return qd(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Zd(e,t,n,r){let i=x(()=>Object.keys(n)),a=x(()=>({}));for(let o of i)a[o]=Yd(e,t,n[o],r);return a}function Qd(){!Lc.current&&zc();let[e]=(0,y.useState)(Ic.current);return e}function $d(e){return typeof e==`object`&&!Array.isArray(e)}function ef(e,t,n,r){return e==null?[]:typeof e==`string`&&$d(t)?Va(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function tf(e,t,n){return e*(t+1)+n*t}function nf(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function rf(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):nf(t,r)??e}function af(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(w(e,i),r--)}}function of(e,t,n,r,i,a){af(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:B(i,a,r[o]),easing:xe(n,o)})}function sf(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function cf(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var lf=`easeInOut`,uf=20;function df(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:rf(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=pf(e),{delay:l=0,times:u=wn(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n;r.mixer||=n.mixer;let x=typeof l==`function`?l(a,s):l,S=c.length,C=Wr(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&gf(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=oe(b));let r=qt(n,e,C);v=r.ease,b=r.duration}b??=o;let ee=f+x;u.length===1&&u[0]===0&&(u[1]=1);let w=u.length-c.length;if(w>0&&Cn(u,w),c.length===1&&c.unshift(null),m&&m<uf){let e=b>0?g/b:0;b=tf(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?fe(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:xe(f,e-1))}sf(u,m,e)}let T=ee+b;of(r,c,v,u,ee,T),y=Math.max(x+b,y),p=Math.max(T,p)};if(ua(g)){let e=ff(g,c);b(_,v,Q(`default`,e))}else{let e=ef(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=ff(r,c);for(let e in _)b(_[e],mf(v,e),Q(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};return m(e,0),a&&(a.duration=p,a.labels=u),c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(cf);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(ie(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(lf)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o;let{type:d,...f}=t;u.transition[i]={...f,duration:p,ease:l,times:c,mixer:a.mixer||t.mixer,...n}}}),s}function ff(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Q(e,t){return t[e]||(t[e]=[]),t[e]}function pf(e){return Array.isArray(e)?e:[e]}function mf(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var hf=e=>typeof e==`number`,gf=e=>e.every(hf);function _f(e,t){return ua(e)||typeof e==`number`||typeof e==`string`&&!$d(t)}function vf(e,t,n,r){let i=[];if(_f(e,t))i.push(G(e,$d(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=ef(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...Lo(r,t,s,Oc.get(r))):i.push(...Pa(Ma(r)??Ro,r,t,s))}}return i}function yf(e,t,n,r){let i=[];return df(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Hi(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:yn},r).forEach(({keyframes:e,transition:t},n)=>{i.push(...vf(n,e,t))}),i}var bf=0;function xf(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var Sf=(e,t)=>t===void 0?e:{name:e,at:t};function Cf(e){e.pause(),e.time=0,e.stop()}var wf=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.motionScope=Ra.current,this.isKilled=!1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new Ii(n),this.watch()):(this.invalidate(),this.flush());let{scope:r}=t;r&&(r.animations.push(this),this.finished.then(()=>w(r.animations,this)))}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+bf++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+bf++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=Math.abs(this.speed);return this.speed=t<this.time?-n:n,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&!this.isKilled&&this.build()}adopt(e){this.group&&=(Cf(this.group),void 0),this.isDirty=!1,this.parent=e}build(){this.isDirty=!1,this.isWrapped=!1;let e=this.group,t=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(t=e.animations.length?e.time:0,Cf(e)),this.isRebuilding=!1);let{defaultTransition:n,onComplete:r,onUpdate:i,onRepeat:a,onReverseComplete:o,autoplay:s,scope:c,...l}=this.options,u={};c?.reduceMotion!==void 0&&(u.reduceMotion=c.reduceMotion),c?.skipAnimations!==void 0&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);let d=new Map,f={},p=Ra.current;Ra.current=this.motionScope;let m;try{m=yf(this.toSequence(d),{defaultTransition:n,...u},c,f)}finally{Ra.current=p}let h=f.labels,g=u.duration??f.duration,_=f.duration?g/f.duration:1;if(h.forEach((e,t)=>h.set(t,e*_)),this.markers=[],d.forEach((e,t)=>{e.time=h.get(t),h.delete(t),g=Math.max(g,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=h,this.totalDuration=g,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||i||a){let e=this.clock=Hi(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),m.unshift(this.clockAnimation=G(e,[0,g],{...u,duration:g,ease:`linear`}))}let v=this.group=new Ii(m);t=Math.min(t,g),this.isDone&&t<g&&this.newFinished(),this.scrollTimeline?this.detachScroll=v.attachTimeline(this.scrollTimeline):(v.speed=this.playbackSpeed,this.isPaused&&v.pause(),t&&(v.time=t)),this.repeatIndex=this.currentRepeat(),this.prevTime=t||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),Sf(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?Sf(n,r):r===void 0?n:Array.isArray(n)?xf(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:nf(e,this.labels)??this.time}currentRepeat(){let{repeat:e=0,repeatDelay:t=0,delay:n=0}=this.options,r=this.totalDuration+t,i=(this.clockAnimation?.time??0)-n;return r&&i>0?Math.min(e,Math.floor(i/r)):0}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat();if(a!==this.repeatIndex&&(this.repeatIndex=a,r?.(),i===`loop`)){let e=this.speed>0;if(this.cross(t,e?this.totalDuration:0))return;t=e?-1:1/0}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options;(this.speed<0&&n||t)?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e});let e=this.motionScope?.add(()=>{this.isKilled=!0,this.stop()});e&&this.finished.then(e)}};function Tf(e){return Array.isArray(e)&&e.some(Array.isArray)}function Ef(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=Ra.current?.transition,s={};n!==void 0&&(s.reduceMotion=n),r!==void 0&&(s.skipAnimations=r);let c;if(Tf(e)){let n={...s,...i,scope:t};o&&(n.defaultTransition={...o,...n.defaultTransition}),c=new wf(e,n)}else{let{onComplete:n,...r}=a||{},l={...s,...o,...r},{onUpdate:u}=r;c=new wf([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...l,onUpdate:void 0}]:[e,i,l]],{...s,onComplete:n,scope:t},vf(e,i,l,t))}return c}return i}var Df=Object.assign(Ef(),{addEffect:Aa,removeEffect:ja}),Of=class{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}},kf=()=>new Of;function Af(){return x(kf)}var jf=g(),Mf=Gd;function Nf(e){let t=[[]],n=[[]],r=()=>(n.push([]),t.push([])-1),i=0;for(let a=0;a<e.length;a++){let o=e[a],s=r();if(o===`*`&&e[a+1]===`*`){if(e[a+2]===`/`){let e=r();n[i].push(s,e),t[e].push([`any`,e],[{lit:`/`},s]),a+=2}else t[i].push([`any`,i]),n[i].push(s),a+=1}else o===`*`?(t[i].push([`nonslash`,i]),n[i].push(s)):t[i].push([o===`?`?`nonslash`:{lit:o},s]);i=s}return{trans:t,eps:n,accept:i}}function Pf(e,t){let n=new Set(t),r=[...t];for(;r.length;)for(let t of e.eps[r.pop()])n.has(t)||(n.add(t),r.push(t));return[...n].sort((e,t)=>e-t)}var Ff=(e,t)=>e===`any`||(e===`nonslash`?t!==`/`:e.lit===t);function If(e,t,n){let r=t.flatMap(t=>e.trans[t].filter(([e])=>Ff(e,n)).map(([,e])=>e));return r.length?Pf(e,r):[]}var Lf=5e4;function Rf(e,t){if(e.includes(t))return!0;let n=Nf(t),r=e.map(Nf),i=[`/`,``,...new Set([...t,...e.join(``)].filter(e=>e!==`/`))],a=[Pf(n,[0]),...r.map(e=>Pf(e,[0]))],o=new Set([JSON.stringify(a)]),s=[a];for(let e=0;e<s.length;e++){let[t,...a]=s[e];if(t.includes(n.accept)&&!a.some((e,t)=>e.includes(r[t].accept)))return!1;for(let e of i){let i=If(n,t,e);if(!i.length)continue;let c=[i,...a.map((t,n)=>t.length?If(r[n],t,e):t)],l=JSON.stringify(c);if(!o.has(l)){if(o.size>=Lf)return;o.add(l),s.push(c)}}}return!0}function zf(e,t){return t.filter(t=>Rf(e,t)!==!0)}var Bf=[`**/migrations/**`,`**/*.sql`,`**/schema.prisma`,`**/*.schema.json`,`**/schema.graphql`,`**/schema.ts`],$=[`.github/workflows/**`,`.githooks/**`,`.husky/**`,`.gitlab-ci.yml`,`**/Dockerfile`,`**/Dockerfile.*`,`**/docker-compose*.yml`,`**/docker-compose*.yaml`,`**/compose.yml`,`**/compose.yaml`,`**/*.tf`,`**/wrangler.toml`,`**/wrangler.json`,`**/wrangler.jsonc`,`**/fly.toml`,`**/vercel.json`,`**/netlify.toml`],Vf=[`**/node_modules/**`,`.baesian/**`,`**/vendor/**`,`**/__fixtures__/**`],Hf=[`schema`,`infra`,`api`,`ignore`],Uf={schema:`gate_schema`,infra:`gate_infra`,api:`gate_api`,ignore:`gate_ignore`},Wf={schema:Bf,infra:$,api:[],ignore:[]};function Gf(e,t){return e[t]??Wf[t]}var Kf=[`public_api`,`schema`,`dependency`,`infra`,`user_facing`,`security`,`privacy`,`other`],qf=[`publishes`,`money`,`data_loss`],Jf=[...Kf,...qf],Yf=[`agent-decides`,`sample`,`tell-me`,`stop-and-ask`,`never-without-me`],Xf={public_api:`Public interfaces and module boundaries`,schema:`Data formats`,dependency:`Runtime dependencies`,infra:`Delivery and infrastructure`,user_facing:`Product behaviour`,security:`Security`,privacy:`Privacy`,other:`Anything else that's hard to undo`,publishes:`Publishing`,money:`Spending`,data_loss:`Destroying data`},Zf={"agent-decides":`let the agent decide`,sample:`check a sample afterwards`,"tell-me":`tell me but carry on`,"stop-and-ask":`stop and ask`,"never-without-me":`never without me`},Qf={"tell-me":`provisional`,"stop-and-ask":`blocking`,"never-without-me":`hard`},$f={security:`tell-me`,privacy:`tell-me`},ep={"public-api":`public_api`,schema:`schema`,dependency:`dependency`,infra:`infra`,"user-facing":`user_facing`,security:`security`,privacy:`privacy`,publishes:`publishes`,money:`money`,"data-loss":`data_loss`},tp=[`publishes`,`money`,`data_loss`,`security`,`privacy`,`public_api`,`schema`,`infra`,`dependency`,`user_facing`,`other`],np=e=>Yf.indexOf(e),rp=[`provisional`,`blocking`,`hard`],ip=e=>rp.indexOf(e),ap=(e,t)=>t!==void 0&&ip(t)>ip(e)?t:e,op=e=>qf.includes(e),sp={public_api:`tell-me`,schema:`tell-me`,dependency:`tell-me`,infra:`tell-me`,user_facing:`tell-me`,security:`never-without-me`,privacy:`never-without-me`,other:`tell-me`},cp=[{id:`today`,name:`Today`,summary:`Every card reaches you, as it does now.`,rows:sp},{id:`fewer-interruptions`,name:`Fewer interruptions`,summary:`Dependencies, infrastructure and anything else go ahead, and a sample comes back to you.`,rows:{...sp,dependency:`sample`,infra:`sample`,other:`sample`}},{id:`hands-off`,name:`Hands-off`,summary:`Every row but security and privacy goes ahead; dependencies and anything else are the agent's, with fewer audits.`,rows:{...sp,public_api:`sample`,schema:`sample`,infra:`sample`,user_facing:`sample`,dependency:`agent-decides`,other:`agent-decides`}}],lp=.1,up=.95;function dp(e,t,n=lp){let r=e+1,i=r*Math.log(1-n),a=0;for(let e=0;e<=t&&e<r;e++)a+=Math.exp(i),i+=Math.log((r-e)/(e+1))+Math.log(n/(1-n));return Math.max(0,Math.min(1,1-a))}function fp(e,t){let n=dp(e,t);if(n>=.95)return`down`;if(1-n>=.95)return`up`}function pp(e,t){let n=0;for(;dp(e+n,t)<up;)n++;return n}var mp=(e=0)=>pp(e,e)+e;function hp(){let e=1;for(;fp(e+1,1)===`up`;)e++;return e}function gp(e){let t=0;for(;t<=e&&fp(e,t)!==`up`;)t++;return t}cp[0].rows;function _p(e,t){let n=e=>op(e)?`never-without-me`:t.rows[e],r=e.length?[...new Set(e.map(e=>ep[e]))]:[`other`],i=r[0];for(let e of r.slice(1)){let t=np(n(e))-np(n(i));(t>0||t===0&&tp.indexOf(e)<tp.indexOf(i))&&(i=e)}return{row:i,position:n(i)}}function vp(e,t){let{row:n,position:r}=_p(e.touches,t),i=r,a=op(n)?`floor`:`row`,o=(e,t)=>{np(i)<np(e)&&(i=e,a=t)};!op(n)&&$f[n]&&o($f[n],`floor`),e.reverse===`one-way`&&o(`tell-me`,`one-way`),e.source!==`agent`&&o(`tell-me`,e.source);let s=Qf[i];if(s){let t=ap(s,e.asked);return{row:n,position:r,outcome:`shown`,level:t,reason:t===s?a:`agent`}}let c=i===`agent-decides`?t.rate_agent_decides:t.rate_sample,l=e.heldBefore(n),u=l<t.burn_in;return{row:n,position:r,outcome:`held`,reason:a,draw:e.draw,p:c,held_before:l,burn_in:u,drawn:u||e.draw<c}}var yp=new Set([`accept`,`alternative`,`correction`,`reject`]),bp=new Set([`alternative`,`correction`,`reject`]);function xp(e,t={}){let n=[...e].reverse().find(e=>yp.has(e.response)),r=e.some(e=>e.should_have_asked===!0);if(!n)return r?{miss:!0,missBy:`asked`,switched:!1}:{miss:!1,switched:!1};let i={response:n.response,at:n.at,...n.first_choice?{first_choice:n.first_choice}:{}},a=bp.has(n.response)?`overturn`:r?`asked`:t.preference===!0&&n.first_choice===`alternative`?`blind`:void 0;return{final:i,miss:a!==void 0,...a?{missBy:a}:{},switched:n.response===`accept`&&n.first_choice===`alternative`}}function Sp(e){return e.meta.answered_in_chat!==void 0||e.verdicts.some(e=>e.seen===!0)}function Cp(e){return e.source_agent===`baesian`||e.rule!==void 0||e.convention!==void 0||e.pref_row!==void 0||e.conflict_of!==void 0}function wp(e){if(!(Cp(e.meta)||e.gate?.source===`baesian`||e.status===`withdrawn`||Sp(e)))return{id:e.meta.id,touches:e.meta.touches,reverse:e.meta.reverse,...e.gate?.asked?{asked:e.gate.asked}:{},source:e.gate?.source??`agent`,outcome:xp(e.verdicts,{preference:e.meta.crux_preference})}}function Tp(e,t){let n=()=>({cards:0,shown:0,held:0,heldMissed:0,audits:0}),r={},i=n(),a=new Map,o=[];for(let s of e){let e=vp({touches:s.touches,reverse:s.reverse,asked:s.asked,source:s.source,draw:1,heldBefore:e=>a.get(e)??0},t),c=r[e.row]??=n();for(let t of[c,i])t.cards++,e.outcome===`shown`?t.shown++:(t.held++,s.outcome.miss&&t.heldMissed++,t.audits+=e.burn_in?1:e.p);e.outcome===`held`&&(a.set(e.row,(a.get(e.row)??0)+1),o.push(s.id))}return{rows:r,total:i,held:o}}function Ep(e){let t=e=>np(e)<np(`tell-me`),n=cp[0],r=-1;for(let i of cp){let a=(e.fine??[]).filter(e=>t(i.rows[e])).length+(e.see??[]).filter(e=>!t(i.rows[e])).length;a>r&&(n=i,r=a)}return n}new Set(`a an and are as at be by do for from how in is it of on or should the this to use we what which with`.split(` `));function Dp(e,t){let n=Array.from({length:t.length+1},(e,t)=>t);for(let r=1;r<=e.length;r++){let i=n[0];n[0]=r;for(let a=1;a<=t.length;a++){let o=n[a];n[a]=Math.min(o+1,n[a-1]+1,i+(e[r-1]===t[a-1]?0:1)),i=o}}return n[t.length]}function Op(e,t){let n=e=>e.split(`/`).at(-1)??e,r=[];for(let i of t)i!==e&&(Dp(e,i)<=2||n(e)===n(i))&&r.push(i);return r.sort()}[...[`public_api`,`schema`,`dependency`,`infra`,`user_facing`,`security`,`privacy`,`other`].map(e=>`row_${e}`)];var kp={common:{name:`Common`,rank:1,position:`the lowest of four levels`},uncommon:{name:`Uncommon`,rank:2,position:`the second of four levels`},rare:{name:`Rare`,rank:3,position:`the third of four levels`},mythic:{name:`Mythic`,rank:4,position:`the highest of four levels`}},Ap=new Set([`security`,`privacy`,`money`,`data-loss`,`publishes`]),jp={proposal:`alternative`,alternative:`proposal`},Mp=e=>e.canonicalTopic.split(`/`)[0],Np=e=>new Map(e.cards.map(e=>[e.meta.id,e]));function Pp(e){if(e.meta.reply===void 0)return;let t=e.verdicts.filter(t=>t.revision===e.meta.revision-1&&(t.response===`alternative`||t.response===`correction`)).at(-1);return{reply:e.meta.reply,to:t?.choice}}var Fp=e=>`${e.meta.id}@${e.meta.revision}`,Ip=e=>e?.practice,Lp=e=>e.meta.level===`hard`||e.gate?.outcome===`shown`&&e.gate.level===`hard`;function Rp(e,t){return e.dependents.flatMap(e=>t.get(e)??[]).filter(e=>e.status!==`withdrawn`&&e.status!==`superseded`)}function zp(e,t){let n=e.meta,r=[],i=n.touches.filter(e=>Ap.has(e)),a=(n.conflict_of?.length??0)>0;return i.length?(r.push(`it touches ${i.join(` and `).replace(`-`,` `)}`),n.reverse===`one-way`&&r.push(`it's hard to undo`),n.level!==`provisional`&&r.push(`an agent has stopped for it`),{rarity:`mythic`,tier:`high`,why:r}):n.reverse===`one-way`||t>=3||a?(a&&r.push(`two settled decisions disagree`),n.reverse===`one-way`&&r.push(`it's hard to undo`),t>=3&&r.push(`${t} decisions depend on it`),{rarity:`rare`,tier:`high`,why:r}):t>=1||n.reverse===`moderate`?(t&&r.push(`${t} decision${t===1?` depends`:`s depend`} on it`),n.reverse===`moderate`&&r.push(`it's moderately costly to undo`),{rarity:`uncommon`,tier:`medium`,why:r}):(r.push(`it's cheap to undo and nothing is built on it yet`),{rarity:`common`,tier:`low`,why:r})}var Bp=e=>e.length<2?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`;function Vp(e,t){let n=e.meta,r={"one-way":`Hard to undo`,moderate:`Costly to undo`,cheap:`Easy to undo`}[n.reverse],i=[],a=n.touches.filter(e=>Ap.has(e));return a.length&&i.push(`touches ${Bp(a.map(e=>e.replace(`-`,` `)))}`),(n.conflict_of?.length??0)>0&&i.push(`two settled decisions disagree`),n.pref_row&&i.push(`a change to your preferences`),t&&i.push(`${t} decision${t===1?` rests`:`s rest`} on it`),[r,...i].join(`, `)}var Hp=e=>/[“”]/.test(e)?e:`“${e}”`,Up=e=>e.meta.source_agent===`baesian`?`Baesian`:e.meta.source_agent,Wp=/\b(B-[0-9a-hjkmnp-tv-z]{5}),\s+(?=“)/g,Gp=/\b(B-[0-9a-hjkmnp-tv-z]{5})\b/g,Kp=/\s*\((?:(?:B-[0-9a-hjkmnp-tv-z]{5}|D\d+|P\d+)(?:,\s*)?)+\)/g;function qp(e,t){return e.replace(Kp,``).replace(Wp,``).replace(Gp,e=>{let n=t.get(e);return n?`“${n.meta.title}”`:`another decision`})}function Jp(e,t){return e.waiting.some(e=>t-Date.parse(e.at)<=9e4)?`waiting`:e.waiting.length?`gone`:e.fallbacks.some(t=>t.revision===e.meta.revision)?`carried-on`:`none`}var Yp=(e,t,n=Date.now())=>Date.parse(e.server.now)+(n-t);function Xp(e,t){let n=Np(e),r=e.cards.filter(e=>e.status===`open`),i=new Map(r.map(e=>[e.meta.id,kp[zp(e,Rp(e,n).length).rarity].rank])),a=e=>Jp(e,t)===`waiting`,o=new Map;for(let e of r)o.set(Mp(e),Math.max(o.get(Mp(e))??0,i.get(e.meta.id)));let s=(e,t)=>i.get(t.meta.id)-i.get(e.meta.id)||e.meta.created.localeCompare(t.meta.created),c=r.filter(a).sort(s),l=r.filter(e=>!a(e)).sort((e,t)=>{let n=Mp(e),r=Mp(t);return n===r?s(e,t):o.get(r)-o.get(n)||n.localeCompare(r)}),u=e.cards.filter(e=>e.audit).sort((e,t)=>e.meta.created.localeCompare(t.meta.created));return Zp([...c,...l],u)}function Zp(e,t,n=2){let r=[],i=0;return e.forEach((e,a)=>{r.push(e),(a+1)%n===0&&i<t.length&&r.push(t[i++])}),[...r,...t.slice(i)]}var Qp=e=>e.cards.filter(e=>e.status===`rerouted`||e.status===`deferred`),$p=e=>e.cards.filter(e=>e.status===`held`&&!e.audit).sort((e,t)=>t.meta.created.localeCompare(e.meta.created)),em=e=>(e.removed??[]).filter(e=>e.ended===`held`).sort((e,t)=>t.settled.localeCompare(e.settled)),tm=e=>new Date(e).toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`}),nm={answered:`An earlier decision`,withdrawn:`A withdrawn card`,held:`A card held back`},rm={answered:`settled`,withdrawn:`withdrawn`,held:`held back`};function im(e){return{name:nm[e.ended],state:`${rm[e.ended]} ${tm(e.settled)}; its text is no longer on the service`}}var am=e=>e.status===`held`,om=e=>e.meta.answered_in_chat!==void 0;function sm(e){let t=e.trim();for(let[e,n]of[[`“`,`”`],[`"`,`"`]]){let r=t.slice(1,-1);if(t.length>1&&t.startsWith(e)&&t.endsWith(n)&&!r.includes(e)&&!r.includes(n))return r.trim()}return t}var cm={open:`waiting for you`,held:`held back: its agent went ahead`,resolved:`settled earlier`,returned:`returned to its agent`,rerouted:`passed to another reviewer`,deferred:`deferred`,withdrawn:`withdrawn`,superseded:`superseded`},lm=e=>e.split(`
10
+ `).map(e=>e.replace(/^#+\s*/,``).replace(/\.$/,``).trim()).find(Boolean)??`a rule`;function um(e,t){let n=Np(t),r=new Map(t.rules.map(e=>[e.meta.id,e])),i=new Map((t.removed??[]).map(e=>[e.id,e])),a=e.meta,o=Ip(e)?.of,s=new Map,c=e=>{let t=n.get(e);if(t)return{name:t.meta.title,state:t.before_linking?`settled before linking`:cm[t.status]};let a=r.get(e);if(a)return{name:lm(a.body),state:a.retired?`retired rule`:`your rule`};let o=i.get(e);if(o)return im(o)},l=(e,t)=>{if(e===a.id||e===o||s.has(e))return;let n=c(e);n&&s.set(e,{id:e,...t,...n})};for(let e of a.depends_on)l(e,{kind:`builds-on`,label:`this card builds on`,where:`up`});let u={proposal:a.proposal_breaks,alternative:a.alternative_breaks},d=new Set([...a.conflict_of??[],...t.cards.filter(e=>e.meta.conflict_of?.includes(a.id)).map(e=>e.meta.id),...u.proposal,...u.alternative]);for(let e of d){let t=e.startsWith(`R-`),n=r.get(e)?.retired?[]:[`proposal`,`alternative`].filter(t=>u[t].includes(e)),i=n.length===1?n[0]:void 0,a=i?{[i]:{text:t?`may break it`:`replaced`,bad:!0},[jp[i]]:{text:t?`keeps to it`:`kept`,bad:!1}}:void 0;l(e,{kind:t?`rule`:`conflict`,label:t?`this card may conflict with`:`this card conflicts with`,where:`down`,...a?{effect:a,keptBy:jp[i]}:{}})}for(let e of a.rules)l(e,{kind:`rule`,label:`this card may conflict with`,where:`down`});for(let n of t.rules)!n.retired&&n.meta.topic&&n.meta.topic===e.canonicalTopic&&l(n.meta.id,{kind:`rule`,label:`a rule on the same topic`,where:`down`});for(let t of Rp(e,n))l(t.meta.id,{kind:`relies-on-this`,label:`relies on this card`,where:`down`});let f=t.cards.filter(t=>t.status===`resolved`&&t.canonicalTopic===e.canonicalTopic&&t.meta.id!==a.id&&t.meta.id!==o&&!s.has(t.meta.id)).sort((e,t)=>t.meta.created.localeCompare(e.meta.created))[0];return f&&l(f.meta.id,{kind:`precedent`,label:`your precedent, on the same topic`,where:`down`}),[...s.values()]}function dm(e){let t=7;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t}function fm(e,t){return dm(`${t}${e}`)%2==0?{left:`proposal`,right:`alternative`}:{left:`alternative`,right:`proposal`}}var pm=[{reason:`question`,label:`Ask a question`,placeholder:`What do you want the agent to answer?`},{reason:`correction`,label:`Suggest a correction`,placeholder:`Your own answer, in place of both options`},{reason:`reject`,label:`Reject, with a reason`,placeholder:`Why, so the agent can re-propose`}],mm=[{reason:`need_context`,label:`I need more context`},{reason:`not_my_area`,label:`It's outside my expertise`},{reason:`see_it_run`,label:`I need to see it run`}],hm={common:0,uncommon:2e3,rare:3e3,mythic:3e3},gm=5e3;function _m(e,t){let n={card:e.meta.id,revision:e.meta.revision},r=t.kind===`choose`?(t.why??``).trim():t.text.trim(),i=t.kind!==`pass`&&t.rule?{make_rule:!0}:{};if(t.kind===`choose`){let a=t.option===`proposal`?{response:`accept`}:{response:`alternative`,choice:e.meta.alternative},o=t.first&&!om(e)?{first_choice:t.first}:{},s=t.retire?.length?{retire_rules:t.retire}:{},c=t.asked?{should_have_asked:!0}:{};return{verdict:{...n,...a,...o,...r?{comment:r}:{},...i,...s,...c}}}return t.kind===`write`?r?t.reason===`correction`?{verdict:{...n,response:`correction`,choice:r,...i}}:{verdict:{...n,response:t.reason,comment:r,...t.reason===`reject`?i:{}}}:{problem:t.reason===`question`?`Write your question first.`:t.reason===`correction`?`Write your answer first.`:`Say why first.`}:{verdict:{...n,response:t.reason,...r?{comment:r}:{}}}}function vm(e,t){return t.kind===`choose`&&e.status===`held`?t.option===`proposal`?`You kept ${Hp(e.meta.proposal)}.`:`You overturned it, for ${Hp(e.meta.alternative)}.`:t.kind===`choose`&&om(e)&&t.option===`proposal`?`You confirmed ${Hp(e.meta.proposal)}, your answer in chat.`:t.kind===`choose`?`You chose ${Hp(e.meta[t.option])}.`:t.kind===`write`?t.reason===`question`?`You asked a question.`:t.reason===`correction`?`You gave your own answer.`:`You rejected it.`:t.reason===`see_it_run`?`You asked to see it run.`:t.reason===`not_my_area`?`You passed it on.`:`You asked for more context.`}var ym=e=>({see:Kf.filter(t=>e[t]===`see`),fine:Kf.filter(t=>e[t]===`fine`)});function bm(e,t){let n=ym(e);return{...t?{replaces:t}:{},preset:Ep(n).id,...n.see.length?{survey_see:n.see}:{},...n.fine.length?{survey_fine:n.fine}:{}}}var xm=e=>({mode:e.mode,rows:{...e.rows}}),Sm=(e,t)=>e.mode!==t.mode||Kf.some(n=>e.rows[n]!==t.rows[n])||e.survey!==void 0,Cm=e=>cp.find(t=>Kf.every(n=>t.rows[n]===e[n])),wm=e=>$f[e]??Yf[0],Tm=(e,t)=>np(t)>=np(wm(e)),Em=e=>np(e)<np(`tell-me`);function Dm(e){return e.preferences?e.preferences.name:e.problem?.match(/preferences\/(\S+?\.json)/)?.[1]}function Om(e,t,n){let r=Object.fromEntries(Kf.map(t=>[`row_${t}`,e.rows[t]]));return{...t?{replaces:t}:{},...e.preset?{preset:e.preset}:{},mode:e.mode,...r,...e.survey?.see.length?{survey_see:e.survey.see}:{},...e.survey?.fine.length?{survey_fine:e.survey.fine}:{},...n?.trim()?{reason:n.trim()}:{}}}function km(e){return[...e].sort((e,t)=>(e.gate?.at??e.meta.created).localeCompare(t.gate?.at??t.meta.created)).flatMap(e=>wp(e)??[])}var Am=(e,t,n)=>Tp(e,{...n,mode:t.mode,rows:t.rows}),jm=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Mm(e,t){let n=t?`${t} would`:`Would`;if(!e.cards)return`No past cards to try it on yet.`;if(!e.held)return`${n} have shown you ${e.cards===1?`your one past card`:`all ${e.cards} of your past cards`}.`;let r=e.heldMissed?` You answered ${e.heldMissed} of ${e.held===1?`it`:`those`} against the agent.`:``;return`${n} have held back ${e.held} of your ${jm(e.cards,`past card`)}.${r}`}var Nm={public_api:`A public API, a URL scheme, or where one module ends and another begins.`,schema:`A schema, a migration, or how something is stored on disk.`,dependency:`A package the code needs to run, added or removed.`,infra:`CI, infrastructure, or how the code is deployed.`,user_facing:`Anything the product's users see or do.`,security:`Who can get in, what they can reach, and the secrets that guard it.`,privacy:`What's kept about people, and who sees it.`,other:`Costly to reverse, and none of the above.`,data_loss:`Deleting or overwriting what's stored.`,money:`Anything that costs money.`,publishes:`Releasing or posting something others will see.`},Pm={"agent-decides":`Agent decides`,sample:`Sample after`,"tell-me":`Tell me, carry on`,"stop-and-ask":`Stop and ask`,"never-without-me":`Never without me`},Fm=e=>Zf[e].charAt(0).toUpperCase()+Zf[e].slice(1),Im=`about 9 minutes`;function Lm(e){return e>=1?`every one`:e<=0?`none`:`about 1 in ${Math.round(1/e)}`}function Rm(e,t){let n=t===1?`a row's first one`:`a row's first ${t}`;return e>=1?`Every one comes to you anyway, to check.`:e<=0?t?`Only ${n} ${t===1?`comes`:`come`} to you, to check.`:`None comes to you to check.`:`About 1 in ${Math.round(1/e)} comes to you anyway, at random, to check${t?`; so does ${t===1?n:`each of ${n}`}`:``}.`}function zm(e,t){return[{position:`never-without-me`,chip:`hard`,card:`Reaches you.${t?` Answering it takes your passkey.`:``}`,agent:`Stops. It never goes ahead without your answer.`},{position:`stop-and-ask`,chip:`blocking`,card:`Reaches you.`,agent:`Waits for you while you're here, up to ${Im}, then goes ahead with its pick until you answer.`},{position:`tell-me`,chip:`provisional`,card:`Reaches you.`,agent:`Goes ahead with its pick at once, and hears your answer at its next stopping point. If you choose otherwise, it reworks.`},{position:`sample`,chip:`held`,card:`Goes to your Held back list, not your queue. ${Rm(e.rate_sample,e.burn_in)}`,agent:`Goes ahead with its pick. Its branch can merge without your answer, and you can still answer it later.`},{position:`agent-decides`,chip:`held`,card:`Goes to your Held back list. ${Rm(e.rate_agent_decides,e.burn_in)}`,agent:`Goes ahead with its pick, as above.`}]}function Bm(e,t){return e===`shadow`?{now:`Shadow: your settings are tried out, not applied. Every card still reaches you.`,more:`Baesian notes which cards the two lowest stops would have held back, so a row set to one of them shows what holding back would have cost you before you turn it on.`}:{now:`On: cards on rows at the two lowest stops skip your queue. Their agents carry on, and a random sample comes back to you.`,more:`${t?`Turning it on takes your passkey, because it lets cards past you. `:``}Rows at the three upper stops are unchanged.`}}function Vm(e,t,n,r){if(e===`never-without-me`)return`These cards reach you, and the agent stops until you answer${r.hosted?`, with your passkey`:``}.`;if(e===`stop-and-ask`)return`These cards reach you, and the agent waits for your answer while you're here, up to ${Im}, before going ahead with its pick.`;if(e===`tell-me`)return`These cards reach you, and the agent carries on with its pick meanwhile, so you never hold it up. It hears your answer at its next stopping point.`;let i=e===`sample`?n.rate_sample:n.rate_agent_decides,a=Math.max(0,n.burn_in-r.held),o=t===`shadow`,s=i>0&&i<1?Lm(i):void 0,c=e=>o?`would come`:e?`comes`:`come`,l=s&&!o?`, at random`:``,u;return u=i>=1?`every one ${c(!0)} back to you`:a?`the row's ${r.held?`next`:`first`} ${a===1?`one`:a} ${c(a===1)} back to you, then ${s??`none`}${l}`:`${s??`none`} ${c(!0)} back to you${l}`,o?`In shadow, these cards still reach you. With holding back on, they'd go to your Held back list and the agent would carry on with its pick; ${u}.`:`These cards skip your queue: the agent carries on with its pick, and the card waits on your Held back list. ${u.charAt(0).toUpperCase()}${u.slice(1)}.`}function Hm(e,t,n){let r=e?e.shown+e.held+e.wouldHold:0;if(!r)return`No cards in this row yet.`;let i=e.misses?`${jm(r,`card`)} so far: ${jm(e.misses,`miss`,`misses`)}.`:`${jm(r,`card`)} so far: no misses.`;if(!n||!t?.cards)return i;let a=t.cards,o=a===1&&r===1,s=a===r?`them`:`its ${jm(a,`past card`)}`;return`${i} At this stop, ${o?t.held?`it would`:`it wouldn't`:t.held?t.held===a&&s===`them`?`all of them would`:`${t.held} of ${s} would`:`none of ${s} would`} have been held back${t.heldMissed?o?`, and it was a miss`:`, including ${jm(t.heldMissed,`miss`,`misses`)}`:``}.`}var Um=e=>{let t=Xf[e]??e;return t.charAt(0).toLowerCase()+t.slice(1)};function Wm(e){return{sample:Kf.filter(t=>e[t]===`sample`),agent:Kf.filter(t=>e[t]===`agent-decides`)}}var Gm=e=>{if(e.length<2)return e.join(``);let t=e.length>2&&e.some(e=>/ and /.test(e))?`,`:``;return`${e.slice(0,-1).join(`, `)}${t} and ${e.at(-1)}`},Km=e=>[`no`,`one`,`two`,`three`,`four`,`five`,`six`,`seven`,`eight`,`nine`,`ten`][e]??String(e);function qm(e){if(!e.length)return;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2}function Jm(e){let t=t=>qm(e.filter(e=>t.includes(e.rarity)).map(e=>e.ms)),n={},r=t([`rare`,`mythic`]),i=t([`uncommon`]),a=t([`common`]);return r!==void 0&&(n.high=r),i!==void 0&&(n.uncommon=i),a!==void 0&&(n.common=a),n}var Ym=e=>e===void 0?`none yet`:`${(e/1e3).toFixed(1)}\u00a0s`;function Xm(e){let t=e=>e.verdicts.some(e=>Zm.has(e.client)&&(e.response===`accept`||e.response===`alternative`||e.response===`correction`));return{names:e.cards.filter(e=>e.status===`superseded`&&t(e)&&!Sp(e)).map(e=>e.meta.title),inChat:e.cards.filter(e=>(e.status===`superseded`||e.status===`resolved`)&&t(e)&&Sp(e)).length}}var Zm=new Set([`web`,`hosted-desktop`,`hosted-phone`]),Qm=mp(0),$m=e=>({agreed:e.agreed,cameRound:e.cameRound,missed:e.misses,total:e.agreed+e.cameRound+e.misses}),eh=e=>Math.max(Qm,...e.map(e=>e.total));function th(e){if(e)return e.waiting?`A move for this row waits for you`:e.toLoosen===void 0?`As low as it can go`:e.toLoosen===0?`Enough for a lower stop`:`${e.toLoosen} more without a miss for a lower stop`}var nh={down:`after ${mp(0)} answers with none, ${mp(1)} with one, ${mp(2)} with two`,up:`a miss in its first ${hp()} answers, ${gp(10)} in 10, ${gp(20)} in 20`},rh=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,ih=e=>e===1?`once`:`${e} times`;function ah(e){let t=Math.min(e.auditsUnanswered,e.heldWaiting),n=e.unanswered-e.heldWaiting,r=e.heldWaiting-t;return[n?`${n} not answered`:``,r?`${r} held back`:``,t?`${rh(t,`audit`)} waiting`:``,e.unblind?`${e.unblind} kept without a blind choice`:``,e.inChat?`${e.inChat} answered in chat`:``].filter(Boolean)}var oh=e=>e?e.unanswered+e.unblind+e.inChat:0;function sh(e){let t=$m(e),n=ah(e),r=oh(e);if(!t.total)return r?`No answers to count yet: ${Gm(n)}.`:`No answers yet: each row's bar fills in as you answer its cards.`;let i=`Of ${rh(t.total,`card`)}, you chose as the agent did ${ih(t.agreed)} without seeing its pick and came round to it ${ih(t.cameRound)} after reading its case; ${t.missed===1?`1 was a miss`:`${t.missed} were misses`}.`;return r?`${i} ${r}\u00a0more ${r===1?`isn't`:`aren't`} counted: ${Gm(n)}.`:i}function ch(e,t,n,r){return`${e}: ${{agreed:`you chose as the agent did, blind`,cameRound:`you came round to its pick`,missed:n===1?`a miss`:`misses`}[t]}, on ${n} of ${rh(r,`card`)}`}function lh(e){if(!e.length)return``;let t=t=>e.filter(t).length,n=[[t(e=>e.kind===`choose`&&e.option===`proposal`),`took the agent's pick`],[t(e=>e.kind===`choose`&&e.option===`alternative`),`chose the alternative`],[t(e=>e.kind===`write`),`wrote an answer`],[t(e=>e.kind===`pass`),`couldn't judge`]].filter(([e])=>e),r=`${e.length} card${e.length===1?``:`s`}`;if(n.length===1)return`You answered ${r}, and ${n[0][1]} ${e.length===1?``:`each time`}`.trimEnd()+`.`;let i=n.map(([e,t])=>`${e} ${t}`);return`You answered ${r}: ${i.slice(0,-1).join(`, `)} and ${i.at(-1)}.`}var uh=m(),dh=[`left`,`right`,`up`,`down`],fh=96,ph=110,mh=44,hh=.7,gh=12,_h=1.012,vh=1.035,yh=.035,bh={type:`spring`,stiffness:520,damping:34},xh=`Hold the card until it lifts, then drag it to an answer.`,Sh=(e,t)=>({name:e,tone:t,hint:`Choose`,letGo:`Let go to choose`}),Ch=e=>({name:e,tone:`ink`,hint:`Answer`,letGo:`Let go to answer`});function wh(e,t,n,r){let i={left:e,right:n-e,up:t,down:r-t},a=e=>Math.max(mh,Math.min(e===`left`||e===`right`?fh:ph,i[e]*hh));return{left:a(`left`),right:a(`right`),up:a(`up`),down:a(`down`)}}function Th(e,t,n,r){if(Math.max(Math.abs(e),Math.abs(t))<gh)return{dir:void 0,progress:0};let i=Math.abs(e)>=Math.abs(t)?e<0?`left`:`right`:t<0?`up`:`down`;return n.includes(i)?{dir:i,progress:Math.abs(i===`left`||i===`right`?e:t)/r[i]}:{dir:void 0,progress:0}}function Eh(e){try{if(navigator.userActivation&&!navigator.userActivation.hasBeenActive)return;navigator.vibrate?.(e)}catch{}}function Dh(e){let[t,n]=(0,y.useState)(),r=Kd(0),i=Kd(0),a=(0,y.useRef)(void 0),o=(0,y.useRef)(!1),s=(0,y.useRef)(e);s.current=e;let c=e.touch&&e.dirs.length>0,l=e=>{let t=a.current;if(!t)return;clearTimeout(t.timer),a.current=void 0;let{x:o,y:c,scale:l,reduced:u,el:d,onReach:f}=s.current;if(r.set(0),i.set(0),t.phase===`lifted`){n(void 0);let e=u?{duration:0}:bh;Df(o,0,e),Df(c,0,e),Df(l,1,e)}else d.current?.dataset.lift===`pressing`&&(d.current.dataset.lift=`ready`),Df(l,1,u?{duration:0}:{duration:.12});e&&f(e)},u=()=>{let e=a.current;if(!e||e.phase!==`pressing`)return;let{el:t,scale:i,reduced:o}=s.current;e.phase=`lifted`,e.reach=wh(e.x0,e.y0,window.innerWidth,window.innerHeight);try{t.current?.setPointerCapture(e.id)}catch{}r.set(1),Df(i,vh,o?{duration:0}:bh),Eh(12),n({phase:`lifted`,dir:void 0,armed:!1})};return(0,y.useEffect)(()=>{let t=e.el.current;if(!t)return;let n=e=>{a.current?.phase===`lifted`&&e.cancelable&&e.preventDefault()},r=e=>{o.current&&(o.current=!1,e.preventDefault(),e.stopPropagation())},i=e=>{a.current&&e.preventDefault()};t.addEventListener(`touchmove`,n,{passive:!1}),t.addEventListener(`click`,r,!0),t.addEventListener(`contextmenu`,i);let{x:c,y:l,scale:u}=s.current,d=()=>{t.style.transformOrigin&&!a.current&&c.get()===0&&l.get()===0&&u.get()===1&&(t.style.transformOrigin=``)},f=[c,l,u].map(e=>e.on(`animationComplete`,d));return()=>{t.removeEventListener(`touchmove`,n),t.removeEventListener(`click`,r,!0),t.removeEventListener(`contextmenu`,i);for(let e of f)e();clearTimeout(a.current?.timer)}},[e.el]),{lift:t,lifted:r,progress:i,handlers:{onPointerDown:e=>{o.current=!1;let{touch:t,el:n,scale:r,reduced:i,onMouse:l}=s.current;if(!t)return;if(e.pointerType===`mouse`)return l?.(e);if(!c||a.current||!e.isPrimary)return;let d=n.current;if(d){let t=d.getBoundingClientRect();d.style.transformOrigin=`${e.clientX-t.left}px ${e.clientY-t.top}px`}a.current={id:e.pointerId,x0:e.clientX,y0:e.clientY,phase:`pressing`,dir:void 0,armed:!1,reach:wh(0,0,0,0),timer:window.setTimeout(u,350)},d&&(d.dataset.lift=`pressing`),i||Df(r,_h,{duration:350/1e3,ease:`easeIn`})},onPointerMove:e=>{let t=a.current;if(!t||e.pointerId!==t.id)return;let r=e.clientX-t.x0,o=e.clientY-t.y0;if(t.phase===`pressing`){Math.hypot(r,o)>8&&l();return}s.current.x.set(r),s.current.y.set(o);let{dir:c,progress:u}=Th(r,o,s.current.dirs,t.reach);i.set(Math.min(1,u));let d=u>=1;d&&!t.armed&&Eh(8),(c!==t.dir||d!==t.armed)&&(t.dir=c,t.armed=d,n({phase:`lifted`,dir:c,armed:d}))},onPointerUp:e=>{let t=a.current;t&&e.pointerId===t.id&&(t.phase===`lifted`&&(o.current=!0),l(t.phase===`lifted`&&t.armed?t.dir:void 0))},onPointerCancel:e=>{a.current&&e.pointerId===a.current.id&&l()}},attr:c||t?t?.phase??`ready`:void 0}}function Oh({labels:e,lift:t,progress:n}){return(0,uh.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`lift-dim`,"aria-hidden":`true`}),(0,q.jsx)(Mf.div,{className:`lift-signals`,"aria-hidden":`true`,"data-dir":t.dir,style:{"--a":n},children:dh.map(n=>{let r=e[n];if(!r)return null;let i=t.dir===n,a=i&&t.armed;return(0,q.jsxs)(`div`,{className:`sig ${n}${i?` on`:``}${a?` armed`:``}`,"data-tone":r.tone,children:[(0,q.jsx)(`small`,{children:a?r.letGo:r.hint}),(0,q.jsx)(`b`,{children:r.name})]},n)})})]}),document.body)}function kh(e,t){if(e===`common`)return`M ${-t} 0 a ${t} ${t} 0 1 0 ${2*t} 0 a ${t} ${t} 0 1 0 ${-2*t} 0`;if(e===`uncommon`)return`M 0 ${-t*1.25} L ${t*1.1} 0 L 0 ${t*1.25} L ${-t*1.1} 0 Z`;if(e===`rare`){let e=[];for(let n=0;n<10;n++){let r=n%2?t*.55:t*1.3,i=-Math.PI/2+n*Math.PI/5;e.push(`${(r*Math.cos(i)).toFixed(2)} ${(r*Math.sin(i)).toFixed(2)}`)}return`M ${e.join(` L `)} Z`}return`M ${-t*1.3} ${t*.9} L ${-t*1.3} ${-t*.5} L ${-t*.6} ${t*.1} L 0 ${-t*1.1} L ${t*.6} ${t*.1} L ${t*1.3} ${-t*.5} L ${t*1.3} ${t*.9} Z`}var Ah={common:[`#F0E4BE`,`#2E2343`],uncommon:[`#F0E4BE`,`#6d7482`],rare:[`#f6e3a4`,`#B8860B`],mythic:[`#f3d58a`,`#6E1F2E`]};function jh({kind:e,size:t=16,answered:n=!1,stopped:r=!1}){let[i,a]=Ah[e];return(0,q.jsxs)(`svg`,{className:`mk`,width:t,height:t,viewBox:`-8 -8 16 16`,"aria-hidden":`true`,children:[(0,q.jsx)(`path`,{d:kh(e,5.2),fill:i,stroke:a,strokeWidth:1.6}),n&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`circle`,{cx:5,cy:4.6,r:3.6,fill:`#3f8f5a`}),(0,q.jsx)(`path`,{d:`M3.3 4.7 L4.6 6 L6.8 3.4`,stroke:`#fff`,strokeWidth:1.2,fill:`none`})]}),r&&(0,q.jsx)(`circle`,{cx:5.2,cy:-4.8,r:3.3,fill:`#8E3A5F`,stroke:`#F0E4BE`,strokeWidth:1})]})}function Mh(e){return e.split(/(\*\*[^*]+\*\*|`[^`]+`)/).map((e,t)=>e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>4?(0,q.jsx)(`b`,{children:e.slice(2,-2)},t):e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,q.jsx)(`code`,{children:e.slice(1,-1)},t):e)}function Nh({text:e}){let t=e.trim().split(/\n\s*\n/).map(e=>e.trim()).filter(Boolean);return(0,q.jsx)(q.Fragment,{children:t.map((e,t)=>{let n=e.split(`
11
+ `);return n.every(e=>/^\s*[-*] /.test(e))?(0,q.jsx)(`ul`,{children:n.map((e,t)=>(0,q.jsx)(`li`,{children:Mh(e.replace(/^\s*[-*] /,``))},t))},t):(0,q.jsx)(`p`,{children:Mh(n.join(` `))},t)})})}var Ph={left:`←`,right:`→`,up:`↑`,down:`↓`},Fh=(e,t)=>e.left===t?`left`:`right`;function Ih(e){let{card:t,rarity:n,mode:r}=e,i=t.meta;return(0,q.jsxs)(`div`,{className:`face`,style:{"--read":e.readFraction},children:[(0,q.jsxs)(`p`,{className:`stakes rarity-${n}`,children:[(0,q.jsx)(`span`,{className:`rmark`,title:`${kp[n].name}: ${kp[n].position} of stakes`,"aria-label":kp[n].name,children:(0,q.jsx)(jh,{kind:n,size:22})}),(0,q.jsx)(`b`,{children:e.stakes}),!am(t)&&(0,q.jsx)(Rh,{agent:Up(t),wait:e.wait})]}),(0,q.jsxs)(`p`,{className:`doing`,children:[(0,q.jsx)(`b`,{children:Up(t)}),` is `,i.doing]}),(0,q.jsx)(`h1`,{children:i.question}),r.kind===`seen`&&(0,q.jsx)(Yh,{...e,mode:r}),r.kind===`write`||r.kind===`pass`?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(zh,{card:t}),(0,q.jsxs)(`div`,{className:`options`,children:[(0,q.jsx)(Vh,{...e,side:`left`}),(0,q.jsx)(Vh,{...e,side:`right`})]})]}),(r.kind===`live`||r.kind===`seen`)&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Hh,{card:t}),e.near?.length&&e.onMerge?(0,q.jsx)(Lh,{topic:t.canonicalTopic,near:e.near,onMerge:e.onMerge}):null,(0,q.jsx)(Kh,{...e})]}),r.kind===`reveal`&&(0,q.jsx)(qh,{...e,mode:r}),r.kind===`review`&&(0,q.jsx)(Xh,{...e}),r.kind===`past`&&(0,q.jsx)(Zh,{...e}),(r.kind===`write`||r.kind===`pass`)&&(0,q.jsx)(tg,{...e,mode:r})]})}function Lh({topic:e,near:t,onMerge:n}){let[r,i]=(0,y.useState)(),a=e=>`${e} card${e===1?``:`s`}`;return r?(0,q.jsxs)(`p`,{className:`topic-merge`,children:[`Merge `,(0,q.jsx)(`code`,{children:e}),` into `,(0,q.jsx)(`code`,{children:r}),`? Decisions on both then count as one topic, and it can't be undone.`,` `,(0,q.jsx)(`button`,{type:`button`,onClick:()=>n(r),children:`Merge them`}),` `,(0,q.jsx)(`button`,{type:`button`,onClick:()=>i(void 0),children:`Cancel`})]}):(0,q.jsxs)(`p`,{className:`topic-merge`,children:[`Its topic, `,(0,q.jsx)(`code`,{children:e}),`, looks like`,` `,t.map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0?` or `:``,(0,q.jsx)(`button`,{type:`button`,onClick:()=>i(e.topic),children:e.topic}),` `,`(`,a(e.count),`)`]},e.topic)),`. Same topic?`]})}function Rh({agent:e,wait:t}){return t===`waiting`?(0,q.jsxs)(`span`,{className:`stopped`,children:[e,` stopped`]}):t===`gone`?(0,q.jsxs)(`span`,{className:`gone`,children:[e,` stopped waiting`]}):t===`carried-on`?(0,q.jsxs)(`span`,{className:`gone`,children:[e,` carried on`]}):null}function zh({card:e}){let t=e.meta;return(0,q.jsxs)(`div`,{className:`crux`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`lbl`,children:t.crux_preference?`It turns on what you value`:`It turns on`}),` `,t.crux]}),t.crux_fact&&(0,q.jsx)(`p`,{className:`fact`,children:Mh(t.crux_fact)}),(0,q.jsx)(Bh,{card:e})]})}function Bh({card:e}){let t=Pp(e);return t?(0,q.jsxs)(`p`,{className:`facet reply`,children:[(0,q.jsxs)(`b`,{children:[Up(e),` replied`]}),t.to?(0,q.jsxs)(q.Fragment,{children:[`You chose “`,t.to,`”. `]}):null,t.reply]}):null}function Vh(e){let{card:t,mode:n,side:r}=e,i=t.meta,a=e.sides[r],o=n.kind===`live`||n.kind===`seen`,s=a===`proposal`&&(n.kind===`reveal`||n.kind===`past`||n.kind===`seen`),c=om(t)?`Your answer in chat`:am(t)?`${Up(t)} went ahead with this`:`${Up(t)}'s pick${i.serves?`, for ${i.serves}`:``}`,l=n.kind===`reveal`?n.option:n.kind===`past`?e.past?.chosen:void 0,u=(l?l===a?` chosen`:` unchosen`:``)+(e.armed===r?` armed`:``);return(0,q.jsxs)(`button`,{type:`button`,className:`opt${u}`,"data-side":r,"data-kind":a,tabIndex:o?0:-1,"aria-label":`Choose ${i[a]}`,onClick:()=>o&&e.onReach(r),onPointerEnter:()=>o&&e.onHover(r),onPointerLeave:()=>e.onHover(void 0),children:[o&&(0,q.jsx)(`kbd`,{className:`key`,"aria-hidden":`true`,children:Ph[r]}),(0,q.jsx)(`span`,{className:`ifans`,children:a===`proposal`?i.crux_proposal:i.crux_alternative}),(0,q.jsx)(`h2`,{children:i[a]}),(0,q.jsxs)(`p`,{className:`then`,children:[`then `,Mh(a===`proposal`?i.proposal_then:i.alternative_then)]}),s&&(0,q.jsx)(`span`,{className:`pickof`,children:c})]})}function Hh({card:e}){let t=e.meta;return(0,q.jsxs)(q.Fragment,{children:[t.premise&&t.premise_option&&(0,q.jsxs)(`p`,{className:`facet unverified`,children:[(0,q.jsx)(`b`,{children:`Unverified`}),` “`,t[t.premise_option],`” `,t.premise,`. `,(0,q.jsxs)(`span`,{className:`soft`,children:[`Check: `,t.premise_check,`.`]})]}),!am(e)&&(0,q.jsx)(Uh,{card:e})]})}function Uh({card:e}){let t=e.meta;return!t.acted||!t.acted_option?null:(0,q.jsxs)(`p`,{className:`facet acted`,children:[(0,q.jsx)(`b`,{children:`Already built`}),` `,Up(e),` has done “`,t[t.acted_option],`”: `,t.acted,`.`]})}function Wh({card:e}){let t=e.gate;return(0,q.jsxs)(q.Fragment,{children:[t&&(0,q.jsxs)(`p`,{className:`facet held`,children:[(0,q.jsx)(`b`,{children:`Held back`}),` Your setting for `,Um(t.row),` is “`,Zf[t.position],`”, so `,Up(e),` went ahead without asking.`,e.audit?` This one came back to you as a sample.`:``]}),(0,q.jsx)(Uh,{card:e})]})}function Gh({card:e,on:t,onChange:n}){let r=e.gate;if(r?.outcome!==`held`)return null;let i=r.mode===`enforce`;return(0,q.jsxs)(`label`,{className:`rule-toggle`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:t??!1,onChange:e=>n(e.target.checked)}),(0,q.jsxs)(`span`,{children:[i?`You should have asked me`:`I'd have wanted to be asked`,` `,(0,q.jsx)(`span`,{className:`soft`,children:i?`Whatever you choose, it counts against that setting, and Baesian may propose showing you more like it.`:`In shadow, your setting for ${Um(r.row)}, “${Zf[r.position]}”, would have held this back. Ticked, it counts against that setting.`})]})]})}function Kh(e){let t=Up(e.card),n=Ph[Fh(e.sides,`alternative`)],r=om(e.card)?e.touch?`Not what you meant? Tap the other option, or answer otherwise.`:`Not what you meant? Choose the other option (${n}), or answer otherwise.`:e.readLeftMs>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`b`,{children:`Read it first:`}),` `,(e.readLeftMs/1e3).toFixed(1),`\xA0s`]}):e.touch?`${xh} ${e.rarity===`mythic`?`Then press and hold to confirm.`:`You choose first.`} ${t}'s pick shows after.`:`${e.rarity===`mythic`?`Choose, then hold.`:`You choose first.`} ${t}'s pick shows after.`;return(0,q.jsxs)(`div`,{className:`foot`,children:[(0,q.jsx)(`span`,{className:`rule`,"data-testid":`rule`,children:r}),(0,q.jsxs)(`button`,{type:`button`,className:e.armed===`up`?`armed`:void 0,onClick:()=>e.onReach(`up`),children:[(0,q.jsx)(`kbd`,{className:`dir`,children:`↑`}),` Other answer`]}),(0,q.jsxs)(`button`,{type:`button`,className:e.armed===`down`?`armed`:void 0,onClick:()=>e.onReach(`down`),children:[(0,q.jsx)(`kbd`,{className:`dir`,children:`↓`}),` Can't judge`]})]})}function qh(e){let{card:t,mode:n}=e,r=t.meta,i=Up(t),a=r.source_model?`${i} (${r.source_model})`:i,o=am(t),s=Cp(r),c=om(t),l=n.option===`proposal`,u=l&&n.first!==`proposal`&&!c,d=o?l?`Keep ${Hp(r.proposal)}`:`Overturn it: ${Hp(r.alternative)}`:`Confirm ${Hp(r[n.option])}`,f=o&&!l?`Overturning it sends ${i} a brief of what to redo.`:``,p=e.touch?f:`${f?`${f} `:``}Esc goes back to ${c?`your answer in chat`:`the choice`}.`;return(0,q.jsxs)(`div`,{className:`panel-in`,children:[(0,q.jsx)(`p`,{className:`verdict`,children:c?l?(0,q.jsxs)(q.Fragment,{children:[`You chose `,(0,q.jsx)(`b`,{children:r.proposal}),`, your answer in chat.`]}):(0,q.jsxs)(q.Fragment,{children:[`You chose `,(0,q.jsx)(`b`,{children:r[n.option]}),`, not your answer in chat, `,(0,q.jsx)(`b`,{children:r.proposal}),`.`]}):o?u?(0,q.jsxs)(q.Fragment,{children:[`You're keeping `,(0,q.jsx)(`b`,{children:r.proposal}),`, what `,a,` went ahead with.`]}):(0,q.jsxs)(q.Fragment,{children:[`You chose `,(0,q.jsx)(`b`,{children:r[n.option]}),`. `,a,` went ahead with `,l?`the same`:(0,q.jsx)(`b`,{children:r.proposal}),`.`]}):u?(0,q.jsxs)(q.Fragment,{children:[`You switched to `,(0,q.jsx)(`b`,{children:r.proposal}),`, `,i,`'s pick`,r.source_model?` (${r.source_model})`:``,`.`]}):(0,q.jsxs)(q.Fragment,{children:[`You chose `,(0,q.jsx)(`b`,{children:r[n.option]}),`. `,a,` `,l?`picked the same.`:(0,q.jsxs)(q.Fragment,{children:[`picked `,(0,q.jsx)(`b`,{children:r.proposal}),`.`]})]})}),o&&(0,q.jsx)(Wh,{card:t}),(0,q.jsxs)(`div`,{className:`reasoning`,children:[(r.rationale||r.wrong_if||!t.body.trim())&&(0,q.jsx)(Qh,{card:t}),r.secret_reason&&(0,q.jsxs)(`p`,{className:`small`,children:[i,` filed it though it looks like it holds a secret: `,(0,q.jsx)(`q`,{children:r.secret_reason})]}),t.body.trim()&&(0,q.jsxs)(`details`,{className:`context`,open:!(r.rationale||r.wrong_if),children:[(0,q.jsxs)(`summary`,{children:[`More from `,i]}),(0,q.jsx)(Nh,{text:t.body})]})]}),!l&&(0,q.jsxs)(`label`,{className:`why-line`,children:[(0,q.jsxs)(`span`,{className:`lbl`,children:[`Why?`,` `,(0,q.jsx)(`span`,{className:`soft`,children:s?`Optional. It's kept with your answer, and committed with the code.`:(0,q.jsxs)(q.Fragment,{children:[`Optional. It goes to `,i,` with your answer`,t.replied?`.`:`, and ${i} may reply once, with a new fact or a check.`,` It's committed with the code.`]})})]}),(0,q.jsx)(`input`,{type:`text`,autoComplete:`off`,placeholder:`One line`,value:n.why,onChange:t=>e.onMode({...n,why:t.target.value}),onKeyDown:t=>{t.key===`Enter`&&e.rarity!==`mythic`&&(t.preventDefault(),e.onConfirm())}})]}),(0,q.jsx)(Gh,{card:t,on:n.asked,onChange:t=>e.onMode({...n,asked:t})}),!s&&(0,q.jsx)(eg,{card:t,on:n.rule,onChange:t=>e.onMode({...n,rule:t})}),$h(t,n.option,e.rules).map(t=>(0,q.jsxs)(`label`,{className:`rule-toggle`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:n.retire?.includes(t.meta.id)??!1,onChange:r=>e.onMode({...n,retire:r.target.checked?[...n.retire??[],t.meta.id]:(n.retire??[]).filter(e=>e!==t.meta.id)})}),(0,q.jsxs)(`span`,{children:[`Retire this rule: `,lm(t.body),` `,(0,q.jsxs)(`span`,{className:`soft`,children:[`Your answer breaks it. Retired, it stops approving changes at commit, and `,i,` stops citing it.`]})]})]},t.meta.id)),(0,q.jsxs)(`div`,{className:`reveal-row`,children:[(0,q.jsx)(Jh,{...e,words:d,side:n.side}),!l&&(0,q.jsx)(`button`,{type:`button`,className:`switch`,onClick:e.onSwitch,children:c?`Back to your answer in chat`:o?`Keep ${i}'s pick`:`Switch to ${i}'s pick`}),e.touch&&(0,q.jsx)(`button`,{type:`button`,className:`cancel`,onClick:e.onBack,children:`Back to the choice`})]}),p&&(0,q.jsx)(`p`,{className:`small`,children:p})]})}function Jh(e){let t=Ph[e.side];return e.rarity===`mythic`?(0,q.jsxs)(`button`,{type:`button`,className:`hold`,onPointerDown:e.onHoldStart,onPointerUp:e.onHoldEnd,onPointerLeave:e.onHoldEnd,onPointerCancel:e.onHoldEnd,onContextMenu:e=>e.preventDefault(),children:[(0,q.jsx)(`span`,{className:`fill`,style:{width:`${(e.hold??0)*100}%`}}),(0,q.jsx)(`span`,{children:e.touch?`Press and hold to confirm`:(0,q.jsxs)(q.Fragment,{children:[`Hold `,(0,q.jsx)(`kbd`,{children:t}),` or click and hold to confirm`]})})]}):(0,q.jsxs)(`button`,{type:`button`,className:`confirm`,onClick:e.onConfirm,children:[e.words,` `,(0,q.jsx)(`kbd`,{children:t})]})}function Yh(e){let{card:t,mode:n}=e,r=t.meta,i=Up(t);return(0,q.jsxs)(`div`,{className:`panel-in seen`,children:[(0,q.jsxs)(`div`,{className:`said`,children:[(0,q.jsx)(`span`,{className:`lbl`,children:`You answered this in chat`}),(0,q.jsx)(`q`,{children:sm(r.answered_in_chat??``)})]}),(0,q.jsxs)(`p`,{className:`verdict`,children:[i,` filed your answer as its pick: `,(0,q.jsx)(`b`,{children:r.proposal}),`.`]}),(0,q.jsx)(eg,{card:t,on:n.rule,onChange:t=>e.onMode({...n,rule:t})}),(0,q.jsx)(`div`,{className:`reveal-row`,children:(0,q.jsx)(Jh,{...e,words:`Confirm ${Hp(r.proposal)}`,side:Fh(e.sides,`proposal`)})}),(0,q.jsx)(`p`,{className:`small`,children:`You'd seen the pick, so your calibration leaves this card out.`})]})}function Xh(e){let t=Up(e.card),n=e.review,r=!!n?.practice&&n.sent;return(0,q.jsxs)(`div`,{className:`panel-in`,children:[(0,q.jsx)(`div`,{className:`result`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`b`,{children:n?.words??`You answered this card.`}),` `,n?.practice?n.practice:n?.test?n.sent?`It's recorded.`:`It's recorded in a few seconds.`:n?.sent?`It was sent to ${t}.`:n?.waiting?`It waits for your passkey, and goes to ${t} once you confirm it.`:`It goes to ${t} in a few seconds.`]})}),(0,q.jsxs)(`div`,{className:`row`,children:[!r&&(0,q.jsx)(`button`,{type:`button`,className:`send`,onClick:e.onChange,children:`Change your answer`}),(0,q.jsxs)(`button`,{type:`button`,className:`cancel`,onClick:e.onBack,children:[`Back to the next card `,(0,q.jsx)(`kbd`,{children:`Esc`})]})]}),n?.sent&&!n.test&&!n.practice&&(0,q.jsxs)(`p`,{className:`small`,children:[`A changed answer goes to `,t,` with a brief of what it changes.`]})]})}function Zh(e){let t=e.past?.words??``;return(0,q.jsxs)(`div`,{className:`panel-in`,children:[(0,q.jsx)(`div`,{className:`result`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsxs)(`b`,{children:[t.charAt(0).toUpperCase()+t.slice(1),`.`]}),` Opened from your decisions, by branch: it's settled, so there's nothing to answer here.`]})}),(0,q.jsxs)(`div`,{className:`row`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`send`,onClick:e.past?.onBranches,children:[`Back to your decisions, by branch `,(0,q.jsx)(`kbd`,{children:`B`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`cancel`,onClick:e.onBack,children:[`Back to the next card `,(0,q.jsx)(`kbd`,{children:`Esc`})]})]})]})}function Qh({card:e}){let t=e.meta;return!t.rationale&&!t.wrong_if?(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`who`,children:Up(e)}),` gave no reasoning beyond the card.`]}):(0,q.jsxs)(`p`,{children:[(0,q.jsxs)(`span`,{className:`who`,children:[Up(e),`:`]}),` `,t.rationale&&(0,q.jsx)(`q`,{children:t.rationale}),t.wrong_if&&(0,q.jsxs)(q.Fragment,{children:[` `,`Its pick is wrong if `,t.wrong_if,t.check?` (check ${t.check})`:``,`.`]})]})}function $h(e,t,n=[]){let r=e.meta[`${t}_breaks`];return n.filter(e=>!e.retired&&r.includes(e.meta.id))}function eg({card:e,on:t,onChange:n}){return e.meta.rule===void 0?(0,q.jsxs)(`label`,{className:`rule-toggle`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:t??!1,onChange:e=>n(e.target.checked)}),(0,q.jsxs)(`span`,{children:[`Make this a rule `,(0,q.jsxs)(`span`,{className:`soft`,children:[Up(e),` drafts it for you to confirm, so decisions like this one go the same way.`]})]})]}):null}function tg(e){let{mode:t}=e,n=Up(e.card),r=t.kind===`write`,i=r?pm:mm,a=r?pm.find(e=>e.reason===t.reason)?.placeholder??`Goes back to ${n} with this card.`:`Optional: what would help you judge it?`,o=(0,y.useRef)(null);return(0,q.jsxs)(`div`,{className:`panel-in`,children:[(0,q.jsx)(`h3`,{children:r?`Write to ${n}`:`Why can't you judge it?`}),(0,q.jsx)(`div`,{className:`chips`,role:`group`,children:i.map(n=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":t.reason===n.reason,onClick:()=>{e.onMode({...t,reason:n.reason}),e.touch&&r&&o.current?.focus()},children:n.label},n.reason))}),(0,q.jsx)(`textarea`,{ref:o,autoFocus:!e.touch,"aria-label":r?`Your answer`:`What would help`,placeholder:a,value:t.text,onChange:n=>e.onMode({...t,text:n.target.value}),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.onSend())}}),(0,q.jsx)(`p`,{className:`small`,children:`What you write is committed with the code.`}),t.kind===`write`&&(t.reason===`correction`||t.reason===`reject`)&&(0,q.jsx)(eg,{card:e.card,on:t.rule,onChange:n=>e.onMode({...t,rule:n})}),e.problem&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:e.problem}),(0,q.jsxs)(`div`,{className:`row`,children:[(0,q.jsx)(`button`,{type:`button`,className:`send`,disabled:!t.reason,onClick:e.onSend,children:t.reason===`not_my_area`?`Ask ${n} to find another reviewer`:`Send to ${n}`}),!e.touch&&(0,q.jsxs)(`span`,{className:`small`,children:[(0,q.jsx)(`kbd`,{children:`⌘`}),` `,(0,q.jsx)(`kbd`,{children:`Enter`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`cancel`,onClick:e.onBack,children:[`Cancel `,(0,q.jsx)(`kbd`,{children:`Esc`})]})]})]})}var ng=`(max-width: 760px)`,rg=`(hover: none) and (pointer: coarse)`;function ig(e){let t=(0,y.useCallback)(t=>{let n=matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]);return(0,y.useSyncExternalStore)(t,()=>matchMedia(e).matches)}var ag=e=>{let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer},og=e=>{let t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)},sg=e=>({id:ag(e.id),type:e.type,...e.transports?{transports:e.transports}:{}}),cg=class extends Error{};function lg(e,t){let n=e instanceof DOMException?e.name:``;return n===`NotAllowedError`?new cg(`the passkey wasn't used: it was cancelled, or took too long. Try again`):n===`InvalidStateError`&&t?new cg(`this device already holds a passkey for your account. Use another device or security key, or sign in with the one you have`):n===`SecurityError`?new cg(`this page's address doesn't match the site's passkeys. Open the site at its own address and try again`):n===`NotSupportedError`?new cg(`this browser or device can't make a passkey of a kind the site takes. Try another browser, or a security key`):typeof PublicKeyCredential>`u`?new cg(`this browser doesn't support passkeys. Use a recent Safari, Chrome, Edge or Firefox`):new cg(`the passkey didn't work (${e instanceof Error?e.message:String(e)}). Try again`)}async function ug(e){let t;try{t=await navigator.credentials.get({publicKey:{challenge:ag(e.challenge),...e.timeout?{timeout:e.timeout}:{},...e.rpId?{rpId:e.rpId}:{},...e.allowCredentials?{allowCredentials:e.allowCredentials.map(sg)}:{},...e.userVerification?{userVerification:e.userVerification}:{},...e.extensions?{extensions:e.extensions}:{}}})}catch(e){throw lg(e,!1)}let n=t.response;return{id:t.id,rawId:og(t.rawId),type:t.type,response:{clientDataJSON:og(n.clientDataJSON),authenticatorData:og(n.authenticatorData),signature:og(n.signature),...n.userHandle?{userHandle:og(n.userHandle)}:{}},clientExtensionResults:t.getClientExtensionResults(),...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{}}}var dg=class extends Error{constructor(){super(`you didn't confirm it with your passkey, so it wasn't sent`)}},fg,pg=new Set,mg=()=>{for(let e of pg)e()};function hg(e){return fg?.refuse(),new Promise((t,n)=>{fg={ask:e,done:e=>{fg=void 0,mg(),t(e)},refuse:()=>{fg=void 0,mg(),n(new dg)}},mg()})}var gg=e=>(pg.add(e),()=>pg.delete(e)),_g=[`no`,`one`,`two`,`three`,`four`,`five`,`six`],vg=5;function yg(e){let t=e.titles.length;return e.kind===`preferences`?`This change lets more cards past you without asking, so it counts only once your passkey confirms it's yours.`:t>1?`These ${_g[t]??t} answers count only once your passkey confirms they're yours, not an agent's at your keyboard. One tap confirms them all.`:e.loosens?`Accepting this lets more cards past you without asking, so it counts only once your passkey confirms it's yours.`:`This card is hard, so your answer counts only once your passkey confirms it's yours, not an agent's at your keyboard.`}function bg(){let e=(0,y.useSyncExternalStore)(gg,()=>fg),[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(),a=(0,y.useRef)(null);if((0,y.useEffect)(()=>{i(void 0),n(!1),e&&requestAnimationFrame(()=>a.current?.focus())},[e]),(0,y.useEffect)(()=>{if(!e)return;let t=t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.refuse())};return addEventListener(`keydown`,t,!0),()=>removeEventListener(`keydown`,t,!0)},[e]),!e)return null;let{ask:o}=e,s=async()=>{n(!0),i(void 0);try{e.done(await ug(o.options))}catch(e){n(!1),i(e instanceof Error?e.message:String(e))}},c=o.titles.length-vg;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`proof-backdrop`,"aria-hidden":`true`}),(0,q.jsxs)(`aside`,{className:`panel proof`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`proof-title`,children:[(0,q.jsx)(`h4`,{id:`proof-title`,children:`Confirm with your passkey`}),(0,q.jsx)(`p`,{className:`proof-why`,children:yg(o)}),o.kind===`answers`&&o.titles.length>0&&(0,q.jsxs)(`ul`,{className:`proof-list`,"aria-label":o.titles.length===1?`The card you answered`:`The cards you answered`,children:[o.titles.slice(0,c>1?vg:6).map((e,t)=>(0,q.jsx)(`li`,{children:e},t)),c>1&&(0,q.jsxs)(`li`,{className:`sub`,children:[`and `,_g[c]??c,` more`]})]}),r&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:xg(r)}),(0,q.jsxs)(`div`,{className:`proof-row`,children:[(0,q.jsx)(`button`,{type:`button`,className:`confirm`,ref:a,disabled:t,onClick:()=>void s(),children:t?`Waiting for your passkey…`:`Use your passkey`}),(0,q.jsx)(`button`,{type:`button`,className:`cancel`,onClick:()=>e.refuse(),children:o.kind===`answers`?`Not now`:`Don't send it`})]}),o.kind===`answers`&&(0,q.jsxs)(`p`,{className:`small`,children:[`Not now leaves `,o.titles.length===1?`it`:`them`,` waiting on the desk, for up to 30 minutes from when you answered.`]})]})]})}var xg=e=>{let t=e.trim();return t&&`${t[0].toUpperCase()}${t.slice(1)}${/[.!?]$/.test(t)?``:`.`}`},Sg=(0,y.createContext)({state:`/api/state`,presence:`/api/presence`,verdicts:`/api/verdicts`,aliases:`/api/aliases`,preferences:`/api/preferences`,presets:`/api/presets`,practice:`/api/practice`}),Cg=()=>(0,y.useContext)(Sg),wg=()=>matchMedia(`(max-width: 760px)`).matches?`hosted-phone`:`hosted-desktop`,Tg=e=>({method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),credentials:`same-origin`}),Eg=(e,t)=>e?.error??`the server answered ${t}`;async function Dg(e,t,n,r={}){let i=e.hosted&&r.client?{...n,client:wg()}:n,a=await fetch(t,{...Tg(i),...r.keepalive?{keepalive:!0}:{}});if(a.status!==202||!e.hosted||r.wait)return a;let{passkey:o}=await a.json(),s=(await Og(e,[o.pending],{kind:`preferences`,titles:{},loosens:!0})).outcomes[0],c=s?{status:s.status,body:s.body}:{status:410,body:{error:`it waited too long for your passkey, so it wasn't saved`}};return new Response(JSON.stringify(c.body),{status:c.status,headers:{"content-type":`application/json`}})}async function Og(e,t,n){let r=e.hosted,i=await fetch(r.batches,Tg({pending:t})),a=await i.json().catch(()=>({}));if(i.status===404&&a.expired)return{expired:a.expired,outcomes:[]};if(i.status!==202||!a.passkey)throw Error(Eg(a,i.status));let{batch:o,answers:s,expired:c,options:l}=a.passkey,u=await hg({kind:n.kind,titles:s.map(e=>n.titles[e]).filter(e=>!!e),loosens:n.loosens,options:l}),d=await fetch(r.proofs,Tg({batch:o,response:u})),f=await d.json().catch(()=>({}));if(d.status===404)return{expired:[...c,...s],outcomes:[]};if(d.status!==200||!f.answers)throw Error(Eg(f,d.status));return{expired:c,outcomes:f.answers}}function kg(){let[e,t]=(0,y.useState)({kind:`loading`});return(0,y.useEffect)(()=>{let e=!1,n=0,r=async()=>{try{let r=await fetch(`/api/state`,{credentials:`same-origin`});if(e)return;if(r.status===401)return t({kind:`signed-out`});if(!r.ok)throw Error(`the server answered ${r.status}`);let i=await r.json();!e&&i.version>=n&&(n=i.version,t({kind:`ready`,state:i,fetchedAt:Date.now()}))}catch(n){e||t({kind:`error`,message:n instanceof Error?n.message:String(n)})}};r();let i=new EventSource(`/api/events`);return i.addEventListener(`changed`,()=>void r()),()=>{e=!0,i.close()}},[]),e}function Ag(e){let[t,n]=(0,y.useState)([]),[r,i]=(0,y.useState)(!1),a=e.practice;return(0,y.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(a,{credentials:`same-origin`});if(!t.ok)return;let r=await t.json();e||(n(e=>jg(r.entries,e)),i(!0))}catch{}};t();let r=()=>document.visibilityState===`visible`&&void t();return document.addEventListener(`visibilitychange`,r),()=>{e=!0,document.removeEventListener(`visibilitychange`,r)}},[a]),{entries:t,ready:r,add:(0,y.useCallback)(e=>n(t=>jg([e],t)),[])}}function jg(e,t){let n=e=>JSON.stringify(e),r=new Set;return[...e,...t].filter(e=>!r.has(n(e))&&!!r.add(n(e))).sort((e,t)=>e.at.localeCompare(t.at))}var Mg=3e4;function Ng(){let e=Cg();(0,y.useEffect)(()=>{let t=JSON.stringify(e.hosted?{client:wg()}:{}),n=()=>void fetch(e.presence,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:t}).catch(()=>{}),r=()=>document.visibilityState===`visible`&&n();n();let i=setInterval(n,Mg);return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)}},[e])}function Pg(e,t){try{let n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}function Fg(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var Ig=(e,t)=>`baesian:${e}:${t}`;function Lg(e,t){let n=Ig(e,`spent`);Fg(n,[...Pg(n,[]),t].slice(-1e3))}var Rg=e=>Pg(Ig(e,`spent`),[]);function zg(e){let t=Ig(e.project.name,`seen`),n=(0,y.useRef)(e);n.current=e;let[r,i]=(0,y.useState)(()=>{let n=Pg(t,null);if(n)return new Set(n);let r=e.cards.map(Fp);return Fg(t,r),new Set(r)});return{isNew:e=>!r.has(e),mark:(0,y.useCallback)(e=>i(r=>{if(r.has(e))return r;let i=new Set(r).add(e),a=new Set(n.current.cards.map(Fp));return Fg(t,[...i].filter(e=>a.has(e))),i}),[t])}}function Bg(e){let t=Ig(e.project.name,`setup`),[n,r]=(0,y.useState)(()=>Pg(t,!1));return{offered:n,mark:(0,y.useCallback)(()=>{Fg(t,!0),r(!0)},[t])}}function Vg(e){let t=Ig(e.project.name,`briefed`),n=(0,y.useRef)(e);n.current=e;let[r,i]=(0,y.useState)(()=>new Set(Pg(t,[])));return{has:e=>r.has(e),mark:(0,y.useCallback)(e=>i(r=>{if(r.has(e))return r;let i=new Set(r).add(e),a=new Set(n.current.decks.map(e=>e.meta.id));return Fg(t,[...i].filter(e=>a.has(e))),i}),[t])}}var Hg=e=>e.cards.filter(e=>e.status===`open`&&(e.meta.level===`blocking`||e.meta.level===`hard`));function Ug(e,t){return Hg(t).filter(t=>!e.has(Fp(t)))}function Wg(e,t){let n=typeof Notification<`u`,r=Ig(e.project.name,`notify`),[i,a]=(0,y.useState)(()=>Pg(r,!1)),[o,s]=(0,y.useState)(()=>n?Notification.permission:`denied`),c=n?o===`denied`?`blocked`:i&&o===`granted`?`on`:`off`:`unsupported`,l=(0,y.useRef)(t);l.current=t;let u=(0,y.useRef)(void 0);return(0,y.useEffect)(()=>{let t=u.current;if(u.current=new Set(Hg(e).map(Fp)),t&&c===`on`&&(document.hidden||!document.hasFocus()))for(let n of Ug(t,e)){let e=new Notification(`${n.meta.source_agent} is waiting for you`,{body:n.meta.question,tag:n.meta.id});e.onclick=()=>{window.focus(),l.current(n.meta.id),e.close()}}},[e,c]),{status:c,toggle:async()=>{if(!n)return`unsupported`;if(c===`on`)return Fg(r,!1),a(!1),`off`;let e=Notification.permission==="default"?await Notification.requestPermission():Notification.permission;return s(e),e===`granted`?(Fg(r,!0),a(!0),`on`):e===`denied`?`blocked`:`off`}}}var Gg=class{post;ms;events;now;held;constructor(e,t,n,r=Date.now){this.post=e,this.ms=t,this.events=n,this.now=r}hold(e,t){this.flush();let n=this.now()+this.ms;return this.held={card:e,item:t,until:n,timer:setTimeout(()=>this.flush(),this.ms)},{card:e,item:t,until:n}}waiting(){return this.held&&{card:this.held.card,item:this.held.item,until:this.held.until}}undo(){if(!this.held)return;clearTimeout(this.held.timer);let{card:e}=this.held;return this.held=void 0,e}flush(e=!1){if(!this.held)return;clearTimeout(this.held.timer);let{card:t,item:n}=this.held;this.held=void 0,this.post(n,{keepalive:e}).then(e=>e?this.events.sent(t,e):this.events.sent(t),e=>this.events.failed(t,e instanceof Error?e.message:String(e)))}},Kg=e=>async(t,{keepalive:n})=>`practice`in t?{practice:await qg(e,t.practice,n)}:Jg(await Dg(e,e.verdicts,t.verdict,{keepalive:n,client:!0,wait:!0}));async function qg(e,t,n=!1){let r=await Dg(e,e.practice,t,{keepalive:n,client:!0}),i=await r.json().catch(()=>({}));if(!r.ok||!i.entry)throw Error(i.error??`the server answered ${r.status}`);return i.entry}async function Jg(e){if(e.status===202)return{waiting:(await e.json()).passkey};if(e.ok){let{filed:t}=await e.json().catch(()=>({}));return t?.length?{filed:t}:{}}let t=`the server answered ${e.status}`;try{t=(await e.json()).error??t}catch{}throw Error(t)}var Yg=864e5;7*Yg,30*Yg;var Xg=/\b(?:the proposal|proposals?|proposed|propose|the alternative|alternative's|my pick|our pick|its pick|the pick|i pick|i'd pick|i would pick|i chose|i'd choose|i would choose|i'd go with|i recommend|recommend(?:ed|s)?)\b/i;function Zg(e){let t=[...e.verdicts].reverse().find(e=>yp.has(e.response));if(!(!t||t.response!==`accept`&&t.response!==`alternative`))return{option:t.response===`accept`?`proposal`:`alternative`,at:t.at,...t.first_choice?{first:t.first_choice}:{}}}function Qg(e,t,n,r){let i=e.meta;if(e.status!==`resolved`)return`it isn't settled`;let a=Zg(e);if(!a)return`its final answer isn't a choice of one option`;if(!a.first)return`it has no blind choice`;if(Cp(i))return`it's Baesian's own card`;if(Sp(e))return`it was answered in chat`;if(e.revisions!==1||i.revision!==1)return`it was revised`;if(e.replied||i.reply!==void 0)return`its agent replied`;if(Lp(e))return`it's hard`;if(e.gate?.outcome===`held`)return`the gate held it back`;if(!i.alternative_rationale)return`it has no case for its alternative`;if(i.acted||i.premise)return`it says what's built, or rests on a premise`;if(i.proposal_breaks.length||i.alternative_breaks.length)return`an option breaks a decision or rule`;if(i.conflict_of?.length||t.cards.some(e=>e.meta.conflict_of?.includes(i.id)))return`it's in a conflict`;if(i.rules.length)return`it cites a rule`;if(e.verdicts.some(e=>e.make_rule)||t.rules.some(e=>e.meta.from_card===i.id))return`a rule was made from it`;if(Xg.test(e.body))return`its background speaks of the pick`;let o=n-Date.parse(a.at);if(o<6048e5)return`it was answered under a week ago`;if(o>2592e6)return`it was answered over a month ago`;if(r.has(i.id))return`it has come back before`}function $g(e,t,n){return e.cards.filter(r=>Qg(r,e,t,n)===void 0).sort((e,t)=>Zg(e).at.localeCompare(Zg(t).at))}var e_=e=>`P-${e.slice(2)}`;function t_(e){let{rationale:t,wrong_if:n,check:r,serves:i,alternative_rationale:a,...o}=e.meta,s=Zg(e);return{meta:{...o,id:e_(o.id),proposal:o.alternative,proposal_then:o.alternative_then,crux_proposal:o.crux_alternative,alternative:o.proposal,alternative_then:o.proposal_then,crux_alternative:o.crux_proposal,...a?{rationale:a}:{}},body:e.body,revisions:1,replied:!1,status:`open`,canonicalTopic:e.canonicalTopic,verdicts:[],dependents:[],briefs:[],waiting:[],fallbacks:[],attachments:0,practice:{of:o.id,revision:o.revision,answered:s?.at??o.created}}}var n_={test:1/4,on:1/20},r_={test:1,on:5};function i_(e){return e.pool>0&&e.realLeft>=1&&e.since>=r_[e.phase]&&e.roll<n_[e.phase]}var a_=[{mark:`no`,label:`No`,key:`1`},{mark:`maybe`,label:`Maybe`,key:`2`},{mark:`sure`,label:`Sure`,key:`3`}],o_=e=>new Set(e.flatMap(e=>e.kind===`answer`?[e.card]:[]));function s_(e){let t=new Map;for(let n of e)n.kind===`answer`&&n.test&&t.set(n.card,n.answered);let n=new Map;for(let r of e){if(r.kind!==`mark`)continue;let e=`${r.practice?`p`:`r`}:${r.card}`,i=n.get(e)?.at??r.at,a=r.practice?t.get(r.card):void 0;n.set(e,{card:r.card,practice:r.practice===!0,mark:r.mark,...a?{answered:a}:{},at:i})}let r=[...n.values()].sort((e,t)=>e.at.localeCompare(t.at)),i=r.filter(e=>e.practice)[9];return i?r.filter(e=>!e.practice||e.at<=i.at):r}function c_(e,t){let n=0;for(let r=0;r<t;r++)n+=Math.log(e-r)-Math.log(r+1);return n}function l_(e,t,n,r){let i=0;for(let a=r;a<=Math.min(t,n);a++)n-a>e-t||(i+=Math.exp(c_(t,a)+c_(e-t,n-a)-c_(e,n)));return Math.min(1,i)}var u_=.05;function d_(e){let t=e.filter(e=>e.practice).length,n=e.filter(e=>e.mark!==`no`),r=n.filter(e=>e.practice).length,i=l_(e.length,t,n.length,r);return{total:e.length,practice:t,marked:n.length,right:r,p:i,spotted:i<u_}}function f_(e){let t=e.find(e=>e.kind===`test-start`);if(!t)return{kind:`before`};let n=s_(e),r=n.filter(e=>e.practice).length;if(r<10)return{kind:`test`,started:t.at,marks:n,practice:r};let i=d_(n);return{kind:i.spotted?`spotted`:`on`,started:t.at,marks:n,result:i}}var p_=e=>e.kind===`test`?`test`:e.kind===`on`?`on`:void 0;function m_(e){let t=new Map;for(let n of e)n.kind===`answer`&&!n.test&&t.set(n.card,n);let n=0,r=0,i=0;for(let e of t.values())e.blind===`planted`?n+=1:e.blind===`other`&&e.final===`planted`?r+=1:e.blind===`other`&&e.final===`other`&&(i+=1);return{planted:n,cameRound:r,kept:i,total:n+r+i}}function h_(e,t){let n=m_(e),r=0,i=0;for(let e of t.cards){if(e.status!==`resolved`&&e.status!==`superseded`||Cp(e.meta)||Sp(e)||Lp(e))continue;let t=Zg(e);t&&t.first===`alternative`&&(i+=1,t.option===`proposal`&&(r+=1))}return{planted:{came:n.cameRound,of:n.cameRound+n.kept},real:{came:r,of:i}}}var g_=(e,t)=>Math.max(0,Math.floor((Date.parse(t)-Date.parse(e))/Yg));function __(e){let t=`You marked ${e.marked} of the ${e.total} cards in the test as maybe or sure, and ${e.right} of those ${e.right===1?`was`:`were`} rebuilt, of ${e.practice} rebuilt in all.`,n=`Guessing would do that well ${v_(e.p)} of the time.`;return e.spotted?`${t} ${n} That beats guessing, so practice cards are spotted, and they're dropped.`:`${t} ${n} That doesn't beat guessing, so practice cards aren't spotted: they now come about 1 in 20 cards.`}var v_=e=>e<.01?`under 1%`:`${Math.round(e*100)}%`;function y_(e,t){let n=(e.marks.at(-1)?.at??e.started).slice(0,10),r=e.result,i=e=>t(e)?`${e}, “${t(e)}”`:e,a=e.marks.filter(e=>e.practice),o=e.marks.filter(e=>!e.practice),s=(e,t)=>e.filter(e=>e.mark===t).length,c=[`---`,`type: review`,`status: active`,`authority: log`,`summary: "The blind test of practice cards (B-xx49m, B-bb7ga), ${e.started.slice(0,10)} to ${n}: ${r.total} cards, ${r.practice} rebuilt; ${r.marked} marked maybe or sure, ${r.right} of them rebuilt; ${r.spotted?`spotted, so practice cards are dropped (D71)`:`not spotted, so practice cards start (B-kb5yt)`}."`,`created: ${n}`,`updated: ${n}`,`reviewed: ${n}`,`tags: [baesian, review, calibration]`,`---`,``,`# Practice Cards Blind Test`,``,`The blind test that [[Practice Cards]] puts before practice cards ship (D83, B-kb5yt), run in the deck as you worked (B-xx49m), from ${e.started.slice(0,10)} to ${n}. Counted as B-bb7ga decided: a one-sided Fisher's exact test over every card in the test, maybe and sure counted as marked.`,``,`**Result:** ${__(r)} (p = ${r.p.toFixed(4)}.)`,``,`## The rebuilt cards`,``,`| Card | Your mark | Its original answered | Days before you marked it |`,`|---|---|---|---|`,...a.map(e=>`| ${i(e.card)} | ${e.mark} | ${e.answered?.slice(0,10)??``} | ${e.answered?g_(e.answered,e.at):``} |`),``,`## The real cards`,``,`${o.length} real cards answered in the test: marked no ${s(o,`no`)}, maybe ${s(o,`maybe`)}, sure ${s(o,`sure`)}.`,``].join(`
12
+ `);return{name:`${n} Practice Cards Blind Test.md`,text:c}}function b_(e,t,n=!1){let r=e=>e===`proposal`?`planted`:`other`;return{kind:`answer`,card:e.of,revision:e.revision,answered:e.answered,...t.kind===`choose`&&t.first?{blind:r(t.first)}:{},final:t.kind===`choose`?r(t.option):t.kind,...n?{test:!0}:{}}}function x_(e,t){let n=e.practice;return{kind:`mark`,card:n?n.of:e.meta.id,revision:n?n.revision:e.meta.revision,mark:t,...n?{practice:!0}:{}}}function S_(e,t){return`practice: ${t.kind===`choose`?`you chose ${Hp(e.meta[t.option])}`:t.kind===`write`?`you wrote an answer`:`you couldn't judge it`}`}function C_(e,t){let n=e.practice;return`That was a practice card, rebuilt from one you answered on ${n?tm(n.answered):`an earlier day`}. The pick it showed was the option ${Up(e)} didn't pick${t?`, and no agent was waiting on it`:``}. Nothing went to an agent, and anything you wrote wasn't kept.`}var w_=[`agreed`,`cameRound`,`missed`],T_={agreed:`a`,cameRound:`r`,missed:`o`},E_=e=>`${Math.round(e*1e4)/100}%`;function D_({routing:e}){let t=e.report,n=Jf.map(n=>{let r=t.rows[n],i=r?.position??(op(n)?`never-without-me`:e.settings.rows[n]);return{row:n,name:Xf[n],stop:Zf[i]??i,bar:r?$m(r):{agreed:0,cameRound:0,missed:0,total:0},report:r}}),r={row:`all`,name:`All rows`,bar:$m(t.pooled),report:t.pooled},i=eh(n.map(e=>e.bar)),[a,o]=(0,y.useState)(),s=oh(t.pooled)>0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`panel-head`,children:[(0,q.jsxs)(`div`,{className:`panel-head-text`,children:[(0,q.jsx)(`p`,{className:`lede`,children:`How your answers compare with the agents' picks, row by row. You choose before you see the agent's pick, so where you choose as it did, it could be trusted with more; where you overturn it, keep seeing those cards.`}),(0,q.jsx)(`p`,{className:`cal-summary`,children:sh(t.pooled)})]}),(0,q.jsxs)(`div`,{className:`cal-legend`,"aria-label":`Legend`,children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`i`,{className:`sw a`}),`Chose as the agent did, without seeing its pick`]}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`i`,{className:`sw r`}),`Came round to its pick, after reading its case`]}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`i`,{className:`sw o`}),`A miss: you overturned it or should have been asked, or chose otherwise blind on what you value`]})]})]}),(0,q.jsxs)(`div`,{className:`cal-chart`,onPointerDown:e=>{e.target instanceof Element&&e.target.closest(`.seg`)||o(void 0)},children:[(0,q.jsx)(O_,{line:r,scale:r.bar.total,onTip:o}),n.map(e=>(0,q.jsx)(O_,{line:e,scale:i,onTip:o},e.row))]}),(0,q.jsx)(k_,{tip:a}),(0,q.jsxs)(`details`,{className:`cal-table`,children:[(0,q.jsx)(`summary`,{children:`Show the numbers as a table`}),(0,q.jsxs)(`table`,{children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{scope:`col`,children:`Row`}),(0,q.jsx)(`th`,{scope:`col`,className:`col-stop`,children:`Stop`}),(0,q.jsx)(`th`,{scope:`col`,children:`As the agent`}),(0,q.jsx)(`th`,{scope:`col`,children:`Came round`}),(0,q.jsx)(`th`,{scope:`col`,children:`Misses`}),(0,q.jsx)(`th`,{scope:`col`,children:`Cards`}),s&&(0,q.jsx)(`th`,{scope:`col`,children:`Not counted`})]})}),(0,q.jsx)(`tbody`,{children:[...n,r].map(e=>(0,q.jsxs)(`tr`,{className:e.row===`all`?`all`:void 0,children:[(0,q.jsxs)(`th`,{scope:`row`,children:[e.name,e.stop&&(0,q.jsx)(`span`,{className:`in-row`,children:e.stop})]}),(0,q.jsx)(`td`,{className:`col-stop`,children:e.stop??``}),(0,q.jsx)(`td`,{children:e.bar.agreed}),(0,q.jsx)(`td`,{children:e.bar.cameRound}),(0,q.jsx)(`td`,{children:e.bar.missed}),(0,q.jsx)(`td`,{children:e.bar.total}),s&&(0,q.jsx)(`td`,{children:oh(e.report)})]},e.row))})]}),s&&(0,q.jsx)(`p`,{className:`sub after`,children:`Not counted: cards not answered yet, held back, or kept without a blind choice.`})]}),(0,q.jsxs)(`div`,{className:`cal-reading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`b`,{children:`Mostly indigo`}),`You and the agents agree here. Baesian suggests a lower stop once it's 95% sure a row's misses are under 1 in 10, from its answers since it last moved: `,nh.down,`. Each row says how many more it needs.`]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`b`,{children:`Any rose`}),`Each is a decision you'd have got wrong to leave to the agent. On a question of what you value, your choice before its case is the one that counts: choosing otherwise is a miss even if its case then won you round. Once Baesian is 95% sure a row's misses are over 1 in 10 (`,nh.up,`), it suggests a higher stop.`]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`b`,{children:`Short and faded`}),`Fewer than `,10,` answers: too few to say anything about the row yet.`]})]})]})}function O_(e){let{line:t}=e,{bar:n}=t,[r,i]=(0,y.useState)(0),a=(0,y.useRef)(null),o=w_.filter(e=>n[e]>0),s=t.report?ah(t.report):[],c=th(t.report?.test),l=r=>{let s=a.current?.querySelectorAll(`.seg`)[r];s&&(i(r),e.onTip({text:ch(t.name,o[r],n[o[r]],n.total),el:s}))},u=e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),o.length&&l((r+(e.key===`ArrowRight`?1:o.length-1))%o.length))},d=`${t.name}${t.stop?`, ${t.stop}`:``}: ${n.agreed} chose as the agent did, ${n.cameRound} came round, ${n.missed} ${n.missed===1?`miss`:`misses`}, of ${n.total}.${c?` ${c}.`:``}`;return(0,q.jsxs)(`div`,{ref:a,className:[`cal-row`,t.row===`all`?`all`:``,t.row!==`all`&&n.total<10?`thin`:``].filter(Boolean).join(` `),"data-row":t.row,role:`group`,"aria-label":d,tabIndex:n.total?0:-1,onFocus:e=>e.target===e.currentTarget&&o.length&&l(Math.min(r,o.length-1)),onBlur:()=>e.onTip(void 0),onKeyDown:u,children:[(0,q.jsxs)(`div`,{className:`nm`,children:[(0,q.jsx)(`b`,{children:t.name}),(0,q.jsx)(`span`,{children:t.row===`all`?`scaled to its own width`:t.stop})]}),(0,q.jsx)(`div`,{className:`cal-track`,children:(0,q.jsx)(`div`,{className:`cal-bar`,style:{width:e.scale?E_(n.total/e.scale):`0`},onPointerLeave:t=>t.pointerType===`mouse`&&e.onTip(void 0),children:o.map((e,t)=>(0,q.jsx)(`span`,{className:`seg ${T_[e]}`,"data-kind":e,"data-count":n[e],style:{flexGrow:n[e]},onPointerEnter:e=>e.pointerType===`mouse`&&l(t),onClick:()=>l(t)},e))})}),(0,q.jsxs)(`div`,{className:`num`,children:[n.total?(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`b`,{children:n.missed}),` `,n.missed===1?`miss`:`misses`,` in `,n.total]}):!s.length&&(0,q.jsx)(`span`,{children:`no cards`}),s.length>0&&(0,q.jsx)(`span`,{className:`left`,children:n.total?`and ${s.join(`, `)}`:s.join(`, `)}),c&&(0,q.jsx)(`span`,{className:`needs`,children:c})]})]})}function k_({tip:e}){let t=(0,y.useRef)(null);return(0,y.useLayoutEffect)(()=>{let n=t.current;if(!n||!e)return;let r=()=>{let t=e.el.getBoundingClientRect(),r=n.offsetWidth,i=n.offsetHeight;n.style.left=`${Math.min(Math.max(8,t.left+t.width/2-r/2),innerWidth-r-8)}px`,n.style.top=`${t.top-i-8>=8?t.top-i-8:t.bottom+8}px`};return r(),e.el.setAttribute(`data-tipped`,``),addEventListener(`scroll`,r,!0),addEventListener(`resize`,r),()=>{e.el.removeAttribute(`data-tipped`),removeEventListener(`scroll`,r,!0),removeEventListener(`resize`,r)}},[e]),e?(0,q.jsx)(`div`,{ref:t,className:`cal-tip`,role:`tooltip`,children:e.text}):null}var A_={on:`on`,off:`off`,blocked:`blocked`,unsupported:``};function j_(e){let t=(0,y.useRef)(null);(0,y.useEffect)(()=>{if(!e.open)return;t.current?.querySelector(`button`)?.focus();let n=t=>!(t.target instanceof Element&&t.target.closest(`.menu-wrap`))&&e.onOpen(!1);return addEventListener(`pointerdown`,n),()=>removeEventListener(`pointerdown`,n)},[e.open]);let n=t=>()=>{e.onOpen(!1),t()};return(0,q.jsxs)(`div`,{className:`menu-wrap`,children:[(0,q.jsx)(`button`,{type:`button`,className:`menu-btn`,"aria-haspopup":`menu`,"aria-expanded":e.open,"aria-controls":`menu`,onClick:()=>e.onOpen(!e.open),children:`More`}),e.open&&(0,q.jsxs)(`div`,{className:`menu`,id:`menu`,role:`menu`,ref:t,children:[(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:n(()=>e.onPanel(`calibration`)),children:`Your calibration`}),(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:n(()=>e.onPanel(`branches`)),children:e.touch?`Your decisions, by branch`:(0,q.jsxs)(q.Fragment,{children:[`Your decisions, by branch `,(0,q.jsx)(`kbd`,{children:`B`})]})}),(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:n(()=>e.onPanel(`preferences`)),children:`Your preferences`}),(0,q.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:n(()=>e.onPanel(`held`)),children:[`Held back `,(0,q.jsx)(`span`,{className:`state`,children:e.held||`none`})]}),(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:n(()=>e.onPanel(`keys`)),children:e.touch?`Gestures`:(0,q.jsxs)(q.Fragment,{children:[`Keyboard shortcuts `,(0,q.jsx)(`kbd`,{children:`?`})]})}),e.notify!==`unsupported`&&(0,q.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":e.notify===`on`,onClick:n(e.onNotify),children:[`Notify me when an agent stops `,(0,q.jsx)(`span`,{className:`state ${e.notify}`,children:A_[e.notify]})]}),e.site&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`a`,{role:`menuitem`,href:`/`,className:`menu-link`,children:`Your projects`}),(0,q.jsx)(`a`,{role:`menuitem`,href:`/account`,className:`menu-link`,children:`Your account`})]})]})]})}function M_(e){let t=[...document.querySelectorAll(`#menu [role^=menuitem]`)];t.length&&t[(t.indexOf(document.activeElement)+(e===`down`?1:t.length-1)+t.length)%t.length].focus()}function N_({label:e,onClose:t,children:n,id:r,wide:i,className:a}){return(0,q.jsxs)(`aside`,{className:[`panel`,i?`wide`:``,a??``].filter(Boolean).join(` `),"aria-label":e,...r?{id:r}:{},children:[(0,q.jsxs)(`button`,{type:`button`,className:`panel-close`,onClick:t,children:[`Close `,(0,q.jsx)(`kbd`,{children:`Esc`})]}),(0,q.jsx)(`h4`,{children:e}),n]})}function P_({touch:e,phone:t,onClose:n}){return e?(0,q.jsxs)(N_,{label:`Gestures`,onClose:n,children:[(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:`Drag`}),(0,q.jsx)(`dd`,{children:`Scrolls, wherever you touch the card`}),(0,q.jsx)(`dt`,{children:`Hold, then drag`}),(0,q.jsx)(`dd`,{children:`Hold the card still until it lifts, and each answer is named at its edge of the screen: left or right for an option, up to write an answer, down to say you can't judge it. Drag the card to one and let go when it says to, or let go anywhere else to put it down.`}),(0,q.jsx)(`dt`,{children:`Tap`}),(0,q.jsx)(`dd`,{children:`An option, or Other answer or Can't judge at the card's foot, does the same. Then confirm, once you've seen the agent's pick; on mythic cards, press and hold.`}),(0,q.jsx)(`dt`,{children:`Undo`}),(0,q.jsx)(`dd`,{children:`In the note that comes up, for 5 seconds`}),t&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:`Your path`}),(0,q.jsx)(`dd`,{children:`The bar at the foot of the screen: tap it, or pull it up`})]})]}),(0,q.jsx)(`p`,{className:`sub after`,children:`The setup survey's examples and a deck's briefing are held and dragged the same way.`})]}):(0,q.jsxs)(N_,{label:`Keyboard shortcuts`,onClose:n,children:[(0,q.jsxs)(`dl`,{children:[(0,q.jsxs)(`dt`,{children:[(0,q.jsx)(`kbd`,{children:`←`}),(0,q.jsx)(`kbd`,{children:`→`})]}),(0,q.jsx)(`dd`,{children:`Choose an option, then press it again to confirm, once you've seen the agent's pick; on mythic cards, hold to confirm. Hold to lean first.`}),(0,q.jsx)(`dt`,{children:(0,q.jsx)(`kbd`,{children:`↑`})}),(0,q.jsx)(`dd`,{children:`Write an answer`}),(0,q.jsx)(`dt`,{children:(0,q.jsx)(`kbd`,{children:`↓`})}),(0,q.jsx)(`dd`,{children:`Say you can't judge it`}),(0,q.jsxs)(`dt`,{children:[(0,q.jsx)(`kbd`,{children:`j`}),(0,q.jsx)(`kbd`,{children:`k`})]}),(0,q.jsx)(`dd`,{children:`Next or previous card`}),(0,q.jsx)(`dt`,{children:(0,q.jsx)(`kbd`,{children:`Z`})}),(0,q.jsx)(`dd`,{children:`Undo, for 5 seconds`}),(0,q.jsxs)(`dt`,{children:[(0,q.jsx)(`kbd`,{children:`1`}),(0,q.jsx)(`kbd`,{children:`2`}),(0,q.jsx)(`kbd`,{children:`3`})]}),(0,q.jsx)(`dd`,{children:`In the blind test of practice cards, your guess about the card you've just answered: no, maybe, sure`}),(0,q.jsx)(`dt`,{children:(0,q.jsx)(`kbd`,{children:`B`})}),(0,q.jsx)(`dd`,{children:`Your decisions, by branch: opens them beside the desk, and closes them`}),(0,q.jsx)(`dt`,{children:(0,q.jsx)(`kbd`,{children:`Esc`})}),(0,q.jsx)(`dd`,{children:`Back one step`}),(0,q.jsx)(`dt`,{children:(0,q.jsx)(`kbd`,{children:`?`})}),(0,q.jsx)(`dd`,{children:`These shortcuts`})]}),(0,q.jsx)(`p`,{className:`sub after`,children:`You can also drag the card, or swipe with two fingers.`})]})}function F_({spent:e,superseded:t,routing:n,practice:r,onClose:i}){let a=Jm(e),o=t.names,s=t.inChat?`; ${t.inChat} you answered in chat ${t.inChat===1?`isn't`:`aren't`} counted`:``;return(0,q.jsxs)(N_,{label:`Your calibration`,onClose:i,id:`calibration-panel`,wide:!0,children:[(0,q.jsx)(D_,{routing:n}),r&&(0,q.jsx)(J_,{...r}),(0,q.jsxs)(`div`,{className:`cal-time`,children:[(0,q.jsxs)(`span`,{children:[`Median time on a card, in this browser: mythic and rare `,(0,q.jsx)(`b`,{children:Ym(a.high)}),`, uncommon `,(0,q.jsx)(`b`,{children:Ym(a.uncommon)}),`, common `,(0,q.jsx)(`b`,{children:Ym(a.common)})]}),(0,q.jsxs)(`span`,{children:[`Later superseded:`,` `,o.length?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`b`,{children:o.length}),` of the decisions you settled here: `,o.map(e=>`“${e}”`).join(`, `),s]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`b`,{children:`none`}),` of the decisions you settled here`,s]})]})]})]})}function I_({held:e,gone:t=[],mode:n,onOpen:r,onClose:i}){return(0,q.jsxs)(N_,{label:`Held back`,onClose:i,id:`held-panel`,children:[(0,q.jsx)(`p`,{className:`sub`,children:e.length?`Your settings held these back, and their agents went ahead. Any can be answered: you choose first, then see what was done.`:t.length?`Nothing held back is waiting to be answered.`:n===`shadow`?`Nothing is held back: in shadow, every card reaches you.`:`Nothing is held back.`}),e.length>0&&(0,q.jsx)(`div`,{className:`held-list`,children:e.map(e=>(0,q.jsx)(L_,{card:e,onOpen:r},e.meta.id))}),t.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`sub held-gone-h`,children:[t.length===1?`One more was`:`${t.length} more were`,` held back over 90 days ago and never answered, so the service removed `,t.length===1?`its`:`their`,` text. Your repo's record keeps `,t.length===1?`it`:`them`,`.`]}),(0,q.jsx)(`ul`,{className:`held-list held-gone`,children:t.map(e=>(0,q.jsxs)(`li`,{className:`parked-row`,children:[(0,q.jsxs)(`span`,{className:`nm`,children:[`Held back `,tm(e.settled)]}),(0,q.jsxs)(`span`,{className:`st`,children:[e.level[0].toUpperCase()+e.level.slice(1),`; its text was removed `,tm(e.removed),`.`]})]},e.id))})]})]})}function L_({card:e,onOpen:t}){let n=e.gate?Um(e.gate.row):``;return(0,q.jsxs)(`button`,{type:`button`,className:`parked-row`,onClick:()=>t(e.meta.id),children:[(0,q.jsx)(`span`,{className:`nm`,children:e.meta.title}),(0,q.jsxs)(`span`,{className:`st`,children:[Up(e),` went ahead`,n?`, on ${n}`:``,`.`]}),(0,q.jsx)(`span`,{className:`go`,children:`Answer it`})]})}var R_=/\bB-[0-9a-hjkmnp-tv-z]{5}\b/g,z_=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function B_(e,t,n){let r=new Map,i=e;for(let n of new Set(e.match(R_))){let e=t(n);e&&i.includes(e)&&(r.set(e,n),i=i.replace(RegExp(`\\s*\\(${n}\\)`,`g`),``))}let a=(e,t,r)=>(0,q.jsx)(`button`,{type:`button`,className:`card-link`,title:e,onClick:()=>n(e),children:t},r),o=[],s=0,c=new RegExp([...[...r.keys()].map(z_),R_.source].join(`|`),`g`);for(let e of i.matchAll(c)){let n=r.get(e[0])??e[0],c=r.has(e[0])?e[0]:t(e[0]);c&&(o.push(i.slice(s,e.index),a(n,c,e.index)),s=e.index+e[0].length)}return o.push(i.slice(s)),o}function V_(e){let{deck:t}=e;return(0,q.jsxs)(N_,{label:t.meta.title,onClose:e.onClose,id:`deck-panel`,children:[(0,q.jsx)(`p`,{className:`sub`,children:`The briefing for this work.`}),!t.body.trim()&&(0,q.jsx)(`p`,{className:`sub`,children:`It has no briefing.`}),(0,q.jsx)(H_,{deck:t,titleOf:e.titleOf,onOpen:e.onOpen})]})}function H_(e){let{deck:t}=e;return(0,q.jsxs)(q.Fragment,{children:[t.body.trim()&&(0,q.jsx)(`div`,{className:`briefing`,children:(0,q.jsx)(Nh,{text:t.body})}),t.notes.length>0&&(0,q.jsxs)(`div`,{className:`context-notes`,children:[(0,q.jsx)(`h5`,{children:`Context`}),(0,q.jsx)(`ul`,{children:t.notes.map(t=>(0,q.jsxs)(`li`,{title:t.path,children:[(0,q.jsx)(`b`,{children:t.text}),t.summary&&(0,q.jsx)(`span`,{className:`note-summary`,children:B_(t.summary,e.titleOf,e.onOpen)}),t.missing&&(0,q.jsx)(`span`,{className:`missing`,children:`Not in the vault.`})]},t.link))})]})]})}var U_=e=>!!e&&!e.meta.id.startsWith(`branch-`)&&(e.body.trim()!==``||e.notes.length>0),W_={rerouted:`You said it's outside your expertise.`,deferred:`You deferred it.`},G_=4;function K_(e){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`big`,children:`All caught up.`}),e.recap&&(0,q.jsx)(`p`,{className:`recap`,children:e.recap}),e.parked.length>0&&(0,q.jsxs)(`div`,{className:`parked`,children:[(0,q.jsx)(`p`,{className:`parked-h`,children:`Put aside`}),e.parked.map(t=>(0,q.jsxs)(`button`,{type:`button`,className:`parked-row`,onClick:()=>e.onOpen(t.meta.id),children:[(0,q.jsx)(`span`,{className:`nm`,children:t.meta.title}),(0,q.jsx)(`span`,{className:`st`,children:W_[t.status]??``}),(0,q.jsx)(`span`,{className:`go`,children:`Answer it now`})]},t.meta.id))]}),e.held.length>0&&(0,q.jsxs)(`div`,{className:`parked`,children:[(0,q.jsx)(`p`,{className:`parked-h`,children:`Held back`}),e.held.slice(0,G_).map(t=>(0,q.jsx)(L_,{card:t,onOpen:e.onOpen},t.meta.id)),e.held.length>G_&&(0,q.jsxs)(`button`,{type:`button`,className:`more-held`,onClick:e.onAllHeld,children:[`All `,e.held.length,` held back`]})]}),e.notify===`off`&&(0,q.jsx)(`button`,{type:`button`,className:`ghost`,onClick:e.onNotify,children:`Notify me when an agent stops`}),e.notify===`on`&&(0,q.jsx)(`p`,{className:`small`,children:`Keep this page open: you'll be notified when an agent stops for you.`})]})}var q_=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function J_(e){if(!e.ready)return null;let t=e.status;return(0,q.jsxs)(`section`,{className:`cal-practice`,"aria-label":`Practice cards`,children:[(0,q.jsx)(`h5`,{children:`Practice cards`}),t.kind===`before`&&(0,q.jsx)(X_,{...e}),t.kind===`test`&&(0,q.jsxs)(`p`,{className:`sub`,children:[`The blind test is on: `,t.practice,` of `,10,` rebuilt cards so far. Mark each card you answer. You'll see the result when the tenth rebuilt card is answered.`]}),t.kind===`spotted`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`sub`,children:`You could tell rebuilt cards from real ones in the blind test, so practice cards are off.`}),(0,q.jsx)(Y_,{onResult:e.onResult})]}),t.kind===`on`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Z_,{entries:e.entries,state:e.state}),(0,q.jsx)(`p`,{className:`sub`,children:`Practice cards passed the blind test, so about 1 in 20 of your cards is one. Nothing you answer on one goes to an agent.`}),(0,q.jsx)(Y_,{onResult:e.onResult})]})]})}function Y_({onResult:e}){return(0,q.jsx)(`button`,{type:`button`,className:`cal-link`,onClick:e,children:`The blind test's result`})}function X_(e){let t=$g(e.state,e.now,o_(e.entries)).length,n=t>=10;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`sub`,children:`Baesian can bring back a card you answered before, with the option its agent didn't pick shown as the pick, to see how often you come round to a pick no agent made. Nothing you answer on one goes to an agent.`}),(0,q.jsx)(`p`,{className:`sub`,children:`A blind test comes first. Until ten rebuilt cards have come, about 1 in 4 of your cards is one, and for every card you answer you say whether you think it was rebuilt. If your marks beat guessing, practice cards are dropped.`}),(0,q.jsxs)(`p`,{className:`sub`,children:[`A card can come back from a week to a month after you answered it, if its agent wrote a case for the option it didn't pick. `,t===0?`None can yet`:`${q_(t,`card`)} can now`,n?`.`:`, and the test needs 10.`]}),(0,q.jsx)(`button`,{type:`button`,className:`confirm cal-start`,disabled:!n||e.starting,onClick:e.onStart,children:`Start the blind test`})]})}function Z_({entries:e,state:t}){let n=m_(e),r=h_(e,t),i=[{k:`a`,n:n.planted,what:`chose the planted pick without seeing it`},{k:`r`,n:n.cameRound,what:`came round to it after its case`},{k:`k`,n:n.kept,what:`kept to the other option`}].filter(e=>e.n>0),a=`Practice cards: ${n.planted} chose the planted pick blind, ${n.cameRound} came round to it, ${n.kept} kept to the other option, of ${n.total}.`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:[`cal-row`,`practice`,n.total<10?`thin`:``].filter(Boolean).join(` `),role:`group`,"aria-label":a,children:[(0,q.jsxs)(`div`,{className:`nm`,children:[(0,q.jsx)(`b`,{children:`Practice cards`}),(0,q.jsx)(`span`,{children:`a pick no agent made`})]}),(0,q.jsx)(`div`,{className:`cal-track`,children:(0,q.jsx)(`div`,{className:`cal-bar`,style:{width:n.total?`100%`:`0`},children:i.map(e=>(0,q.jsx)(`span`,{className:`seg ${e.k}`,"data-kind":e.k,"data-count":e.n,style:{flexGrow:e.n},title:`${e.what}: ${e.n} of ${n.total}`},e.k))})}),(0,q.jsx)(`div`,{className:`num`,children:n.total?(0,q.jsx)(`span`,{children:q_(n.total,`card`)}):(0,q.jsx)(`span`,{children:`none yet`})})]}),(0,q.jsxs)(`div`,{className:`cal-legend practice-legend`,"aria-hidden":`true`,children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`i`,{className:`sw a`}),`Chose the planted pick without seeing it`]}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`i`,{className:`sw r`}),`Came round to it after its case`]}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`i`,{className:`sw k`}),`Kept to the other option`]})]}),(0,q.jsx)(`p`,{className:`cal-summary`,children:Q_(r)}),(0,q.jsx)(`p`,{className:`sub`,children:`A planted pick's case is the one its agent wrote for the option it didn't pick, which may be weaker than its case for its own: coming round less often to planted picks can mean weaker cases as well as better judgement.`})]})}function Q_(e){let t=e.planted.of?`You came round to a planted pick on ${e.planted.came} of ${q_(e.planted.of,`practice card`)} where you chose otherwise blind`:`No practice card yet where you chose otherwise blind`,n=e.real.of?`to an agent's real pick on ${e.real.came} of ${e.real.of}`:`no real card yet where you did either`;return e.planted.of?`${t}, and ${n}.`:`${t}, and ${e.real.of?`you came round ${n}`:n}.`}function $_({status:e,titleOf:t,onClose:n}){let r=e.result,i=e.marks.filter(e=>e.practice),a=e.marks.filter(e=>!e.practice);return(0,q.jsxs)(N_,{label:`The blind test's result`,onClose:n,id:`practice-panel`,wide:!0,children:[(0,q.jsx)(`p`,{className:`lede`,children:__(r)}),(0,q.jsx)(`p`,{className:`sub`,children:`The rebuilt cards, each with your mark. None went to an agent, and no agent was waiting on any of them.`}),(0,q.jsx)(`ul`,{className:`practice-list`,children:i.map(e=>(0,q.jsxs)(`li`,{className:`parked-row`,children:[(0,q.jsx)(`span`,{className:`nm`,children:t(e.card)??(e.answered?`A card you answered on ${tm(e.answered)}`:`A card you answered before`)}),(0,q.jsxs)(`span`,{className:`st`,children:[`You marked it `,(0,q.jsx)(`b`,{children:e.mark}),`. `,e.answered?`You'd answered it ${q_(g_(e.answered,e.at),`day`)} before.`:``]})]},e.card))}),(0,q.jsxs)(`p`,{className:`sub`,children:[`Of the `,q_(a.length,`real card`),` you answered in the test, you marked `,a.filter(e=>e.mark===`maybe`).length,` maybe and `,a.filter(e=>e.mark===`sure`).length,` sure.`]}),(0,q.jsx)(`div`,{className:`row`,children:(0,q.jsx)(`button`,{type:`button`,className:`send`,onClick:()=>{let n=y_(e,t),r=URL.createObjectURL(new Blob([n.text],{type:`text/markdown`})),i=document.createElement(`a`);i.href=r,i.download=n.name,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)},children:`Save the result as a note`})}),(0,q.jsx)(`p`,{className:`small`,children:`A note for your vault's Reviews folder, with each rebuilt card's mark against how long before it you'd answered the card it came from.`})]})}var ev=3e5,tv=[`no`,`one`,`two`,`three`,`four`,`five`,`six`],nv=e=>tv[e]??String(e),rv=e=>`${e[0].toUpperCase()}${e.slice(1)}`;function iv(e){return!e.waiting.length||e.busy?`no`:e.waiting.some(t=>t.expiresAt-e.now<=3e5&&!e.warned.has(t.pending))?`expiring`:!e.hardInFront&&e.waiting.some(t=>!e.declined.has(t.pending))?`run-over`:`no`}var av=e=>`${rv(nv(e))} ${e===1?`answer waits`:`answers wait`} for your passkey.`;function ov(e){return e.length===1?`Your answer to “${e[0]}” waited too long for your passkey, so it wasn't recorded. The card is back for you to answer.`:`${rv(nv(e.length))} answers waited too long for your passkey, so they weren't recorded: ${e.map(e=>`“${e}”`).join(`, `)}. Their cards are back for you to answer.`}function sv(e,t){return e===1&&t?t:`${rv(nv(e))} answers confirmed and sent.`}var cv=e=>Ig(e,`passkey-waiting`);function lv(e){try{let t=sessionStorage.getItem(cv(e)),n=t===null?[]:JSON.parse(t);return Array.isArray(n)?n.filter(e=>typeof e?.key==`string`&&typeof e.expires==`string`):[]}catch{return[]}}function uv(e,t){try{t.length?sessionStorage.setItem(cv(e),JSON.stringify(t)):sessionStorage.removeItem(cv(e))}catch{}}var dv=216e5,fv=e=>!e||e===`relay`||e.startsWith(`detached-`),pv=e=>{let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`};function mv(e){switch(e.status){case`withdrawn`:case`superseded`:return`gone`;case`held`:case`deferred`:return`aside`;case`resolved`:return e.verdicts.filter(t=>t.revision===e.meta.revision).at(-1)?.response===`accept`?`with`:`against`;default:return`waiting`}}function hv(e){if(e.status!==`resolved`)return;let t=e.verdicts.filter(t=>t.revision===e.meta.revision).at(-1);return t?.response===`accept`?`proposal`:t?.response===`alternative`?`alternative`:void 0}function gv(e,t){let n=mv(e),r=e.verdicts.filter(t=>t.revision===e.meta.revision).at(-1);switch(e.status){case`withdrawn`:return{words:`withdrawn by its agent`,tone:n};case`superseded`:return{words:`superseded by a later decision`,tone:n};case`held`:return{words:`held back by your settings: ${Up(e)} went ahead`,tone:n};case`deferred`:return{words:`you deferred it`,tone:n};case`returned`:return{words:r?.response===`reject`?`you rejected it: returned to its agent`:`returned to its agent`,tone:n};case`rerouted`:return{words:`you passed it on: waiting for someone else`,tone:n};case`open`:return{words:e.waiting.some(e=>t-Date.parse(e.at)<=9e4)?`${Up(e)} has stopped: waiting for you`:`waiting for you`,tone:n};default:return n===`with`&&r?.seen?{words:`you confirmed “${e.meta.proposal}”, your answer in chat`,tone:n}:n===`with`?{words:`you chose “${e.meta.proposal}”, the agent's pick${r?.first_choice===`alternative`?`, after reading its case`:``}`,tone:n}:r?.response===`alternative`?{words:`you chose “${e.meta.alternative}”, not the agent's pick`,tone:n}:{words:`you answered “${r?.choice??e.decision??r?.response??`otherwise`}”`,tone:n}}}function _v(e){let t=new Map;for(let n of e){let e=Date.parse(n.at),r=t.get(n.commit);r||t.set(n.commit,r={hash:n.commit,short:n.commit.slice(0,7),branch:n.branch,at:n.at,t:e,cards:[]}),r.cards.includes(n.card)||r.cards.push(n.card),e<r.t&&Object.assign(r,{t:e,at:n.at})}return[...t.values()].sort((e,t)=>e.t-t.t||e.hash.localeCompare(t.hash))}var vv=/^(?=.*\d)[0-9a-f]{7,}$/i,yv=e=>[...[...e].flatMap((e,t)=>t>0&&/[-/_.]/.test(e)?[t]:[]),e.length],bv=28;function xv(e){let t=new Map,n=[];for(let r of e){let i=``;for(let t=0;t<r.length;t++)(r[t]===`-`||r[t]===`/`)&&e.some(e=>e!==r&&e.startsWith(r.slice(0,t+1)))&&(i=r.slice(0,t+1));if(!i||r.length<=20){t.set(r,r.length<=28?r:`${r.slice(0,15)}…${r.slice(-10)}`);continue}let a=r.slice(i.length),o=i.replace(/[-/]+$/,``).split(/[-/]/)[0];if(vv.test(a)){let n=e.filter(e=>e!==r&&e.startsWith(i)).map(e=>e.slice(i.length)),s=Math.min(7,a.length);for(;s<a.length&&n.some(e=>e.slice(0,s)===a.slice(0,s));)s++;t.set(r,`${o} ${a.slice(0,s)}`);continue}let s=r.slice(o.length+1),c=yv(s),l=0;for(;l+1<c.length&&c[l+1]<=bv;)l++;n.push({n:r,head:o,rest:s,ends:c,i:l})}let r=e=>`${e.head} ${e.rest.slice(0,e.ends[e.i])}${e.ends[e.i]<e.rest.length?`…`:``}`;for(let e=0;e<64;e++){let e=new Map;for(let t of n)e.set(r(t),[...e.get(r(t))??[],t]);let t=[...e.values()].filter(e=>e.length>1).flat().filter(e=>e.i+1<e.ends.length);if(!t.length)break;for(let e of t)e.i++}for(let e of n)t.set(e.n,r(e));return t}var Sv=e=>`merge:${e.commit.slice(0,12)}:${e.branch}:${e.into}`;function Cv(e,t){let n=[],r=new Map,i=new Set;for(let a of[...e].sort((e,t)=>e.at.localeCompare(t.at))){if(i.has(Sv(a)))continue;i.add(Sv(a));let e=`${a.branch}\0${a.into}`,o=r.get(e);(!o||(t.get(a.branch)??[]).some(e=>e>Date.parse(o.at)+999&&e<=Date.parse(a.at)+999))&&(r.set(e,a),n.push(a))}return n}var wv=[`main`,`master`];function Tv(e,t){if(t)return{name:e.has(t)?t:null,known:!0};let n=wv.find(t=>e.has(t));return n?{name:n,known:!1}:{name:[...e.values()].filter(e=>e.in.length&&!e.out.length).sort((e,t)=>t.last-t.first-(e.last-e.first)||e.first-t.first)[0]?.name??null,known:!1}}function Ev(e,t){let n=t.idleMs??864e5,r=[...e.cards.map(e=>Date.parse(e.meta.created)),...(e.commits??[]).map(e=>Date.parse(e.at)),...(e.merges??[]).map(e=>Date.parse(e.at)+999)].filter(e=>!Number.isNaN(e)),i=Math.max(t.nowMs,...r.map(e=>e+1)),a=e.cards.filter(e=>fv(e.meta.source_branch)).length,o=e.cards.filter(e=>!fv(e.meta.source_branch)).map(e=>({id:e.meta.id,card:e,title:e.meta.title,branch:e.meta.source_branch,agent:Up(e),t:Date.parse(e.meta.created),state:mv(e),forYou:e.status===`open`,hard:Lp(e)})).sort((e,t)=>e.t-t.t||e.id.localeCompare(t.id)),s=new Map(o.map(e=>[e.id,e])),c=_v(e.commits??[]),l=new Map(c.map(e=>[e.hash,e]));for(let t of e.merges??[]){let e=Date.parse(t.at);for(let n of[...t.commits??[],...t.tip?[t.tip]:[]]){let r=l.get(n);r&&r.branch===t.branch&&r.t>=e&&(r.t=e-1)}}let u=new Map,d=(e,t)=>u.set(e,[...u.get(e)??[],t]);for(let e of o)d(e.branch,e.t);for(let e of c)d(e.branch,e.t);let f=Cv((e.merges??[]).filter(e=>e.branch!==e.into&&!fv(e.branch)&&!fv(e.into)),u).map(e=>({...e,gitT:Date.parse(e.at),t:Date.parse(e.at)+999,key:Sv(e),ends:!1,sync:!1})),p=e=>{let t=[],n=e=>{!fv(e)&&!t.includes(e)&&t.push(e)};for(let e of o)n(e.branch);for(let t of e)n(t.branch),n(t.into);return t},m=Tv(new Map(p(f).map(e=>{let t=f.filter(t=>t.branch===e),n=f.filter(t=>t.into===e),r=[...u.get(e)??[],...t.map(e=>e.t),...n.map(e=>e.t)];return[e,{name:e,in:n,out:t,first:Math.min(...r),last:Math.max(...r)}]})),e.defaultBranch),h=new Map;for(let e of[...f].sort((e,t)=>e.t-t.t||e.key.localeCompare(t.key)))h.has(e.into)||h.set(e.into,e);let g=[...h].filter(([e,t])=>e!==m.name&&!(u.get(e)??[]).some(e=>e<t.gitT)&&!f.some(n=>n.branch===e&&n.t<t.t)).map(([,e])=>e),_=f.filter(e=>!g.includes(e)),v=p(_),y=xv([...new Set([...v,...c.filter(e=>!fv(e.branch)).map(e=>e.branch)])]),b=new Map(v.map(e=>[e,{name:e,short:y.get(e)??e,cards:[],commits:[],out:[],in:[],parent:null,parentWhy:null,depth:0,first:1/0,last:-1/0,lastOwn:-1/0,end:{kind:`open`,waiting:0,aside:0,idleSince:null,down:!1}}])),x=e=>b.get(e);for(let e of o)x(e.branch).cards.push(e);for(let e of _){let t=l.get(e.commit);t&&!t.folded&&(t.folded=e,e.own=t),x(e.branch).out.push(e),x(e.into).in.push(e)}for(let e of g)b.has(e.into)&&b.has(e.branch)&&(x(e.into).began=e);let S={branches:[],commits:[]};for(let e of c)e.folded||(b.has(e.branch)?x(e.branch).commits.push(e):(S.commits.push(e),S.branches.includes(e.branch)||S.branches.push(e.branch)));let C=new Map;for(let e of b.values()){let t=[...e.cards.map(e=>e.t),...e.commits.map(e=>e.t)],n=e.began?[e.began.t]:[];e.lastOwn=t.length?Math.max(...t):-1/0,e.first=Math.min(...t,...e.out.map(e=>e.t),...e.in.map(e=>e.t),...n),e.last=Math.max(e.lastOwn,...e.out.map(e=>e.t),...e.in.map(e=>e.t),...n);let r=[...e.out].sort((e,t)=>e.t-t.t).at(-1);r&&e.name!==m.name&&!(e.lastOwn>r.t||e.in.some(e=>e.t>r.t))&&C.set(e.name,r)}let ee=[...b.values()].sort((e,t)=>e.first-t.first||e.name.localeCompare(t.name)),w=new Set,T=new Map,E=()=>{T.clear();for(let[e,t]of C)w.has(t)||T.set(e,t);for(let e of ee){if(e.parent=null,e.parentWhy=null,e.name===m.name)continue;if(e.began){e.parent=e.began.branch,e.parentWhy=`began`;continue}let t=(T.get(e.name)??e.out.find(e=>!w.has(e)))?.into;if(t){e.parent=t,e.parentWhy=`merged`;continue}let n=t=>e.commits.reduce((e,n)=>e+n.cards.filter(e=>s.get(e)?.branch===t.name).length,0),r=t=>[...t.cards.map(e=>e.t),...t.commits.map(e=>e.t),...t.in.map(e=>e.t)].filter(t=>t<=e.first&&t>e.first-dv).length,i=ee.filter(t=>t!==e&&(t.name===m.name||t.first<=e.first&&!(T.get(t.name)&&T.get(t.name).gitT<=e.first))).map(e=>({o:e,s:[n(e),r(e),+(e.name===m.name),e.cards.length]})).sort((e,t)=>t.s[0]-e.s[0]||t.s[1]-e.s[1]||t.s[2]-e.s[2]||t.s[3]-e.s[3]);i[0]&&(e.parent=i[0].o.name,e.parentWhy=`guess`)}},D=(e,t)=>{let n=new Set;for(let r=x(e);r.parent&&!n.has(r.parent)&&x(r.parent).first<=r.first;r=x(r.parent)){if(r.parent===t)return!0;n.add(r.parent)}return!1};for(let e=0;e<=_.length;e++){E();let e=_.filter(e=>!w.has(e)&&D(e.into,e.branch));if(!e.length)break;for(let t of e)w.add(t),t.sync=!0}for(let e of b.values()){let t=new Set([e.name]);for(let n=e.parent;n;n=x(n).parent){if(t.has(n)){e.parent=m.name&&m.name!==e.name?m.name:null,e.parentWhy=e.parent?`guess`:null;break}t.add(n)}}for(let e of b.values())for(let t=e.parent;t;t=x(t).parent)e.depth++;for(let e=0;e<4;e++)for(let e of b.values())e.parent&&e.parent!==m.name&&(x(e.parent).first=Math.min(x(e.parent).first,e.first-1));for(let e of b.values()){let t=T.get(e.name);if(e.name===m.name)e.end={kind:`trunk`,quietSince:e.last};else if(t)e.end={kind:`merged`,into:t.into,at:t.at,merge:t},t.ends=!0;else{let t=e.out.filter(e=>!e.sync).sort((e,t)=>e.t-t.t).at(-1),r=i-e.last>n;e.end={kind:`open`,waiting:e.cards.filter(e=>e.state===`waiting`).length,aside:e.cards.filter(e=>e.state===`aside`).length,idleSince:r?e.last:null,down:r&&!e.cards.some(e=>e.forYou),...t?{since:t}:{}}}}let O=[];for(let e of b.values()){if(!e.parent)continue;let t=e.parentWhy===`began`?e.began:void 0;O.push({kind:`fork`,key:`fork:${e.name}`,lane:e.name,from:e.parent,guess:e.parentWhy===`guess`,t:e.first,rank:t&&t.t===e.first?3:0,...t?{start:t}:{}})}for(let e of o)O.push({kind:`card`,key:`card:${e.id}`,lane:e.branch,card:e,t:e.t,rank:1});for(let e of b.values())for(let t of e.commits)O.push({kind:`commit`,key:`commit:${t.hash}`,lane:e.name,commit:t,t:t.t,rank:2});for(let e of S.commits)O.push({kind:`commit`,key:`commit:${e.hash}`,lane:null,commit:e,t:e.t,rank:2});for(let e of _)O.push({kind:`merge`,key:e.key,lane:e.branch,into:e.into,merge:e,ends:e.ends,t:e.t,rank:3});let k=e=>e.kind===`merge`?{from:e.lane,to:e.into}:e.kind===`fork`&&e.rank===3?{from:e.from,to:e.lane}:null,te=new Map,ne=e=>te.get(e.key)??0,re=new Map;for(let e of O)k(e)&&re.set(e.t,[...re.get(e.t)??[],e]);for(let e of re.values())if(e.length>1)for(let t=0;t<4;t++)for(let t of e)for(let n of e)n!==t&&k(n).to===k(t).from&&te.set(t.key,Math.max(ne(t),ne(n)+1));O.sort((e,t)=>e.t-t.t||e.rank-t.rank||ne(e)-ne(t)||e.key.localeCompare(t.key));let ie=new Map;for(let e of c)for(let t of e.cards)ie.set(t,[...ie.get(t)??[],e]);let ae=[...b.values()],oe=e=>o.filter(t=>t.state===e).length;return{nowT:i,trunk:m.name,trunkKnown:m.known,short:y,lanes:b,cards:o,cardById:s,commits:c,commitByHash:l,citedBy:ie,merges:_,starts:g,loose:S,events:O,offLane:a,counts:{cards:o.length,with:oe(`with`),against:oe(`against`),waiting:o.filter(e=>e.forYou).length,aside:oe(`aside`),gone:oe(`gone`),hard:o.filter(e=>e.hard).length,branches:ae.filter(e=>e.cards.length).length,merged:ae.filter(e=>e.end.kind===`merged`).length,mergedBare:ae.filter(e=>e.end.kind===`merged`&&!e.cards.length).length,open:ae.filter(e=>e.end.kind===`open`),held:ae.filter(e=>e.end.kind===`open`&&e.end.waiting>0),commits:c.length,cited:[...ie.keys()].filter(e=>s.has(e)).length}}}function Dv(e){let t=new Map(e.events.map((e,t)=>[e.key,t])),n=new Map,r=new Map,i=(e,t)=>{e&&r.set(e,t)};e.events.forEach((e,t)=>{e.kind===`fork`?(n.set(e.lane,t),i(e.from,t)):e.kind===`merge`?(i(e.lane,t),i(e.into,t)):i(e.lane,t)});let a=new Map,o=new Map;for(let i of e.lanes.values()){let e=n.get(i.name)??-1/0,s=i.end.kind===`merged`?t.get(i.end.merge.key):1/0;if(a.set(i.name,{start:e,end:s}),i.end.kind===`open`&&i.end.down){let t=r.get(i.name)??Math.max(0,e);o.set(t,[...o.get(t)??[],i.name])}}for(let[e,t]of o)t.sort().forEach((t,n)=>{let r=e+.5+.01*n;Object.assign(a.get(t),{end:r+.005,endRow:{after:e,at:r}})});return a}function Ov(e,t=Dv(e)){let n=e=>{let n=t.get(e.name);return{x0:n.start,x1:n.end}},r=new Map,i=[],a=(e,t)=>!(i[e]??[]).some(e=>e.x0<=t.x1&&t.x0<=e.x1),o=(e,t,n)=>{r.set(e,t),(i[t]??=[]).push(n)};e.trunk&&o(e.trunk,0,n(e.lanes.get(e.trunk)));let s=e=>e.x1===1/0?2**53-1:e.x1-e.x0,c=[...e.lanes.values()].filter(t=>t.name!==e.trunk).map(e=>({L:e,iv:n(e)}));c.sort((e,t)=>e.L.depth-t.L.depth||s(e.iv)-s(t.iv)||e.iv.x0-t.iv.x0||e.L.name.localeCompare(t.L.name));for(let{L:e,iv:t}of c){let n=e.parent&&r.has(e.parent)?r.get(e.parent)+1:0;for(;!a(n,t);)n++;o(e.name,n,t)}return r}function kv(e,t,n){let r=e=>t.get(e)??0,i=[...e.lanes.values()],a=n.spans??Dv(e),o=[...a].map(([e,t])=>({name:e,...t,col:r(e)})),s=e=>{let t=new Map;for(let n of o)n.start<e&&e<n.end&&t.set(n.col,n.name);return t},c=e.events,l=e=>e.kind!==`commit`||n.commits,u=new Map;for(let[e,t]of a)t.endRow&&u.set(t.endRow.after,[...u.get(t.endRow.after)??[],{lane:e,at:t.endRow.at}].sort((e,t)=>t.at-e.at));let d=new Map;c.forEach((e,t)=>d.set(pv(e.t),[...d.get(pv(e.t))??[],t]));let f=[...d.keys()].filter(e=>d.get(e).some(e=>l(c[e])||u.has(e))).sort().reverse(),p=e=>e.kind===`card`&&(e.card.state===`waiting`||e.card.state===`aside`),m=[],h=i.filter(e=>e.end.kind===`open`&&!e.end.down);m.push({kind:`now`,key:`now`,t:e.nowT,tags:h.map(e=>e.name),live:s(c.length-.1),dated:!!f[0]&&f[0]!==pv(e.nowT)});for(let t of f){let i=d.get(t),a=i.map(e=>c[e]),o=i[0],h=i.at(-1),g=a.at(-1).t,_=a[0].t,v=a.filter(e=>e.kind===`card`),y=n.filter?v.some(e=>n.filter(e.card)):!1;if(m.push({kind:`day`,key:`day:${t}`,dk:t,t:g+.5,live:s(h+.9),cards:v.length,against:v.filter(e=>e.card.state===`against`).length,waiting:v.filter(e=>e.card.forYou).length,merges:a.filter(e=>e.kind===`merge`).length}),!n.open.has(t)&&t!==f[0]&&!a.some(p)&&!y){let n=a.filter(e=>e.kind===`fork`).map(t=>e.lanes.get(t.lane).short);m.push({kind:`fold`,key:`fold:${t}`,dk:t,t:_,top:s(h+.9),bottom:s(o-.1),cards:v.length,against:v.filter(e=>e.card.state===`against`).length,gone:v.filter(e=>e.card.state===`gone`).length,began:n,merged:a.filter(e=>e.kind===`merge`&&e.ends).length});continue}let b=null;for(let t of[...i].reverse()){let i=c[t];for(let n of u.get(t)??[]){b=null;let t=e.lanes.get(n.lane);m.push({kind:`end`,key:`end:${n.lane}`,lane:n.lane,t:t.last+.2,live:s(n.at),col:r(n.lane)})}if(!l(i))continue;if(n.filter&&(i.kind===`card`?!n.filter(i.card):i.kind===`commit`)){b||m.push(b={kind:`more`,key:`more:${i.key}`,t:i.t,keys:[],cards:0,commits:0,live:new Map}),b.keys.push(i.key),i.kind===`card`?b.cards++:b.commits++,b.live=s(t);continue}b=null;let a={kind:`event`,key:i.key,e:i,t:i.t,live:s(t),above:s(t+.5),below:s(t-.5),col:null};(i.kind===`card`||i.kind===`commit`)&&(a.col=i.lane?r(i.lane):null),i.kind===`merge`&&(a.col=r(i.into),a.other=r(i.lane)),i.kind===`fork`&&(a.col=r(i.from),a.other=r(i.lane)),m.push(a)}}let g=Math.max(0,...[...e.lanes.keys()].map(r))+1;return{rows:m,cols:e.lanes.size?g:0,loose:n.commits&&e.loose.commits.length>0}}var Av={narrow:14,wide:18},jv={narrow:70,wide:100},Mv=11,Nv=13;function Pv(e,t){let n=t?jv.wide:jv.narrow,r=e<=5?t?Av.wide:Av.narrow:Math.max(6,Math.floor(n/Math.max(1,e-1))),i=e=>Mv+e*r;return{pitch:r,fits:e<=5?e:Math.min(e,Math.floor(n/r)+1),x:i,width:e=>i(Math.max(0,e-1))+Nv}}function Fv(e){let t=0;for(let n of e??[])t=Math.max(t,1+(`col`in n?n.col:Math.max(n.from,n.to)));return t}var Iv=(e,t,n)=>[...e.keys()].some(e=>e>Math.min(t,n)&&e<Math.max(t,n));function Lv(e,t,n){let r=(e,t,n,r)=>({k:`line`,col:e,y1:t,y2:n,lane:r}),i=(e,t=[])=>[...e].filter(([e])=>!t.includes(e)).map(([e,t])=>r(e,0,`100%`,t)),a=(e,t,n,i)=>{let a=e.above.get(t)===n,o=e.below.get(t)===n;return a&&o?[r(t,0,`100%`,n)]:[...a?[r(t,0,i,n)]:[],...o?[r(t,i,`100%`,n)]:[]]};if(e.kind===`now`)return!e.tags.length&&!n.trunk?null:[...e.live].flatMap(([t,n])=>[r(t,37,`100%`,n),...e.tags.includes(n)?[{k:`cap`,col:t,y:37,lane:n,half:5}]:[]]);if(e.kind===`day`||e.kind===`more`)return i(e.live);if(e.kind===`fold`){let n=[];for(let i=0;i<t.cols;i++){let t=e.top.get(i),a=e.bottom.get(i);t&&t===a?n.push(r(i,0,`100%`,t)):(t&&n.push(r(i,0,`38%`,t),{k:`cap`,col:i,y:`38%`,lane:t,half:4}),a&&n.push(r(i,`62%`,`100%`,a),{k:`cap`,col:i,y:`62%`,lane:a,half:4}))}return n}if(e.kind===`end`)return[...i(e.live,[e.col]),r(e.col,19,`100%`,e.lane),{k:`cap`,col:e.col,y:19,lane:e.lane,half:5}];let o=e.e;if(o.kind===`fork`){let t=e.col,n=e.other;return[...i(e.live,[t,n]),...Iv(e.live,t,n)?[{k:`halo`,curve:`fork`,from:t,to:n}]:[],...a(e,t,o.from,25),{k:`fork`,from:t,to:n,lane:o.lane,parent:o.from},...e.above.get(n)===o.lane?[r(n,0,7,o.lane)]:[]]}if(o.kind===`card`||o.kind===`commit`){if(e.col===null)return[...i(e.live),{k:`mark`,col:t.cols,lane:null}];let n=e.col,a=o.lane;return[...i(e.live,[n]),...e.above.get(n)===a?[r(n,0,19,a)]:[],...e.below.get(n)===a?[r(n,19,`100%`,a)]:[],{k:`mark`,col:n,lane:a}]}let s=e.col,c=e.other;return[...i(e.live,[s,c]),...Iv(e.live,c,s)?[{k:`halo`,curve:`merge`,from:c,to:s}]:[],...a(e,s,o.into,22),...a(e,c,o.lane,37),{k:`merge`,from:c,to:s,lane:o.lane,into:o.into}]}var Rv=[`No`,`One`,`Two`,`Three`,`Four`,`Five`,`Six`,`Seven`,`Eight`,`Nine`,`Ten`],zv=e=>Rv[e]??String(e),Bv=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,Vv=e=>e.length<2?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`,Hv=e=>new Date(e).toLocaleDateString(`en-GB`,{weekday:`short`,day:`numeric`,month:`short`}),Uv=e=>new Date(e).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`});function Wv(e){let t=e.end;if(t.kind!==`open`)return``;let n=t.waiting?`Merge held: ${t.waiting} waiting`:`every card answered`;return`${t.since?`No merge recorded after ${Hv(t.since.gitT)}, ${Uv(t.since.gitT)}`:`No merge recorded`} · ${n}${t.idleSince===null?``:` · idle since ${Hv(t.idleSince)}`}`}function Gv(e){let t=e.counts;if(!t.cards)return{lead:`No cards yet.`,body:`A branch appears here once an agent files a card on it.`,open:[],cites:``};let n=t.held.filter(e=>e.cards.some(e=>e.forYou)).map(e=>e.short),r=t.waiting?`${t.waiting===1?`One card is`:`${zv(t.waiting)} cards are`} waiting for you${n.length?`, holding ${Vv(n)} from merging`:``}.`:`Nothing is waiting for you.`,i=t.against?`you chose otherwise than the agent on ${t.against}`:t.with?`you chose the agent's pick on every one you answered`:`none answered yet`,a=t.mergedBare?t.mergedBare<t.merged?`, ${t.mergedBare} of them with commits but no cards`:`, ${t.merged===1?``:t.merged===2?`both `:`all `}with commits but no cards`:``,o=[`${Bv(t.cards,`card`)} on ${Bv(t.branches,`branch`,`branches`)}: ${i}${t.gone?`, and ${t.gone} ${t.gone===1?`was`:`were`} withdrawn`:``}.`,t.merged?`${zv(t.merged)} ${t.merged===1?`branch has`:`branches have`} merged${a}.`:``].filter(Boolean).join(` `),s=e.loose.branches.length,c=t.commits?`${Bv(t.commits,`commit`)} cite ${t.cited} of the cards${s?`; ${Bv(s,`more branch`,`more branches`)} ${s===1?`has`:`have`} commits but no cards`:``}.`:``;return{lead:r,body:o,open:t.open,cites:c}}function Kv(e){let t=e.cards.filter(e=>e.forYou).sort((e,t)=>e.t-t.t)[0],n=e.cards.at(-1),r=t??n;return r?`card:${r.id}`:null}function qv(e,t){if(!t)return[];if(t.startsWith(`card:`))return(e.citedBy.get(t.slice(5))??[]).map(e=>e.folded?e.folded.key:`commit:${e.hash}`);if(t.startsWith(`commit:`))return(e.commitByHash.get(t.slice(7))?.cards??[]).map(e=>`card:${e}`);if(t.startsWith(`merge:`)){let n=e.merges.find(e=>e.key===t);return n?[...new Set([...n.own?.cards??[],...n.cards])].map(e=>`card:${e}`):[]}return[]}function Jv(e,t={commits:!0}){let n=new Map;for(let r of e.events){if(r.kind===`commit`&&!t.commits)continue;let e=pv(r.t);n.has(e)||n.set(e,{key:e,t:r.t,cards:0}),r.kind===`card`&&n.get(e).cards++}return[...n.values()]}var Yv=e=>{let t=e.commits?.length??0;return!e.cards.length&&t?`${Bv(t,`commit`)} citing cards`:`${Bv(e.cards.length,`card`)}${t?` and ${Bv(t,`commit`)} citing cards`:``}`},Xv=e=>new Date(e).toLocaleDateString(`en-GB`,{weekday:`short`,day:`numeric`,month:`short`}),Zv=e=>new Date(e).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}),Qv=e=>`${Xv(e)}, ${Zv(e)}`,$v=e=>e.charAt(0).toUpperCase()+e.slice(1),ey=440,ty=480,ny=680,ry=e=>Math.max(ey,Math.min(960,e-520)),iy=e=>Math.min(880,e-560),ay=900,oy=`baesian:drawer-width`,sy=`br-detail`,cy=[[`all`,`Every card`,()=>!0],[`against`,`You chose otherwise`,e=>e.state===`against`],[`waiting`,`Waiting for you`,e=>e.forYou],[`hard`,`Hard`,e=>e.hard],[`gone`,`Withdrawn`,e=>e.state===`gone`]];function ly(e,t){switch(e.status){case`returned`:return`Returned to its agent`;case`rerouted`:return`Passed on`;case`superseded`:return`Superseded`;case`deferred`:return`Deferred: settled at merge`;case`held`:return`Held back: settled at merge`;default:return{with:`Agent's pick`,against:`You chose otherwise`,waiting:`Waiting for you`,aside:`Held back: settled at merge`,gone:`Withdrawn`}[t]}}function uy(){return(0,y.useSyncExternalStore)(e=>(addEventListener(`resize`,e),()=>removeEventListener(`resize`,e)),()=>innerWidth)}var dy=()=>{try{return Number(localStorage.getItem(oy))||ty}catch{return ty}},fy=e=>{try{localStorage.setItem(oy,String(e))}catch{}};function py({c:e}){let t=e.hard;return(0,q.jsxs)(q.Fragment,{children:[t&&(0,q.jsx)(`circle`,{r:9.6,className:`m-hard`}),e.state===`with`&&(0,q.jsx)(`circle`,{r:t?5.6:6.5,className:`m-with`}),e.state===`against`&&(0,q.jsx)(`rect`,{x:-5.4,y:-5.4,width:10.8,height:10.8,transform:`rotate(45)`,className:`m-against`}),e.state===`waiting`&&(0,q.jsx)(`circle`,{r:t?5:5.8,className:`m-waiting`}),e.state===`aside`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`circle`,{r:t?5.6:6.3,className:`m-aside`}),(0,q.jsx)(`line`,{x1:-1.7,x2:-1.7,y1:-2.6,y2:2.6,className:`m-aside-bar`}),(0,q.jsx)(`line`,{x1:1.7,x2:1.7,y1:-2.6,y2:2.6,className:`m-aside-bar`})]}),e.state===`gone`&&(0,q.jsx)(`circle`,{r:t?5:5.6,className:`m-gone`})]})}var my=(e,t)=>(0,q.jsx)(`path`,{d:`M${e-5.5},${t+5} L${e},${t-4} L${e+5.5},${t+5} Z`,className:`m-merge`}),hy=(e,t)=>(0,q.jsx)(`path`,{d:`M${e-8},${t-5.5} L${e+1},${t} L${e-8},${t+5.5} Z`,className:`m-merge`}),gy=({children:e,w:t=26,h:n=22})=>(0,q.jsx)(`svg`,{width:t,height:n,viewBox:`${-t/2} ${-n/2} ${t} ${n}`,"aria-hidden":`true`,children:e});function _y(e){let t=uy(),[n,r]=(0,y.useState)(dy),i=Math.round(Math.max(ey,Math.min(ry(t),n))),a=!e.phone&&i>=ny,[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(e.open);e.open&&!c&&l(!0),(0,y.useLayoutEffect)(()=>{document.documentElement.style.setProperty(`--dw`,e.phone?`100vw`:`${i}px`),document.body.classList.toggle(`drawer-open`,e.open),document.body.classList.toggle(`drawer-squeeze`,e.open&&!e.phone&&t-i<ay),document.body.classList.toggle(`drawer-resizing`,o)},[e.open,e.phone,i,t,o]),(0,y.useLayoutEffect)(()=>()=>{document.body.classList.remove(`drawer-open`,`drawer-squeeze`,`drawer-resizing`)},[]);let u=(0,y.useRef)(null),d=(0,y.useRef)(!1),f=(0,y.useRef)(null),p=(0,y.useRef)(!1),m=(0,y.useRef)(null);(0,y.useLayoutEffect)(()=>{let e=e=>{e.target instanceof Element&&!e.target.closest(`.drawer`)&&(m.current=e.target)};return addEventListener(`focusin`,e),()=>removeEventListener(`focusin`,e)},[]),(0,y.useLayoutEffect)(()=>{if(e.open&&!p.current){let e=document.activeElement&&document.activeElement!==document.body?document.activeElement:m.current;u.current=e instanceof HTMLElement?e.closest(`.menu`)?document.querySelector(`.menu-btn`):e:null,d.current=!1,requestAnimationFrame(()=>{let e=f.current?.querySelector(`.br-list [tabindex='0']`)??f.current?.querySelector(`.drawer-close`);e?.focus({preventScroll:!0});let t=f.current?.querySelector(`.drawer-scroll`)?.getBoundingClientRect(),n=e?.getBoundingClientRect();e&&t&&n&&(n.top<t.top||n.bottom>t.bottom)&&e.scrollIntoView({block:`center`})})}else!e.open&&p.current&&!d.current&&(u.current?.isConnected?u.current:document.querySelector(`.bar-btn.branches`))?.focus({preventScroll:!0});p.current=e.open},[e.open]);let h=(e,n=!0)=>{let i=Math.round(Math.max(ey,Math.min(ry(t),e)));r(i),n&&fy(i)},g=(0,y.useRef)(null),_=e=>{e.preventDefault(),g.current?.setPointerCapture(e.pointerId),s(!0)},v=e=>{o&&h(innerWidth-e.clientX,!1)},b=()=>{o&&(s(!1),fy(i))},x=e=>{let n=e.shiftKey?160:40,r={ArrowLeft:i+n,ArrowRight:i-n,Home:ey,End:ry(t)}[e.key];r!==void 0&&(e.preventDefault(),h(r))},[S,C]=(0,y.useState)(``),ee=(0,y.useCallback)(e=>{C(``),requestAnimationFrame(()=>C(e))},[]),w=()=>{h(a?ty:iy(t)),ee(a?`Narrower.`:`Wider: a row's time, title and what you chose on one line.`)};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`drawer-veil`,"aria-hidden":`true`,onClick:e.onClose}),(0,q.jsxs)(`aside`,{ref:f,className:`drawer${a?` wide`:``}`,id:`branches-drawer`,role:`dialog`,"aria-modal":e.open?`true`:void 0,"aria-labelledby":`drawer-h`,"aria-describedby":`drawer-status`,inert:!e.open,children:[!e.phone&&(0,q.jsx)(`div`,{ref:g,className:`drawer-grip`,role:`separator`,"aria-orientation":`vertical`,"aria-controls":`branches-drawer`,"aria-label":`The drawer's width: drag, or use the left and right arrow keys`,"aria-valuemin":ey,"aria-valuemax":ry(t),"aria-valuenow":i,"aria-valuetext":`${i} pixels${a?`, wide: one line a row`:``}`,tabIndex:0,onPointerDown:_,onPointerMove:v,onPointerUp:b,onPointerCancel:b,onKeyDown:x,onDoubleClick:w}),(0,q.jsxs)(`div`,{className:`drawer-head`,children:[(0,q.jsx)(`h2`,{id:`drawer-h`,children:`Your decisions, by branch`}),!e.phone&&(0,q.jsxs)(`button`,{type:`button`,className:`drawer-wider`,"aria-pressed":a,disabled:!a&&iy(t)<ny,onClick:w,children:[(0,q.jsx)(`svg`,{width:`18`,height:`12`,viewBox:`0 0 18 12`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:`M1 6h16M5 2 1 6l4 4M13 2l4 4-4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})}),`Wider`]}),(0,q.jsxs)(`button`,{type:`button`,className:`panel-close drawer-close`,"aria-keyshortcuts":`Escape`,onClick:e.onClose,children:[`Close `,(0,q.jsx)(`kbd`,{"aria-hidden":`true`,children:`Esc`})]})]}),(0,q.jsx)(`div`,{className:`drawer-scroll`,children:c&&(0,q.jsx)(yy,{...e,wide:a,say:ee,onOpenCard:t=>{d.current=!0,e.onOpenCard(t)}})}),(0,q.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:S})]})]})}function vy(e){let t=e.closest(`.br-day`)?.querySelector(`.br-row.is-day`);t&&(e.style.scrollMarginTop=`${Math.ceil(t.getBoundingClientRect().height)+11}px`)}function yy(e){let t=Math.floor(e.nowMs/6e4),n=(0,y.useMemo)(()=>Ev(e.state,{nowMs:e.nowMs}),[e.state.cards,e.state.commits,e.state.merges,e.state.defaultBranch,t]),r=(0,y.useMemo)(()=>Ov(n),[n]),i=(0,y.useMemo)(()=>Kv(n),[]),a=!!i&&!!n.cardById.get(i.slice(5))?.forYou,[o,s]=(0,y.useState)(`all`),[c,l]=(0,y.useState)(!1),u=(0,y.useMemo)(()=>Jv(n,{commits:c}),[n,c]),[d,f]=(0,y.useState)(a?i:null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(i),[_,v]=(0,y.useState)(()=>new Set(i?[pv(n.cardById.get(i.slice(5)).t)]:[])),[b,x]=(0,y.useState)(new Set),S=(0,y.useRef)(null),C=(0,y.useRef)(a&&i?{key:i,focus:!1,scroll:!0}:null),ee=cy.find(e=>e[0]===o)[2],w=(0,y.useMemo)(()=>kv(n,r,{commits:c,filter:o===`all`?void 0:ee,open:_}),[n,r,c,o,_]),T=(0,y.useMemo)(()=>new Set(qv(n,d)),[n,d]),E=e=>n.lanes.get(e),D=e=>n.short.get(e)??e,O=[];for(let e of w.rows)e.kind===`now`?(e.tags.length||n.trunk)&&O.push(...e.tags.map(e=>`lane:${e}`)):e.kind===`fold`||e.kind===`more`?O.push(e.key):e.kind===`end`?O.push(`lane:${e.lane}`):e.kind===`event`&&e.e.kind!==`fork`&&O.push(e.key);let k=h&&O.includes(h)?h:O.find(e=>e.startsWith(`card:`))??O[0];(0,y.useLayoutEffect)(()=>{let e=C.current;if(!e||!S.current)return;C.current=null;let t=matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(e.day){let n=S.current.querySelector(`.is-day[data-day="${CSS.escape(e.day)}"]`)?.closest(`.br-day`),r=n?.querySelector(`.br-rb[data-row]`);e.scroll&&n?.scrollIntoView({block:`start`,behavior:t?`auto`:`smooth`}),r&&(g(r.dataset.row),e.focus&&r.focus({preventScroll:!0}));return}let n=e.key?S.current.querySelector(`[data-row="${CSS.escape(e.key)}"]`):null;if(!n)return;let r=n.closest(`li`)?.nextElementSibling,i=e.inner&&r?.classList.contains(`is-detail`)?r.querySelector(e.inner):null;i?i.focus({preventScroll:!0}):e.focus&&n.focus({preventScroll:!0}),e.scroll&&(vy(n),r?.classList.contains(`is-detail`)&&r.scrollIntoView({block:`nearest`,behavior:t?`auto`:`smooth`}),n.scrollIntoView({block:`nearest`,behavior:`auto`}))});let te=(e,t={})=>{f(e),m(null),e&&g(e),e&&(C.current={key:e,focus:t.focus??!0,scroll:t.scroll??!0})},ne=e=>{let t=n.cardById.get(e);t&&(v(e=>new Set([...e,pv(t.t)])),o!==`all`&&!ee(t)&&s(`all`),te(`card:${e}`))},re=e=>{d?.startsWith(`card:`)||d?.startsWith(`merge:`)?(m({from:d,key:`lane:${e}`}),C.current={key:d,inner:`.br-back`,focus:!1,scroll:!0}):te(`lane:${e}`)},ie=()=>{let e=p?.from;m(null),e&&(C.current={key:e,focus:!0,scroll:!0})},ae=t=>{s(t);let r=n.cards.filter(cy.find(e=>e[0]===t)[2]).length;e.say(t===`all`?`Showing every card.`:`${Bv(r,`card`)} match; the rest are folded.`)},oe=t=>{let n=S.current;if(!n)return;let r=[...n.querySelectorAll(`.br-rb, .is-now .br-endtag`)],i=t.target,a=r.indexOf(i);if(a<0)return;let o;if(t.key===`ArrowDown`)o=r[a+1];else if(t.key===`ArrowUp`)o=r[a-1];else if(t.key===`ArrowRight`||t.key===`ArrowLeft`){let n=i.dataset.branch,a=r.filter(e=>n&&e.dataset.branch===n);o=a[a.indexOf(i)+(t.key===`ArrowRight`?1:-1)],o||e.say(n?`Nothing ${t.key===`ArrowRight`?`older`:`newer`} on ${D(n)} here.`:`This row isn't on a branch.`)}else if(t.key===`Home`)o=r[0];else if(t.key===`End`)o=r.at(-1);else if(t.key===`PageDown`||t.key===`PageUp`){let e=[...n.querySelectorAll(`.is-day`)],a=e.filter(e=>e.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING).at(-1);if(!a&&t.key===`PageUp`){t.preventDefault();return}let s=a?e.indexOf(a)+(t.key===`PageDown`?1:-1):t.key===`PageDown`?0:-1,c=e[Math.max(0,Math.min(e.length-1,s))];o=c?r.find(e=>c.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING):void 0}else return;t.preventDefault(),o?.dataset.row&&(g(o.dataset.row),vy(o),o.focus())},A=Pv(w.cols+ +!!w.loose,e.wide),se=A.x,ce=A.width(A.fits),le=e=>e>A.fits?{"--gw":`${A.width(e)}px`,"--pad":`${A.width(e)+4}px`}:void 0,ue=(e,t)=>{let n=E(e).end;return n.kind===`trunk`&&n.quietSince<t?`quiet`:void 0},de=(e,t,n,r,i)=>(0,q.jsx)(`line`,{x1:se(t),x2:se(t),y1:n,y2:r,className:i},e),fe=(e,t,n=[])=>[...e].filter(([e])=>!n.includes(e)).map(([e,n])=>de(`l${e}`,e,0,`100%`,ue(n,t))),j=e=>(0,q.jsx)(`svg`,{className:`br-g`,"aria-hidden":`true`,children:e}),pe=(e,t)=>`M${se(e)},25 C${se(e)},16 ${se(t)},16 ${se(t)},7`,me=(e,t)=>`M${se(e)},37 C${se(e)},28 ${se(t)},30 ${se(t)},22`,he=(e,t)=>(e??[]).map((e,n)=>e.k===`line`?(0,q.jsx)(`line`,{x1:se(e.col),x2:se(e.col),y1:e.y1,y2:e.y2,className:ue(e.lane,t)},n):e.k===`cap`?(0,q.jsx)(`line`,{x1:se(e.col)-e.half,x2:se(e.col)+e.half,y1:e.y,y2:e.y,className:`cap`},n):e.k===`halo`?(0,q.jsx)(`path`,{d:e.curve===`fork`?pe(e.from,e.to):me(e.from,e.to),className:`halo`},n):e.k===`fork`?(0,q.jsx)(`path`,{d:pe(e.from,e.to),className:`fork`},n):e.k===`merge`?(0,q.jsxs)(y.Fragment,{children:[(0,q.jsx)(`path`,{d:me(e.from,e.to)}),my(se(e.to),18)]},n):null),ge=(e,t)=>{let n=e.folded?`the merge's commit`:e.branch===t?.branch?`this branch`:D(e.branch);return(0,q.jsxs)(`button`,{type:`button`,className:`br-lnk`,onClick:()=>d?(m({from:d,key:`commit:${e.hash}`}),C.current={key:d,inner:`.br-back`,focus:!1,scroll:!0}):te(`commit:${e.hash}`),children:[(0,q.jsx)(`code`,{children:e.short}),(0,q.jsxs)(`span`,{children:[Zv(e.t),` · `,n]})]},e.hash)},_e=(e,t=0)=>{let r=n.cardById.get(e);return r?(0,q.jsxs)(`button`,{type:`button`,className:`br-lnk title`,"data-more-first":t===6||void 0,onClick:()=>ne(e),children:[(0,q.jsx)(gy,{w:20,h:20,children:(0,q.jsx)(py,{c:r})}),r.title]},e):null},ve=e=>{let t=e.end;return t.kind===`merged`?`merged into ${D(t.into)} on ${Xv(Date.parse(t.at))}`:t.kind===`trunk`?`is the trunk${n.trunkKnown?`, the repo's default branch`:``}: everything merges into it`:Wv(e).replace(/^No merge recorded/,`has no merge recorded`)},M=t=>{let n=gv(t.card,e.nowMs);return(0,q.jsxs)(`span`,{className:`br-said ${t.state}`,children:[(0,q.jsx)(gy,{w:22,h:22,children:(0,q.jsx)(py,{c:t})}),(0,q.jsx)(`span`,{children:$v(n.words)})]})};function N(t){let r=t.indexOf(`:`),i=t.slice(0,r),a=t.slice(r+1);if(i===`card`){let t=n.cardById.get(a);if(!t)return null;let r=n.citedBy.get(t.id)??[];return(0,q.jsxs)(q.Fragment,{children:[M(t),(0,q.jsxs)(`span`,{className:`br-meta`,children:[t.agent,` on `,(0,q.jsx)(`b`,{children:t.branch}),` · filed `,Qv(t.t),` · `,(0,q.jsx)(`code`,{children:t.id}),` · `,t.hard?`hard`:t.card.meta.level,`. The branch `,ve(E(t.branch)),`.`]}),r.length?(0,q.jsxs)(`div`,{className:`br-links`,children:[(0,q.jsxs)(`span`,{className:`br-list-h`,children:[`Cited by `,Bv(r.length,`commit`),`:`]}),r.map(e=>ge(e,t))]}):(0,q.jsx)(`span`,{className:`br-meta`,children:`No commit cites it yet.`}),(0,q.jsxs)(`div`,{className:`br-acts`,children:[(0,q.jsx)(`button`,{type:`button`,className:`br-btn`,onClick:()=>e.onOpenCard(t.id),children:`Open it on the desk`}),(0,q.jsx)(`button`,{type:`button`,className:`br-btn soft`,onClick:()=>re(t.branch),children:`About this branch`})]})]})}if(i===`commit`){let e=n.commitByHash.get(a);if(!e)return null;let t=n.lanes.get(e.branch);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`h3`,{className:`br-h`,children:[`Commit `,(0,q.jsx)(`code`,{children:e.short})]}),(0,q.jsxs)(`span`,{className:`br-said plain`,children:[(0,q.jsx)(gy,{w:16,h:18,children:(0,q.jsx)(`circle`,{r:3.6,className:`m-commit`})}),(0,q.jsxs)(`span`,{children:[`Cites `,Bv(e.cards.length,`card`)]})]}),(0,q.jsxs)(`span`,{className:`br-meta`,children:[`on `,(0,q.jsx)(`b`,{children:e.branch}),t?``:`, a branch with no cards of its own and no merge recorded`,` · `,Qv(e.t)]}),e.folded&&(0,q.jsxs)(`span`,{className:`br-meta`,children:[`Git recorded it as the merge of `,D(e.folded.branch),` into `,D(e.folded.into),`: it's drawn as that merge.`]}),(0,q.jsx)(`div`,{className:`br-links`,children:e.cards.map(_e)})]})}if(i===`merge`){let e=n.merges.find(e=>e.key===t);if(!e)return null;let r=E(e.branch),i=b.has(t),a=(e.commits??[]).flatMap(e=>n.commitByHash.get(e)??[]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`br-said plain`,children:[(0,q.jsx)(gy,{w:18,h:16,children:hy(5,0)}),(0,q.jsxs)(`span`,{children:[Qv(e.gitT),` · at commit `,(0,q.jsx)(`code`,{children:e.commit.slice(0,7)})]})]}),(0,q.jsxs)(`span`,{className:`br-meta`,children:[e.branch,` · `,Yv(e),` it brought`,e.ends?``:`. It ended nothing: ${e.branch===n.trunk||r.end.kind===`trunk`?`${D(e.branch)} is the trunk`:e.sync?`${D(e.into)} began from ${D(e.branch)}`:`more happened on ${D(e.branch)} after it`}`]}),e.cards.length>0&&(0,q.jsxs)(`div`,{className:`br-links`,children:[(i?e.cards:e.cards.slice(0,6)).map((e,t)=>_e(e,t)),!i&&e.cards.length>6&&(0,q.jsxs)(`button`,{type:`button`,className:`br-lnk`,onClick:()=>{x(e=>new Set([...e,t])),C.current={key:t,inner:`[data-more-first]`,focus:!1,scroll:!1}},children:[`and `,e.cards.length-6,` more`]})]}),a.length>0&&(0,q.jsxs)(`div`,{className:`br-links`,children:[(0,q.jsx)(`span`,{className:`br-list-h`,children:a.length===1?`Its commit citing cards:`:`Its ${a.length} commits citing cards:`}),a.map(e=>ge(e))]}),e.own&&(0,q.jsxs)(`span`,{className:`br-meta`,children:[`Its commit, `,(0,q.jsx)(`code`,{children:e.own.short}),`, cites `,Bv(e.own.cards.length,`card`),`.`]}),e.ends&&r.parentWhy===`merged`&&(0,q.jsxs)(`span`,{className:`br-note`,children:[`Where `,D(e.branch),` began isn't recorded: it's drawn, dashed, from `,D(e.into),`, which it merged into, just before its first card or commit.`]}),e.ends&&r.parentWhy===`began`&&r.began&&(0,q.jsxs)(`span`,{className:`br-note`,children:[D(e.branch),` began from `,D(r.began.branch),`: it was brought up to `,D(r.began.branch),` on `,Qv(r.began.gitT),`, before any work of its own, and its start is drawn, dashed, there.`]}),(0,q.jsx)(`div`,{className:`br-acts`,children:(0,q.jsx)(`button`,{type:`button`,className:`br-btn soft`,onClick:()=>re(e.branch),children:`About this branch`})})]})}return i===`lane`?ye(a):null}function ye(e){let t=n.lanes.get(e);if(!t)return null;let r=t.cards,i=e=>r.filter(t=>t.state===e).length,a=[...n.lanes.values()].filter(t=>t.parent===e).map(e=>e.short),o=t.parent?`from ${D(t.parent)}${t.parentWhy===`began`&&t.began?`, brought up to it on ${Qv(t.began.gitT)} before any work of its own`:t.parentWhy===`merged`?`, which it merged into`:`: a guess, nothing records it (the branch busiest before it)`}`:e===n.trunk?`it's the trunk`:`not known`,s=[i(`with`)&&`the agent's pick on ${i(`with`)}`,i(`against`)&&`otherwise on ${i(`against`)}`,i(`waiting`)&&`${i(`waiting`)} waiting`,i(`aside`)&&`${i(`aside`)} held back`,i(`gone`)&&`${i(`gone`)} withdrawn`].filter(Boolean).join(`, `);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h3`,{className:`br-h`,children:(0,q.jsx)(`span`,{className:`br-nm`,children:e})}),(0,q.jsx)(`span`,{className:`br-meta`,children:$v(ve(t).replace(/^is /,`it's `).replace(/^has /,`it has `))}),(0,q.jsxs)(`dl`,{className:`br-facts`,children:[(0,q.jsx)(`dt`,{children:`Cards`}),(0,q.jsx)(`dd`,{children:r.length?`${r.length}${s?`: ${s}`:``}; ${r.filter(e=>e.hard).length} hard`:`none of its own`}),r.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:`When`}),(0,q.jsxs)(`dd`,{children:[Qv(r[0].t),` to `,Qv(r.at(-1).t)]})]}),(0,q.jsx)(`dt`,{children:`Commits`}),(0,q.jsx)(`dd`,{children:t.commits.length?`${Bv(t.commits.length,`commit`)} made on it cite cards`:`none cite cards`}),(0,q.jsx)(`dt`,{children:`Began`}),(0,q.jsx)(`dd`,{children:o}),a.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:`From it`}),(0,q.jsx)(`dd`,{children:a.join(`, `)})]})]}),d===`lane:${e}`&&(0,q.jsx)(`div`,{className:`br-acts`,children:(0,q.jsx)(`button`,{type:`button`,className:`br-btn soft`,onClick:()=>{te(null),C.current={key:`lane:${e}`,focus:!0,scroll:!1}},children:`Close this`})})]})}let be=(e,t,n,r,i)=>(0,q.jsxs)(`li`,{className:`br-row is-detail`,id:sy,style:i,children:[j((0,q.jsxs)(q.Fragment,{children:[fe(e,t),r]})),(0,q.jsx)(`div`,{className:`br-callout`,children:n})]}),xe=e=>p&&p.from===e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:`br-btn soft br-back`,onClick:ie,children:`← Back`}),N(p.key)]}):N(e),Se=(e,t=!1)=>(0,q.jsx)(`button`,{type:`button`,className:`br-endtag ${e.end.kind===`open`&&e.end.waiting?`held`:`ready`}`,"data-row":`lane:${e.name}`,"data-branch":e.name,tabIndex:t?k===`lane:${e.name}`?0:-1:void 0,"aria-expanded":d===`lane:${e.name}`,"aria-controls":d===`lane:${e.name}`?sy:void 0,onClick:()=>d===`lane:${e.name}`?te(null,{scroll:!1}):te(`lane:${e.name}`),children:(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`b`,{children:e.short}),` · `,Wv(e)]})},e.name);function Ce(e){if(e.kind===`now`){let t=Lv(e,w,n);if(!t)return null;let r=e.tags.find(e=>d===`lane:${e}`),i=le(Fv(t));return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`li`,{className:`br-row is-now`,style:i,children:[j(he(t,e.t)),(0,q.jsxs)(`span`,{className:`br-nowh`,children:[`Now, `,e.dated?`${Xv(n.nowT)}, `:``,Zv(n.nowT)]}),e.tags.length>0&&(0,q.jsx)(`div`,{className:`br-tags`,children:e.tags.map(e=>Se(E(e),!0))})]}),r&&be(e.live,e.t,ye(r),void 0,i)]})}if(e.kind===`fold`){let t=he(Lv(e,w,n),e.t),r=[Bv(e.cards,`card`)+(e.against?`, ${e.against} you chose otherwise`:``)+(e.gone?`, ${e.gone} withdrawn`:``)];return e.began.length?r.push(`${Bv(e.began.length,`branch`,`branches`)} began${e.merged?` and ${e.merged} merged`:``} (${e.began.slice(0,3).join(`, `)}${e.began.length>3?`, …`:``})`):e.merged&&r.push(`${Bv(e.merged,`branch`,`branches`)} merged`),(0,q.jsxs)(`li`,{className:`br-row is-fold`,children:[j(t),(0,q.jsxs)(`button`,{type:`button`,className:`br-rb`,"data-row":e.key,tabIndex:k===e.key?0:-1,onClick:()=>{v(t=>new Set([...t,e.dk])),C.current={day:e.dk,focus:!0,scroll:!1}},children:[r.join(`; `),`. `,(0,q.jsx)(`u`,{children:`Show the day`})]})]})}if(e.kind===`more`)return(0,q.jsxs)(`li`,{className:`br-row is-more`,children:[j(he(Lv(e,w,n),e.t)),(0,q.jsxs)(`button`,{type:`button`,className:`br-rb`,"data-row":e.key,tabIndex:k===e.key?0:-1,onClick:()=>{s(`all`);let t=e.keys[0];g(t),C.current={key:t,focus:!0,scroll:!0}},children:[[e.cards?Bv(e.cards,`other card`):``,e.commits?Bv(e.commits,`commit`):``].filter(Boolean).join(`, `),`. `,(0,q.jsx)(`u`,{children:`Show them`})]})]});if(e.kind===`end`){let t=E(e.lane),r=`lane:${e.lane}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`li`,{className:`br-row is-end`,children:[j(he(Lv(e,w,n),e.t)),(0,q.jsxs)(`button`,{type:`button`,className:`br-rb`,"data-row":r,"data-branch":e.lane,tabIndex:k===r?0:-1,"aria-expanded":d===r,"aria-controls":d===r?sy:void 0,onClick:()=>d===r?te(null,{scroll:!1}):te(r),children:[(0,q.jsx)(`span`,{className:`br-rs`,children:t.short}),(0,q.jsx)(`span`,{className:`br-rm`,children:(0,q.jsx)(`span`,{className:`st ${t.end.kind===`open`&&t.end.waiting?`waiting`:`with`}`,children:Wv(t)})})]})]}),d===r&&be(e.live,e.t,ye(e.lane),de(`own`,e.col,0,`100%`))]})}if(e.kind!==`event`)return null;let t=e.e;if(t.kind===`fork`)return(0,q.jsxs)(`li`,{className:`br-row is-fork`,children:[j(he(Lv(e,w,n),e.t)),(0,q.jsxs)(`span`,{className:`br-tx`,children:[E(t.lane).short,` began, from `,D(t.from),t.guess?` (a guess: nothing records it)`:``]})]});let r=T.has(t.key),i=d?.startsWith(`card:`)?`cites the selected card`:d?.startsWith(`commit:`)?`cited by the selected commit`:`linked to the selected merge`,a=null,o=null,c=``,l;if(t.kind===`card`){let s=t.card,u=e.col;l=s.branch,a=(0,q.jsxs)(q.Fragment,{children:[he(Lv(e,w,n),e.t),(0,q.jsxs)(`g`,{transform:`translate(${se(u)},19)`,children:[r&&(0,q.jsx)(`circle`,{r:11.5,className:`lit-ring`}),(0,q.jsx)(py,{c:s})]})]});let d=n.citedBy.get(s.id)?.length??0,f=ly(s.card,s.state);o=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`br-tm`,children:Zv(s.t)}),(0,q.jsx)(`span`,{className:`br-rt`,children:s.title}),(0,q.jsxs)(`span`,{className:`br-rm`,children:[(0,q.jsx)(`span`,{className:`st ${s.state}`,children:f}),` · `,D(s.branch),(0,q.jsxs)(`span`,{className:`br-nar`,children:[` · `,Zv(s.t)]}),s.hard?` · hard`:``,d?` · cited by ${Bv(d,`commit`)}`:``,r&&(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`span`,{className:`br-lk`,children:[`↳ `,i]})]})]})]}),c=`${s.title}. ${f}.${s.hard?` Hard.`:``} ${D(s.branch)}, ${Qv(s.t)}.${d?` Cited by ${Bv(d,`commit`)}.`:``}${r?` ${$v(i)}.`:``}`}else if(t.kind===`commit`){let s=t.commit;l=s.branch;let u=e.col??w.cols;a=(0,q.jsxs)(q.Fragment,{children:[he(Lv(e,w,n),e.t),e.col===null&&(0,q.jsx)(`path`,{d:`M${se(u)},19 L${se(u)-6},28`,className:`stub`}),(0,q.jsx)(`circle`,{cx:se(u),cy:19,r:r?4.2:3.2,className:`m-commit${r?` lit`:``}`})]});let d=n.cardById.get(s.cards[0]);o=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`br-tm`,children:Zv(s.t)}),(0,q.jsxs)(`span`,{className:`br-rs`,children:[(0,q.jsx)(`code`,{children:s.short}),` cites “`,d?.title??s.cards[0],`”`,s.cards.length>1?` and ${Bv(s.cards.length-1,`more card`)}`:``]}),(0,q.jsxs)(`span`,{className:`br-rm`,children:[e.col===null?`on ${D(s.branch)}, no cards of its own`:D(s.branch),(0,q.jsxs)(`span`,{className:`br-nar`,children:[` · `,Zv(s.t)]}),r&&(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`span`,{className:`br-lk`,children:[`↳ `,i]})]})]})]}),c=`Commit ${s.short} on ${D(s.branch)}, ${Qv(s.t)}, cites ${Bv(s.cards.length,`card`)}.${r?` ${$v(i)}.`:``}`}else{let s=t.merge;l=s.branch,a=he(Lv(e,w,n),e.t),o=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`br-tm`,children:Zv(s.gitT)}),(0,q.jsxs)(`span`,{className:`br-rs`,children:[D(s.branch),` merged into `,D(s.into)]}),(0,q.jsxs)(`span`,{className:`br-rm`,children:[(0,q.jsxs)(`span`,{className:`br-nar`,children:[Zv(s.gitT),` · `]}),Yv(s),s.own?` · its commit cites ${Bv(s.own.cards.length,`card`)}`:``,r&&(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`span`,{className:`br-lk`,children:[`↳ `,i]})]})]})]}),c=`${D(s.branch)} merged into ${D(s.into)}, ${Qv(s.gitT)}, with ${Yv(s)}.${s.own?` Its commit cites ${Bv(s.own.cards.length,`card`)}.`:``}${r?` ${$v(i)}.`:``}`}let u=d===t.key;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`li`,{className:`br-row is-${t.kind}${u?` sel`:``}${r?` linked`:``}`,children:[j(a),(0,q.jsx)(`button`,{type:`button`,className:`br-rb`,"data-row":t.key,"data-branch":l,tabIndex:k===t.key?0:-1,"aria-expanded":u,"aria-controls":u?sy:void 0,"aria-label":c,onClick:()=>u?(f(null),m(null),g(t.key)):te(t.key),children:o})]}),u&&be(e.below,e.t-1,xe(t.key))]})}let P=[{rows:[]}];for(let e of w.rows)e.kind===`day`?P.push({head:e,rows:[]}):P.at(-1).rows.push(e);let we=Gv(n),F=n.cards.filter(e=>e.forYou).sort((e,t)=>e.t-t.t),Te=e.touch;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`br-status`,children:[(0,q.jsxs)(`span`,{id:`drawer-status`,children:[(0,q.jsx)(`b`,{children:we.lead}),` `,we.body]}),F.length>0&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(`button`,{type:`button`,className:`br-go`,onClick:()=>ne(F[0].id),children:`Show the oldest`})]})]}),(0,q.jsxs)(`div`,{className:`br-controls`,children:[(0,q.jsx)(`div`,{className:`br-chips`,role:`group`,"aria-label":`Show`,children:cy.map(([e,t,r])=>{let i=n.cards.filter(r).length;return(0,q.jsxs)(`button`,{type:`button`,className:`br-chip`,"aria-pressed":o===e,disabled:!i&&o!==e,onClick:()=>ae(e),children:[e!==`all`&&(0,q.jsx)(gy,{w:20,h:20,children:(0,q.jsx)(py,{c:{state:e===`hard`?`with`:e===`waiting`?`waiting`:e,hard:e===`hard`}})}),t,` `,(0,q.jsx)(`span`,{className:`n`,children:i})]},e)})}),(0,q.jsxs)(`label`,{className:`br-ctl br-fsel`,children:[`Show`,(0,q.jsx)(`select`,{value:o,onChange:e=>ae(e.target.value),children:cy.map(([e,t,r])=>{let i=n.cards.filter(r).length;return(0,q.jsxs)(`option`,{value:e,disabled:!i&&o!==e,children:[t,` · `,i]},e)})})]}),(0,q.jsxs)(`div`,{className:`br-ctl-end`,children:[(0,q.jsxs)(`label`,{className:`br-ctl`,children:[`Go to`,(0,q.jsxs)(`select`,{value:``,onChange:e=>{let t=e.target.value;t&&(v(e=>new Set([...e,t])),C.current={day:t,focus:!0,scroll:!0})},children:[(0,q.jsx)(`option`,{value:``,disabled:!0,hidden:!0,children:`a day`}),[...u].reverse().map(e=>(0,q.jsxs)(`option`,{value:e.key,children:[Xv(e.t),` · `,Bv(e.cards,`card`)]},e.key))]})]}),(0,q.jsxs)(`button`,{type:`button`,className:`br-switch`,role:`switch`,"aria-checked":c,onClick:()=>l(e=>!e),children:[(0,q.jsx)(`span`,{className:`box`}),`Commits`]})]})]}),(0,q.jsxs)(`details`,{className:`br-key`,children:[(0,q.jsx)(`summary`,{children:`What the marks mean`}),(0,q.jsx)(`div`,{className:`br-key-grid`,children:[[(0,q.jsx)(py,{c:{state:`with`,hard:!1}},`k`),`You chose the agent's pick`],[(0,q.jsx)(py,{c:{state:`against`,hard:!1}},`k`),`You chose otherwise`],[(0,q.jsx)(py,{c:{state:`waiting`,hard:!1}},`k`),`Waiting for you`],[(0,q.jsx)(py,{c:{state:`aside`,hard:!1}},`k`),(0,q.jsxs)(q.Fragment,{children:[`Held back or deferred `,(0,q.jsx)(`span`,{className:`fine`,children:`(settled at merge)`})]})],[(0,q.jsx)(py,{c:{state:`gone`,hard:!1}},`k`),`Withdrawn by its agent`],[(0,q.jsx)(py,{c:{state:`with`,hard:!0}},`k`),(0,q.jsxs)(q.Fragment,{children:[`A hard card `,(0,q.jsx)(`span`,{className:`fine`,children:`(the outer ring)`})]})],[(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`line`,{x1:0,x2:0,y1:-11,y2:11,className:`key-line`}),(0,q.jsx)(`circle`,{r:3.2,className:`m-commit`})]}),(0,q.jsxs)(q.Fragment,{children:[`A commit citing cards `,(0,q.jsx)(`span`,{className:`fine`,children:`(the Commits switch shows them; pick a card: which)`})]})],[(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{d:`M6,11 C6,4 -6,4 -6,-4`,className:`key-curve`}),my(-6,-6)]}),(0,q.jsxs)(q.Fragment,{children:[`A merge `,(0,q.jsx)(`span`,{className:`fine`,children:`(recorded)`})]})],[(0,q.jsx)(`path`,{d:`M-6,11 C-6,2 6,2 6,-9`,className:`key-curve fork`},`k`),(0,q.jsxs)(q.Fragment,{children:[`Where a branch began `,(0,q.jsx)(`span`,{className:`fine`,children:`(placed just before its first event, or where it was brought up to another)`})]})]].map(([e,t],n)=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(gy,{w:28,h:24,children:e}),(0,q.jsx)(`span`,{children:t})]},n))})]}),!Te&&(0,q.jsxs)(`p`,{className:`drawer-keys`,children:[(0,q.jsx)(`kbd`,{children:`↑`}),(0,q.jsx)(`kbd`,{children:`↓`}),` rows · `,(0,q.jsx)(`kbd`,{children:`←`}),(0,q.jsx)(`kbd`,{children:`→`}),` along a branch · `,(0,q.jsx)(`kbd`,{children:`PgUp`}),(0,q.jsx)(`kbd`,{children:`PgDn`}),` days · `,(0,q.jsx)(`kbd`,{children:`Enter`}),` opens`]}),n.lanes.size===0?(0,q.jsx)(`p`,{className:`br-empty`,children:`No branches yet: a branch appears here once an agent files a card on it.`}):(0,q.jsx)(`ol`,{className:`br-list`,ref:S,"aria-label":`Your decisions by branch, newest first`,style:{"--gw":`${ce}px`,"--pad":`${ce+4}px`},onKeyDown:oe,children:P.map((e,t)=>e.head?(0,q.jsx)(`li`,{className:`br-day`,"aria-label":Xv(e.head.t),style:le(Math.max(...[e.head,...e.rows].map(e=>Fv(Lv(e,w,n))))),children:(0,q.jsxs)(`ol`,{className:`br-dayrows`,children:[(0,q.jsxs)(`li`,{className:`br-row is-day`,"data-day":e.head.dk,children:[j(fe(e.head.live,e.head.t)),(0,q.jsxs)(`h3`,{children:[Xv(e.head.t),` `,(0,q.jsx)(`span`,{children:[Bv(e.head.cards,`card`),e.head.waiting?`${e.head.waiting} waiting`:``,e.head.against?`${e.head.against} otherwise`:``,e.head.merges?Bv(e.head.merges,`merge`):``].filter(Boolean).join(` · `)})]})]}),e.rows.map(e=>(0,q.jsx)(y.Fragment,{children:Ce(e)},e.key))]})},e.head.key):e.rows.map(e=>(0,q.jsx)(y.Fragment,{children:Ce(e)},`${t}:${e.key}`)))}),(0,q.jsxs)(`p`,{className:`br-foot`,children:[we.cites?`${we.cites} `:``,`Merges are found by Baesian's command line on the machine where they happen: at a merge, a pull, a squash's commit or a rebase; one made on GitHub shows once a machine with Baesian pulls it. Git doesn't record where a branch began, so each one starts, dashed, just before its first card or commit: from the branch it merged into, or, if it hasn't merged, the branch busiest in the hours before. One brought up to another branch before any work of its own starts there, from that branch. The commits shown are those whose messages cite a card; their messages never leave your machine.`,n.offLane?` ${Bv(n.offLane,`card`)} filed on Baesian's own branch or a detached HEAD ${n.offLane===1?`isn't`:`aren't`} shown.`:``]})]})}var by=8,xy=380,Sy=`cubic-bezier(.3,.7,.3,1)`,Cy=e=>e.charAt(0).toUpperCase()+e.slice(1);function wy(e){let t=(0,y.useRef)(null),n=(0,y.useRef)(null),[r,i]=(0,y.useState)(0),[a,o]=(0,y.useState)(),[s,c]=(0,y.useState)(0),[l,u]=(0,y.useState)(),d=e.trail.slice(Math.max(0,e.trail.length-by+r)),f=e.trail.length-d.length,p=new Set([...d,...e.upcoming].flatMap(e=>e.link?[e.id]:[])),m=e.relations.filter(e=>!p.has(e.id)),h=(0,y.useRef)(new Map),g=(0,y.useRef)(s),[_,v]=(0,y.useState)(0);(0,y.useLayoutEffect)(()=>{let l=n.current,u=t.current,f=u?.parentElement;if(!l||!u||!f)return;let p=e.sheet?null:document.querySelector(`.stage article.card:not([data-leaving])`),m=p?.querySelector(`h1`),_=l.querySelector(`.row.now .node`),v=0;if(p&&m&&_){let t=ky(p),n=u.getBoundingClientRect(),a=n.top+4,o=n.top+Ay(l.firstElementChild,u).top,s=n.top+Ay(_,u).top+_.offsetHeight/2;if(v=Math.round(Math.max(t.top+Ay(m,p).top+17-s,a-o)),s+v>t.top+t.height-36&&d.length>0&&r<e.trail.length){i(e=>e+1);return}}if(v!==s){c(v);return}let y=[...l.querySelectorAll(`[data-flip]`)],b=new Map(y.map(e=>[e.dataset.flip,Ay(e,u).top])),x=[],C=matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!C&&h.current.size)for(let e of y){let t=h.current.get(e.dataset.flip)??(e.dataset.from?h.current.get(e.dataset.from):void 0),n=b.get(e.dataset.flip);t===void 0?x.push(e.animate([{opacity:0,transform:`translateY(6px)`},{opacity:1,transform:`none`}],{duration:xy,easing:Sy})):Math.abs(t-n)>.5&&x.push(e.animate([{transform:`translateY(${t-n}px)`},{transform:`none`}],{duration:xy,easing:Sy}))}h.current=b,!C&&(x.length||s!==g.current)&&S(x),g.current=s;let ee=My(f,l,p??void 0);if(JSON.stringify(ee)!==JSON.stringify(a)&&o(ee),e.fly){let t=l.querySelector(`.row.past[data-key="${CSS.escape(e.fly.key)}"]`);t&&Ty(e.fly,t,u,s),e.onFlown?.()}});let b=(0,y.useRef)(0),x=(0,y.useRef)(0),S=e=>{if(b.current=Math.max(b.current,performance.now()+xy+40),Promise.allSettled(e.map(e=>e.finished)).then(()=>v(e=>e+1)),x.current)return;let t=()=>{v(e=>e+1),x.current=performance.now()<b.current?requestAnimationFrame(t):0};x.current=requestAnimationFrame(t)};(0,y.useEffect)(()=>()=>cancelAnimationFrame(x.current),[]),(0,y.useLayoutEffect)(()=>{let e=t.current?.parentElement;if(!e)return;let n=()=>v(e=>e+1),r=new ResizeObserver(()=>requestAnimationFrame(n));return r.observe(e),addEventListener(`resize`,n),document.fonts?.ready.then(n),()=>{r.disconnect(),removeEventListener(`resize`,n)}},[]),(0,y.useLayoutEffect)(()=>i(0),[e.layoutKey]);let C=(0,y.useRef)(null),ee=(0,y.useRef)(void 0);ee.current=a?.join;let w=(0,y.useRef)(e.card);w.current=e.card;let T=(0,y.useRef)(()=>{let e=C.current,t=ee.current,n=w.current;e&&t&&e.setAttribute(`d`,jy(t,n?.x.get()??0,n?.y.get()??0,n?.rotate.get()??0))}).current;return(0,y.useLayoutEffect)(T),(0,y.useEffect)(()=>{let t=e.card;if(!t)return;let n=[t.x.on(`change`,T),t.y.on(`change`,T),t.rotate.on(`change`,T)];return()=>n.forEach(e=>e())},[e.card,T]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{className:`path-lines`,width:a?.width??0,height:a?.height??0,"aria-hidden":`true`,children:[a?.done.map(e=>(0,q.jsx)(`path`,{className:`spine done`,d:e},e)),a?.ahead.map(e=>(0,q.jsx)(`path`,{className:`spine ahead`,d:e},e)),a?.join&&(0,q.jsx)(`path`,{className:`join`,ref:C}),a?.arcs.map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{className:`arc${e.conflict?` conflict`:``}${l===e.id?` hot`:``}`,d:e.d}),(0,q.jsx)(`path`,{className:`arc-head${e.conflict?` conflict`:``}`,d:e.head})]},e.id))]}),(0,q.jsx)(`aside`,{className:`hood`,ref:t,"aria-label":`Your path through the decisions, and what this one is connected to`,"data-lean":e.lean??``,children:(0,q.jsxs)(`div`,{className:`path`,ref:n,style:{transform:`translateY(${s}px)`},"data-glide":h.current.size?``:void 0,children:[f>0&&(0,q.jsx)(`p`,{className:`earlier`,"data-flip":`earlier`,children:f===1?`1 earlier answer`:`${f} earlier answers`}),d.map(t=>(0,q.jsxs)(`button`,{type:`button`,className:`row past`,"data-id":t.id,"data-key":t.key,"data-flip":`past:${t.key}`,"data-from":`id:${t.id}`,title:`${t.name}: ${t.state}. Click to see your answer.`,onClick:()=>e.onGoTo(t.id),onPointerEnter:()=>u(t.id),onPointerLeave:()=>u(void 0),children:[(0,q.jsxs)(`span`,{className:`lbl`,children:[(0,q.jsx)(`span`,{className:`nm`,children:t.name}),(0,q.jsx)(`span`,{className:`st`,children:t.state}),t.waiting&&(0,q.jsx)(`span`,{className:`tag passkey`,children:`waiting for your passkey`}),t.link&&(0,q.jsx)(`span`,{className:`tag link${t.link.kind===`conflict`||t.link.kind===`rule`?` c`:``}`,children:Dy(t.link)})]}),(0,q.jsx)(`span`,{className:`node`,children:(0,q.jsx)(jh,{kind:t.rarity,size:16,answered:!0})})]},t.key)),e.current&&(0,q.jsxs)(`div`,{className:`row now`,"data-id":e.current.id,"data-flip":`id:${e.current.id}`,children:[(0,q.jsx)(`span`,{className:`lbl`,children:e.sheet&&e.current.name&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`nm`,children:e.current.name}),(0,q.jsx)(`span`,{className:`st`,children:`the card you're on`})]})}),(0,q.jsx)(`span`,{className:`node`,children:(0,q.jsx)(jh,{kind:e.current.rarity,size:22,stopped:e.current.stopped})})]}),m.length>0&&(0,q.jsxs)(`div`,{className:`rels`,children:[e.current?.conflict&&(0,q.jsx)(`p`,{className:`group-h`,"data-flip":`group-h`,children:`Your answer keeps one, replaces the other`}),m.map(t=>(0,q.jsx)(Oy,{rel:t,lean:e.lean,optionLabel:e.optionLabel,conflictCard:e.current?.conflict??!1},t.id))]}),e.upcoming.length>0&&(0,q.jsx)(`p`,{className:`next-h`,"data-flip":`next-h`,children:`Next`}),e.upcoming.map(t=>(0,q.jsxs)(`button`,{type:`button`,className:`row next`,"data-id":t.id,"data-flip":`id:${t.id}`,title:`${t.name}: to answer. Click to answer it.`,onClick:()=>e.onGoTo(t.id),children:[(0,q.jsxs)(`span`,{className:`lbl`,children:[(0,q.jsxs)(`span`,{className:`nm`,children:[t.fresh&&(0,q.jsx)(`span`,{className:`new-tag`,children:`new`}),t.name]}),t.link&&(0,q.jsx)(`span`,{className:`tag link${t.link.kind===`conflict`||t.link.kind===`rule`?` c`:``}`,children:Dy(t.link)})]}),(0,q.jsx)(`span`,{className:`node`,children:(0,q.jsx)(jh,{kind:t.rarity,size:16,stopped:t.stopped})})]},t.id)),e.more>0&&(0,q.jsxs)(`p`,{className:`earlier ahead`,"data-flip":`more`,children:[e.more,` more after these`]})]})})]})}function Ty(e,t,n,r){let i=t.querySelector(`.st`);if(!i)return;let a=document.createElement(`span`);a.className=`fly`,a.textContent=e.text,document.body.append(a);let o=n.getBoundingClientRect(),s=Ay(i,n),c=a.offsetWidth,l={x:o.left+s.left+i.offsetWidth-c,y:o.top+s.top+r-3};i.animate([{opacity:0},{opacity:0,offset:.45},{opacity:1,offset:.55}],{duration:700}),t.querySelector(`.node`)?.animate([{transform:`scale(1)`},{transform:`scale(1)`,offset:.35},{transform:`scale(1.35)`,offset:.45},{transform:`scale(1)`,offset:.6}],{duration:700}),a.animate([{transform:`translate(${e.from.x}px, ${e.from.y}px) scale(1.2)`,opacity:1},{transform:`translate(${e.from.x-40}px, ${l.y-5}px) scale(1)`,opacity:1,offset:.25},{transform:`translate(${l.x}px, ${l.y}px) scale(.85)`,opacity:1,offset:.45},{transform:`translate(${l.x}px, ${l.y}px) scale(.85)`,opacity:0,offset:.55},{transform:`translate(${l.x}px, ${l.y}px) scale(.85)`,opacity:0}],{duration:700,easing:`cubic-bezier(.3,.7,.3,1)`}).finished.then(()=>a.remove(),()=>a.remove())}function Ey(e,t){let n=document.createElement(`span`);n.className=`fly`,n.textContent=e.text,document.body.append(n);let r=t.getBoundingClientRect(),i=Math.min(n.offsetWidth,r.width-24),a={x:r.left+(r.width-i)/2,y:r.top+8};t.querySelector(`.grip`)?.animate([{transform:`scaleX(1)`},{transform:`scaleX(1)`,offset:.4},{transform:`scaleX(1.8)`,offset:.5},{transform:`scaleX(1)`,offset:.65}],{duration:700}),n.animate([{transform:`translate(${e.from.x}px, ${e.from.y}px) scale(1.1)`,opacity:1},{transform:`translate(${a.x}px, ${a.y}px) scale(.85)`,opacity:1,offset:.45},{transform:`translate(${a.x}px, ${a.y+10}px) scale(.7)`,opacity:0,offset:.6},{transform:`translate(${a.x}px, ${a.y+10}px) scale(.7)`,opacity:0}],{duration:700,easing:`cubic-bezier(.3,.7,.3,1)`}).finished.then(()=>n.remove(),()=>n.remove())}function Dy(e){return e.kind===`builds-on`?`this card builds on it`:e.kind===`relies-on-this`?`it relies on this card`:e.kind===`precedent`?`your precedent`:e.label}function Oy({rel:e,lean:t,optionLabel:n,conflictCard:r}){let i=t?e.effect?.[t]:void 0,a=i?i.bad?` fx-bad`:` fx-good`:``,o=i?`${i.bad?`✗`:`✓`} ${Cy(i.text)}`:r&&e.keptBy?`kept if you choose ${n(e.keptBy)}`:e.label,s=!r&&e.effect?Object.entries(e.effect).filter(([,e])=>e.bad):[],c=e.kind===`conflict`||e.kind===`rule`;return(0,q.jsxs)(`div`,{className:`row rel${a}`,"data-id":e.id,"data-flip":`rel:${e.id}`,children:[(0,q.jsxs)(`span`,{className:`lbl`,children:[(0,q.jsx)(`span`,{className:`tag${c?` c`:``}${e.kind===`precedent`?` p`:``}`,children:o}),(0,q.jsx)(`span`,{className:`nm`,children:e.name}),(0,q.jsx)(`span`,{className:`st`,children:e.state}),s.length>0&&(0,q.jsx)(`span`,{className:`hurt`,children:s.map(([e,t])=>`${n(e)} ${t.text}`).join(`; `)})]}),(0,q.jsx)(`span`,{className:`mk-l`,children:(0,q.jsx)(`i`,{className:`rdot${c?` c`:``}`})})]})}function ky(e){let t=e.offsetParent,n=t?.getBoundingClientRect()??{left:0,top:0};return{left:n.left+(t?.clientLeft??0)+e.offsetLeft,top:n.top+(t?.clientTop??0)+e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function Ay(e,t){let n=0,r=0;for(let i=e;i&&i!==t;i=i.offsetParent)n+=i.offsetLeft,r+=i.offsetTop;return{left:n,top:r}}function jy(e,t,n,r){let i=r*Math.PI/180,a=e.w/2,o=(e.y-(e.cy+n)+a*Math.sin(i))/Math.cos(i),s=e.cx+t-a*Math.cos(i)-o*Math.sin(i)+2;return s>e.x1+1?`M ${e.x1.toFixed(1)} ${e.y.toFixed(1)} H ${s.toFixed(1)}`:``}function My(e,t,n){let r=e.getBoundingClientRect(),i=e=>{let t=e.getBoundingClientRect();return{x:t.left-r.left+t.width/2,y:t.top-r.top+t.height/2}},a=e=>[...t.querySelectorAll(e)],o=a(`.row.past .node`),s=t.querySelector(`.row.now .node`),c=a(`.row.next .node`),l=e=>(e===s?15:(e.querySelector(`.mk`)?.getBoundingClientRect().height??16)/2)+4,u=e=>{let t=[];for(let n=1;n<e.length;n++){let r=i(e[n-1]),a=i(e[n]),o=r.y+l(e[n-1]),s=a.y-l(e[n]);s>o+2&&t.push(`M ${r.x.toFixed(1)} ${o.toFixed(1)} V ${s.toFixed(1)}`)}return t},d={width:Math.round(r.width),height:Math.round(r.height),done:u([...o,...s?[s]:[]]),ahead:u([...s?[s]:[],...c]),arcs:[]};if(s){let e=i(s);if(n){let t=ky(n),i=e=>Math.round(e*10)/10;d.join={x1:i(e.x+15),y:i(e.y),cx:i(t.left-r.left+t.width/2),cy:i(t.top-r.top+t.height/2),w:t.width}}for(let n of t.querySelectorAll(`.row.past`)){let t=n.querySelector(`.tag.link`),r=n.querySelector(`.node`);if(!t||!r)continue;let a=i(r),o=l(r),s=e.x+15*Math.cos(-Math.PI/3),c=e.y+15*Math.sin(-Math.PI/3);d.arcs.push({id:n.dataset.id,conflict:t.classList.contains(`c`),d:`M ${(a.x+o).toFixed(1)} ${a.y.toFixed(1)} C ${(a.x+30).toFixed(1)} ${a.y.toFixed(1)}, ${(s+18).toFixed(1)} ${(c-26).toFixed(1)}, ${(s+1).toFixed(1)} ${(c-2).toFixed(1)}`,head:`M ${(s+1).toFixed(1)} ${(c-2).toFixed(1)} l 2.5 -7.5 M ${(s+1).toFixed(1)} ${(c-2).toFixed(1)} l 7.2 -2.8`})}}return d}var Ny=60,Py=e=>e.charAt(0).toUpperCase()+e.slice(1);function Fy(e){let t=(0,y.useRef)(null),n=(0,y.useRef)(null),r=(0,y.useRef)(null),i=(0,y.useRef)(!1),a=(0,y.useRef)(e.open);(0,y.useLayoutEffect)(()=>{e.open?n.current?.focus({preventScroll:!0}):a.current&&(!document.activeElement||document.activeElement===document.body)&&t.current?.focus({preventScroll:!0}),a.current=e.open},[e.open]);let o=(0,y.useRef)(void 0),s=t=>({onPointerDown:e=>{o.current={id:e.pointerId,y:e.clientY},i.current=!1,e.currentTarget.setPointerCapture?.(e.pointerId)},onPointerMove:n=>{let a=o.current;if(!a||n.pointerId!==a.id)return;let s=n.clientY-a.y;t===`up`&&s<-24&&!i.current&&(i.current=!0,e.onOpen(!0)),t===`down`&&r.current&&(Math.abs(s)>4&&(i.current=!0),r.current.style.transform=`translateY(${Math.max(0,s)}px)`)},onPointerUp:n=>{let i=o.current;if(!i||n.pointerId!==i.id)return;let a=n.clientY-i.y;o.current=void 0,t===`down`&&r.current&&(r.current.style.transform=``,a>Ny&&e.onOpen(!1))},onPointerCancel:()=>{o.current=void 0,r.current&&(r.current.style.transform=``)}}),c=t=>()=>{i.current?i.current=!1:e.onOpen(t)},l=e.lean?e.connected.flatMap(t=>t.effect?.[e.lean]?[{...t.effect[e.lean],name:t.name}]:[]):[],u=[e.answered?`${e.answered} answered`:``,e.connected.length?`${e.connected.length} connected`:``,e.next?`${e.next} next`:``].filter(Boolean),d=e.connected.some(e=>e.kind===`conflict`||e.kind===`rule`),f=l.length?l.some(e=>e.bad)?`bad`:`good`:void 0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`sheet-bar`,"data-fx":f,inert:e.inert,children:(0,q.jsxs)(`button`,{type:`button`,ref:t,className:`sheet-peek`,"aria-expanded":e.open,"aria-controls":`path-sheet`,onClick:c(!e.open),...s(`up`),children:[(0,q.jsx)(`span`,{className:`grip`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`peek-text`,children:f?l.map((e,t)=>(0,q.jsxs)(`span`,{className:e.bad?`fx bad`:`fx good`,children:[e.bad?`✗`:`✓`,` `,Py(e.text),`: `,e.name]},t)):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`b`,{children:`Your path`}),u.length>0&&(0,q.jsx)(`span`,{className:`soft`,children:u.join(` · `)}),d&&(0,q.jsx)(`i`,{className:`rdot c`,"aria-hidden":`true`})]})})]})}),e.open&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`sheet-backdrop`,"aria-hidden":`true`,onClick:()=>e.onOpen(!1)}),(0,q.jsxs)(`div`,{className:`sheet`,id:`path-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`Your path`,ref:r,children:[(0,q.jsxs)(`button`,{type:`button`,ref:n,className:`sheet-head`,onClick:c(!1),...s(`down`),children:[(0,q.jsx)(`span`,{className:`grip`,"aria-hidden":`true`}),(0,q.jsx)(`b`,{children:`Your path`}),(0,q.jsx)(`span`,{className:`soft`,children:`Close`})]}),(0,q.jsx)(`div`,{className:`sheet-body`,children:(0,q.jsx)(`div`,{className:`sheet-path`,children:e.children})})]})]})]})}var Iy=e=>[...new Set(e.split(`
13
+ `).map(e=>e.trim()).filter(Boolean))],Ly=e=>Object.fromEntries(Hf.map(t=>[t,Gf(e,t).join(`
14
+ `)])),Ry=e=>Object.fromEntries(Hf.map(t=>[t,Iy(e[t])])),zy=e=>Object.fromEntries(Hf.flatMap(t=>e[Uf[t]]?[[t,e[Uf[t]]]]:[])),By=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),Vy=(e,t)=>Hf.every(n=>By(Gf(e,n),Gf(t,n))),Hy={schema:Gf({},`schema`),infra:Gf({},`infra`)},Uy=[{kind:`schema`,name:`Schemas and data formats`,help:`A change to a file that matches is a schema decision.`},{kind:`infra`,name:`CI, infrastructure and deploys`,help:`Workflows, containers, deploy settings, and the git hooks that run on everyone's machine.`},{kind:`api`,name:`Public modules`,help:`A breaking change to what these export is an API decision. With none, the gate doesn't look; it needs livedocs on the machine that commits.`},{kind:`ignore`,name:`Never looked at`,help:(0,q.jsxs)(q.Fragment,{children:[`Besides these, always:`,` `,Vf.map((e,t)=>(0,q.jsxs)(`span`,{children:[t?`, `:``,(0,q.jsx)(`code`,{children:e})]},e)),`.`]})}],Wy={schema:`for schemas`,infra:`for infrastructure`,api:`for API changes`};function Gy(e,t){let n=[],r=e=>e.map((e,t)=>(0,q.jsxs)(`span`,{children:[t?`, `:``,(0,q.jsx)(`code`,{children:e})]},e));for(let i of[`schema`,`infra`,`api`]){let a=zf(Gf(t,i),Gf(e,i));a.length&&n.push((0,q.jsxs)(`span`,{children:[`it would stop looking at `,r(a),` `,Wy[i]]},i))}let i=zf([...Vf,...Gf(e,`ignore`)],Gf(t,`ignore`));return i.length&&n.push((0,q.jsxs)(`span`,{children:[`it would never look at `,r(i)]},`ignore`)),n}function Ky(e){let t=Cg(),n=!!t.hosted,r={name:Dm(e.routing),paths:e.routing.settings.paths??{}},[i,a]=(0,y.useState)(r),[o,s]=(0,y.useState)(()=>Ly(r.paths)),[c,l]=(0,y.useState)({kind:`idle`}),u=Ry(o),d=!Vy(u,i.paths),f=Gy(i.paths,u);(0,y.useEffect)(()=>{r.name!==i.name&&(d?Vy(r.paths,i.paths)&&a(r):(a(r),s(Ly(r.paths))))},[r.name]);let p=(e,t)=>{s({...o,[e]:t}),c.kind!==`sending`&&l({kind:`idle`})},m=async()=>{l({kind:`sending`});let n={...i.name?{replaces:i.name}:{},...Object.fromEntries(Hf.map(e=>[Uf[e],u[e]]))};try{let i=await Dg(t,t.preferences,n,{client:!0}),o=await i.json().catch(()=>({}));if(i.status===201&&o.name&&o.file){let t=zy(o.file);a({name:o.name,paths:t}),s(Ly(t)),l({kind:`done`}),e.onSaved(`The gate looks where your lists say from the next commit.`)}else i.status===409?(a(r),s(Ly(r.paths)),l({kind:`stale`})):l({kind:`error`,message:o.error??`the server answered ${i.status}`})}catch(e){l(e instanceof dg?{kind:`unconfirmed`}:{kind:`error`,message:e instanceof Error?e.message:String(e)})}};return(0,q.jsxs)(`section`,{className:`gate-paths`,"aria-labelledby":`gate-paths-h`,children:[(0,q.jsx)(`h5`,{id:`gate-paths-h`,children:`What the gate looks for`}),(0,q.jsxs)(`p`,{className:`gate-intro`,children:[`When an agent commits, Baesian's gate reads the change for decisions it can spot on its own, and holds the commit until a card or an acknowledgement covers each one. Some of what it looks for is built in; these lists say where else to look, and where never to. Only you change them, here: `,n?`anything that makes the gate see less asks for your passkey.`:`agents can't.`]}),(0,q.jsxs)(`ul`,{className:`gate-fixed`,"aria-label":`Always looked for`,children:[(0,q.jsxs)(`li`,{children:[`Runtime dependencies added to or removed from `,(0,q.jsx)(`code`,{children:`package.json`}),`, `,(0,q.jsx)(`code`,{children:`pyproject.toml`}),` or a requirements file.`]}),(0,q.jsxs)(`li`,{children:[`Linking the repo to the service, or changing its link, in `,(0,q.jsx)(`code`,{children:`.baesian/config.json`}),`.`]})]}),(0,q.jsxs)(`p`,{className:`gate-how`,children:[`One pattern a line: `,(0,q.jsx)(`code`,{children:`**`}),` crosses folders, `,(0,q.jsx)(`code`,{children:`*`}),` and `,(0,q.jsx)(`code`,{children:`?`}),` stay within one.`]}),(0,q.jsx)(`div`,{className:`gate-lists`,children:Uy.map(({kind:e,name:t,help:n})=>{let r=Hy[e],i=Iy(o[e]).length;return(0,q.jsxs)(`div`,{className:`gate-list`,children:[(0,q.jsx)(`label`,{htmlFor:`gate-${e}`,className:`lbl`,children:t}),(0,q.jsx)(`span`,{className:`help`,id:`gate-${e}-help`,children:n}),(0,q.jsx)(`textarea`,{id:`gate-${e}`,"aria-describedby":`gate-${e}-help`,rows:Math.min(Math.max(i+1,2),9),spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,value:o[e],onChange:t=>p(e,t.target.value)}),r&&(By(Iy(o[e]),r)?(0,q.jsx)(`span`,{className:`built`,children:`The built-in list.`}):(0,q.jsx)(`button`,{type:`button`,className:`link built`,onClick:()=>p(e,r.join(`
15
+ `)),children:`Use the built-in list`}))]},e)})}),d&&f.length>0&&(0,q.jsxs)(`p`,{className:`gate-less`,children:[`With these lists the gate sees less:`,` `,f.map((e,t)=>(0,q.jsxs)(`span`,{children:[t?`; and `:``,e]},t)),`. `,n?`Using them asks for your passkey.`:`That's yours to choose.`]}),(0,q.jsxs)(`div`,{className:`row gate-foot`,children:[(0,q.jsx)(`button`,{type:`button`,className:`send`,disabled:!d||c.kind===`sending`,onClick:()=>void m(),children:c.kind===`sending`?`Sending…`:`Use these lists`}),(0,q.jsx)(`button`,{type:`button`,className:`cancel`,disabled:!d,onClick:()=>s(Ly(i.paths)),children:`Put them back`}),(0,q.jsx)(`span`,{className:`small`,"aria-live":`polite`,children:c.kind===`done`&&!d?`In use.`:d?`Not in use yet.`:``})]}),c.kind===`stale`&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:`The gate's lists changed while you edited them, so yours weren't used. They're shown as they are now: make your change again.`}),c.kind===`unconfirmed`&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:`Your passkey wasn't used, so the gate's lists are as they were.`}),c.kind===`error`&&(0,q.jsxs)(`p`,{className:`problem`,role:`alert`,children:[`That didn't go through: `,c.message,`.`]})]})}function qy(e,t){let[n,r]=(0,y.useState)(),i=Cg().presets;return(0,y.useEffect)(()=>{if(!e)return;let t=!1;return fetch(i,{credentials:`same-origin`}).then(e=>e.ok?e.json():Promise.reject(Error(`the server answered ${e.status}`))).then(e=>!t&&r(e)).catch(()=>{}),()=>{t=!0}},[e,t,i]),n}async function Jy(e,t){try{let n=await Dg(e,e.preferences,t,{client:!0}),r=await n.json().catch(()=>({}));return n.status===201?{ok:r}:n.status===409?{stale:r.error??`the preferences have changed`}:{error:r.error??`the server answered ${n.status}`}}catch(e){return{error:e instanceof Error?e.message:String(e)}}}var Yy=e=>cp.find(t=>t.id===e)?.name;function Xy(e){let{routing:t}=e,n=Cg(),r=!!n.hosted,[i,a]=(0,y.useState)(()=>({name:Dm(t),settings:t.settings})),[o,s]=(0,y.useState)(()=>e.initial??xm(t.settings)),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)({kind:`idle`}),f=Sm(o,i.settings),p=Dm(t);(0,y.useEffect)(()=>{p===i.name||f||(a({name:p,settings:t.settings}),s(xm(t.settings)))},[p,t.settings]);let m=e=>{s(e),u.kind!==`saving`&&d({kind:`idle`})},h=(e,t)=>m({...o,rows:{...o.rows,[e]:t}}),g=()=>m(xm(i.settings)),_=async()=>{d({kind:`saving`});let r=await Jy(n,Om(o,i.name,c));`ok`in r?(a({name:r.ok.name,settings:{...i.settings,mode:o.mode,rows:o.rows}}),s(xm({...i.settings,mode:o.mode,rows:o.rows})),l(``),d({kind:`saved`}),e.onSaved(o.mode===`shadow`?`Your preferences are saved, in shadow: nothing is held back yet.`:`Your preferences are saved. They apply to the next cards agents file.`)):`stale`in r?(a({name:Dm(t),settings:t.settings}),s(xm(t.settings)),d({kind:`stale`})):d({kind:`error`,message:r.error})},v=Am(e.cards,o,t.settings),b=Cm(o.rows)?.id,x=t.preferences?.file,S=t.settings,C=Bm(o.mode,r),ee=(e,n)=>({row:e,value:n,mode:o.mode,settings:S,hosted:r,report:t.report.rows[e],replayed:v.rows[e]});return(0,q.jsxs)(N_,{label:`Your preferences`,onClose:e.onClose,id:`prefs-panel`,wide:!0,children:[(0,q.jsxs)(`div`,{className:`panel-head`,children:[(0,q.jsx)(`p`,{className:`lede`,children:`Agents file a card for each decision that's hard to undo, and each card falls in a row by what it changes. A row's stop decides two things: whether its cards reach you, and what the agent does while it waits for your answer.`}),(0,q.jsxs)(`div`,{className:`pref-hold`,children:[(0,q.jsx)(`span`,{className:`pref-label`,id:`mode-h`,children:`Holding back`}),(0,q.jsx)(`div`,{className:`stops two`,role:`radiogroup`,"aria-labelledby":`mode-h`,children:[`shadow`,`enforce`].map(e=>(0,q.jsxs)(`label`,{className:`stop`,"data-on":o.mode===e||void 0,children:[(0,q.jsx)(`input`,{type:`radio`,name:`pref-mode`,value:e,checked:o.mode===e,onChange:()=>m({...o,mode:e})}),(0,q.jsx)(`span`,{children:e===`shadow`?`Shadow`:`On`})]},e))}),(0,q.jsx)(`p`,{className:`now`,children:C.now}),(0,q.jsx)(`p`,{className:`more`,children:C.more})]})]}),t.problem&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:`Your preferences can't be read, so “Today” applies, in shadow. Saving writes new ones.`}),(0,q.jsx)(`h5`,{children:`What each stop does`}),(0,q.jsxs)(`table`,{className:`stops-table`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{scope:`col`,children:`Stop`}),(0,q.jsx)(`th`,{scope:`col`,children:`The card`}),(0,q.jsx)(`th`,{scope:`col`,children:`The agent, meanwhile`})]})}),(0,q.jsx)(`tbody`,{children:zm(S,r).map(e=>(0,q.jsxs)(`tr`,{className:e.position===`sample`?`cut`:void 0,children:[(0,q.jsxs)(`th`,{scope:`row`,children:[e.position===`sample`&&(0,q.jsx)(`span`,{className:`cut-label`,children:`Held back, when holding back is on`}),(0,q.jsx)(`span`,{className:`stop-name`,children:Fm(e.position)}),(0,q.jsx)(`span`,{className:e.chip===`held`?`lvl held`:`lvl`,children:e.chip})]}),(0,q.jsx)(`td`,{"data-label":`The card`,children:e.card}),(0,q.jsx)(`td`,{"data-label":`The agent, meanwhile`,children:e.agent})]},e.position))})]}),(0,q.jsx)(`p`,{className:`sub after`,children:`Whatever the stop, an agent may ask for a higher one than its row's, and a card it says can't be undone is never held back.`}),(0,q.jsx)(`h5`,{children:`Start from a preset`}),(0,q.jsx)(`div`,{className:`presets`,children:cp.map(t=>{let n=e.presets?.presets.find(e=>e.id===t.id)?.replay;return(0,q.jsxs)(`button`,{type:`button`,className:`preset`,"aria-pressed":b===t.id,onClick:()=>m({...o,rows:{...t.rows},preset:t.id}),children:[(0,q.jsx)(`b`,{children:t.name}),(0,q.jsx)(`span`,{children:t.summary}),(0,q.jsx)(`span`,{className:`soft`,children:n?Mm(n.total):`Trying it on your past cards…`})]},t.id)})}),(0,q.jsx)(`h5`,{children:`Your rows`}),(0,q.jsxs)(`div`,{className:`pref-rows`,children:[Kf.map(e=>(0,q.jsx)(Zy,{...ee(e,o.rows[e]),note:$f[e]?`No lower than “${Zf[$f[e]]}”.`:void 0,onChange:t=>h(e,t)},e)),qf.map(e=>(0,q.jsx)(Zy,{...ee(e,`never-without-me`),note:`Always “${Zf[`never-without-me`]}”.`},e))]}),(0,q.jsxs)(`div`,{className:`pref-foot`,children:[(0,q.jsx)(`p`,{className:`pref-total`,children:Mm(v.total,`These settings`)}),(0,q.jsxs)(`label`,{className:`why-line`,children:[(0,q.jsxs)(`span`,{className:`lbl`,children:[`Why? `,(0,q.jsx)(`span`,{className:`soft`,children:`Optional. It's kept with the change.`})]}),(0,q.jsx)(`input`,{type:`text`,autoComplete:`off`,placeholder:`One line`,value:c,onChange:e=>l(e.target.value)})]}),(0,q.jsxs)(`div`,{className:`row`,children:[(0,q.jsx)(`button`,{type:`button`,className:`send`,disabled:!f||u.kind===`saving`,onClick:()=>void _(),children:u.kind===`saving`?`Saving…`:`Save`}),(0,q.jsx)(`button`,{type:`button`,className:`cancel`,disabled:!f,onClick:g,children:`Discard changes`}),(0,q.jsx)(`span`,{className:`small`,role:`status`,children:u.kind===`saved`?`Saved.`:f?`Not saved yet.`:``})]}),u.kind===`stale`&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:`Your preferences changed while this was open, so nothing was saved. They're shown as they are now: make your change again.`}),u.kind===`error`&&(0,q.jsxs)(`p`,{className:`problem`,role:`alert`,children:[`That wasn't saved: `,u.message,`.`]}),(0,q.jsxs)(`p`,{className:`sub after`,children:[x?`Last changed by ${x.by} on ${new Date(x.at).toLocaleDateString(void 0,{day:`numeric`,month:`long`})}${x.from_card?`, from Baesian's proposal`:Yy(x.profile)?`, from “${Yy(x.profile)}”`:``}.`:`None saved yet, so “Today” applies, in shadow.`,` `,(0,q.jsx)(`button`,{type:`button`,className:`link`,onClick:e.onSurvey,children:`Find a preset from example decisions`})]})]}),(0,q.jsx)(Ky,{routing:t,onSaved:e.onSaved})]})}function Zy(e){let t=!e.onChange,n=Vm(e.value,e.mode,e.settings,{hosted:e.hosted,held:e.report?.held??0});return(0,q.jsxs)(`div`,{className:`pref-row`,"data-row":e.row,"data-fixed":t||void 0,children:[(0,q.jsxs)(`div`,{className:`pref-name`,children:[(0,q.jsx)(`b`,{id:`row-${e.row}`,children:Xf[e.row]}),(0,q.jsx)(`span`,{className:`what`,children:Nm[e.row]}),e.note&&(0,q.jsx)(`span`,{className:`limit`,children:e.note})]}),(0,q.jsxs)(`div`,{className:`pref-stops`,children:[(0,q.jsx)(`div`,{className:`stops five`,role:`radiogroup`,"aria-labelledby":`row-${e.row}`,children:Yf.map(n=>{let r=!t&&Tm(e.row,n);return(0,q.jsxs)(`label`,{className:Em(n)?`stop holds`:`stop`,"data-on":e.value===n||void 0,"data-off":!r||void 0,children:[(0,q.jsx)(`input`,{type:`radio`,name:`pref-${e.row}`,value:n,title:Fm(n),checked:e.value===n,disabled:!r,onChange:()=>e.onChange?.(n)}),(0,q.jsx)(`span`,{children:Pm[n]})]},n)})}),(0,q.jsxs)(`p`,{className:`means`,children:[n,(0,q.jsx)(`span`,{className:`evidence`,children:Hm(e.report,e.replayed,Em(e.value))})]})]})]})}var Qy={left:`see`,right:`fine`},$y={cheap:`Easy to undo`,moderate:`Costly to undo`,"one-way":`Hard to undo`},eb=e=>e.charAt(0).toUpperCase()+e.slice(1);function tb(e){return(0,q.jsxs)(`div`,{className:`face`,children:[(0,q.jsxs)(`p`,{className:`doing`,children:[(0,q.jsx)(`b`,{children:`Baesian`}),` is setting up this repo`]}),(0,q.jsx)(`h1`,{children:`How much should reach you?`}),(0,q.jsxs)(`p`,{className:`setup-text`,children:[e.count===void 0?`A few`:eb(Km(e.count)),` example decisions, one for each kind your settings can hold back. Say of each whether you'd want to see ones like it, and Baesian suggests a preset to start from.`]}),(0,q.jsx)(`p`,{className:`setup-text soft`,children:`It starts in shadow: every card still reaches you until you turn holding back on.`}),(0,q.jsxs)(`div`,{className:`briefing-foot`,children:[(0,q.jsxs)(`div`,{className:`row`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`confirm`,disabled:e.count===void 0,onClick:e.onStart,children:[`Start `,(0,q.jsx)(`kbd`,{children:`→`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`cancel`,onClick:e.onAway,children:[`Not now `,(0,q.jsx)(`kbd`,{children:`Esc`})]})]}),(0,q.jsx)(`p`,{className:`small`,children:`Offered once. Your preferences, in the menu, offer it again.`})]})]})}function nb(e){let t=e.survey.items[e.i],n={see:{name:e.survey.see,then:`ones like it reach you`},fine:{name:e.survey.fine,then:`agents go ahead on ones like it, and a sample comes back to you`}};return(0,q.jsxs)(`div`,{className:`face`,children:[(0,q.jsxs)(`p`,{className:`stakes`,children:[(0,q.jsxs)(`b`,{children:[`Example `,e.i+1,` of `,e.survey.items.length,`: `,Xf[t.row]]}),(0,q.jsx)(`span`,{className:`gone`,children:$y[t.reverse]})]}),(0,q.jsxs)(`p`,{className:`doing`,children:[(0,q.jsx)(`b`,{children:`An agent`}),` is `,t.doing]}),(0,q.jsx)(`h1`,{children:t.question}),(0,q.jsxs)(`div`,{className:`example`,"aria-label":`Its two options`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`b`,{children:t.proposal}),` then `,t.proposal_then]}),(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`b`,{children:t.alternative}),` then `,t.alternative_then]})]}),(0,q.jsx)(`div`,{className:`crux`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`lbl`,children:`The question`}),` `,e.survey.question]})}),(0,q.jsx)(`div`,{className:`options`,children:[`left`,`right`].map(t=>{let r=n[Qy[t]];return(0,q.jsxs)(`button`,{type:`button`,className:e.armed===t?`opt armed`:`opt`,"data-side":t,"data-answer":Qy[t],onClick:()=>e.onAnswer(t),children:[(0,q.jsx)(`kbd`,{className:`key`,"aria-hidden":`true`,children:Ph[t]}),(0,q.jsx)(`h2`,{children:r.name}),(0,q.jsxs)(`p`,{className:`then`,children:[`then `,r.then]})]},t)})}),(0,q.jsxs)(`div`,{className:`foot`,children:[(0,q.jsxs)(`span`,{className:`rule`,children:[e.touch?`${xh} `:``,`Your answers suggest a preset. Nothing is saved until you say so.`]}),e.i>0&&(0,q.jsx)(`button`,{type:`button`,onClick:e.onBack,children:`Back`}),(0,q.jsxs)(`button`,{type:`button`,className:e.armed===`down`?`armed`:void 0,onClick:e.onSkip,children:[(0,q.jsx)(`kbd`,{className:`dir`,children:`↓`}),` Not sure`]}),(0,q.jsxs)(`button`,{type:`button`,onClick:e.onAway,children:[`Not now `,(0,q.jsx)(`kbd`,{children:`Esc`})]})]})]})}function rb(e){let t=Ep(ym(e.answers)),n=e.presets.presets.find(e=>e.id===t.id)?.replay,{sample:r,agent:i}=Wm(t.rows),a=e=>Gm(e.map(Um));return(0,q.jsxs)(`div`,{className:`face`,children:[(0,q.jsxs)(`p`,{className:`doing`,children:[(0,q.jsx)(`b`,{children:`Your answers`}),` suggest`]}),(0,q.jsx)(`h1`,{children:t.name}),(0,q.jsx)(`p`,{className:`setup-text`,children:t.summary}),(0,q.jsxs)(`ul`,{className:`setup-rows`,children:[r.length>0&&(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`b`,{children:`Checked by sample afterwards:`}),` `,a(r),`.`]}),i.length>0&&(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`b`,{children:`Left to the agent:`}),` `,a(i),`.`]}),(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`b`,{children:r.length||i.length?`Everything else reaches you`:`Every kind reaches you`}),`, and security and privacy never go ahead without you.`]})]}),(0,q.jsx)(`p`,{className:`setup-text`,children:n?Mm(n.total,`It`):`Trying it on your past cards…`}),(0,q.jsx)(`p`,{className:`setup-text soft`,children:e.mode===`shadow`?`It starts in shadow: nothing is held back until you turn that on, in your preferences.`:`Holding back is on, so it applies to the next cards agents file.`}),e.problem&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:e.problem}),(0,q.jsx)(`div`,{className:`briefing-foot`,children:(0,q.jsxs)(`div`,{className:`row`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`confirm`,disabled:e.saving,onClick:e.onUse,children:[e.saving?`Saving…`:`Use it`,` `,(0,q.jsx)(`kbd`,{children:`Enter`})]}),(0,q.jsx)(`button`,{type:`button`,className:`switch`,onClick:e.onAdjust,children:`Adjust it first`}),(0,q.jsxs)(`button`,{type:`button`,className:`cancel`,onClick:e.onAway,children:[`Not now `,(0,q.jsx)(`kbd`,{children:`Esc`})]})]})})]})}var ib=new Set,ab=()=>{for(let e of ib)e()};addEventListener(`popstate`,ab);function ob(e,t={}){t.replace?history.replaceState(null,``,e):history.pushState(null,``,e),scrollTo({top:0}),ab()}var sb=e=>t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),ob(e))},cb=150,lb=110,ub=.16,db=cb*ub,fb=8,pb=3,mb=[`No`,`One`,`Two`,`Three`,`Four`,`Five`,`Six`],hb=700,gb=[`left`,`right`,`up`,`down`],_b=[`left`,`right`,`down`],vb=[`left`,`right`],yb=[];function bb(e,t,n){let r=[],i=[];for(let a of lv(e)){if(a.answered?.phase!==`waiting`||!a.answered.wait)continue;let e=t.cards.find(e=>Fp(e)===a.key);!e||e.status!==`open`&&e.status!==`held`||(Date.parse(a.expires)<=n?i.push(a.answered.name):r.push([a.key,a.answered]))}return{kept:r,expired:i}}function xb(e,t){let{proposal:n,alternative:r}=e.meta;return t.kind===`choose`&&am(e)?t.option===`proposal`?`you kept ${Hp(n)}`:`you overturned it, for ${Hp(r)}`:t.kind===`choose`&&om(e)&&t.option===`proposal`?`you confirmed ${Hp(n)}, your answer in chat`:t.kind===`choose`?t.option===`proposal`?`you chose ${Hp(n)}`:`you chose ${Hp(r)}, not ${Up(e)}'s pick`:t.kind===`write`?`you wrote an answer`:`you couldn't judge it`}function Sb(e,t){let n=!!e.test&&t;return{words:e.words,sent:e.phase===`sent`,waiting:e.phase===`waiting`,...n?{test:!0}:{},...e.practice&&!n?{practice:C_(e.practice.card,e.practice.stopped)}:{}}}var Cb=e=>e&&om(e)?{kind:`seen`}:{kind:`live`};function wb(e,t,n){let r=e.meta;return n?`Recorded.`:Ip(e)?`Recorded: it was practice.`:r.pref_row&&r.pref_to&&t.kind===`choose`?t.option===`proposal`?`Saved: ${Xf[r.pref_row]} is at “${Zf[r.pref_to]}” now.`:`Recorded: the setting for ${Um(r.pref_row)} stays as it is.`:Cp(r)?`Recorded.`:`Sent to ${r.source_agent}.`}var Tb=e=>e?` Baesian has ${e===1?`a proposal`:`${mb[e]?.toLowerCase()??e} proposals`} from your answers, in your queue.`:``;function Eb(e,t){if(!Cp(e.meta))return e;let{crux_fact:n}=e.meta;return{...e,body:qp(e.body,t),meta:{...e.meta,...n?{crux_fact:qp(n,t)}:{}}}}function Db(e,t){let n=7;for(let t of e)n=n*31+t.charCodeAt(0)>>>0;return{r:(n%9-4)*.55+(t%2?.9:-.9),dx:(n>>4)%9-4,dy:3+t*3+(n>>8)%3}}function Ob({state:e,fetchedAt:t,notice:n,refreshing:r=!1}){let i=(0,y.useMemo)(()=>Math.random().toString(36).slice(2),[]),a=Qd(),o=Cg(),[s]=(0,y.useState)(()=>o.hosted?bb(e.project.name,e,Yp(e,t)):{kept:[],expired:[]}),[c,l]=(0,y.useState)(()=>new Map(s.kept)),u=(0,y.useRef)(c);u.current=c;let[d,f]=(0,y.useState)(s.expired),[p,m]=(0,y.useState)(),[h,g]=(0,y.useState)(),[_,v]=(0,y.useState)({kind:`live`}),[b,x]=(0,y.useState)(),[S,C]=(0,y.useState)(),[ee,w]=(0,y.useState)(),[T,E]=(0,y.useState)(),[D,O]=(0,y.useState)(),[k,te]=(0,y.useState)(),ne=(0,y.useCallback)((e,t)=>te(n=>e||(n===t?void 0:n)),[]),[re,ie]=(0,y.useState)(),[ae,oe]=(0,y.useState)(0),[A,se]=(0,y.useState)(),ce=(0,y.useRef)(new Map),le=(0,y.useRef)(`fade`),[ue,de]=(0,y.useState)(!1),[fe,j]=(0,y.useState)(),pe=fe===`branches`,[me,he]=(0,y.useState)(),[ge,_e]=(0,y.useState)(),[ve,M]=(0,y.useState)(),N=e.project.name,ye=ig(ng),be=ig(rg),xe=(0,y.useRef)(null);Ng();let Se=zg(e),Ce=Vg(e),P=Bg(e),we=Ag(o),F=f_(we.entries),Te=we.ready?p_(F):void 0,Ee=Te===`test`,[I,De]=(0,y.useState)(),[Oe,ke]=(0,y.useState)(),Ae=(0,y.useRef)(1/0),je=(0,y.useRef)(new Set),[Me,Ne]=(0,y.useState)(),Pe=Yp(e,t),Fe=Np(e),Ie=Xp(e,Pe).filter(e=>!c.has(Fp(e))),Le=Qp(e).filter(e=>!c.has(Fp(e))),Re=$p(e).filter(e=>!c.has(Fp(e))),ze=em(e),Be=h?e.cards.find(e=>Fp(e)===h)??c.get(h)?.practice?.card:void 0,[Ve,He]=(0,y.useState)(``),Ue=Ie.find(e=>Fp(e)===Ve),We=p?Ie.find(e=>e.meta.id===p)??Le.find(e=>e.meta.id===p)??Re.find(e=>e.meta.id===p):void 0,Ge=me?e.cards.find(e=>e.meta.id===me):void 0,L=Ge??Be??We??I?.card??Ue??Ie[0],Ke=L?Fp(L):``,qe=L?e.decks.find(e=>e.meta.id===L.meta.deck):void 0,Je=e=>I?.card===e?I.stopped:[...c.values()].find(t=>t.practice?.card===e)?.practice?.stopped,Ye=e=>Ip(e)?Je(e)?`waiting`:`none`:Jp(e,Pe),R=Ie.filter(e=>Jp(e,Pe)===`waiting`).length+ +!!I?.stopped,Xe=!P.offered&&!e.routing.preferences&&!e.routing.problem&&R===0&&!Be&&!We&&!Ge,z=ge??(Xe?{step:`offer`}:void 0),Ze=qy(fe===`preferences`||z!==void 0,e.version),Qe=!z&&!Be&&!Ge&&!Ip(L)&&U_(qe)&&!Ce.has(qe.meta.id)?qe:void 0,$e=L?Rp(L,Fe).length:0,et=L?zp(L,$e):void 0,tt=L?fm(L.meta.id,i):{left:`alternative`,right:`proposal`},nt=e=>tt.left===e?`left`:`right`,[rt,it]=(0,y.useState)(()=>performance.now());Ve!==Ke&&(He(Ke),v(Ge?{kind:`past`}:h&&h===Ke?{kind:`review`}:Cb(L)),x(void 0),w(void 0),E(void 0),it(performance.now()));let at=!!Qe||!!z||!!Oe;(0,y.useEffect)(()=>{Ke&&!at&&Se.mark(Ke)},[Ke,at,Se.mark]);let ot=(0,y.useRef)(at);ot.current!==at&&(ot.current=at,at||it(performance.now()));let st=et&&L&&_.kind!==`review`&&!om(L)?hm[et.rarity]:0,[,ct]=(0,y.useState)(0),lt=Math.max(0,st-(performance.now()-rt));(0,y.useEffect)(()=>{if(lt<=0)return;let e=requestAnimationFrame(()=>ct(e=>e+1));return()=>cancelAnimationFrame(e)});let ut=(e,t)=>C({text:e,...t?{undoUntil:t}:{},id:Date.now()+Math.random()}),dt=we.add,ft=(0,y.useRef)(void 0);ft.current||=new Gg(Kg(o),gm,{sent:(e,t)=>{let n=u.current.get(e);t?.practice&&dt(t.practice);let r=!!ft.current?.waiting(),i=t?.waiting;if(i)return l(t=>t.has(e)?new Map(t).set(e,{...t.get(e),phase:`waiting`,wait:i}):t),r?void 0:ut(`${n?.hard===!1?`Accepting it lets more cards past you, so it`:`It`} waits for your passkey.`);l(t=>t.has(e)?new Map(t).set(e,{...t.get(e),phase:`sent`}):t),n?.practice&&!n.test&&Ne(C_(n.practice.card,n.practice.stopped)),r||ut(`${n?.sent??`Sent.`}${n?.test?``:Tb(t?.filed?.length??0)}`)},failed:(e,t)=>{l(t=>{let n=new Map(t);return n.delete(e),n}),ut(`That answer wasn't recorded: ${t}. The card is back.`)}}),(0,y.useEffect)(()=>{let e=()=>ft.current.flush(!0);return addEventListener(`pagehide`,e),()=>{removeEventListener(`pagehide`,e),e()}},[]);let pt=[...c].filter(e=>e[1].phase===`waiting`&&!!e[1].wait),mt=pt.map(([,e])=>e.wait.pending).join(` `),[ht,gt]=(0,y.useState)(!1),_t=(0,y.useRef)(new Set),vt=(0,y.useRef)(new Set),yt=Pe-Date.now(),bt=e=>Date.parse(e.wait.expires);(0,y.useEffect)(()=>{o.hosted&&uv(N,pt.map(([e,t])=>({key:e,expires:t.wait.expires,answered:t})))},[mt]);let[,xt]=(0,y.useState)(0);(0,y.useEffect)(()=>{let e=pt.flatMap(([,e])=>[bt(e)-yt-ev,bt(e)-yt]).filter(e=>e>Date.now());if(!e.length)return;let t=setTimeout(()=>xt(e=>e+1),Math.min(...e)-Date.now()+20);return()=>clearTimeout(t)});let B=e=>{e.length&&(l(t=>{let n=new Map(t);for(let t of e)n.delete(t);return n}),h&&e.includes(h)&&g(void 0))},St=e=>e.length&&f(t=>[...new Set([...t,...e])]),Ct=pt.filter(([,e])=>bt(e)<=Pe),wt=Ct.map(([e])=>e).join(` `);(0,y.useEffect)(()=>{Ct.length&&(B(Ct.map(([e])=>e)),St(Ct.map(([,e])=>e.name)))},[wt]);let Tt=(e,t)=>{let n=new Map(e.map(([e,t])=>[t.wait.pending,e])),r=t.expired.flatMap(e=>n.get(e)??[]),i=[],a=[],o=0;for(let e of t.outcomes){let t=n.get(e.pending);if(!t)continue;let s=e.body;e.status===201?(i.push(t),o+=s?.filed?.length??0):e.status===410?r.push(t):a.push({key:t,why:s?.error??`the server answered ${e.status}`})}let s=new Map(e.map(([e,t])=>[e,t]));if(l(e=>{let t=new Map(e);for(let e of i){let n=t.get(e);if(!n)continue;let{wait:r,...i}=n;t.set(e,{...i,phase:`sent`})}return t}),B([...r,...a.map(e=>e.key)]),St(r.map(e=>s.get(e).name)),a.length){let e=a.length===1;ut(`${e?`That answer wasn't`:`${mb[a.length]??a.length} answers weren't`} recorded: ${a[0].why}. ${e?`The card is`:`Their cards are`} back.`)}else i.length&&ut(`${sv(i.length,s.get(i[0])?.sent)}${Tb(o)}`)},Et=async(n=!1)=>{let r=pt.filter(([,n])=>bt(n)>Yp(e,t));if(!r.length||!o.hosted)return;let i=r.map(([,e])=>e.wait.pending);if(n)for(let e of i)vt.current.add(e);gt(!0);try{let e=Object.fromEntries(r.map(([,e])=>[e.wait.pending,e.name]));Tt(r,await Og(o,i,{kind:`answers`,titles:e,loosens:r.some(([,e])=>e.wait.proving.includes(`preferences`))}))}catch(e){for(let e of i)_t.current.add(e);let t=r.length===1;e instanceof dg?ut(`Not confirmed: ${t?`your answer waits`:`your answers wait`} for your passkey.`):ut(`Your passkey didn't confirm ${t?`it`:`them`}: ${e instanceof Error?e.message:String(e)}. ${t?`It waits`:`They wait`} still.`)}finally{gt(!1)}},Dt=ht||[...c.values()].some(e=>e.phase===`held`)||_.kind===`write`||_.kind===`pass`||ue||!!fe&&fe!==`path`,Ot=iv({waiting:pt.filter(([,e])=>bt(e)>Pe).map(([,e])=>({pending:e.wait.pending,expiresAt:bt(e)})),busy:Dt,hardInFront:!!L&&Lp(L),declined:_t.current,warned:vt.current,now:Pe});(0,y.useEffect)(()=>{Ot!==`no`&&Et(Ot===`expiring`)},[Ot,mt]);let kt=pt.length>0||[...c.values()].some(e=>e.phase===`held`&&e.hard),At=e=>{kt||(ft.current.flush(!0),sb(`/`)(e))};(0,y.useEffect)(()=>{if(!kt)return;let e=e=>{e.preventDefault(),e.returnValue=``};return addEventListener(`beforeunload`,e),()=>removeEventListener(`beforeunload`,e)},[kt]);let jt=t=>{if(!Te||(Ae.current+=1,I)||F.kind===`test`&&F.practice>=10)return;let n=$g(e,Pe,new Set([...o_(we.entries),...je.current])),r=Ie.filter(e=>Fp(e)!==Fp(t)).length;if(!i_({phase:Te,since:Ae.current,realLeft:r,pool:n.length,roll:Math.random()}))return;let i=n[Math.floor(Math.random()*n.length)];je.current.add(i.meta.id),Ae.current=0,De({card:t_(i),stopped:Jp(t,Pe)===`waiting`})},Mt=e=>{if(!L)return;if(r)return ut(`This project is still refreshing: answer once it's up to date, in a moment.`);let t=_m(L,e);if(`problem`in t)return x(t.problem);let n=Ee&&!om(L),i=Ip(L),s=vm(L,e);if(h||om(L)||i||Lg(N,{rarity:et.rarity,ms:Math.round(performance.now()-rt),at:new Date().toISOString()}),le.current=e.kind===`choose`?nt(e.option):e.kind===`write`?`up`:`down`,e.kind===`choose`&&!a){let t=document.querySelector(`.stage article.card:not([data-leaving]) .opt[data-kind="${e.option}"] h2`)?.getBoundingClientRect();t&&se({key:Ke,from:{x:t.left,y:t.top},text:L.meta[e.option]})}let c=i?{practice:b_(i,e,n)}:{verdict:t.verdict},u=i?Je(L)??!1:!1;l(t=>new Map(t).set(Ke,{answer:e,phase:`held`,words:s,agent:Up(L),sent:wb(L,e,n),name:L.meta.title,rarity:et.rarity,state:i&&!n?S_(L,e):xb(L,e),...o.hosted?{hard:Lp(L)}:{},...n?{test:!0}:{},...i?{practice:{card:L,stopped:u,said:S_(L,e)}}:{}}));let d=ft.current.hold(Ke,c);mn.current=void 0,ut(n||Cp(L.meta)?`Recording it in`:i?`That was practice. Recording it in`:`Sending to ${L.meta.source_agent} in`,d.until),m(void 0),g(void 0),i?De(void 0):h||jt(L),n&&(ke({key:Ke,card:L}),Qt())},Nt=async e=>{if(Oe&&!Oe.saving){ke({...Oe,saving:!0});try{we.add(await qg(o,x_(Oe.card,e))),le.current=`fade`,ke(void 0),it(performance.now()),Qt()}catch(e){ke({...Oe,saving:!1,problem:`Your guess wasn't kept: ${e instanceof Error?e.message:String(e)}. Try again.`})}}},Pt=()=>{let e=ft.current.undo();if(!e)return;let t=u.current.get(e);Oe?.key===e&&ke(void 0),l(t=>{let n=new Map(t);return n.delete(e),n}),le.current=`fade`,g(void 0),t?.practice?(m(void 0),De({card:t.practice.card,stopped:t.practice.stopped})):m(e.split(`@`)[0]),ut(`Undone. The card is back.`)},Ft=e=>{if(!L||_.kind!==`live`&&_.kind!==`seen`)return;if(w(void 0),e===`up`)return v({kind:`write`,text:``});if(e===`down`)return v({kind:`pass`,text:``});if(lt>0)return oe(e=>e+1);let t=tt[e];if(_.kind===`seen`)return t===`alternative`?v({kind:`reveal`,option:t,side:e,why:``,..._.rule?{rule:!0}:{}}):et?.rarity===`mythic`?(oe(e=>e+1),ut(be?`Press and hold to confirm.`:`Hold to confirm, until the bar fills.`)):It();ce.current.has(Ke)||ce.current.set(Ke,t),v({kind:`reveal`,option:t,side:e,first:ce.current.get(Ke),why:``})},It=()=>{if(_.kind===`seen`)return Mt({kind:`choose`,option:`proposal`,..._.rule?{rule:!0}:{}});_.kind===`reveal`&&Mt({kind:`choose`,option:_.option,..._.first?{first:_.first}:{},..._.why.trim()?{why:_.why}:{},..._.rule?{rule:!0}:{},..._.retire?.length?{retire:_.retire}:{},..._.asked?{asked:!0}:{}})},Lt=()=>_.kind===`reveal`&&(L&&om(L)?v({kind:`seen`,..._.rule?{rule:!0}:{}}):v({..._,option:`proposal`,side:nt(`proposal`),why:``,retire:[]})),Rt=()=>{if(_.kind===`write`||_.kind===`pass`){if(!_.reason)return x(`Choose a reason first.`);Mt(_.kind===`write`?{kind:`write`,reason:_.reason,text:_.text,..._.rule?{rule:!0}:{}}:{kind:`pass`,reason:_.reason,text:_.text})}},zt=()=>{x(void 0),me?(le.current=`fade`,he(void 0)):h&&(_.kind===`review`||c.has(h))?(le.current=`fade`,g(void 0)):v(Cb(L))},Bt=()=>{if(!h)return;let e=c.get(h);(e?.phase===`held`||e?.phase===`waiting`)&&(e.phase===`held`&&ft.current.undo(),l(e=>{let t=new Map(e);return t.delete(h),t}),e.practice&&(g(void 0),De({card:e.practice.card,stopped:e.practice.stopped}))),v(Cb(L)),it(performance.now())},Vt=e=>{if(_.kind===`write`||_.kind===`pass`)return ut(`Send or cancel your written answer first.`);if(z&&$t(),e===L?.meta.id)return;le.current=`fade`,he(void 0);let t=[...c.keys()].find(t=>t.startsWith(`${e}@`));t?g(t):(g(void 0),m(e)),requestAnimationFrame(()=>document.querySelector(`.stage article.card:not([data-leaving])`)?.focus({preventScroll:!0}))},V=new Map;for(let t of e.cards)Cp(t.meta)||V.set(t.canonicalTopic,(V.get(t.canonicalTopic)??0)+1);let Ht=L&&!Cp(L.meta)&&!Ip(L)?Op(L.canonicalTopic,V.keys()).map(e=>({topic:e,count:V.get(e)})):[],H=async e=>{if(!L)return;let t=L.canonicalTopic,n={from:t,to:e};try{let r=await Dg(o,o.aliases,n);if(!r.ok)throw Error((await r.json().catch(()=>({}))).error??`the server answered ${r.status}`);ut(`Merged: “${t}” now counts as “${e}”.`)}catch(e){ut(`The topics weren't merged: ${e instanceof Error?e.message:String(e)}.`)}},[Ut,Wt]=(0,y.useState)(!1),Gt=async()=>{Wt(!0);try{we.add(await qg(o,{kind:`test-start`})),j(void 0),ut(`The blind test is on. Mark each card you answer.`)}catch(e){ut(`The blind test didn't start: ${e instanceof Error?e.message:String(e)}.`)}finally{Wt(!1)}},Kt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{Kt.current&&(F.kind===`spotted`||F.kind===`on`)&&j(`practice`),Kt.current=F.kind===`test`},[F.kind]);let qt=Wg(e,Vt),Jt=async()=>{let e=qt.status,t=await qt.toggle();t===`on`?ut(`Notifications are on. Keep this page open to get them.`):t===`blocked`?ut(`Your browser blocks notifications for this page. Its site settings can allow them.`):e===`on`&&ut(`Notifications are off.`)},Yt=e=>{e===`preferences`&&M(void 0),j(t=>t===e?void 0:e)},Xt=t=>{if(j(void 0),t===L?.meta.id)return Qt();if([...Ie,...Le,...Re].some(e=>e.meta.id===t)||[...c.keys()].some(e=>e.startsWith(`${t}@`)))return Vt(t);if(_.kind===`write`||_.kind===`pass`)return ut(`Send or cancel your written answer first.`);e.cards.some(e=>e.meta.id===t)&&(z&&$t(),le.current=`fade`,g(void 0),he(t),Qt())},Zt=Ze?.survey,Qt=()=>requestAnimationFrame(()=>document.querySelector(`.stage article.card:not([data-leaving])`)?.focus({preventScroll:!0})),$t=()=>{P.mark(),le.current=`fade`,_e(void 0),Qt()},en=()=>{Zt&&(P.mark(),j(void 0),le.current=`fade`,_e({step:`ask`,i:0,answers:{}}),Qt())},tn=e=>{if(z?.step!==`ask`||!Zt)return;let t=Zt.items[z.i],n={...z.answers};e===`down`?delete n[t.row]:n[t.row]=Qy[e],le.current=e,_e(z.i+1<Zt.items.length?{step:`ask`,i:z.i+1,answers:n}:{step:`result`,answers:n})},nn=()=>{z?.step===`ask`&&z.i!==0&&(le.current=`fade`,_e({...z,i:z.i-1}))},rn=async()=>{if(z?.step!==`result`)return;_e({...z,saving:!0});let t=await Jy(o,bm(z.answers,Dm(e.routing)));if(`ok`in t){let e=Ep(ym(z.answers));ut(t.ok.file.mode===`shadow`?`Saved: “${e.name}”, in shadow. Nothing is held back yet.`:`Saved: “${e.name}”. It applies to the next cards agents file.`),$t()}else _e({...z,saving:!1,problem:`stale`in t?`Your preferences changed meanwhile, so nothing was saved. Open them, in the menu, to see them as they are.`:`That wasn't saved: ${t.error}.`})},an=()=>{if(z?.step!==`result`)return;let t=ym(z.answers),n=Ep(t);M({mode:e.routing.settings.mode,rows:{...n.rows},preset:n.id,survey:t}),$t(),j(`preferences`)},on=e=>{z?.step===`offer`&&(e===`right`||e===`enter`)?en():z?.step===`ask`&&(e===`left`||e===`right`||e===`down`)?tn(e):z?.step===`result`&&e===`enter`&&rn()},sn=()=>{Qe&&(Ce.mark(Qe.meta.id),it(performance.now()),requestAnimationFrame(()=>document.querySelector(`.stage article.card:not([data-leaving])`)?.focus({preventScroll:!0})))},cn=(0,y.useRef)(void 0),ln=()=>{if(_.kind!==`reveal`&&_.kind!==`seen`||cn.current!==void 0)return;cn.current=performance.now();let e=()=>{if(cn.current===void 0)return;let t=Math.min(1,(performance.now()-cn.current)/900);if(ie(t),t>=1)return cn.current=void 0,ie(void 0),pn.current.confirm();requestAnimationFrame(e)};requestAnimationFrame(e)},un=()=>{cn.current!==void 0&&(cn.current=void 0,ie(void 0),ut(`Keep holding until the bar fills.`))},dn=nt(`proposal`),fn=!!Oe,pn=(0,y.useRef)({mode:_,reach:Ft,confirm:It,undo:Pt,back:zt,beginHold:ln,endHold:un,ordered:Ie,current:L,rarity:et?.rarity,pickSide:dn,menuOpen:ue,panel:fe,briefing:!!Qe,dismissBriefing:sn,setup:!!z,setupKey:on,setupAway:$t,marking:fn,giveMark:Nt});pn.current={mode:_,reach:Ft,confirm:It,undo:Pt,back:zt,beginHold:ln,endHold:un,ordered:Ie,current:L,rarity:et?.rarity,pickSide:dn,menuOpen:ue,panel:fe,briefing:!!Qe,dismissBriefing:sn,setup:!!z,setupKey:on,setupAway:$t,marking:fn,giveMark:Nt};let mn=(0,y.useRef)(void 0);(0,y.useLayoutEffect)(()=>{let e={ArrowLeft:`left`,ArrowRight:`right`,ArrowUp:`up`,ArrowDown:`down`},t=t=>{let n=pn.current;if(n.menuOpen){t.key===`Escape`&&de(!1),(t.key===`ArrowDown`||t.key===`ArrowUp`)&&(t.preventDefault(),M_(t.key===`ArrowDown`?`down`:`up`));return}if(t.key===`Escape`){if(n.panel)j(void 0);else if(n.setup)n.setupAway();else if(n.marking)return;else n.briefing?n.dismissBriefing():n.mode.kind!==`live`||hn.current?n.back():mn.current&&(mn.current=void 0,w(void 0));return}if((t.key===`b`||t.key===`B`)&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!(t.target instanceof Element&&t.target.closest(`input:not([type="checkbox"]), textarea, select, [contenteditable="true"]`))){t.preventDefault(),t.repeat||j(e=>e===`branches`?void 0:`branches`);return}if(n.panel===`branches`||t.target instanceof Element&&t.target.closest(`input:not([type="checkbox"]), textarea, .panel, .sheet`)||t.metaKey||t.ctrlKey||t.altKey)return;if(t.key===`z`||t.key===`Z`)return n.undo();if(t.key===`?`)return j(e=>e===`keys`?void 0:`keys`);let r=e[t.key];if(n.marking){let e=a_.find(e=>e.key===t.key);(e||r)&&t.preventDefault(),e&&!t.repeat&&n.giveMark(e.mark)}else if(n.setup){let e=t.key===`Enter`&&!(t.target instanceof HTMLButtonElement);(r||e)&&(t.preventDefault(),t.repeat||n.setupKey(r??`enter`))}else{if((t.key===`j`||t.key===`k`)&&(n.mode.kind===`live`||n.mode.kind===`seen`)&&n.ordered.length){let e=n.current?n.ordered.indexOf(n.current):-1,r=n.ordered[(e+(t.key===`j`?1:n.ordered.length-1)+n.ordered.length)%n.ordered.length];return le.current=`fade`,g(void 0),m(r?.meta.id)}if(n.briefing)(r||t.key===`Enter`&&!(t.target instanceof HTMLButtonElement))&&(t.preventDefault(),t.repeat||n.dismissBriefing());else if(r&&n.current&&(t.preventDefault(),!t.repeat)){if(n.mode.kind===`reveal`)return r===n.mode.side?(mn.current=r,n.rarity===`mythic`?n.beginHold():n.confirm()):void 0;if(n.mode.kind===`seen`&&r===n.pickSide)return n.rarity===`mythic`?(mn.current=r,n.beginHold()):n.confirm();if(n.mode.kind===`live`||n.mode.kind===`seen`){if(r===`up`||r===`down`)return n.reach(r);mn.current=r,w(r)}}}},n=t=>{let n=e[t.key];if(!n||mn.current!==n)return;mn.current=void 0;let r=pn.current;if(r.mode.kind===`reveal`||r.mode.kind===`seen`&&n===r.pickSide)return r.endHold();(r.mode.kind===`live`||r.mode.kind===`seen`)&&r.reach(n)};return addEventListener(`keydown`,t),addEventListener(`keyup`,n),()=>{removeEventListener(`keydown`,t),removeEventListener(`keyup`,n)}},[]);let hn=(0,y.useRef)(h);hn.current=h;let gn=z||Oe?void 0:L,_n=gn?um(gn,e):[],vn=new Map(_n.map(e=>[e.id,e])),yn=[...c.entries()].filter(([e])=>e!==Ke).map(([e,t])=>{let n=e.split(`@`)[0],r=vn.get(n),i=t.practice&&t.test&&!Ee?t.practice.said:t.state;return{key:e,id:n,name:t.name,state:i,rarity:t.rarity,...t.phase===`waiting`?{waiting:!0}:{},...r?{link:r}:{}}}),bn=gn?Ie.filter(e=>e.meta.id!==gn.meta.id):z?Ie:[],xn=bn.slice(0,pb).map(e=>{let t=vn.get(e.meta.id);return{id:e.meta.id,name:e.meta.title,rarity:zp(e,Rp(e,Fe).length).rarity,stopped:Jp(e,Pe)===`waiting`,fresh:Se.isNew(Fp(e)),...t?{link:t}:{}}}),Sn=ee??D??T,Cn=_.kind===`live`?Sn?tt[Sn]:void 0:_.kind===`seen`?Sn?tt[Sn]:`proposal`:_.kind===`reveal`?_.option:void 0,wn=z?`setup:${z.step}:${z.step===`ask`?z.i:``}`:Oe?`mark:${Oe.key}`:Qe?`brief:${Qe.meta.id}`:L?Ke:`empty`;(0,y.useLayoutEffect)(()=>{ye&&xe.current?.scrollTo({top:0})},[wn,ye]),(0,y.useEffect)(()=>{if(!ye||_.kind!==`reveal`&&_.kind!==`write`&&_.kind!==`pass`)return;let e=xe.current,t=e?.querySelector(`.stage article.card:not([data-leaving]) .panel-in`);if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.height<=n.height-24?r.bottom-n.bottom+12:r.top-n.top-12;i>0&&e.scrollBy({top:i,behavior:a?`auto`:`smooth`})},[ye,_.kind,Ke]),(0,y.useEffect)(()=>{if(!ye)return;let e=()=>{let e=document.activeElement;e instanceof HTMLElement&&e.matches(`.stage textarea, .stage input[type="text"]`)&&e.scrollIntoView({block:`nearest`})},t=window.visualViewport;return addEventListener(`resize`,e),t?.addEventListener(`resize`,e),()=>{removeEventListener(`resize`,e),t?.removeEventListener(`resize`,e)}},[ye]);let Tn=ye&&fe===`path`;(0,y.useLayoutEffect)(()=>{if(!ye||!A||Tn)return;let e=document.querySelector(`.sheet-peek`);e&&Ey(A,e),se(void 0)},[A,ye,Tn]),(0,y.useEffect)(()=>{ye||j(e=>e===`path`?void 0:e)},[ye]);let En=e=>j(t=>e?`path`:t===`path`?void 0:t),Dn={trail:yn,current:gn&&et?{id:gn.meta.id,name:gn.meta.title,rarity:et.rarity,stopped:Ye(gn)===`waiting`,conflict:(gn.meta.conflict_of?.length??0)>0}:void 0,relations:_n,upcoming:xn,more:Math.max(0,bn.length-pb),lean:Cn,optionLabel:e=>`${Ph[nt(e)]} ${Hp(L?.meta[e]??``)}`,onGoTo:Vt,layoutKey:`${Ke}:${_.kind}`},On=!z||!Zt?0:z.step===`offer`?Zt.items.length:z.step===`ask`?Zt.items.length-z.i-1:0,kn=z?Array.from({length:Math.min(4,On)},(e,t)=>`survey-${t}`):gn?bn.filter(e=>Mp(e)===Mp(gn)).slice(0,4).map(e=>e.meta.id):[],An=Ie.length+ +!!I,jn=An?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`b`,{children:[An,` to answer.`]}),R>0&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(`span`,{className:`stop-dot`,"aria-hidden":`true`}),mb[R]??R,` `,R===1?`agent has`:`agents have`,` stopped for you.`]})]}):(0,q.jsx)(`b`,{children:`Nothing to answer.`});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`bar`,inert:pe,children:[o.hosted?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`a`,{className:`wordmark`,href:`/`,title:`Your projects`,onClick:At,children:`Baesian`}),(0,q.jsx)(`span`,{className:`place`,title:o.hosted.name?void 0:o.hosted.project,children:o.hosted.name??`Unnamed project`})]}):(0,q.jsx)(`span`,{className:`wordmark`,children:`Baesian`}),(0,q.jsxs)(`p`,{className:`summary`,"aria-live":`polite`,children:[jn,r&&(0,q.jsx)(`span`,{className:`refreshing`,children:` Refreshing…`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`bar-btn branches`,"aria-haspopup":`dialog`,"aria-expanded":pe,"aria-controls":`branches-drawer`,onClick:()=>Yt(`branches`),children:[(0,q.jsxs)(`svg`,{className:`bar-icon`,width:`18`,height:`18`,viewBox:`0 0 18 18`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5`,cy:`3.5`,r:`2`}),(0,q.jsx)(`circle`,{cx:`5`,cy:`14.5`,r:`2`}),(0,q.jsx)(`circle`,{cx:`13`,cy:`5`,r:`2`}),(0,q.jsx)(`path`,{d:`M5 5.5v7M13 7c0 3.5-8 2.5-8 5.5`})]}),(0,q.jsx)(`span`,{className:`bar-lbl`,children:`Branches`}),` `,(0,q.jsx)(`kbd`,{children:`B`})]}),(0,q.jsx)(j_,{open:ue,notify:qt.status,held:Re.length+ze.length,touch:be,site:!!o.hosted,onOpen:de,onPanel:Yt,onNotify:()=>void Jt()})]}),o.hosted&&(0,q.jsx)(bg,{}),fe===`keys`&&(0,q.jsx)(P_,{touch:be,phone:ye,onClose:()=>j(void 0)}),fe===`calibration`&&(0,q.jsx)(F_,{spent:Rg(N),superseded:Xm(e),routing:e.routing,practice:{status:F,entries:we.entries,ready:we.ready,state:e,now:Pe,starting:Ut,onStart:()=>void Gt(),onResult:()=>j(`practice`)},onClose:()=>j(void 0)}),fe===`practice`&&(F.kind===`spotted`||F.kind===`on`)&&(0,q.jsx)($_,{status:F,titleOf:e=>Fe.get(e)?.meta.title,onClose:()=>j(void 0)}),(0,q.jsx)(_y,{state:e,nowMs:Pe,open:pe,phone:ye,touch:be,onClose:()=>j(void 0),onOpenCard:Xt}),fe===`held`&&(0,q.jsx)(I_,{held:Re,gone:ze,mode:e.routing.settings.mode,onOpen:e=>{j(void 0),Vt(e)},onClose:()=>j(void 0)}),fe===`preferences`&&(0,q.jsx)(Xy,{routing:e.routing,cards:km(e.cards),presets:Ze,...ve?{initial:ve}:{},onSaved:e=>ut(e),onSurvey:en,onClose:()=>j(void 0)}),fe===`deck`&&qe&&(0,q.jsx)(V_,{deck:qe,titleOf:e=>Fe.get(e)?.meta.title,onOpen:e=>{j(void 0),Vt(e)},onClose:()=>j(void 0)}),(0,q.jsxs)(`main`,{className:`desk`,ref:xe,inert:Tn||pe,children:[!ye&&(0,q.jsx)(wy,{...Dn,...k?{card:k}:{},...A?{fly:A,onFlown:()=>se(void 0)}:{}}),(0,q.jsxs)(`section`,{className:`stage`,"aria-label":`The card to answer`,children:[n&&(0,q.jsx)(`p`,{className:`desk-notice`,role:`status`,children:n}),Me&&(0,q.jsxs)(`div`,{className:`passkey-wait practice-note`,role:`status`,children:[(0,q.jsx)(`p`,{children:Me}),(0,q.jsx)(`button`,{type:`button`,className:`cancel`,onClick:()=>Ne(void 0),children:`Got it`})]}),d.length>0&&(0,q.jsxs)(`div`,{className:`passkey-wait lapsed`,role:`alert`,children:[(0,q.jsx)(`p`,{children:ov(d)}),(0,q.jsx)(`button`,{type:`button`,className:`cancel`,onClick:()=>f([]),children:`Got it`})]}),pt.length>0&&(0,q.jsxs)(`div`,{className:`passkey-wait`,role:`status`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`key-dot`,"aria-hidden":`true`}),av(pt.length)]}),(0,q.jsx)(`button`,{type:`button`,className:`confirm`,disabled:ht,onClick:()=>void Et(),children:pt.length===1?`Confirm it`:`Confirm them`})]}),(0,q.jsx)(`p`,{className:`crumbs`,children:z?(0,q.jsxs)(q.Fragment,{children:[`setting up › `,(0,q.jsx)(`b`,{children:`Your preferences`})]}):Oe?(0,q.jsxs)(q.Fragment,{children:[`blind test › `,(0,q.jsx)(`b`,{children:`Your guess`})]}):L&&(0,q.jsxs)(q.Fragment,{children:[Mp(L),` ›`,` `,qe&&(qe.body.trim()||qe.notes.length)?(0,q.jsx)(`button`,{type:`button`,className:`crumb-deck`,"aria-expanded":fe===`deck`,"aria-controls":`deck-panel`,title:`The briefing`,onClick:()=>Yt(`deck`),children:(0,q.jsx)(`b`,{children:qe.meta.title})}):(0,q.jsx)(`b`,{children:qe?.meta.title??L.meta.deck})]})}),(0,q.jsxs)(`div`,{className:`deck`,children:[(0,q.jsx)(`div`,{className:`pile`,"aria-hidden":`true`,children:kn.map((e,t)=>{let n=Db(e,t+1);return(0,q.jsx)(`div`,{className:`under`,style:{"--r":`${n.r.toFixed(2)}deg`,"--dx":`${n.dx}px`,"--dy":`${n.dy}px`,zIndex:10-t}},e)})}),(0,q.jsx)(Lu,{custom:le.current,initial:!1,children:z?(0,q.jsx)(Rb,{label:z.step===`offer`?`Setting up your preferences`:z.step===`ask`&&Zt?Zt.items[z.i].question:`The preset your answers suggest`,exit:le.current,touch:be,...z.step===`ask`&&Zt?{onSwipe:e=>tn(e),labels:{left:Sh(Zt.see,`left`),right:Sh(Zt.fine,`right`),down:Ch(`Not sure`)}}:{},children:t=>z.step===`offer`?(0,q.jsx)(tb,{count:Zt?.items.length,onStart:en,onAway:$t}):z.step===`ask`&&Zt?(0,q.jsx)(nb,{survey:Zt,i:z.i,armed:t,touch:be,onAnswer:tn,onSkip:()=>tn(`down`),onBack:nn,onAway:$t}):z.step===`result`&&Ze?(0,q.jsx)(rb,{presets:Ze,answers:z.answers,mode:e.routing.settings.mode,saving:z.saving,problem:z.problem,onUse:()=>void rn(),onAdjust:an,onAway:$t}):(0,q.jsx)(`div`,{className:`face`,children:(0,q.jsx)(`p`,{className:`doing`,children:`Reading the example decisions…`})})},z.step===`ask`?`setup:ask:${z.i}`:`setup:${z.step}`):Oe?(0,q.jsx)(Lb,{name:Oe.card.meta.title,touch:be,saving:!!Oe.saving,problem:Oe.problem,onMark:e=>void Nt(e)},`mark:${Oe.key}`):Qe?(0,q.jsx)(Ib,{deck:Qe,waiting:Ie.filter(e=>e.meta.deck===Qe.meta.id).length,touch:be,titleOf:e=>Fe.get(e)?.meta.title,onOpen:e=>{sn(),Vt(e)},onDone:sn},`brief:${Qe.meta.id}`):L&&et?(0,q.jsx)(Nb,{exit:le.current,touch:be,arriveAfter:A&&A.key!==Ke?hb*.65:0,lean:ee,onMotion:ne,onHandLean:O,nudged:ae,locked:lt>0,rarity:et.rarity,card:{card:Eb(L,Fe),rarity:et.rarity,stakes:Vp(L,$e),wait:Ye(L),sides:tt,mode:_,rules:e.rules,readLeftMs:lt,readFraction:st?1-lt/st:1,...re===void 0?{}:{hold:re},...b?{problem:b}:{},...h&&c.get(h)?{review:Sb(c.get(h),Ee)}:{},...Ge?{past:{words:gv(Ge,Pe).words,chosen:hv(Ge),onBranches:()=>j(`branches`)}}:{},...Ht.length&&!Ge?{near:Ht,onMerge:e=>void H(e)}:{},onReach:Ft,onMode:e=>{x(void 0),v(e)},onConfirm:It,onSwitch:Lt,onBack:zt,onSend:Rt,onChange:Bt,onHover:E,onHoldStart:ln,onHoldEnd:un,touch:be}},Ke):(0,q.jsx)(Mf.div,{className:`empty`,initial:!a&&{opacity:0},animate:{opacity:1},children:(0,q.jsx)(K_,{recap:lh([...c.values()].filter(e=>!e.practice).map(e=>e.answer)),parked:Le,held:Re,notify:qt.status,onNotify:()=>void Jt(),onOpen:Vt,onAllHeld:()=>j(`held`)})},`empty`)})]})]})]}),ye&&(0,q.jsx)(Fy,{open:Tn,answered:yn.length,connected:_n,next:bn.length,lean:Cn,onOpen:En,inert:pe,children:(0,q.jsx)(wy,{...Dn,sheet:!0,onGoTo:e=>{En(!1),Vt(e)},...A?{fly:A,onFlown:()=>se(void 0)}:{}})}),(0,q.jsx)(zb,{toast:S,onUndo:Pt,onDone:()=>C(void 0)})]})}function kb(e,t){return{dir:Math.abs(e)>=Math.abs(t)?e>0?`right`:`left`:t<0?`up`:`down`,progress:Math.max(Math.abs(e)/cb,Math.abs(t)/lb)}}var Ab=110,jb=650;function Mb(e,t,n){let r=e=>([t=0,n=0,r=0])=>r&&Math.abs(n)>Math.abs(t)?0:Math.max(0,Math.min(1,e*t/db));return{pl:Yd([e,t,n],r(-1)),pr:Yd([e,t,n],r(1))}}function Nb(e){let t=Qd(),n=Nu(),r=Kd(0),i=Kd(0),a=Kd(1),o=(e.card.mode.kind===`live`||e.card.mode.kind===`seen`)&&n,s=(0,y.useRef)(null),c=Af(),l=Dh({el:s,x:r,y:i,scale:a,touch:e.touch,dirs:o?gb:yb,onReach:e.card.onReach,reduced:!!t,onMouse:e=>o&&c.start(e)}),{pl:u,pr:d}=Mb(r,i,l.lifted),f=Yd([r,l.lifted],([e=0,t=0])=>e*(t?yh:.06)),[p]=(0,y.useState)(e.arriveAfter),m=(0,y.useMemo)(()=>({x:r,y:i,rotate:f}),[r,i,f]),{onMotion:h,onHandLean:g}=e;(0,y.useLayoutEffect)(()=>{if(n)return h(m),()=>h(void 0,m)},[n,m,h]);let _=(0,y.useRef)(n);_.current=n;let v=(0,y.useRef)(!1);v.current=!!l.lift;let b=(0,y.useRef)(void 0),x=(0,y.useCallback)(e=>{b.current!==e&&(b.current=e,g(e))},[g]);(0,y.useEffect)(()=>{let e=r.on(`change`,e=>{v.current||x(_.current?e<=-8?`left`:e>=fb?`right`:void 0:void 0)});return()=>{e(),x(void 0)}},[r,x]);let S=!!l.lift,C=l.lift?.dir;(0,y.useEffect)(()=>{S&&x(C===`left`||C===`right`?C:void 0)},[S,C,x]),(0,y.useEffect)(()=>{let n=o&&e.lean?(e.lean===`left`?-1:1)*(e.locked?.25:.7)*db:0,i=Df(r,n,t?{duration:0}:{type:`spring`,stiffness:520,damping:34});return()=>i.stop()},[e.lean,e.locked,o,t,r]);let[ee,w]=(0,y.useState)(),T=(e,t)=>{let n=kb(e,t);w(n.progress>=1?n.dir:void 0)},E=(0,y.useRef)({live:o,reduced:t,onReach:e.card.onReach,arm:T});E.current={live:o,reduced:t,onReach:e.card.onReach,arm:T},(0,y.useEffect)(()=>{let e=s.current;if(!e)return;let t={x:0,y:0},n=0,a=0,o=o=>{if(o.ctrlKey)return;let s=e.closest(`.desk`);Math.abs(o.deltaY)>Math.abs(o.deltaX)&&s&&s.scrollHeight>s.clientHeight||(o.preventDefault(),!(!E.current.live||performance.now()<a)&&(t={x:t.x-o.deltaX,y:t.y-o.deltaY},E.current.arm(t.x,t.y),r.set(Math.max(-24,Math.min(db,t.x*ub))),i.set(Math.max(-24,Math.min(db,t.y*ub))),clearTimeout(n),n=window.setTimeout(()=>{a=performance.now()+jb;let e=kb(t.x,t.y);t={x:0,y:0},E.current.arm(0,0);let n=E.current.reduced?{duration:0}:{type:`spring`,stiffness:520,damping:34};Df(r,0,n),Df(i,0,n),e.progress>=1&&E.current.onReach(e.dir)},Ab)))};return e.addEventListener(`wheel`,o,{passive:!1}),()=>{e.removeEventListener(`wheel`,o),clearTimeout(n)}},[r,i]);let D=(0,y.useRef)(!0);(0,y.useEffect)(()=>{D.current?D.current=!1:t||Df(r,[0,-6,6,0],{duration:.32})},[e.nudged,t,r]);let O=e=>({x:e===`left`?-130:e===`right`?130:0,y:e===`up`?-40:e===`down`?40:0,opacity:0,transition:{duration:t?0:.22,ease:`easeIn`}}),k=l.lift?l.lift.armed?l.lift.dir:void 0:ee,te=e.card.card.meta,ne=t=>e.locked?{...Sh(te[e.card.sides[t]],t),hint:`Read it first`,letGo:`Read it first`}:Sh(te[e.card.sides[t]],t),re={left:ne(`left`),right:ne(`right`),up:Ch(`Other answer`),down:Ch(`Can't judge`)};return(0,q.jsxs)(Mf.article,{ref:s,tabIndex:-1,className:`card rarity-${e.rarity}`,"data-mode":e.card.mode.kind,"data-locked":e.locked||void 0,"data-leaving":!n||void 0,"data-lift":l.attr,inert:!n,"aria-label":e.card.card.meta.question,style:{x:r,y:i,scale:a,rotate:f,"--pl":u,"--pr":d,pointerEvents:n?void 0:`none`},initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:t?0:.24,delay:t?0:p/1e3}},exit:O(e.exit),drag:o,dragListener:!e.touch,dragControls:c,dragSnapToOrigin:!0,dragElastic:ub,dragConstraints:{left:0,right:0,top:0,bottom:0},onDrag:(e,t)=>T(t.offset.x,t.offset.y),onDragEnd:(t,n)=>{T(0,0);let{dir:r,progress:i}=kb(n.offset.x,n.offset.y),a=Math.abs(r===`left`||r===`right`?n.velocity.x:n.velocity.y);(i>=1||a>900&&i>.3)&&e.card.onReach(r)},...l.handlers,children:[(0,q.jsx)(`div`,{className:`frame`,"aria-hidden":`true`}),(0,q.jsx)(Ih,{...e.card,...k&&o?{armed:k}:{}}),l.lift&&(0,q.jsx)(Oh,{labels:re,lift:l.lift,progress:l.progress})]})}var Pb={name:`Go to its cards`,tone:`ink`,hint:`Go on`,letGo:`Let go to go on`},Fb={left:Pb,right:Pb};function Ib(e){let t=Qd(),n=Nu(),r=Kd(0),i=Kd(0),a=Kd(1),o=(0,y.useRef)(null),s=Af(),c=Dh({el:o,x:r,y:i,scale:a,touch:e.touch,dirs:n?vb:yb,onReach:()=>e.onDone(),reduced:!!t,onMouse:e=>n&&s.start(e)}),l=Yd([r,c.lifted],([e=0,t=0])=>e*(t?yh:.06)),u=(0,y.useRef)(e.onDone);u.current=e.onDone,(0,y.useEffect)(()=>{let e=o.current;if(!e)return;let n=0,i=0,a=e=>{e.ctrlKey||Math.abs(e.deltaX)<=Math.abs(e.deltaY)||(e.preventDefault(),n-=e.deltaX,r.set(Math.max(-24,Math.min(db,n*ub))),clearTimeout(i),i=window.setTimeout(()=>{let e=Math.abs(n)>=cb;n=0,Df(r,0,t?{duration:0}:{type:`spring`,stiffness:520,damping:34}),e&&u.current()},Ab))};return e.addEventListener(`wheel`,a,{passive:!1}),()=>{e.removeEventListener(`wheel`,a),clearTimeout(i)}},[r,t]);let d=`${e.waiting} ${e.waiting===1?`card`:`cards`}`;return(0,q.jsxs)(Mf.article,{ref:o,tabIndex:-1,className:`card briefing-card`,"data-leaving":!n||void 0,"data-lift":c.attr,inert:!n,"aria-label":`The briefing for ${e.deck.meta.title}`,style:{x:r,y:i,scale:a,rotate:l,pointerEvents:n?void 0:`none`},initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:t?0:.24}},exit:{opacity:0,y:-16,transition:{duration:t?0:.2,ease:`easeIn`}},drag:n?`x`:!1,dragListener:!e.touch,dragControls:s,dragSnapToOrigin:!0,dragElastic:ub,dragConstraints:{left:0,right:0},onDragEnd:(t,n)=>{(Math.abs(n.offset.x)>=cb||Math.abs(n.velocity.x)>900&&Math.abs(n.offset.x)>cb*.3)&&e.onDone()},...c.handlers,children:[(0,q.jsx)(`div`,{className:`frame`,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`face`,children:[(0,q.jsxs)(`p`,{className:`doing`,children:[(0,q.jsx)(`b`,{children:d}),` in this work `,e.waiting===1?`is`:`are`,` waiting for you.`]}),(0,q.jsx)(`h1`,{children:e.deck.meta.title}),(0,q.jsx)(H_,{deck:e.deck,titleOf:e.titleOf,onOpen:e.onOpen}),(0,q.jsxs)(`div`,{className:`briefing-foot`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`confirm`,onClick:e.onDone,children:[`Go to its cards `,(0,q.jsx)(`kbd`,{children:`→`})]}),(0,q.jsx)(`p`,{className:`small`,children:`Shown once. The deck's name above each card opens it again.`})]})]}),c.lift&&(0,q.jsx)(Oh,{labels:Fb,lift:c.lift,progress:c.progress})]})}function Lb(e){let t=Qd(),n=Nu();return(0,q.jsxs)(Mf.article,{tabIndex:-1,className:`card mark-card`,"data-leaving":!n||void 0,inert:!n,"aria-label":`Blind test: was that card rebuilt from a past one?`,style:{pointerEvents:n?void 0:`none`},initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:t?0:.24}},exit:{opacity:0,y:-16,transition:{duration:t?0:.2,ease:`easeIn`}},children:[(0,q.jsx)(`div`,{className:`frame`,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`face`,children:[(0,q.jsxs)(`p`,{className:`doing`,children:[(0,q.jsx)(`b`,{children:`Blind test`}),`: your answer is on its way.`]}),(0,q.jsx)(`h1`,{children:`Was that card rebuilt from a past one?`}),(0,q.jsxs)(`p`,{className:`mark-which`,children:[`“`,e.name,`”, the card you just answered.`]}),(0,q.jsx)(`div`,{className:`mark-ways`,role:`group`,"aria-label":`Your guess`,children:a_.map(t=>(0,q.jsxs)(`button`,{type:`button`,className:`mark-way`,disabled:e.saving,onClick:()=>e.onMark(t.mark),children:[t.label,!e.touch&&(0,q.jsx)(`kbd`,{children:t.key})]},t.mark))}),e.problem&&(0,q.jsx)(`p`,{className:`problem`,role:`alert`,children:e.problem}),(0,q.jsx)(`p`,{className:`small`,children:`A rebuilt card shows the option its agent didn't pick as the pick. You'll see which were when the test ends, once ten rebuilt cards have come.`})]})]})}function Rb(e){let t=Qd(),n=Nu(),r=Kd(0),i=Kd(0),a=Kd(1),[o,s]=(0,y.useState)(),c=(0,y.useRef)(null),l=(0,y.useRef)(e.onSwipe);l.current=n?e.onSwipe:void 0;let u=e=>e!==`up`&&l.current?.(e),d=n&&!!e.onSwipe,f=Af(),p=Dh({el:c,x:r,y:i,scale:a,touch:e.touch,dirs:d?_b:yb,onReach:u,reduced:!!t,onMouse:e=>d&&f.start(e)}),{pl:m,pr:h}=Mb(r,i,p.lifted),g=Yd([r,p.lifted],([e=0,t=0])=>e*(t?yh:.06));(0,y.useEffect)(()=>{let e=c.current;if(!e)return;let n=0,i=0,a=e=>{!l.current||e.ctrlKey||Math.abs(e.deltaX)<=Math.abs(e.deltaY)||(e.preventDefault(),n-=e.deltaX,r.set(Math.max(-24,Math.min(db,n*ub))),s(Math.abs(n)>=cb?n>0?`right`:`left`:void 0),clearTimeout(i),i=window.setTimeout(()=>{let e=Math.abs(n)>=cb,i=n>0?`right`:`left`;n=0,s(void 0),Df(r,0,t?{duration:0}:{type:`spring`,stiffness:520,damping:34}),e&&l.current?.(i)},Ab))};return e.addEventListener(`wheel`,a,{passive:!1}),()=>{e.removeEventListener(`wheel`,a),clearTimeout(i)}},[r,t]);let _=e=>({x:e===`left`?-130:e===`right`?130:0,y:e===`up`?-40:e===`down`?40:0,opacity:0,transition:{duration:t?0:.22,ease:`easeIn`}}),v=p.lift?p.lift.armed?p.lift.dir:void 0:o;return(0,q.jsxs)(Mf.article,{ref:c,tabIndex:-1,className:`card setup-card`,"data-leaving":!n||void 0,"data-lift":p.attr,inert:!n,"aria-label":e.label,style:{x:r,y:i,scale:a,rotate:g,"--pl":m,"--pr":h,pointerEvents:n?void 0:`none`},initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:t?0:.24}},exit:_(e.exit),drag:d,dragListener:!e.touch,dragControls:f,dragSnapToOrigin:!0,dragElastic:ub,dragConstraints:{left:0,right:0,top:0,bottom:0},onDrag:(e,t)=>{let n=kb(t.offset.x,t.offset.y);s(n.progress>=1&&n.dir!==`up`?n.dir:void 0)},onDragEnd:(e,t)=>{s(void 0);let{dir:n,progress:r}=kb(t.offset.x,t.offset.y),i=Math.abs(n===`left`||n===`right`?t.velocity.x:t.velocity.y);(r>=1||i>900&&r>.3)&&u(n)},...p.handlers,children:[(0,q.jsx)(`div`,{className:`frame`,"aria-hidden":`true`}),e.children(v),p.lift&&e.labels&&(0,q.jsx)(Oh,{labels:e.labels,lift:p.lift,progress:p.progress})]})}function zb({toast:e,onUndo:t,onDone:n}){let[,r]=(0,y.useState)(0),i=Qd(),a=(0,y.useRef)(null);if((0,y.useEffect)(()=>{if(!e?.undoUntil||i||!a.current)return;let t=a.current.animate([{transform:`scaleX(1)`},{transform:`scaleX(0)`}],{duration:Math.max(0,e.undoUntil-Date.now()),easing:`linear`,fill:`forwards`});return()=>t.cancel()},[e,i]),(0,y.useEffect)(()=>{if(!e)return;let t=setInterval(()=>r(e=>e+1),250),i=setTimeout(n,e.undoUntil?Math.max(0,e.undoUntil-Date.now())+200:2400);return()=>{clearInterval(t),clearTimeout(i)}},[e]),!e)return null;let o=e.undoUntil?Math.max(1,Math.ceil((e.undoUntil-Date.now())/1e3)):0;return(0,q.jsxs)(`div`,{className:`toast on`,role:`status`,children:[(0,q.jsxs)(`span`,{children:[e.text,e.undoUntil?(0,q.jsxs)(q.Fragment,{children:[` `,o,`\xA0s.`]}):null]}),e.undoUntil&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`undo`,onClick:t,children:[`Undo `,(0,q.jsx)(`kbd`,{children:`Z`})]}),(0,q.jsx)(`i`,{className:`timer`,ref:a,"aria-hidden":`true`})]})]})}function Bb(){let e=kg();return e.kind===`loading`?(0,q.jsx)(Vb,{summary:``}):e.kind===`signed-out`?(0,q.jsx)(Vb,{summary:``,children:(0,q.jsxs)(`p`,{className:`notice`,children:[`Open the address `,(0,q.jsx)(`code`,{children:`baesian serve`}),` printed. It signs this browser in.`]})}):e.kind===`not-yours`?(0,q.jsx)(Vb,{summary:``,children:(0,q.jsx)(`p`,{className:`notice`,children:e.message})}):e.kind===`error`?(0,q.jsx)(Vb,{summary:``,children:(0,q.jsxs)(`p`,{className:`notice`,children:[`Couldn't reach the server: `,e.message,`. Is `,(0,q.jsx)(`code`,{children:`baesian serve`}),` still running?`]})}):(0,q.jsx)(Ob,{state:e.state,fetchedAt:e.fetchedAt})}function Vb({summary:e,children:t}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`bar`,children:[(0,q.jsx)(`span`,{className:`wordmark`,children:`Baesian`}),(0,q.jsx)(`p`,{className:`summary`,"aria-live":`polite`,children:e})]}),(0,q.jsx)(`main`,{className:`desk`,children:t})]})}(0,jf.createRoot)(document.getElementById(`root`)).render((0,q.jsx)(y.StrictMode,{children:(0,q.jsx)(Bb,{})}));