grok-studio 0.1.0
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.
- package/README.md +117 -0
- package/dist/client/assets/index-CxpDl-6Y.css +1 -0
- package/dist/client/assets/index-aP61AD4r.js +15 -0
- package/dist/client/index.html +13 -0
- package/dist/server/cli.js +1949 -0
- package/package.json +71 -0
|
@@ -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),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,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}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 A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 M(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,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(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(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(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 te(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=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)},P={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(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=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,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.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=g({},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:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};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(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},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.2.7`})),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,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=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&&E());){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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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`):w=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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function F(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function I(e,t){ae++,ie[ae]=e.current,e.current=t}var se=oe(null),ce=oe(null),le=oe(null),ue=oe(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zd(t),e=Qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(se),I(se,e)}function fe(){F(se),F(ce),F(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Qd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(F(se),F(ce)),ue.current===e&&(F(ue),sp._currentValue=re)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!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}e.call(n.prototype)}}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{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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&261888;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 L(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(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 Ye(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(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&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(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 et(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 tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Cp(e.type)):e}function at(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bf(e);e!==null;){if(n=e[st])return n;e=bf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$`),Et={},Dt={};function Ot(e){return Se.call(Dt,e)?!0:Se.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(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 At(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 jt(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 Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(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 Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(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=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(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=``+Mt(s):e.removeAttribute(`name`)}function Vt(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)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(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),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(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=``+Mt(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 Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(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||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(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 Zt=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`],[`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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(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="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(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&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(Ou(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||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 un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.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 hn=i.slice(e,1<r?1-r:void 0)}function _n(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 vn(){return!0}function yn(){return!1}function bn(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)?vn:yn,this.isPropagationStopped=yn,this}return h(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=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=h({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=h({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,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!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(h({},On,{dataTransfer:0})),jn=bn(h({},Cn,{relatedTarget:0})),Mn=bn(h({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(h({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(h({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(h({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(h({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(h({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(h({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(h({},On,{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})),Gn=bn(h({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!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 Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Fd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){Od(e,0)}function ur(e){if(It(vt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(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(!Se.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(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=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(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=Lt(e.document)}return t}function kr(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 Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,R=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||jr==null||jr!==Lt(r)||(r=jr,`selectionStart`in r&&kr(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}),R&&wr(R,r)||(R=r,r=Fd(Mr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};un&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),Ct(t,[e])}var Xr=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)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[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&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(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 ai(e){if(50<yu)throw yu=0,bu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(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&65011712,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 di(e,t){e.flags&=65011714;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 fi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=Qf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ci(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return pi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ci(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ci(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function mi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function hi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function gi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=new WeakMap;function vi(e,t){if(typeof e==`object`&&e){var n=_i.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},_i.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var yi=[],bi=0,xi=null,Si=0,Ci=[],wi=0,Ti=null,Ei=1,Di=``;function Oi(e,t){yi[bi++]=Si,yi[bi++]=xi,xi=e,Si=t}function ki(e,t,n){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ti=e;var r=Ei;e=Di;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,Ei=1<<32-ze(t)+i|n<<i|r,Di=a+e}else Ei=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null;for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Di=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null}function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ei=t.id,Di=t.overflow,Ti=e}var Ni=null,Pi=null,Fi=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Gi(vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:U(`cancel`,t),U(`close`,t);break;case`iframe`:case`object`:case`embed`:U(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)U(Ed[n],t);break;case`source`:U(`error`,t);break;case`img`:case`image`:case`link`:U(`error`,t),U(`load`,t);break;case`details`:U(`toggle`,t);break;case`input`:U(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:U(`invalid`,t);break;case`textarea`:U(`invalid`,t),Gt(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||Vd(t.textContent,n)?(r.popover!=null&&(U(`beforetoggle`,t),U(`toggle`,t)),r.onScroll!=null&&U(`scroll`,t),r.onScrollEnd!=null&&U(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Ni=Ni.return}}function Hi(e){if(e!==Ni)return!1;if(!Fi)return Vi(e),Fi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||$d(e.type,e.memoizedProps)),n=!n),n&&Pi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=yf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=yf(e)}else t===27?(t=Pi,cf(e.type)?(e=vf,vf=null,Pi=e):Pi=t):Pi=Ni?_f(e.stateNode.nextSibling):null;return!0}function Ui(){Pi=Ni=null,Fi=!1}function Wi(){var e=Ii;return e!==null&&(au===null?au=e:au.push.apply(au,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=oe(null),qi=null,Ji=null;function Yi(e,t,n){I(Ki,t._currentValue),t._currentValue=n}function Xi(e){e._currentValue=Ki.current,F(Ki)}function Zi(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 Qi(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),Zi(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),Zi(s,n,e),s=null}else 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 $i(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;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sp]:e.push(sp))}a=a.return}e!==null&&Qi(t,e,n,r),t.flags|=262144}function ea(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ta(e){qi=e,Ji=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function na(e){return ia(qi,e)}function ra(e,t){return qi===null&&ta(e),ia(e,t)}function ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ji===null){if(e===null)throw Error(i(308));Ji=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ji=Ji.next=t;return n}var aa=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()})}},oa=t.unstable_scheduleCallback,sa=t.unstable_NormalPriority,ca={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new aa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&oa(sa,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=bd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(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=N.S;N.S=function(e,t){cu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=oe(null);function ba(){var e=ya.current;return e===null?Gl.pooledCache:e}function xa(e,t){t===null?I(ya,ya.current):I(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Ca=Error(i(460)),wa=Error(i(474)),Ta=Error(i(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Gl,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,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(i(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(i(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(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=ui(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=mi(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&ka(i)===t.type)?(t=a(t,n.props),Ia(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Ia(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=gi(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=mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=fi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case v:return t=gi(t,e.mode,n),t.return=e,t;case O:return t=ka(t),f(e,t,n)}if(ne(t)||ee(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===C)return f(e,ra(e,t),n);La(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=ka(n),p(e,t,n,r)}if(ne(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===C)return p(e,t,ra(e,n),r);La(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=ka(r),m(e,t,n,r,i)}if(ne(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Fa(r),i);if(r.$$typeof===C)return m(e,t,n,ra(t,r),i);La(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),Fi&&Oi(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 Fi&&Oi(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(g.key===null?h:g.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)}),Fi&&Oi(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),Fi&&Oi(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 Fi&&Oi(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(v.key===null?g:v.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)}),Fi&&Oi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ka(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,ra(e,o),c);La(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=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(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 Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ka(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,et(e,n)}}function qa(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!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?(H&f)===f:(r&f)===f){f!==0&&f===pa&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Va=!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),$l|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=oe(null),eo=oe(0);function to(e,t){e=Zl,I(eo,e),I($a,t),Zl=e|t.baseLanes}function no(){I(eo,Zl),I($a,$a.current)}function ro(){Zl=eo.current,F($a),F(eo)}var io=oe(null),ao=null;function oo(e){var t=e.alternate;I(fo,fo.current&1),I(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){I(fo,fo.current),I(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(I(fo,fo.current),I(io,e),ao===null&&(ao=e)):lo(e)}function lo(){I(fo,fo.current),I(io,io.current)}function uo(e){F(io),ao===e&&(ao=null),F(fo)}var fo=oe(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hf(n)||W(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 mo=0,z=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(i(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return mo=a,z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Us:Ws,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){N.H=Hs;var t=ho!==null&&ho.next!==null;if(mo=0,go=ho=z=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||sc||(e=e.dependencies,e!==null&&ea(e)&&(sc=!0))}function Oo(e,t,n,r){z=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Gs,o=t(n,r)}while(vo);return o}function ko(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(z.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}mo=0,go=ho=z=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?z.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=z.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?z.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw z.alternate===null?Error(i(467)):Error(i(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?z.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Oa(So,e,t),t=z,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Us:Ws),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return na(e)}throw Error(i(438,String(e)))}function Ro(e){var t=null,n=z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=z.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=Fo(),z.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]=A;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(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?(mo&f)===f:(H&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===pa&&(d=!0);else if((mo&p)===p){u=u.next,p===pa&&(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,z.lanes|=p,$l|=p;f=u.action,yo&&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,z.lanes|=f,$l|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(sc=!0,d&&(n=ma,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 Ho(e){var t=Po(),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);Cr(o,t.memoizedState)||(sc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=z,a=Po(),o=Fi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((ho||a).memoizedState,n);if(s&&(a.memoizedState=n,sc=!0),a=a.queue,ms(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||mo&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=z.updateQueue,t===null?(t=Fo(),z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Jo(e){var t=ri(e,2);t!==null&&Cu(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,a){if(zs(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)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(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,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(Fi){var n=Gl.formState;if(n!==null){a:{var r=z;if(Fi){if(Pi){b:{for(var i=Pi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=_f(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=_f(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Is.bind(null,z,r),r.dispatch=n,r=Yo(!1),a=Rs.bind(null,z,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return os(Po(),ho,e)}function os(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(z.flags|=2048,ls(9,{destroy:void 0},ss.bind(null,i,n),null)),[r,a,e]}function ss(e,t){e.action=t}function cs(e){var t=Po(),n=ho;if(n!==null)return os(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=z.updateQueue,t===null&&(t=Fo(),z.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 us(){return Po().memoizedState}function ds(e,t,n,r){var i=No();z.flags|=e,i.memoizedState=ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function fs(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=ls(t,a,n,r):(z.flags|=e,i.memoizedState=ls(1|t,a,n,r))}function ps(e,t){ds(8390656,8,e,t)}function ms(e,t){fs(2048,8,e,t)}function hs(e){z.flags|=4;var t=z.updateQueue;if(t===null)t=Fo(),z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gs(e){var t=Po().memoizedState;return hs({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function _s(e,t){return fs(4,2,e,t)}function vs(e,t){return fs(4,4,e,t)}function ys(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 bs(e,t,n){n=n==null?null:n.concat([e]),fs(4,4,ys.bind(null,t,e),n)}function xs(){}function Ss(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function ws(e,t,n){return n===void 0||mo&1073741824&&!(H&261930)?e.memoizedState=t:(e.memoizedState=n,e=Su(),z.lanes|=e,$l|=e,n)}function Ts(e,t,n,r){return Cr(n,t)?n:$a.current===null?!(mo&42)||mo&1073741824&&!(H&261930)?(sc=!0,e.memoizedState=n):(e=Su(),z.lanes|=e,$l|=e,t):(e=ws(e,n,r),Cr(e,t)||(sc=!0),e)}function Es(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Rs(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ls(e,t,_a(c,r),xu(e)):Ls(e,t,r,xu(e))}catch(n){Ls(e,t,{then:function(){},status:`rejected`,reason:n},xu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Ds(){}function Os(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ks(e).queue;Es(e,a,t,re,n===null?Ds:function(){return As(e),n(r)})}function ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function As(e){var t=ks(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},xu())}function js(){return na(sp)}function Ms(){return Po().memoizedState}function Ns(){return Po().memoizedState}function Ps(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Cu(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Fs(e,t,n){var r=xu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Bs(t,n):(n=ni(e,t,n,r),n!==null&&(Cu(n,e,r),Vs(n,t,r)))}function Is(e,t,n){Ls(e,t,n,xu())}function Ls(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Bs(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,Cr(s,o))return ti(e,t,i,0),Gl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Cu(n,e,r),Vs(n,t,r),!0}return!1}function Rs(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Cu(t,e,2)}function zs(e){var t=e.alternate;return e===z||t!==null&&t===z}function Bs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Hs={readContext:na,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Hs.useEffectEvent=wo;var Us={readContext:na,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:na,useEffect:ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ds(4194308,4,ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){ds(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){Re(!0);try{n(t)}finally{Re(!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=Fs.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Is.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return ws(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Es.bind(null,z,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,a=No();if(Fi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));H&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ps(Ko.bind(null,r,o,e),[e]),r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Gl.identifierPrefix;if(Fi){var n=Di,r=Ei;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:js,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rs.bind(null,z,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ps.bind(null,z)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ws={readContext:na,use:Lo,useCallback:Ss,useContext:na,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Bo,useRef:us,useState:function(){return Bo(zo)},useDebugValue:xs,useDeferredValue:function(e,t){return Ts(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Ws.useEffectEvent=gs;var Gs={readContext:na,use:Lo,useCallback:Ss,useContext:na,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Ho,useRef:us,useState:function(){return Ho(zo)},useDebugValue:xs,useDeferredValue:function(e,t){var n=Po();return ho===null?ws(n,e,t):Ts(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Gs.useEffectEvent=gs;function Ks(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Cu(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Cu(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(Cu(t,e,n),Ka(t,e,n))}};function Js(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?!wr(n,r)||!wr(i,a):!0}function Ys(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&&qs.enqueueReplaceState(t,t.state,null)}function Xs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Zs(e){Xr(e)}function Qs(e){console.error(e)}function $s(e){Xr(e)}function ec(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 nc(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){ec(e,t)},n}function rc(e){return e=Wa(e),e.tag=3,e}function ic(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`&&(du===null?du=new Set([this]):du.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&$i(t,n,a,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?Fu():n.alternate===null&&Ql===0&&(Ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ed(e,r,a)),!1;case 22:return n.flags|=65536,r===Ea?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)),ed(e,r,a)),!1}throw Error(i(435,n.tag))}return ed(e,r,a),Fu(),!1}if(Fi)return t=io.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Gi(vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=vi(r,n),a=nc(e.stateNode,r,a),qa(e,a),Ql!==4&&(Ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Gi(vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=vi(o,n),iu===null?iu=[o]:iu.push(o),Ql!==4&&(Ql=2),t===null)return!0;r=vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=nc(n.stateNode,r,e),qa(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`&&(du===null||!du.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=rc(a),ic(a,e,n,r),qa(n,a),!1}n=n.return}while(n!==null);return!1}var oc=Error(i(461)),sc=!1;function cc(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function lc(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 ta(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(Fi&&s&&Ai(t),t.flags|=1,cc(e,t,r,i),t.child)}function uc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,dc(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Pc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Nc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function dc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(sc=!1,t.pendingProps=r=a,Pc(e,i))e.flags&131072&&(sc=!0);else return t.lanes=e.lanes,Nc(e,t,i)}return yc(e,t,n,r,i)}function fc(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 mc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,mc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),no(),lo(t)):(xa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return cc(e,t,i,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),no(),co(t),e!==null&&$i(e,t,r,!0),t.childLanes=i,null}function hc(e,t){return t=Oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gc(e,t,n){return za(t,e.child,null,n),e=hc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function _c(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Fi){if(r.mode===`hidden`)return e=hc(t,r),t.lanes=536870912,pc(null,e);if(so(t),(e=Pi)?(e=mf(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),a)if(t.flags&256)t.flags&=-257,t=gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(sc||$i(e,t,n,!1),a=(n&e.childLanes)!==0,sc||a){if(r=Gl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Cu(r,e,s),oc;Fu(),t=gc(e,t,n)}else e=o.treeContext,Pi=_f(s.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=hc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vc(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 yc(e,t,n,r,i){return ta(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(Fi&&r&&Ai(t),t.flags|=1,cc(e,t,n,i),t.child)}function bc(e,t,n,r,i,a){return ta(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!sc?(jo(e,t,a),Nc(e,t,a)):(Fi&&r&&Ai(t),t.flags|=1,cc(e,t,n,a),t.child)}function xc(e,t,n,r,i){if(ta(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=na(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?na(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ks(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&&qs.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),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=Xs(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=na(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)&&Ys(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(Ks(t,n,d,r),l=t.memoizedState),(c=Va||Js(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,Ua(e,t),o=t.memoizedProps,u=Xs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=na(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)&&Ys(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ea(e.dependencies)?(typeof s==`function`&&(Ks(t,n,s,r),p=t.memoizedState),(u=Va||Js(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ea(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,vc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):cc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Nc(e,t,i),e}function Sc(e,t,n,r){return Ui(),t.flags|=256,cc(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wc(e){return{baseLanes:e,cachePool:Sa()}}function Tc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=nu),e}function Ec(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(fo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Fi){if(a?oo(t):lo(t),(e=Pi)?(e=mf(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return W(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(lo(t),a=t.mode,c=Oc({mode:`hidden`,children:c},a),r=pi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(null,r)):(oo(t),Dc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,a=t.mode,r=Oc({mode:`visible`,children:r.children},a),c=pi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,t=pc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),W(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=kc(e,t,n)}else if(sc||$i(e,t,n,!1),s=(n&e.childLanes)!==0,sc||s){if(s=Gl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Cu(s,e,r),oc;hf(c)||Fu(),t=kc(e,t,n)}else hf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=_f(c.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=Dc(t,r.children),t.flags|=4096);return t}return a?(lo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,pc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=wc(n):(a=c.cachePool,a===null?a=Sa():(l=ca._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Dc(e,t){return t=Oc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Oc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return za(t,e.child,null,n),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zi(e.return,t,n)}function jc(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 Mc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(fo,o),cc(e,t,r,n),r=Fi?Si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ac(e,n,t);else if(e.tag===19)Ac(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jc(t,!0,n,null,a,r);break;case`together`:jc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($i(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=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ea(e))):!0}function Fc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Yi(t,ca,e.memoizedState.cache),Ui();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Nc(e,t,n),e===null?null:e.sibling):Ec(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=($i(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Mc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(fo,fo.current),r)break;return null;case 22:return t.lanes=0,fc(e,t,n,t.pendingProps);case 24:Yi(t,ca,e.memoizedState.cache)}return Nc(e,t,n)}function Ic(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)sc=!0;else{if(!Pc(e,n)&&!(t.flags&128))return sc=!1,Fc(e,t,n);sc=!!(e.flags&131072)}else sc=!1,Fi&&t.flags&1048576&&ki(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Xs(e,r),t.tag=1,t=xc(null,t,e,r,n)):(t.tag=0,t=yc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=lc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=uc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Xs(r,t.pendingProps),xc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Yi(t,ca,r),r!==o.cache&&Qi(t,[ca],n,!0),Ya(),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=Sc(e,t,r,n);break a}else if(r!==a){a=vi(Error(i(424)),t),Gi(a),t=Sc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=_f(e.firstChild),Ni=t,Fi=!0,Ii=null,Li=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===a){t=Nc(e,t,n);break a}cc(e,t,r,n)}t=t.child}return t;case 26:return vc(e,t),e===null?(n=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fi||(n=t.type,e=t.pendingProps,r=Xd(le.current).createElement(n),r[st]=t,r[ct]=e,Wd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Fi&&(r=t.stateNode=xf(t.type,t.pendingProps,le.current),Ni=t,Li=!0,a=Pi,cf(t.type)?(vf=a,Pi=_f(r.firstChild)):Pi=a),cc(e,t,t.pendingProps.children,n),vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fi&&((a=r=Pi)&&(r=ff(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=_f(r.firstChild),Li=!1,a=!0)),a||zi(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,$d(a,o)?r=null:s!==null&&$d(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Eo(e,t,ko,null,null,n),sp._currentValue=a),vc(e,t),cc(e,t,r,n),t.child;case 6:return e===null&&Fi&&((e=n=Pi)&&(n=pf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||zi(t)),null;case 13:return Ec(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):cc(e,t,r,n),t.child;case 11:return lc(e,t,t.type,t.pendingProps,n);case 7:return cc(e,t,t.pendingProps,n),t.child;case 8:return cc(e,t,t.pendingProps.children,n),t.child;case 12:return cc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Yi(t,t.type,r.value),cc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ta(t),a=na(a),r=r(a),t.flags|=1,cc(e,t,r,n),t.child;case 14:return uc(e,t,t.type,t.pendingProps,n);case 15:return dc(e,t,t.type,t.pendingProps,n);case 19:return Mc(e,t,n);case 31:return _c(e,t,n);case 22:return fc(e,t,n,t.pendingProps);case 24:return ta(t),r=na(ca),e===null?(a=ba(),a===null&&(a=Gl,o=la(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ha(t),Yi(t,ca,a)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Yi(t,ca,r),r!==a.cache&&Qi(t,[ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Yi(t,ca,r))),cc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Lc(e){e.flags|=4}function Rc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Mu())e.flags|=8192;else throw Aa=Ea,wa}else e.flags&=-16777217}function zc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$f(t))if(Mu())e.flags|=8192;else throw Aa=Ea,wa}function Bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,ru|=t)}function Vc(e,t){if(!Fi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Hc(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&65011712,r|=i.flags&65011712,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 Uc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hc(t),null;case 1:return Hc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xi(ca),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Lc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),Hc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Lc(t),o===null?(Hc(t),Rc(t,a,null,r,n)):(Hc(t),zc(t,o))):o?o===e.memoizedState?(Hc(t),t.flags&=-16777217):(Lc(t),Hc(t),zc(t,o)):(e=e.memoizedProps,e!==r&&Lc(t),Hc(t),Rc(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}e=se.current,Hi(t)?Bi(t,e):(e=xf(a,r,n),t.stateNode=e,Lc(t))}return Hc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}if(o=se.current,Hi(t))Bi(t,o);else{var s=Xd(le.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[st]=t,o[ct]=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(Wd(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&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Vd(e.nodeValue,n)),e||zi(t,!0)}else e=Xd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(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[st]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(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[st]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(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),Bc(t,t.updateQueue),Hc(t),null);case 4:return fe(),e===null&&jd(t.stateNode.containerInfo),Hc(t),null;case 10:return Xi(t.type),Hc(t),null;case 19:if(F(fo),r=t.memoizedState,r===null)return Hc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Vc(r,!1);else{if(Ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return I(fo,fo.current&1|2),Fi&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>lu&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}else{if(!a)if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return Hc(t),null}else 2*De()-r.renderingStartTime>lu&&n!==536870912&&(t.flags|=128,a=!0,Vc(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)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=fo.current,I(fo,a?n&1|2:n&1),Fi&&Oi(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(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&&F(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(ca),Hc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Wc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(ca),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(fo),null;case 4:return fe(),null;case 10:return Xi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&F(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(ca),null;case 25:return null;default:return null}}function Gc(e,t){switch(ji(t),t.tag){case 3:Xi(ca),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:F(fo);break;case 10:Xi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&F(ya);break;case 24:Xi(ca)}}function Kc(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){$u(t,t.return,e)}}function qc(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){$u(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){$u(t,t.return,e)}}function Jc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){$u(e,e.return,t)}}}function Yc(e,t,n){n.props=Xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){$u(e,t,n)}}function Xc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){$u(e,t,n)}}function Zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){$u(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){$u(e,t,n)}else n.current=null}function Qc(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){$u(e,e.return,t)}}function $c(e,t,n){try{var r=e.stateNode;Gd(r,e.type,n,t),r[ct]=t}catch(t){$u(e,e.return,t)}}function el(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cf(e.type)||e.tag===4}function tl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||el(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&&cf(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 nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Wd(t,r,n),t[st]=e,t[ct]=n}catch(t){$u(e,e.return,t)}}var al=!1,ol=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Jd=gp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Yd={focusedElem:e,selectionRange:n},gp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Xs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){$u(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)df(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:df(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&Kc(5,n);break;case 1:if(El(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){$u(n,n.return,e)}else{var i=Xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){$u(n,n.return,e)}}r&64&&Jc(n),r&512&&Xc(n,n.return);break;case 3:if(El(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{Qa(e,t)}catch(e){$u(n,n.return,e)}}break;case 27:t===null&&r&4&&il(n);case 26:case 5:El(e,n),t===null&&r&4&&Qc(n),r&512&&Xc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rd.bind(null,n),gf(e,n))));break;case 22:if(r=n.memoizedState!==null||al,!r){t=t!==null&&t.memoizedState!==null||ol,i=al;var a=ol;al=r,(ol=t)&&!a?Dl(e,n,(n.subtreeFlags&8772)!=0):El(e,n),al=i,ol=a}break;case 30:break;default:El(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:ol||Zc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ol||Zc(n,t);var r=pl,i=ml;cf(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),Sf(n.stateNode),pl=r,ml=i;break;case 5:ol||Zc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null)if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){$u(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){$u(n,t,e)}break;case 18:pl!==null&&(ml?(e=pl,lf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hp(e)):lf(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:qc(2,n,t),ol||qc(4,n,t),hl(e,t,n);break;case 1:ol||(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Yc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:ol=(r=ol)||n.memoizedState!==null,hl(e,t,n),ol=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hp(e)}catch(e){$u(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hp(e)}catch(e){$u(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(i(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=id.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(cf(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(i(160));gl(o,s,a),pl=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(qc(3,e,e.return),Kc(3,e),qc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&64&&al&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Sl;if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[mt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Wd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=Xf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Xf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else Zf(a,e.type,e.stateNode);else e.stateNode=Gf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Zf(a,e.type,e.stateNode):Gf(a,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),n!==null&&r&4&&$c(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){$u(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,$c(e,a,n===null?a:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){$u(e,e.return,t)}}break;case 3:if(Yf=null,a=Sl,Sl=Tf(t.containerInfo),xl(t,e),Sl=a,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hp(t.containerInfo)}catch(t){$u(e,e.return,t)}sl&&(sl=!1,Tl(e));break;case 4:r=Sl,Sl=Tf(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(su=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=al,d=ol;if(al=u||a,ol=d||l,xl(t,e),ol=d,al=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||al||ol||B(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){$u(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){$u(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?uf(m,!0):uf(l.stateNode,!1)}catch(e){$u(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(el(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;rl(e,tl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),rl(e,tl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;nl(e,tl(e),s);break;default:throw Error(i(161))}}catch(t){$u(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function B(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qc(4,t,t.return),B(t);break;case 1:Zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Yc(t,t.return,n),B(t);break;case 27:Sf(t.stateNode);case 26:case 5:Zc(t,t.return),B(t);break;case 22:t.memoizedState===null&&B(t);break;case 30:B(t);break;default:B(t)}e=e.sibling}}function Dl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Dl(i,a,n),Kc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){$u(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Za(c[i],s)}catch(e){$u(r,r.return,e)}}n&&o&64&&Jc(a),Xc(a,a.return);break;case 27:il(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&Qc(a),Xc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 13:Dl(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Xc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(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&&ua(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&Kc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e)));break;case 12:if(i&2048){Al(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){$u(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Ml(a,o,s,c,i),Kc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(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:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&ep(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=Sl;Sl=Tf(e.stateNode.containerInfo),Fl(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(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 Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&qc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:qc(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:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Hl={getCacheForType:function(e){var t=na(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return na(ca).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,V=null,H=0,Kl=0,ql=null,Jl=!1,Yl=!1,Xl=!1,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=null,au=null,ou=!1,su=0,cu=0,lu=1/0,uu=null,du=null,fu=0,pu=null,mu=null,hu=0,gu=0,_u=null,vu=null,yu=0,bu=null;function xu(){return Wl&2&&H!==0?H&-H:N.T===null?it():bd()}function Su(){if(nu===0)if(!(H&536870912)||Fi){var e=We;We<<=1,!(We&3932160)&&(We=262144),nu=e}else nu=536870912;return e=io.current,e!==null&&(e.flags|=32),nu}function Cu(e,t,n){(e===Gl&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)&&(Au(e,0),Du(e,H,nu,!1)),Ze(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(eu|=n),Ql===4&&Du(e,H,nu,!1)),fd(e))}function wu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),a=r?Ru(e,t):Iu(e,t,!0),o=r;do{if(a===0){Yl&&!r&&Du(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Eu(n)){a=Iu(e,t,!1),o=!1;continue}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=iu;var l=c.current.memoizedState.isDehydrated;if(l&&(Au(c,s).flags|=256),s=Iu(c,s,!1),s!==2){if(Xl&&!l){c.errorRecoveryDisabledLanes|=o,eu|=o,a=4;break a}o=au,au=a,o!==null&&(au===null?au=o:au.push.apply(au,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Au(e,0),Du(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)break;case 6:Du(r,t,nu,!Jl);break a;case 2:au=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=su+300-De(),10<a)){if(Du(r,t,nu,!Jl),L(r,0,!0)!==0)break a;hu=t,r.timeoutHandle=nf(Tu.bind(null,r,n,au,uu,ou,t,nu,eu,ru,Jl,o,`Throttled`,-0,0),a);break a}Tu(r,n,au,uu,ou,t,nu,eu,ru,Jl,o,null,-0,0)}}break}while(1);fd(e)}function Tu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},Il(t,a,d);var m=(a&62914560)===a?su-De():(a&4194048)===a?cu-De():0;if(m=np(d,m),m!==null){hu=a,e.cancelPendingCommit=m(Gu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Du(e,a,o,!l);return}}Gu(e,t,a,n,r,i,o,s,c)}function Eu(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(!Cr(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 Du(e,t,n,r){t&=~tu,t&=~eu,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&&$e(e,n,t)}function Ou(){return Wl&6?!0:(pd(0,!1),!1)}function ku(){if(V!==null){if(Kl===0)var e=V.return;else e=V,Ji=qi=null,Mo(e),Na=null,Pa=0,e=V;for(;e!==null;)Gc(e.alternate,e),e=e.return;V=null}}function Au(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hu=0,ku(),Gl=e,V=n=ui(e.current,null),H=t,Kl=0,ql=null,Jl=!1,Yl=qe(e,t),Xl=!1,ru=nu=tu=eu=$l=Ql=0,au=iu=null,ou=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return Zl=t,ei(),n}function ju(e,t){z=null,N.H=Hs,t===Ca||t===Ta?(t=ja(),Kl=3):t===wa?(t=ja(),Kl=4):Kl=t===oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ql=t,V===null&&(Ql=1,ec(e,vi(t,e.current)))}function Mu(){var e=io.current;return e===null?!0:(H&4194048)===H?ao===null:(H&62914560)===H||H&536870912?e===ao:!1}function Nu(){var e=N.H;return N.H=Hs,e===null?Hs:e}function Pu(){var e=N.A;return N.A=Hl,e}function Fu(){Ql=4,Jl||(H&4194048)!==H&&io.current!==null||(Yl=!0),!($l&134217727)&&!(eu&134217727)||Gl===null||Du(Gl,H,nu,!1)}function Iu(e,t,n){var r=Wl;Wl|=2;var i=Nu(),a=Pu();(Gl!==e||H!==t)&&(uu=null,Au(e,t)),t=!1;var o=Ql;a:do try{if(Kl!==0&&V!==null){var s=V,c=ql;switch(Kl){case 8:ku(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=Kl;if(Kl=0,ql=null,Hu(e,s,c,l),n&&Yl){o=0;break a}break;default:l=Kl,Kl=0,ql=null,Hu(e,s,c,l)}}Lu(),o=Ql;break}catch(t){ju(e,t)}while(1);return t&&e.shellSuspendCounter++,Ji=qi=null,Wl=r,N.H=i,N.A=a,V===null&&(Gl=null,H=0,ei()),o}function Lu(){for(;V!==null;)Bu(V)}function Ru(e,t){var n=Wl;Wl|=2;var r=Nu(),a=Pu();Gl!==e||H!==t?(uu=null,lu=De()+500,Au(e,t)):Yl=qe(e,t);a:do try{if(Kl!==0&&V!==null){t=V;var o=ql;b:switch(Kl){case 1:Kl=0,ql=null,Hu(e,t,o,1);break;case 2:case 9:if(Da(o)){Kl=0,ql=null,Vu(t);break}t=function(){Kl!==2&&Kl!==9||Gl!==e||(Kl=7),fd(e)},o.then(t,t);break a;case 3:Kl=7;break a;case 4:Kl=5;break a;case 7:Da(o)?(Kl=0,ql=null,Vu(t)):(Kl=0,ql=null,Hu(e,t,o,7));break;case 5:var s=null;switch(V.tag){case 26:s=V.memoizedState;case 5:case 27:var c=V;if(s?$f(s):c.stateNode.complete){Kl=0,ql=null;var l=c.sibling;if(l!==null)V=l;else{var u=c.return;u===null?V=null:(V=u,Uu(u))}break b}}Kl=0,ql=null,Hu(e,t,o,5);break;case 6:Kl=0,ql=null,Hu(e,t,o,6);break;case 8:ku(),Ql=6;break a;default:throw Error(i(462))}}zu();break}catch(t){ju(e,t)}while(1);return Ji=qi=null,N.H=r,N.A=a,Wl=n,V===null?(Gl=null,H=0,ei(),Ql):0}function zu(){for(;V!==null&&!Te();)Bu(V)}function Bu(e){var t=Ic(e.alternate,e,Zl);e.memoizedProps=e.pendingProps,t===null?Uu(e):V=t}function Vu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=bc(n,t,t.pendingProps,t.type,void 0,H);break;case 11:t=bc(n,t,t.pendingProps,t.type.render,t.ref,H);break;case 5:Mo(t);default:Gc(n,t),t=V=di(t,Zl),t=Ic(n,t,Zl)}e.memoizedProps=e.pendingProps,t===null?Uu(e):V=t}function Hu(e,t,n,r){Ji=qi=null,Mo(t),Na=null,Pa=0;var i=t.return;try{if(ac(e,i,t,n,H)){Ql=1,ec(e,vi(n,e.current)),V=null;return}}catch(t){if(i!==null)throw V=i,t;Ql=1,ec(e,vi(n,e.current)),V=null;return}t.flags&32768?(Fi||r===1?e=!0:Yl||H&536870912?e=!1:(Jl=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wu(t,e)):Uu(t)}function Uu(e){var t=e;do{if(t.flags&32768){Wu(t,Jl);return}e=t.return;var n=Uc(t.alternate,t,Zl);if(n!==null){V=n;return}if(t=t.sibling,t!==null){V=t;return}V=t=e}while(t!==null);Ql===0&&(Ql=5)}function Wu(e,t){do{var n=Wc(e.alternate,e);if(n!==null){n.flags&=32767,V=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){V=e;return}V=e=n}while(e!==null);Ql=6,V=null}function Gu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Xu();while(fu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,Qe(e,n,o,s,c,l),e===Gl&&(V=Gl=null,H=0),mu=t,pu=e,hu=n,gu=o,_u=a,vu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ad(je,function(){return Zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Wl,Wl|=4;try{ul(e,t,n)}finally{Wl=s,P.p=a,N.T=r}}fu=1,Ku(),qu(),Ju()}}function Ku(){if(fu===1){fu=0;var e=pu,t=mu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Wl;Wl|=4;try{Cl(t,e);var a=Yd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(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 _=Er(s,h),v=Er(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}}gp=!!Jd,Yd=Jd=null}finally{Wl=i,P.p=r,N.T=n}}e.current=t,fu=2}}function qu(){if(fu===2){fu=0;var e=pu,t=mu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Wl;Wl|=4;try{dl(e,t.alternate,t)}finally{Wl=i,P.p=r,N.T=n}}fu=3}}function Ju(){if(fu===4||fu===3){fu=0,Ee();var e=pu,t=mu,n=hu,r=vu;t.subtreeFlags&10256||t.flags&10256?fu=5:(fu=0,mu=pu=null,Yu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(du=null),rt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}hu&3&&Xu(),fd(e),i=e.pendingLanes,n&261930&&i&42?e===bu?yu++:(yu=0,bu=e):yu=0,pd(0,!1)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function Xu(){return Ku(),qu(),Ju(),Zu()}function Zu(){if(fu!==5)return!1;var e=pu,t=gu;gu=0;var n=rt(hu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=_u,_u=null;var o=pu,s=hu;if(fu=0,mu=pu=null,hu=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,pd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{P.p=a,N.T=r,Yu(e,t)}}function Qu(e,t,n){t=vi(n,t),t=nc(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Ze(e,2),fd(e))}function $u(e,t,n){if(e.tag===3)Qu(e,e,n);else for(;t!==null;){if(t.tag===3){Qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(du===null||!du.has(r))){e=vi(n,e),n=rc(2),r=Ga(t,n,2),r!==null&&(ic(n,r,t,e),Ze(r,2),fd(r));break}}t=t.return}}function ed(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;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)||(Xl=!0,i.add(n),e=td.bind(null,e,t,n),t.then(e,e))}function td(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(H&n)===n&&(Ql===4||Ql===3&&(H&62914560)===H&&300>De()-su?!(Wl&2)&&Au(e,0):tu|=n,ru===H&&(ru=0)),fd(e)}function nd(e,t){t===0&&(t=Ye()),e=ri(e,t),e!==null&&(Ze(e,t),fd(e))}function rd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nd(e,n)}function id(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),nd(e,n)}function ad(e,t){return Ce(e,t)}var od=null,sd=null,cd=!1,ld=!1,ud=!1,dd=0;function fd(e){e!==sd&&e.next===null&&(sd===null?od=sd=e:sd=sd.next=e),ld=!0,cd||(cd=!0,yd())}function pd(e,t){if(!ud&&ld){ud=!0;do for(var n=!1,r=od;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,vd(r,a))}else a=H,a=L(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,vd(r,a));r=r.next}while(n);ud=!1}}function md(){hd()}function hd(){ld=cd=!1;var e=0;dd!==0&&tf()&&(e=dd);for(var t=De(),n=null,r=od;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?od=i:n.next=i,i===null&&(sd=n)):(n=r,(e!==0||a&3)&&(ld=!0)),r=i}fu!==0&&fu!==5||pd(e,!1),dd!==0&&(dd=0)}function gd(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]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=H,n=L(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=_d.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(fu!==0&&fu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var r=H;return r=L(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wu(e,r,t),gd(e,De()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Xu())return null;wu(e,t,!0)}function yd(){of(function(){Wl&6?Ce(ke,md):hd()})}function bd(){if(dd===0){var e=pa;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),dd=e}return dd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dd!==0){var e=o?Sd(i,o):new FormData(i);Os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),Os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<Jr.length;wd++){var Td=Jr[wd];Yr(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`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(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(e,t){t=(t&4)!=0;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){Xr(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){Xr(e)}i.currentTarget=null,a=c}}}}function U(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Md(t,e,2,!1),n.add(r))}function kd(e,t,n){var r=0;t&&(r|=4),Md(n,e,r,t)}var Ad=`_reactListening`+Math.random().toString(36).slice(2);function jd(e){if(!e[Ad]){e[Ad]=!0,xt.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||kd(t,!1,e),kd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ad]||(t[Ad]=!0,kd(`selectionchange`,!1,t))}}function Md(e,t,n,r){switch(Cp(t)){case 2:var i=_p;break;case 8:i=vp;break;default:i=yp}n=i.bind(null,t,n,e),i=void 0,!dn||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 Nd(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=gt(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}cn(function(){var r=a,i=nn(n),s=[];a:{var c=qr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;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=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Br:case Vr:case Hr:l=Mn;break;case Kr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,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=ln(m,p),g!=null&&d.push(Pd(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Id,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ld(s,c,l,d,!1),u!==null&&f!==null&&Ld(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c))if(fr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,R=null);break;case`focusout`:R=Mr=jr=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Fd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Fd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Cd(s,e,r,n,i)}Od(s,t)})}function Pd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fd(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=ln(e,n),i!=null&&r.unshift(Pd(e,i,a)),i=ln(e,t),i!=null&&r.push(Pd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Id(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ld(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=ln(n,a),l!=null&&o.unshift(Pd(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Pd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Rd=/\r\n?/g,zd=/\u0000|\uFFFD/g;function Bd(e){return(typeof e==`string`?e:``+e).replace(Rd,`
|
|
9
|
+
`).replace(zd,``)}function Vd(e,t){return t=Bd(t),Bd(e)===t}function Hd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Hd(e,t,`name`,a.name,a,null),Hd(e,t,`formEncType`,a.formEncType,a,null),Hd(e,t,`formMethod`,a.formMethod,a,null),Hd(e,t,`formTarget`,a.formTarget,a,null)):(Hd(e,t,`encType`,a.encType,a,null),Hd(e,t,`method`,a.method,a,null),Hd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&U(`scroll`,e);break;case`onScrollEnd`:r!=null&&U(`scrollend`,e);break;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));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=$t(``+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`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`:U(`beforetoggle`,e),U(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Ud(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&U(`scroll`,e);break;case`onScrollEnd`:r!=null&&U(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Wd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:U(`error`,e),U(`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:Hd(e,t,o,s,n,null)}}a&&Hd(e,t,`srcSet`,n.srcSet,n,null),r&&Hd(e,t,`src`,n.src,n,null);return;case`input`:U(`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:Hd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in U(`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:Hd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in U(`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:Hd(e,t,s,c,n,null)}Gt(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:Hd(e,t,l,r,n,null)}return;case`dialog`:U(`beforetoggle`,e),U(`toggle`,e),U(`cancel`,e),U(`close`,e);break;case`iframe`:case`object`:U(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)U(Ed[r],e);break;case`image`:U(`error`,e),U(`load`,e);break;case`details`:U(`toggle`,e);break;case`embed`:case`source`:case`link`:U(`error`,e),U(`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:Hd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ud(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Hd(e,t,c,r,n,null))}function Gd(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)||Hd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Hd(e,t,p,m,r,f)}}Bt(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)||Hd(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Hd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(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:Hd(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Hd(e,t,s,a,r,o)}Wt(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:Hd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Hd(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)&&Hd(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:Hd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ud(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||Ud(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Hd(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||Hd(e,t,f,p,r,m)}function Kd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function qd(){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&&Kd(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&&Kd(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 Jd=null,Yd=null;function Xd(e){return e.nodeType===9?e:e.ownerDocument}function Zd(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 Qd(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 $d(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 ef=null;function tf(){var e=window.event;return e&&e.type===`popstate`?e===ef?!1:(ef=e,!0):(ef=null,!1)}var nf=typeof setTimeout==`function`?setTimeout:void 0,rf=typeof clearTimeout==`function`?clearTimeout:void 0,af=typeof Promise==`function`?Promise:void 0,of=typeof queueMicrotask==`function`?queueMicrotask:af===void 0?nf:function(e){return af.resolve(null).then(e).catch(sf)};function sf(e){setTimeout(function(){throw e})}function cf(e){return e===`head`}function lf(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),Hp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sf(e.ownerDocument.body);n=i}while(n);Hp(t)}function uf(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 df(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`:df(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ff(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[mt])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=_f(e.nextSibling),e===null)break}return null}function pf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_f(e.nextSibling),e===null))return null;return e}function mf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_f(e.nextSibling),e===null))return null;return e}function hf(e){return e.data===`$?`||e.data===`$~`}function W(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gf(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 _f(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 vf=null;function yf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _f(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bf(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 xf(e,t,n){switch(t=Xd(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 Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var Cf=new Map,wf=new Set;function Tf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ef=P.d;P.d={f:Df,r:Of,D:jf,C:Mf,L:Nf,m:Pf,X:If,S:Ff,M:Lf};function Df(){var e=Ef.f(),t=Ou();return e||t}function Of(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?As(t):Ef.r(e)}var kf=typeof document>`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Wd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Wd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Wd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=yt(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);bt(c),Wd(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,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=yt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=h({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),bt(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=yt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),bt(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=le.current)?Tf(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`?(t=zf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=zf(n.href);var o=yt(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(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,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`?(t=Uf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+zt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Wd(t,`link`,n),bt(t),e.head.appendChild(t))}function Uf(e){return`[src="`+zt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Wd(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Wd(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,bt(a),a):(r=n,(a=Cf.get(o))&&(r=h({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Wd(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,Kf(r,n.precedence,e));return t.instance}function Kf(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 qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Yf=null;function Xf(e,t,n){if(Yf===null){var r=new Map,i=Yf=new Map;i.set(n,r)}else i=Yf,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[mt]||a[st]||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 Zf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qf(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 $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(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=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Wd(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=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&tp===0&&(tp=62500*qd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.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=rp.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 sp={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function cp(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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function lp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new cp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function up(e){return e?(e=oi,e):oi}function dp(e,t,n,r,i,a){i=up(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Cu(n,e,t),Ka(n,e,t))}function fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pp(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function mp(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Cu(t,e,67108864),pp(e,67108864)}}function hp(e){if(e.tag===13||e.tag===31){var t=xu();t=nt(t);var n=ri(e,t);n!==null&&Cu(n,e,t),pp(e,t)}}var gp=!0;function _p(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,yp(e,t,n,r)}finally{P.p=a,N.T=i}}function vp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,yp(e,t,n,r)}finally{P.p=a,N.T=i}}function yp(e,t,n,r){if(gp){var i=bp(r);if(i===null)Nd(e,t,r,xp,n),Mp(e,r);else if(Pp(i,e,t,n,r))r.stopPropagation();else if(Mp(e,r),t&4&&-1<jp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(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}fd(a),!(Wl&6)&&(lu=De()+500,pd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Cu(s,a,2),Ou(),pp(a,2)}if(a=bp(r),a===null&&Nd(e,t,r,xp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nd(e,t,r,null,n)}}function bp(e){return e=nn(e),Sp(e)}var xp=null;function Sp(e){if(xp=null,e=gt(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 xp=e,null}function Cp(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var wp=!1,Tp=null,Ep=null,Dp=null,Op=new Map,kp=new Map,Ap=[],jp=`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 Mp(e,t){switch(e){case`focusin`:case`focusout`:Tp=null;break;case`dragenter`:case`dragleave`:Ep=null;break;case`mouseover`:case`mouseout`:Dp=null;break;case`pointerover`:case`pointerout`:Op.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kp.delete(t.pointerId)}}function Np(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=_t(t),t!==null&&mp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pp(e,t,n,r,i){switch(t){case`focusin`:return Tp=Np(Tp,e,t,n,r,i),!0;case`dragenter`:return Ep=Np(Ep,e,t,n,r,i),!0;case`mouseover`:return Dp=Np(Dp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Op.set(a,Np(Op.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kp.set(a,Np(kp.get(a)||null,e,t,n,r,i)),!0}return!1}function Fp(e){var t=gt(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,at(e.priority,function(){hp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){hp(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 Ip(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&mp(t),e.blockedOn=n,!1;t.shift()}return!0}function Lp(e,t,n){Ip(e)&&n.delete(t)}function Rp(){wp=!1,Tp!==null&&Ip(Tp)&&(Tp=null),Ep!==null&&Ip(Ep)&&(Ep=null),Dp!==null&&Ip(Dp)&&(Dp=null),Op.forEach(Lp),kp.forEach(Lp)}function zp(e,n){e.blockedOn===n&&(e.blockedOn=null,wp||(wp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rp)))}var Bp=null;function Vp(e){Bp!==e&&(Bp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bp===e&&(Bp=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(Sp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hp(e){function t(t){return zp(t,e)}Tp!==null&&zp(Tp,e),Ep!==null&&zp(Ep,e),Dp!==null&&zp(Dp,e),Op.forEach(t),kp.forEach(t);for(var n=0;n<Ap.length;n++){var r=Ap[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ap.length&&(n=Ap[0],n.blockedOn===null);)Fp(n),n.blockedOn===null&&Ap.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[ct]||null;if(typeof a==`function`)o||Vp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(Sp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vp(n)}}}function Up(){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 Wp(e){this._internalRoot=e}Gp.prototype.render=Wp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dp(n,xu(),e,t,null,null)},Gp.prototype.unmount=Wp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dp(e.current,2,null,e,null,null),Ou(),t[lt]=null}};function Gp(e){this._internalRoot=e}Gp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ap.length&&t!==0&&t<Ap[n].priority;n++);Ap.splice(n,0,e),n===0&&Fp(e)}};var Kp=n.version;if(Kp!==`19.2.7`)throw Error(i(527,Kp,`19.2.7`));P.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 qp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{Ie=Jp.inject(qp),Le=Jp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Zs,s=Qs,c=$s;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=lp(e,1,!1,null,null,n,r,null,o,s,c,Up),e[lt]=t.current,jd(e),new Wp(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()})),_=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),v=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),y=e=>{let t=v(e);return t.charAt(0).toUpperCase()+t.slice(1)},b=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),x=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},S={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},C=c(u()),w=(0,C.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,C.createElement)(`svg`,{ref:c,...S,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:b(`lucide`,i),...!a&&!x(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,C.createElement)(e,t)),...Array.isArray(a)?a:[a]])),T=(e,t)=>{let n=(0,C.forwardRef)(({className:n,...r},i)=>(0,C.createElement)(w,{ref:i,iconNode:t,className:b(`lucide-${_(y(e))}`,`lucide-${e}`,n),...r}));return n.displayName=y(e),n},E=T(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),D=T(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),O=T(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),k=T(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),A=T(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),j=T(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),ee=T(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),M=T(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),te=T(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ne=T(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),N=T(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),P=T(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),re=T(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ie=T(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ae=T(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),oe=T(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),F=g(),I=`carousel`,se=`controller`,ce=`navigation`,le=`no-scroll`,ue=`portal`,de=`root`,fe=`toolbar`,pe=`zoom`,me=`loading`,he=`playing`,ge=`error`,_e=`complete`,ve=e=>`active-slide-${e}`;ve(me),ve(he),ve(ge),ve(_e);var ye=`fullsize`,be=`flex_center`,xe=`no_scroll`,Se=`no_scroll_padding`,Ce=`slide`,we=`slide_wrapper`,Te=`prev`,Ee=`next`,De=`swipe`,Oe=`close`,ke=`onPointerDown`,Ae=`onPointerMove`,je=`onPointerUp`,Me=`onPointerLeave`,Ne=`onPointerCancel`,Pe=`onKeyDown`,Fe=`onKeyUp`,Ie=`onWheel`,Le=`Escape`,Re=`ArrowLeft`,ze=`ArrowRight`,Be=`button`,Ve=`icon`,He=`contain`,Ue=`Unknown action type`,We=m(),Ge=`yarl__`;function Ke(...e){return e.filter(Boolean).join(` `)}function L(e){return`${Ge}${e}`}function qe(e){return`--${Ge}${e}`}function Je(e,t){return`${e}${t?`_${t}`:``}`}function Ye(e){return t=>Je(e,t)}function Xe(e,t){return e?.[t]??t}function Ze(e,t,n){return Xe(e,`{index} of {total}`).replace(/\{index}/g,`${ct(n,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function Qe(...e){return()=>{e.forEach(e=>{e()})}}function $e(e,t,n){return()=>{let r=C.useContext(n);if(!r)throw Error(`${e} must be used within a ${t}.Provider`);return r}}function et(){return typeof window<`u`}function tt(e,t=0){let n=10**t;return Math.round((e+2**-52)*n)/n}function nt(e){return e.type===void 0||e.type===`image`}function rt(e,t){return e.imageFit===`cover`||e.imageFit!==`contain`&&t===`cover`}function it(e){return typeof e==`string`?Number.parseInt(e,10):e}function at(e){if(typeof e==`number`)return{pixel:e};if(typeof e==`string`){let t=it(e);return e.endsWith(`%`)?{percent:t}:{pixel:t}}return{pixel:0}}function ot(e,t){let n=at(t),r=n.percent===void 0?n.pixel:e.width/100*n.percent;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function st(){return(et()?window==null?void 0:window.devicePixelRatio:void 0)||1}function ct(e,t){return t>0?(e%t+t)%t:0}function lt(e){return e.length>0}function ut(e,t){return e[ct(t,e.length)]}function dt(e,t){return lt(e)?ut(e,t):void 0}function ft(e){return nt(e)?e.src:void 0}function pt(e,t,n){if(!n)return e;let{buttons:r,...i}=e,a=r.findIndex(e=>e===t),o=C.isValidElement(n)?C.cloneElement(n,{key:t},null):n;if(a>=0){let e=[...r];return e.splice(a,1,o),{buttons:e,...i}}return{buttons:[o,...r],...i}}function mt(e,t,n=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),n))}var ht=Number(`19.2.7`.split(`.`)[0])>=19;function gt(e){return{inert:ht?e:e?``:void 0}}function _t(e){e.scrollTop}var vt={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[Oe]},labels:{},animation:{fade:250,swipe:500,easing:{fade:`ease`,swipe:`ease-out`,navigation:`ease-in-out`}},carousel:{finite:!1,preload:2,padding:`16px`,spacing:`30%`,imageFit:He,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:`none`,closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,closeOnEscape:!0,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:``};function yt(e,t){return{name:e,component:t}}function bt(e,t){return{module:e,children:t}}function xt(e,t,n){return e.module.name===t?n(e):e.children?[bt(e.module,e.children.flatMap(e=>xt(e,t,n)??[]))]:[e]}function St(e,t,n){return e.flatMap(e=>xt(e,t,n)??[])}function Ct(e,t=[],n=[]){let r=e,i=e=>{let t=[...r];for(;t.length>0;){let n=t.pop();if(n?.module.name===e)return!0;n?.children&&t.push(...n.children)}return!1},a=(e,t)=>{if(e===``){r=[bt(t,r)];return}r=St(r,e,e=>[bt(t,[e])])},o=(e,t)=>{r=St(r,e,e=>[bt(e.module,[bt(t,e.children)])])},s=(e,t,n)=>{r=St(r,e,e=>[bt(e.module,[...n?[bt(t)]:[],...e.children??[],...n?[]:[bt(t)]])])},c=(e,t,n)=>{r=St(r,e,e=>[...n?[bt(t)]:[],e,...n?[]:[bt(t)]])},l=e=>{o(se,e)},u=(e,t)=>{r=St(r,e,e=>[bt(t,e.children)])},d=e=>{r=St(r,e,e=>e.children)},f=e=>{n.push(e)};return t.forEach(e=>{e({contains:i,addParent:a,append:o,addChild:s,addSibling:c,addModule:l,replace:u,remove:d,augment:f})}),{config:r,augmentation:e=>n.reduce((e,t)=>t(e),e)}}var wt=C.createContext(null),Tt=$e(`useA11yContext`,`A11yContext`,wt);function Et({children:e}){let[t,n]=C.useState(!1),[r,i]=C.useState(!1),a=C.useMemo(()=>({focusWithin:t,trackFocusWithin:(e,t)=>{let r=r=>i=>{var a;i.currentTarget.contains(i.relatedTarget)||n(r),(a=r?e:t)==null||a(i)};return{onFocus:r(!0),onBlur:r(!1)}},autoPlaying:r,setAutoPlaying:i}),[t,r]);return C.createElement(wt.Provider,{value:a},e)}var Dt=C.createContext(null),Ot=$e(`useDocument`,`DocumentContext`,Dt);function kt({nodeRef:e,children:t}){let n=C.useMemo(()=>{let t=t=>(t||e.current)?.ownerDocument||document;return{getOwnerDocument:t,getOwnerWindow:e=>t(e)?.defaultView||window}},[e]);return C.createElement(Dt.Provider,{value:n},t)}var At=C.createContext(null),jt=$e(`useEvents`,`EventsContext`,At);function Mt({children:e}){let[t]=C.useState({});C.useEffect(()=>()=>{Object.keys(t).forEach(e=>delete t[e])},[t]);let n=C.useMemo(()=>{let e=(e,n)=>{var r;(r=t[e])==null||r.splice(0,t[e].length,...t[e].filter(e=>e!==n))};return{publish:(...[e,n])=>{var r;(r=t[e])==null||r.forEach(e=>e(n))},subscribe:(n,r)=>(t[n]||(t[n]=[]),t[n].push(r),()=>e(n,r)),unsubscribe:e}},[t]);return C.createElement(At.Provider,{value:n},e)}var Nt=C.createContext(null),Pt=$e(`useLightboxProps`,`LightboxPropsContext`,Nt);function Ft({children:e,...t}){return C.createElement(Nt.Provider,{value:t},e)}var It=C.createContext(null),Lt=$e(`useLightboxState`,`LightboxStateContext`,It),Rt=C.createContext(null),zt=$e(`useLightboxDispatch`,`LightboxDispatchContext`,Rt);function Bt(e,t){switch(t.type){case`swipe`:{let{slides:n}=e,r=t?.increment||0,i=e.globalIndex+r,a=ct(i,n.length);return{slides:n,currentIndex:a,globalIndex:i,currentSlide:dt(n,a),animation:r||t.duration!==void 0?{increment:r,duration:t.duration,easing:t.easing}:void 0}}case`update`:return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:dt(t.slides,t.index)}:e;default:throw Error(Ue)}}function Vt({slides:e,index:t,children:n}){let[r,i]=C.useReducer(Bt,{slides:e,currentIndex:t,globalIndex:t,currentSlide:dt(e,t)}),[a,o]=C.useState(e),[s,c]=C.useState(t);(e!==a||t!==s)&&(o(e),c(t),i({type:`update`,slides:e,index:t}));let l=C.useMemo(()=>({...r,state:r,dispatch:i}),[r,i]);return C.createElement(Rt.Provider,{value:i},C.createElement(It.Provider,{value:l},n))}var Ht=C.createContext(null),Ut=$e(`useRTLContext`,`RTLContext`,Ht);function Wt({isRTL:e,children:t}){let n=C.useMemo(()=>({isRTL:e}),[e]);return C.createElement(Ht.Provider,{value:n},t)}var Gt=C.createContext(null),Kt=$e(`useTimeouts`,`TimeoutsContext`,Gt);function qt({children:e}){let[t]=C.useState([]);C.useEffect(()=>()=>{t.forEach(e=>window.clearTimeout(e)),t.splice(0,t.length)},[t]);let n=C.useMemo(()=>{let e=e=>{t.splice(0,t.length,...t.filter(t=>t!==e))};return{setTimeout:(n,r)=>{let i=window.setTimeout(()=>{e(i),n()},r);return t.push(i),i},clearTimeout:t=>{t!==void 0&&(e(t),window.clearTimeout(t))}}},[t]);return C.createElement(Gt.Provider,{value:n},e)}var Jt=C.forwardRef(function({label:e,className:t,icon:n,renderIcon:r,onClick:i,style:a,...o},s){let{styles:c,labels:l}=Pt(),u=Xe(l,e);return C.createElement(`button`,{ref:s,type:`button`,title:u,"aria-label":u,className:Ke(L(Be),t),onClick:i,style:{...a,...c.button},...o},r?r():C.createElement(n,{className:L(Ve),style:c.icon}))});function Yt(e,t){let n=e=>C.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:`24`,height:`24`,"aria-hidden":`true`,focusable:`false`,...e},t);return n.displayName=e,n}function Xt(e,t){return Yt(e,C.createElement(`g`,{fill:`currentColor`},C.createElement(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),t))}var Zt=Xt(`Close`,C.createElement(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})),Qt=Xt(`Previous`,C.createElement(`path`,{d:`M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z`})),$t=Xt(`Next`,C.createElement(`path`,{d:`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`})),en=Xt(`Loading`,C.createElement(C.Fragment,null,Array.from({length:8}).map((e,t,n)=>C.createElement(`line`,{key:t,x1:`12`,y1:`6.5`,x2:`12`,y2:`1.8`,strokeLinecap:`round`,strokeWidth:`2.6`,stroke:`currentColor`,strokeOpacity:1/n.length*(t+1),transform:`rotate(${360/n.length*t}, 12, 12)`})))),tn=Xt(`Error`,C.createElement(`path`,{d:`M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z`})),nn=et()?C.useLayoutEffect:C.useEffect;function rn(){let[e,t]=C.useState(!1);return C.useEffect(()=>{var e;let n=window.matchMedia?.call(window,`(prefers-reduced-motion: reduce)`);t(n?.matches);let r=e=>t(e.matches);return(e=n?.addEventListener)==null||e.call(n,`change`,r),()=>(n?.removeEventListener)?.call(n,`change`,r)},[]),e}function an(e){let t=0,n=0,r=0,i=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(i){let e=i[1].split(`,`).map(it);e.length===6?(t=e[4],n=e[5]):e.length===16&&(t=e[12],n=e[13],r=e[14])}return{x:t,y:n,z:r}}function on(e,t){let n=C.useRef(void 0),r=C.useRef(void 0),i=rn();return nn(()=>{var a,o;if(e.current&&n.current!==void 0&&!i){let{keyframes:i,duration:s,easing:c,onfinish:l}=t(n.current,e.current.getBoundingClientRect(),an(e.current))||{};if(i&&s){(a=r.current)==null||a.cancel(),r.current=void 0;try{r.current=(o=e.current).animate?.call(o,i,{duration:s,easing:c})}catch(e){console.error(e)}r.current&&(r.current.onfinish=()=>{r.current=void 0,l?.()})}}n.current=void 0}),{prepareAnimation:e=>{n.current=e},isAnimationPlaying:()=>r.current?.playState===`running`}}function sn(){let e=C.useRef(null),t=C.useRef(void 0),[n,r]=C.useState();return{setContainerRef:C.useCallback(n=>{e.current=n,t.current&&=(t.current.disconnect(),void 0);let i=()=>{if(n){let e=window.getComputedStyle(n),t=e=>parseFloat(e)||0;r({width:Math.round(n.clientWidth-t(e.paddingLeft)-t(e.paddingRight)),height:Math.round(n.clientHeight-t(e.paddingTop)-t(e.paddingBottom))})}else r(void 0)};i(),n&&typeof ResizeObserver<`u`&&(t.current=new ResizeObserver(i),t.current.observe(n))},[]),containerRef:e,containerRect:n}}function cn(){let e=C.useRef(void 0),{setTimeout:t,clearTimeout:n}=Kt();return C.useCallback((r,i)=>{n(e.current),e.current=t(r,i>0?i:0)},[t,n])}function ln(e){let t=C.useRef(e);return nn(()=>{t.current=e}),C.useCallback((...e)=>t.current?.call(t,...e),[])}function un(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function dn(e,t){return C.useMemo(()=>e==null&&t==null?null:n=>{un(e,n),un(t,n)},[e,t])}function fn(e,t=!1){let n=C.useRef(!1);return nn(()=>{t&&n.current&&(n.current=!1,e())},[t,e]),{onFocus:C.useCallback(()=>{n.current=!0},[]),onBlur:C.useCallback(()=>{n.current=!1},[])}}function pn(){return Ut().isRTL}function mn(){let[e]=C.useState({}),t=C.useCallback((t,n)=>{var r;(r=e[t])==null||r.forEach(e=>{n.isPropagationStopped()||e(n)})},[e]);return{registerSensors:C.useMemo(()=>({onPointerDown:e=>t(ke,e),onPointerMove:e=>t(Ae,e),onPointerUp:e=>t(je,e),onPointerLeave:e=>t(Me,e),onPointerCancel:e=>t(Ne,e),onKeyDown:e=>t(Pe,e),onKeyUp:e=>t(Fe,e),onWheel:e=>t(Ie,e)}),[t]),subscribeSensors:C.useCallback((t,n)=>(e[t]||(e[t]=[]),e[t].unshift(n),()=>{let r=e[t];r&&r.splice(0,r.length,...r.filter(e=>e!==n))}),[e])}}function hn(e,t){let n=C.useRef(0),r=cn(),i=ln((...t)=>{n.current=Date.now(),e(t)});return C.useCallback((...e)=>{r(()=>{i(e)},t-(Date.now()-n.current))},[t,i,r])}var gn=Ye(`slide`),_n=Ye(`slide_image`);function vn({slide:e,offset:t,render:n,rect:r,imageFit:i,imageProps:a,onClick:o,onLoad:s,onError:c,style:l}){let[u,d]=C.useState(me),{publish:f}=jt(),{setTimeout:p}=Kt(),m=C.useRef(null);C.useEffect(()=>{t===0&&f(ve(u))},[t,u,f]);let h=ln(e=>{(`decode`in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{e.parentNode&&(d(_e),p(()=>{s?.(e)},0))})}),g=C.useCallback(e=>{m.current=e,e?.complete&&h(e)},[h]),_=C.useCallback(e=>{h(e.currentTarget)},[h]),v=ln(()=>{d(ge),c?.()}),y=rt(e,i),b=(e,t)=>Number.isFinite(e)?e:t,x=b(Math.max(...(e.srcSet?.map(e=>e.width)??[]).concat(e.width?[e.width]:[]).filter(Boolean)),m.current?.naturalWidth||0),S=b(Math.max(...(e.srcSet?.map(e=>e.height)??[]).concat(e.height?[e.height]:[]).filter(Boolean)),m.current?.naturalHeight||0),w=x&&S?{maxWidth:`min(${x}px, 100%)`,maxHeight:`min(${S}px, 100%)`}:{maxWidth:`100%`,maxHeight:`100%`},T=e.srcSet?.slice().sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(`, `),E=T&&r&&et()?`${Math.round(Math.min(r&&!y&&e.width&&e.height?r.height/e.height*e.width:Number.MAX_VALUE,r.width))}px`:void 0,{style:D,className:O,...k}=(typeof a==`function`?a(e):a)||{};return C.createElement(C.Fragment,null,C.createElement(`img`,{ref:g,onLoad:_,onError:v,onClick:o,draggable:!1,className:Ke(L(_n()),y&&L(_n(`cover`)),u!==`complete`&&L(_n(`loading`)),O),style:{...w,...l,...D},...k,alt:e.alt??``,sizes:E,srcSet:T,src:e.src}),u!==`complete`&&C.createElement(`div`,{className:L(gn(`placeholder`))},u===`loading`&&(n?.iconLoading?n.iconLoading():C.createElement(en,{className:Ke(L(`icon`),L(gn(`loading`)))})),u===`error`&&(n?.iconError?n.iconError():C.createElement(tn,{className:Ke(L(`icon`),L(gn(`error`)))}))))}var yn=C.forwardRef(function({className:e,children:t,onFocus:n,onBlur:r,...i},a){let o=C.useRef(null),[s,c]=C.useState(!1),{trackFocusWithin:l}=Tt(),u=ln(()=>{if(o.current){let e=window.getComputedStyle(o.current).direction===`rtl`;e!==s&&c(e)}});return C.useEffect(u),C.createElement(kt,{nodeRef:o},C.createElement(Wt,{isRTL:s},C.createElement(`div`,{ref:dn(a,o),className:Ke(L(`root`),e),...l(n,r),...i},t)))}),bn;(function(e){e[e.NONE=0]=`NONE`,e[e.SWIPE=1]=`SWIPE`,e[e.PULL=2]=`PULL`,e[e.ANIMATION=3]=`ANIMATION`})(bn||={});function xn(e,t,n,r,i){C.useEffect(()=>i?()=>{}:Qe(e(ke,t),e(Ae,n),e(je,r),e(Me,r),e(Ne,r)),[e,t,n,r,i])}var Sn;(function(e){e[e.NONE=0]=`NONE`,e[e.SWIPE=1]=`SWIPE`,e[e.PULL=2]=`PULL`})(Sn||={});var Cn=30;function wn({disableSwipeNavigation:e,closeOnBackdropClick:t},n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let _=C.useRef(0),v=C.useRef([]),y=C.useRef(void 0),b=C.useRef(0),x=C.useRef(Sn.NONE),S=C.useCallback(e=>{y.current===e.pointerId&&(y.current=void 0,x.current=Sn.NONE);let t=v.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),w=C.useCallback(e=>{S(e),e.persist(),v.current.push(e)},[S]),T=C.useCallback(e=>v.current.find(({pointerId:t})=>e.pointerId===t),[]),E=ln(e=>{w(e)}),D=(e,t)=>d&&e>t||u&&e<-t,O=ln(e=>{let n=T(e);if(n)if(y.current===e.pointerId){let e=Date.now()-b.current,t=_.current;x.current===Sn.SWIPE?Math.abs(t)>.3*i||Math.abs(t)>5&&e<a?c(t,e):l(t):x.current===Sn.PULL&&(D(t,2*Cn)?m(t,e):h(t)),_.current=0,x.current=Sn.NONE}else{let{target:r}=e;t&&r instanceof HTMLElement&&r===n.target&&(r.classList.contains(L(`slide`))||r.classList.contains(L(`slide_wrapper`)))&&g()}S(e)});xn(n,E,ln(t=>{let n=T(t);if(n){let i=y.current===t.pointerId;if(t.buttons===0){i&&_.current!==0?O(t):S(n);return}let a=t.clientX-n.clientX,c=t.clientY-n.clientY;if(y.current===void 0){let n=e=>{w(t),y.current=t.pointerId,b.current=Date.now(),x.current=e};Math.abs(a)>Math.abs(c)&&Math.abs(a)>Cn&&r(a)?e||(n(Sn.SWIPE),o()):Math.abs(c)>Math.abs(a)&&D(c,Cn)&&(n(Sn.PULL),f())}else i&&(x.current===Sn.SWIPE?(_.current=a,s(a)):x.current===Sn.PULL&&(_.current=c,p(c)))}}),O)}function Tn({preventDefaultWheelX:e,preventDefaultWheelY:t}){let n=C.useRef(null),r=ln(n=>{let r=Math.abs(n.deltaX)>Math.abs(n.deltaY);(r&&e||!r&&t||n.ctrlKey)&&n.preventDefault()});return C.useCallback(e=>{var t;e?e.addEventListener(`wheel`,r,{passive:!1}):(t=n.current)==null||t.removeEventListener(`wheel`,r),n.current=e},[r])}function En(e,t,n,r,i,a,o,s,c){let l=C.useRef(0),u=C.useRef(0),d=C.useRef(void 0),f=C.useRef(void 0),p=C.useRef(0),m=C.useRef(void 0),h=C.useRef(0),{setTimeout:g,clearTimeout:_}=Kt(),v=C.useCallback(()=>{d.current&&=(_(d.current),void 0)},[_]),y=C.useCallback(()=>{f.current&&=(_(f.current),void 0)},[_]),b=ln(()=>{e!==bn.SWIPE&&(l.current=0,h.current=0,v(),y())});C.useEffect(b,[e,b]);let x=ln(e=>{f.current=void 0,l.current===e&&c(l.current)}),S=ln(t=>{if(t.ctrlKey||Math.abs(t.deltaY)>Math.abs(t.deltaX))return;let c=e=>{p.current=e,_(m.current),m.current=e>0?g(()=>{p.current=0,m.current=void 0},300):void 0};if(e===bn.NONE){if(Math.abs(t.deltaX)<=1.2*Math.abs(p.current)){c(t.deltaX);return}if(!n(-t.deltaX))return;if(u.current+=t.deltaX,v(),Math.abs(u.current)>30)u.current=0,c(0),h.current=Date.now(),a();else{let e=u.current;d.current=g(()=>{d.current=void 0,e===u.current&&(u.current=0)},i)}}else if(e===bn.SWIPE){let e=l.current-t.deltaX;if(e=Math.min(Math.abs(e),r)*Math.sign(e),l.current=e,o(e),y(),Math.abs(e)>.2*r){c(t.deltaX),s(e,Date.now()-h.current);return}f.current=g(()=>x(e),2*i)}else c(t.deltaX)});C.useEffect(()=>t(Ie,S),[t,S])}var Dn=Ye(`container`),On=C.createContext(null),kn=$e(`useController`,`ControllerContext`,On);function An({children:e,...t}){let{carousel:n,animation:r,controller:i,on:a,styles:o,render:s}=t,{closeOnPullUp:c,closeOnPullDown:l,preventDefaultWheelX:u,preventDefaultWheelY:d}=i,[f,p]=C.useState(),m=Lt(),h=zt(),[g,_]=C.useState(bn.NONE),v=C.useRef(0),y=C.useRef(0),b=C.useRef(1),{registerSensors:x,subscribeSensors:S}=mn(),{subscribe:w,publish:T}=jt(),E=cn(),D=cn(),O=cn(),{containerRef:k,setContainerRef:A,containerRect:j}=sn(),ee=dn(Tn({preventDefaultWheelX:u,preventDefaultWheelY:d}),A),M=C.useRef(null),te=dn(M,void 0),{getOwnerDocument:ne}=Ot(),N=pn(),P=e=>(N?-1:1)*(typeof e==`number`?e:1),re=ln(()=>k.current?.focus()),ie=ln(()=>t),ae=ln(()=>m),oe=C.useCallback(e=>T(Te,e),[T]),F=C.useCallback(e=>T(Ee,e),[T]),I=C.useCallback(()=>T(Oe),[T]),se=e=>!(n.finite&&(P(e)>0&&m.currentIndex===0||P(e)<0&&m.currentIndex===m.slides.length-1)),ce=e=>{var t;v.current=e,(t=k.current)==null||t.style.setProperty(qe(`swipe_offset`),`${Math.round(e)}px`)},le=e=>{var t,n;y.current=e,b.current=(()=>{let t=.5,n=l&&e>0?e:c&&e<0?-e:0;return Math.min(Math.max(tt(1-n/60*(1-t),2),t),1)})(),(t=k.current)==null||t.style.setProperty(qe(`pull_offset`),`${Math.round(e)}px`),(n=k.current)==null||n.style.setProperty(qe(`pull_opacity`),`${b.current}`)},{prepareAnimation:ue}=on(M,(e,t,n)=>{if(M.current&&j)return{keyframes:[{transform:`translate(0, ${e.rect.y-t.y+n.y}px)`,opacity:e.opacity},{transform:`translate(0, 0)`,opacity:1}],duration:e.duration,easing:r.easing.fade}}),de=(e,t)=>{if(c||l){le(e);let n=0;M.current&&(n=r.fade*(t?2:1),ue({rect:M.current.getBoundingClientRect(),opacity:b.current,duration:n})),O(()=>{le(0),_(bn.NONE)},n),_(bn.ANIMATION),t||I()}},{prepareAnimation:fe,isAnimationPlaying:pe}=on(M,(e,t,r)=>{if(M.current&&j&&m.animation?.duration){let i=at(n.spacing),a=(i.percent?i.percent*j.width/100:i.pixel)||0;return{keyframes:[{transform:`translate(${P(m.globalIndex-e.index)*(j.width+a)+e.rect.x-t.x+r.x}px, 0)`},{transform:`translate(0, 0)`}],duration:m.animation.duration,easing:m.animation.easing}}}),me=ln(e=>{let t=e.offset||0,n=t?r.swipe:r.navigation??r.swipe,i=!t&&!pe()?r.easing.navigation:r.easing.swipe,{direction:a}=e,o=e.count??1,s=bn.ANIMATION,c=n*o;if(!a){let r=j?.width,i=e.duration||0,s=r?n/r*Math.abs(t):n;o===0?c=n/2:(i<s?c=c/s*Math.max(i,s/5):r&&(c=n/r*(r-Math.abs(t))),a=P(t)>0?Te:Ee)}let l=0;a===`prev`?se(P(1))?l=-o:(s=bn.NONE,c=n):a===`next`&&(se(P(-1))?l=o:(s=bn.NONE,c=n)),c=Math.round(c),D(()=>{ce(0),_(bn.NONE)},c),M.current&&fe({rect:M.current.getBoundingClientRect(),index:m.globalIndex}),_(s),T(De,{type:`swipe`,increment:l,duration:c,easing:i})});C.useEffect(()=>{m.animation?.increment&&m.animation?.duration&&E(()=>h({type:`swipe`,increment:0}),m.animation.duration)},[m.animation,h,E]);let he=[S,se,j?.width||0,r.swipe,()=>_(bn.SWIPE),e=>ce(e),(e,t)=>me({offset:e,duration:t,count:1}),e=>me({offset:e,count:0})],ge=[()=>{l&&_(bn.PULL)},e=>le(e),e=>de(e),e=>de(e,!0)];wn(i,...he,c,l,...ge,I),En(g,...he);let _e=ln(()=>{i.focus&&ne().querySelector(`.${L(`portal`)} .${L(Dn())}`)&&re()});C.useEffect(_e,[_e]);let ve=ln(()=>{var e;(e=a.view)==null||e.call(a,{index:m.currentIndex})});C.useEffect(ve,[m.globalIndex,ve]),C.useEffect(()=>Qe(w(Te,e=>me({direction:Te,...e})),w(Ee,e=>me({direction:Ee,...e})),w(De,e=>h(e))),[w,me,h]);let ye=C.useMemo(()=>({prev:oe,next:F,close:I,focus:re,slideRect:j?ot(j,n.padding):{width:0,height:0},containerRect:j||{width:0,height:0},subscribeSensors:S,containerRef:k,setCarouselRef:te,toolbarWidth:f,setToolbarWidth:p}),[oe,F,I,re,S,j,k,te,f,p,n.padding]);return C.useImperativeHandle(i.ref,()=>({prev:oe,next:F,close:I,focus:re,getLightboxProps:ie,getLightboxState:ae}),[oe,F,I,re,ie,ae]),C.createElement(`div`,{ref:ee,className:Ke(L(Dn()),L(be)),style:{...g===bn.SWIPE?{[qe(`swipe_offset`)]:`${Math.round(v.current)}px`}:null,...g===bn.PULL?{[qe(`pull_offset`)]:`${Math.round(y.current)}px`,[qe(`pull_opacity`)]:`${b.current}`}:null,...i.touchAction===`none`?null:{[qe(`controller_touch_action`)]:i.touchAction},...o.container},tabIndex:-1,...x},j&&C.createElement(On.Provider,{value:ye},e,s.controls?.call(s)))}var jn=yt(se,An);function Mn(e){return Je(I,e)}function Nn(e){return Je(Ce,e)}function Pn({slide:e,offset:t}){let n=C.useRef(null),{currentIndex:r,slides:i}=Lt(),{slideRect:a,focus:o}=kn(),{render:s,carousel:{imageFit:c,imageProps:l},on:{click:u},styles:{slide:d},labels:f}=Pt(),{getOwnerDocument:p}=Ot(),m=t!==0;C.useEffect(()=>{m&&n.current?.contains(p().activeElement)&&o()},[m,o,p]);let h=()=>{let n=s.slide?.call(s,{slide:e,offset:t,rect:a});return!n&&nt(e)&&(n=C.createElement(vn,{slide:e,offset:t,render:s,rect:a,imageFit:c,imageProps:l,onClick:m?void 0:()=>u?.({index:r})})),n?C.createElement(C.Fragment,null,s.slideHeader?.call(s,{slide:e}),(s.slideContainer??(({children:e})=>e))({slide:e,children:n}),s.slideFooter?.call(s,{slide:e})):null};return C.createElement(`div`,{ref:n,className:Ke(L(Nn()),!m&&L(Nn(`current`)),L(be)),...gt(m),style:d,role:`group`,"aria-roledescription":Xe(f,`Slide`),"aria-label":Ze(f,i,r+t)},h())}function Fn(){let e=Pt().styles.slide;return C.createElement(`div`,{className:L(Ce),style:e})}function In({carousel:e,labels:t}){let{slides:n,currentIndex:r,globalIndex:i}=Lt(),{setCarouselRef:a}=kn(),{autoPlaying:o,focusWithin:s}=Tt(),c=at(e.spacing),l=at(e.padding),u=mt(e,n,1),d=[];if(lt(n))for(let t=r-u;t<=r+u;t+=1){let a=ut(n,t),o=i-r+t,s=e.finite&&(t<0||t>n.length-1);d.push(s?{key:o}:{key:[`${o}`,ft(a)].filter(Boolean).join(`|`),offset:t-r,slide:a})}return C.createElement(`div`,{ref:a,className:Ke(L(Mn()),d.length>0&&L(Mn(`with_slides`))),style:{[`${qe(Mn(`slides_count`))}`]:d.length,[`${qe(Mn(`spacing_px`))}`]:c.pixel||0,[`${qe(Mn(`spacing_percent`))}`]:c.percent||0,[`${qe(Mn(`padding_px`))}`]:l.pixel||0,[`${qe(Mn(`padding_percent`))}`]:l.percent||0},role:`region`,"aria-live":o&&!s?`off`:`polite`,"aria-roledescription":Xe(t,`Carousel`),"aria-label":Xe(t,`Photo gallery`)},d.map(({key:e,slide:t,offset:n})=>t?C.createElement(Pn,{key:e,slide:t,offset:n}):C.createElement(Fn,{key:e})))}var Ln=yt(I,In);function Rn(){let{carousel:e}=Pt(),{slides:t,currentIndex:n}=Lt();return{prevDisabled:t.length===0||e.finite&&n===0,nextDisabled:t.length===0||e.finite&&n===t.length-1}}function zn(e){let t=pn(),{publish:n}=jt(),{animation:r,controller:i}=Pt(),{prevDisabled:a,nextDisabled:o}=Rn(),s=(r.navigation??r.swipe)/2,c=hn(()=>n(Te),s),l=hn(()=>n(Ee),s),u=ln(e=>{switch(e.key){case Le:if(!i.closeOnEscape)return;n(Oe);break;case Re:(t?o:a)||(t?l:c)();break;case ze:(t?a:o)||(t?c:l)();break;default:return}e.stopPropagation()});C.useEffect(()=>e(Pe,u),[e,u])}function Bn({label:e,icon:t,renderIcon:n,action:r,onClick:i,disabled:a,style:o}){return C.createElement(Jt,{label:e,icon:t,renderIcon:n,className:L(`navigation_${r}`),disabled:a,onClick:i,style:o,...fn(kn().focus,a)})}function Vn({render:{buttonPrev:e,buttonNext:t,iconPrev:n,iconNext:r},styles:i}){let{prev:a,next:o,subscribeSensors:s}=kn(),{prevDisabled:c,nextDisabled:l}=Rn();return zn(s),C.createElement(C.Fragment,null,e?e():C.createElement(Bn,{label:`Previous`,action:Te,icon:Qt,renderIcon:n,style:i.navigationPrev,disabled:c,onClick:a}),t?t():C.createElement(Bn,{label:`Next`,action:Ee,icon:$t,renderIcon:r,style:i.navigationNext,disabled:l,onClick:o}))}var Hn=yt(ce,Vn),Un=L(xe),Wn=L(Se);function Gn(e){return`style`in e}function Kn(e,t,n){let r=window.getComputedStyle(e),i=n?`padding-left`:`padding-right`,a=n?r.paddingLeft:r.paddingRight,o=e.style.getPropertyValue(i);return e.style.setProperty(i,`${(it(a)||0)+t}px`),()=>{o?e.style.setProperty(i,o):e.style.removeProperty(i)}}function qn({noScroll:{disabled:e},children:t}){let n=pn(),{getOwnerDocument:r,getOwnerWindow:i}=Ot();return C.useEffect(()=>{if(e)return()=>{};let t=[],a=i(),{body:o,documentElement:s}=r(),c=Math.round(a.innerWidth-s.clientWidth);if(c>0){t.push(Kn(o,c,n));let e=o.getElementsByTagName(`*`);for(let r=0;r<e.length;r+=1){let i=e[r];Gn(i)&&a.getComputedStyle(i).getPropertyValue(`position`)===`fixed`&&!i.classList.contains(Wn)&&t.push(Kn(i,c,n))}}return o.classList.add(Un),()=>{o.classList.remove(Un),t.forEach(e=>e())}},[n,e,r,i]),C.createElement(C.Fragment,null,t)}var Jn=yt(le,qn);function Yn(e){return Je(ue,e)}function Xn(e,t,n){let r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}function Zn({portal:{root:e,container:{className:t,style:n,...r}={}},animation:i,styles:a,className:o,on:s,close:c,labels:l,children:u}){let[d,f]=C.useState(!1),[p,m]=C.useState(!1),h=C.useRef([]),g=C.useRef(null),{setTimeout:_}=Kt(),{subscribe:v}=jt(),y=rn()?0:i.fade;C.useEffect(()=>(f(!0),()=>{f(!1),m(!1)}),[]);let b=ln(()=>{h.current.forEach(e=>e()),h.current=[]}),x=ln(()=>{var e;m(!1),b(),(e=s.exiting)==null||e.call(s),_(()=>{var e;(e=s.exited)==null||e.call(s),c()},y)});C.useEffect(()=>v(Oe,x),[v,x]);let S=ln(e=>{var t;_t(e),m(!0),(t=s.entering)==null||t.call(s);let n=e.parentNode?.children??[];for(let t=0;t<n.length;t+=1){let r=n[t];[`TEMPLATE`,`SCRIPT`,`STYLE`].indexOf(r.tagName)===-1&&r!==e&&(h.current.push(Xn(r,`inert`,``)),h.current.push(Xn(r,`aria-hidden`,`true`)))}h.current.push(()=>{var e,t;(t=(e=g.current)?.focus)==null||t.call(e)}),_(()=>{var e;(e=s.entered)==null||e.call(s)},y)}),w=C.useCallback(e=>{e?S(e):b()},[S,b]);return d?(0,We.createPortal)(C.createElement(yn,{ref:w,className:Ke(o,t,L(Yn()),L(Se),p&&L(Yn(`open`))),"aria-modal":!0,role:`dialog`,"aria-label":Xe(l,`Lightbox`),style:{...i.fade===vt.animation.fade?null:{[qe(`fade_animation_duration`)]:`${y}ms`},...i.easing.fade===vt.animation.easing.fade?null:{[qe(`fade_animation_timing_function`)]:i.easing.fade},...a.root,...n},onFocus:e=>{g.current||=e.relatedTarget},...r},u),(typeof e==`function`?e():e)||document.body):null}var Qn=yt(ue,Zn);function $n({children:e}){return C.createElement(C.Fragment,null,e)}var er=yt(de,$n);function tr(e){return Je(fe,e)}function nr({toolbar:{buttons:e},render:{buttonClose:t,iconClose:n},styles:r}){let{close:i,setToolbarWidth:a}=kn(),{setContainerRef:o,containerRect:s}=sn();nn(()=>{a(s?.width)},[a,s?.width]);let c=()=>t?t():C.createElement(Jt,{key:Oe,label:`Close`,icon:Zt,renderIcon:n,onClick:i});return C.createElement(`div`,{ref:o,style:r.toolbar,className:L(tr())},e?.map(e=>e===`close`?c():e))}var rr=yt(fe,nr);function ir(e,t){return C.createElement(e.module.component,{key:e.module.name,...t},e.children?.map(e=>ir(e,t)))}function ar(e,t={}){let{easing:n,...r}=e,{easing:i,...a}=t;return{easing:{...n,...i},...r,...a}}function or({carousel:e,animation:t,render:n,toolbar:r,controller:i,noScroll:a,on:o,plugins:s,slides:c,index:l,...u}){let{animation:d,carousel:f,render:p,toolbar:m,controller:h,noScroll:g,on:_,slides:v,index:y,plugins:b,...x}=vt,{config:S,augmentation:w}=Ct([bt(Qn,[bt(Jn,[bt(jn,[bt(Ln),bt(rr),bt(Hn)])])])],s||b),T=w({animation:ar(d,t),carousel:{...f,...e},render:{...p,...n},toolbar:{...m,...r},controller:{...h,...i},noScroll:{...g,...a},on:{..._,...o},...x,...u});return T.open?C.createElement(Ft,{...T},C.createElement(Vt,{slides:c||v,index:it(l||y)},C.createElement(qt,null,C.createElement(Mt,null,C.createElement(Et,null,ir(bt(er,S),T)))))):null}var sr={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1,maxZoom:8};function cr(e){return Math.min(Math.max(e,2**-52),1)}function lr(e){let{minZoom:t,...n}={...sr,...e};return{minZoom:cr(t),...n}}function ur(e,t,n,r){let i=C.useRef(void 0),a=C.useRef(void 0),{zoom:o}=Pt().animation,s=rn(),c=ln(()=>{var c,l;if((c=i.current)==null||c.cancel(),i.current=void 0,a.current&&r?.current){try{i.current=(l=r.current).animate?.call(l,[{transform:a.current},{transform:`scale(${e}) translateX(${t}px) translateY(${n}px)`}],{duration:s?0:o??500,easing:i.current?`ease-out`:`ease-in-out`})}catch(e){console.error(e)}a.current=void 0,i.current&&(i.current.onfinish=()=>{i.current=void 0})}});return nn(c,[e,t,n,c]),C.useCallback(()=>{a.current=r?.current?window.getComputedStyle(r.current).transform:void 0},[r])}function dr(e,t){let{on:n}=Pt(),r=ln(()=>{var r;t||(r=n.zoom)==null||r.call(n,{zoom:e})});C.useEffect(r,[e,r])}function fr(){let{zoom:e}=Pt();return lr(e)}function pr(e,t){let n=typeof e==`function`?e(t)??sr.maxZoom:e;return Math.max(n,1)}function mr(e,t){let n={width:0,height:0},r={width:0,height:0},{currentSlide:i}=Lt(),{imageFit:a}=Pt().carousel,{maxZoomPixelRatio:o,maxZoom:s}=fr();if(e&&i){let s={...i,...t};if(nt(s)){let t=rt(s,a),i=Math.max(...(s.srcSet?.map(e=>e.width)||[]).concat(s.width?[s.width]:[])),c=Math.max(...(s.srcSet?.map(e=>e.height)||[]).concat(s.height?[s.height]:[]));i>0&&c>0&&e.width>0&&e.height>0&&(r=t?{width:Math.round(Math.min(i,e.width/e.height*c)),height:Math.round(Math.min(c,e.height/e.width*i))}:{width:i,height:c},r={width:r.width*o,height:r.height*o},n=t?{width:Math.min(e.width,r.width,i),height:Math.min(e.height,r.height,c)}:{width:Math.round(Math.min(e.width,e.height/c*i,i)),height:Math.round(Math.min(e.height,e.width/i*c,c))})}else e.width>0&&e.height>0&&(n=t&&t.width>0&&t.height>0?{width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}:{width:e.width,height:e.height})}let c=i&&n.width?nt(i)?Math.max(tt(r.width/n.width,5),1):pr(s,i):1;return{imageRect:n,maxZoom:c}}function hr(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function gr(e,t,n=100,r=2){return e*Math.min(1+Math.abs(t/n),r)**Math.sign(t)}function _r(e,t,n,r,i,a,o,s,c){let l=C.useRef([]),u=C.useRef(0),d=C.useRef(void 0),{globalIndex:f}=Lt(),{getOwnerWindow:p}=Ot(),{containerRef:m,subscribeSensors:h}=kn(),{keyboardMoveDistance:g,zoomInMultiplier:_,wheelZoomDistanceFactor:v,scrollToZoom:y,doubleTapDelay:b,doubleClickDelay:x,doubleClickMaxStops:S,pinchZoomDistanceFactor:w,pinchZoomV4:T}=fr(),E=C.useCallback(e=>{if(m.current){let{pageX:t,pageY:n}=e,{scrollX:r,scrollY:i}=p(),{left:a,top:o,width:s,height:c}=m.current.getBoundingClientRect();return[t-a-r-s/2,n-o-i-c/2]}return[]},[m,p]),D=ln(t=>{let{key:n,metaKey:r,ctrlKey:c}=t,l=r||c,u=()=>{t.preventDefault(),t.stopPropagation()};if(e>1){let e=(e,t)=>{u(),s(e,t)};n===`ArrowDown`?e(0,g):n===`ArrowUp`?e(0,-g):n===`ArrowLeft`?e(-g,0):n===`ArrowRight`&&e(g,0)}n===`+`||l&&n===`=`?(u(),i()):n===`-`||l&&n===`_`?(u(),a()):l&&n===`0`&&(u(),o(1))}),O=ln(t=>{if((t.ctrlKey||y)&&Math.abs(t.deltaY)>Math.abs(t.deltaX)){t.stopPropagation(),o(gr(e,-t.deltaY,v),!0,...E(t));return}e>1&&(t.stopPropagation(),y||s(t.deltaX,t.deltaY))}),k=C.useCallback(e=>{let t=l.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),A=C.useCallback(e=>{k(e),e.persist(),l.current.push(e)},[k]),j=ln(r=>{let i=l.current;if(r.pointerType===`mouse`&&r.buttons>1||!(c?.current)?.contains(r.target))return;e>1&&r.stopPropagation();let{timeStamp:a}=r;if(i.length===0&&a-u.current<(r.pointerType===`touch`?b:x)?(u.current=0,o(e>=1?e===n?1:e*Math.max(n**(1/S),_):e===t?1:e/Math.max(t**(-1/S),_),!1,...E(r))):u.current=a,A(r),i.length===2){let t=hr(i[0],i[1]);d.current={previousDistance:t,initialDistance:Math.max(t,1),initialZoom:e}}}),ee=ln(t=>{let n=l.current,r=n.find(e=>e.pointerId===t.pointerId);if(n.length===2&&d.current){t.stopPropagation(),A(t);let r=hr(n[0],n[1]);o(T?d.current.initialZoom/d.current.initialDistance*r:gr(e,r-d.current.previousDistance,w),!0,...n.map(e=>E(e)).reduce((e,t)=>t.map((t,n)=>e[n]+t/2))),d.current.previousDistance=r;return}e>1&&(t.stopPropagation(),r&&(n.length===1&&s((r.clientX-t.clientX)/e,(r.clientY-t.clientY)/e),A(t)))}),M=C.useCallback(e=>{let t=l.current;t.length===2&&t.find(t=>t.pointerId===e.pointerId)&&(d.current=void 0),k(e)},[k]),te=C.useCallback(()=>{let e=l.current;e.splice(0,e.length),u.current=0,d.current=void 0},[]);xn(h,j,ee,M,r),C.useEffect(te,[f,te]),C.useEffect(()=>r?()=>{}:Qe(te,h(Pe,D),h(Ie,O)),[r,h,te,D,O])}function vr(e,t,n){let[r,i]=C.useState(1),[a,o]=C.useState(0),[s,c]=C.useState(0),l=ur(r,a,s,n),{currentSlide:u,globalIndex:d}=Lt(),{containerRect:f,slideRect:p}=kn(),{minZoom:m,zoomInMultiplier:h}=fr(),g=u&&nt(u)?u.src:void 0,_=!n?.current;nn(()=>{i(1),o(0),c(0)},[d,g]);let v=C.useCallback((t,n,i)=>{let l=i||r,u=a-(t||0),d=s-(n||0),f=(e.width*l-p.width)/2/l,m=(e.height*l-p.height)/2/l;o(Math.min(Math.abs(u),Math.max(f,0))*Math.sign(u)),c(Math.min(Math.abs(d),Math.max(m,0))*Math.sign(d))},[r,a,s,p,e.width,e.height]),y=C.useCallback((e,n,a,o)=>{let s=tt(e+.01<t?e-.01>m?e:m:t,5);n||l(),v(a?a*(1/r-1/s):0,o?o*(1/r-1/s):0,s),i(s)},[r,m,t,v,l]),b=ln(()=>{r>1&&(r>t&&y(t,!0),v())});return nn(b,[f.width,f.height,b]),{zoom:r,offsetX:a,offsetY:s,disabled:_,changeOffsets:v,changeZoom:y,zoomIn:C.useCallback(()=>{let e=r*h;y(r<1&&e>1?1:e)},[r,h,y]),zoomOut:C.useCallback(()=>{let e=r/h;y(r>1&&e<1?1:e)},[r,h,y])}}var yr=C.createContext(null),br=$e(`useZoom`,`ZoomControllerContext`,yr);function xr({children:e}){let[t,n]=C.useState(),{slideRect:r}=kn(),{ref:i,minZoom:a}=fr(),{imageRect:o,maxZoom:s}=mr(r,t?.imageDimensions),{zoom:c,offsetX:l,offsetY:u,disabled:d,changeZoom:f,changeOffsets:p,zoomIn:m,zoomOut:h}=vr(o,s,t?.zoomWrapperRef);dr(c,d),_r(c,a,s,d,m,h,f,p,t?.zoomWrapperRef);let g=C.useMemo(()=>({zoom:c,minZoom:a,maxZoom:s,offsetX:l,offsetY:u,disabled:d,zoomIn:m,zoomOut:h,changeZoom:f}),[c,a,s,l,u,d,m,h,f]);C.useImperativeHandle(i,()=>g,[g]);let _=C.useMemo(()=>({...g,setZoomWrapper:n}),[g,n]);return C.createElement(yr.Provider,{value:_},e)}var Sr=Xt(`ZoomIn`,C.createElement(C.Fragment,null,C.createElement(`path`,{d:`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z`}),C.createElement(`path`,{d:`M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z`}))),Cr=Xt(`ZoomOut`,C.createElement(`path`,{d:`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z`})),wr=C.forwardRef(function({zoomIn:e,onLoseFocus:t},n){let r=C.useRef(!1),i=C.useRef(!1),{zoom:a,minZoom:o,maxZoom:s,zoomIn:c,zoomOut:l,disabled:u}=br(),{render:d}=Pt(),f=u||(e?a>=s:a<=o);return C.useEffect(()=>{f&&r.current&&i.current&&t(),f||(r.current=!0)},[f,t]),C.createElement(Jt,{ref:n,disabled:f,label:e?`Zoom in`:`Zoom out`,icon:e?Sr:Cr,renderIcon:e?d.iconZoomIn:d.iconZoomOut,onClick:e?c:l,onFocus:()=>{i.current=!0},onBlur:()=>{i.current=!1}})});function Tr(){let e=C.useRef(null),t=C.useRef(null),{focus:n}=kn(),r=C.useCallback(e=>{var t;e.current?.disabled?n():(t=e.current)==null||t.focus()},[n]),i=C.useCallback(()=>r(e),[r]),a=C.useCallback(()=>r(t),[r]);return C.createElement(C.Fragment,null,C.createElement(wr,{zoomIn:!0,ref:e,onLoseFocus:a}),C.createElement(wr,{ref:t,onLoseFocus:i}))}function Er(){let{render:e}=Pt(),t=br();return e.buttonZoom?C.createElement(C.Fragment,null,e.buttonZoom(t)):C.createElement(Tr,null)}function Dr(e){return(e.srcSet?.length||0)>0}function Or({current:e,preload:t},{type:n,source:r}){switch(n){case`fetch`:return e?{current:e,preload:r}:{current:r};case`done`:return r===t?{current:r}:{current:e,preload:t};default:throw Error(Ue)}}function kr(e){let[{current:t,preload:n},r]=C.useReducer(Or,{}),{slide:i,rect:a,imageFit:o,render:s,interactive:c}=e,l=i.srcSet.sort((e,t)=>e.width-t.width),u=i.width??l[l.length-1].width,d=i.height??l[l.length-1].height,f=rt(i,o),p=Math.max(...l.map(e=>e.width)),m=Math.min((f?Math.max:Math.min)(a.width,u*(a.height/d)),p),h=st(),g=ln(()=>{let e=l.find(e=>e.width>=m*h)??l[l.length-1];(!t||l.findIndex(e=>e.src===t)<l.findIndex(t=>t===e))&&r({type:`fetch`,source:e.src})});nn(g,[a.width,a.height,h,g]);let _=ln(e=>r({type:`done`,source:e})),v={WebkitTransform:c?`initial`:`translateZ(0)`};return f||Object.assign(v,a.width/a.height<u/d?{width:`100%`,height:`auto`}:{width:`auto`,height:`100%`}),C.createElement(C.Fragment,null,n&&n!==t&&C.createElement(vn,{key:`preload`,...e,offset:void 0,slide:{...i,src:n,srcSet:void 0},style:{position:`absolute`,visibility:`hidden`,...v},onLoad:()=>_(n),render:{...s,iconLoading:()=>null,iconError:()=>null}}),t&&C.createElement(vn,{key:`current`,...e,slide:{...i,src:t,srcSet:void 0},style:v}))}function Ar({render:e,slide:t,offset:n,rect:r}){let[i,a]=C.useState(),o=C.useRef(null),s=nt(t),{zoom:c,maxZoom:l,offsetX:u,offsetY:d,setZoomWrapper:f}=br(),p=c>1,{carousel:m,on:h}=Pt(),{currentIndex:g}=Lt();nn(()=>{if(n!==0||s||!o.current)return()=>{};let e=()=>{let e=o.current;if(!e)return;let t=0,n=0;for(let r of e.children)r instanceof HTMLElement&&(t=Math.max(t,r.offsetWidth),n=Math.max(n,r.offsetHeight));a(e=>e&&e.width===t&&e.height===n?e:{width:t,height:n})};if(e(),typeof ResizeObserver>`u`)return()=>{};let t=new ResizeObserver(e);for(let e of o.current.children)t.observe(e);return()=>t.disconnect()},[n,s,r]),nn(()=>n===0?(f({zoomWrapperRef:o,imageDimensions:i}),()=>f(void 0)):()=>{},[n,i,f]);let _=e.slide?.call(e,{slide:t,offset:n,rect:r,zoom:c,maxZoom:l});if(!_&&s){let i={slide:t,offset:n,rect:r,render:e,imageFit:m.imageFit,imageProps:m.imageProps,onClick:n===0?()=>h.click?.call(h,{index:g}):void 0};_=Dr(t)?C.createElement(kr,{...i,slide:t,interactive:p,rect:n===0?{width:r.width*c,height:r.height*c}:r}):C.createElement(vn,{onLoad:e=>a({width:e.naturalWidth,height:e.naturalHeight}),...i})}return _?C.createElement(`div`,{ref:o,className:Ke(L(ye),L(be),L(we),p&&L(`slide_wrapper_interactive`)),style:n===0?{transform:`scale(${c}) translateX(${u}px) translateY(${d}px)`}:void 0},_):null}var jr=({augment:e,addModule:t})=>{e(({zoom:e,toolbar:t,render:n,controller:r,...i})=>{let a=lr(e);return{zoom:a,toolbar:pt(t,pe,C.createElement(Er,null)),render:{...n,slide:e=>nt(e.slide)||e.slide.type!=null&&a.supports?.includes(e.slide.type)?C.createElement(Ar,{render:n,...e}):n.slide?.call(n,e)},controller:{...r,preventDefaultWheelY:a.scrollToZoom},...i}}),t(yt(pe,xr))},Mr=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})),R=o(((e,t)=>{t.exports=Mr()}))();function Nr(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Nr(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Pr={value:()=>{}};function Fr(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ir(n)}function Ir(e){this._=e}function Lr(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ir.prototype=Fr.prototype={constructor:Ir,on:function(e,t){var n=this._,r=Lr(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Rr(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=zr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=zr(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ir(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Rr(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function zr(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Pr,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Br={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Vr(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Br.hasOwnProperty(t)?{space:Br[t],local:e}:e}function Hr(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Ur(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wr(e){var t=Vr(e);return(t.local?Ur:Hr)(t)}function Gr(){}function Kr(e){return e==null?Gr:function(){return this.querySelector(e)}}function qr(e){typeof e!=`function`&&(e=Kr(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Fa(r,this._parents)}function Jr(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Yr(){return[]}function Xr(e){return e==null?Yr:function(){return this.querySelectorAll(e)}}function Zr(e){return function(){return Jr(e.apply(this,arguments))}}function Qr(e){e=typeof e==`function`?Zr(e):Xr(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Fa(r,i)}function $r(e){return function(){return this.matches(e)}}function ei(e){return function(t){return t.matches(e)}}var ti=Array.prototype.find;function ni(e){return function(){return ti.call(this.children,e)}}function ri(){return this.firstElementChild}function ii(e){return this.select(e==null?ri:ni(typeof e==`function`?e:ei(e)))}var ai=Array.prototype.filter;function oi(){return Array.from(this.children)}function si(e){return function(){return ai.call(this.children,e)}}function ci(e){return this.selectAll(e==null?oi:si(typeof e==`function`?e:ei(e)))}function li(e){typeof e!=`function`&&(e=$r(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Fa(r,this._parents)}function ui(e){return Array(e.length)}function di(){return new Fa(this._enter||this._groups.map(ui),this._parents)}function fi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}fi.prototype={constructor:fi,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function pi(e){return function(){return e}}function mi(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new fi(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function hi(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new fi(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function gi(e){return e.__data__}function _i(e,t){if(!arguments.length)return Array.from(this,gi);var n=t?hi:mi,r=this._parents,i=this._groups;typeof e!=`function`&&(e=pi(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=vi(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Fa(o,r),o._enter=s,o._exit=c,o}function vi(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function yi(){return new Fa(this._exit||this._groups.map(ui),this._parents)}function bi(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function xi(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Fa(s,this._parents)}function Si(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Ci(e){e||=wi;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Fa(i,this._parents).order()}function wi(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ti(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ei(){return Array.from(this)}function Di(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Oi(){let e=0;for(let t of this)++e;return e}function ki(){return!this.node()}function Ai(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function ji(e){return function(){this.removeAttribute(e)}}function Mi(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ni(e,t){return function(){this.setAttribute(e,t)}}function Pi(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fi(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ii(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Li(e,t){var n=Vr(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Mi:ji:typeof t==`function`?n.local?Ii:Fi:n.local?Pi:Ni)(n,t))}function Ri(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function zi(e){return function(){this.style.removeProperty(e)}}function Bi(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Vi(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Hi(e,t,n){return arguments.length>1?this.each((t==null?zi:typeof t==`function`?Vi:Bi)(e,t,n??``)):Ui(this.node(),e)}function Ui(e,t){return e.style.getPropertyValue(t)||Ri(e).getComputedStyle(e,null).getPropertyValue(t)}function Wi(e){return function(){delete this[e]}}function Gi(e,t){return function(){this[e]=t}}function Ki(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qi(e,t){return arguments.length>1?this.each((t==null?Wi:typeof t==`function`?Ki:Gi)(e,t)):this.node()[e]}function Ji(e){return e.trim().split(/^|\s+/)}function Yi(e){return e.classList||new Xi(e)}function Xi(e){this._node=e,this._names=Ji(e.getAttribute(`class`)||``)}Xi.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Zi(e,t){for(var n=Yi(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Qi(e,t){for(var n=Yi(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function $i(e){return function(){Zi(this,e)}}function ea(e){return function(){Qi(this,e)}}function ta(e,t){return function(){(t.apply(this,arguments)?Zi:Qi)(this,e)}}function na(e,t){var n=Ji(e+``);if(arguments.length<2){for(var r=Yi(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?ta:t?$i:ea)(n,t))}function ra(){this.textContent=``}function ia(e){return function(){this.textContent=e}}function aa(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function oa(e){return arguments.length?this.each(e==null?ra:(typeof e==`function`?aa:ia)(e)):this.node().textContent}function sa(){this.innerHTML=``}function ca(e){return function(){this.innerHTML=e}}function la(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function ua(e){return arguments.length?this.each(e==null?sa:(typeof e==`function`?la:ca)(e)):this.node().innerHTML}function da(){this.nextSibling&&this.parentNode.appendChild(this)}function fa(){return this.each(da)}function pa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ma(){return this.each(pa)}function ha(e){var t=typeof e==`function`?e:Wr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ga(){return null}function _a(e,t){var n=typeof e==`function`?e:Wr(e),r=t==null?ga:typeof t==`function`?t:Kr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function va(){var e=this.parentNode;e&&e.removeChild(this)}function ya(){return this.each(va)}function ba(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xa(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sa(e){return this.select(e?xa:ba)}function Ca(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function wa(e){return function(t){e.call(this,t,this.__data__)}}function Ta(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Ea(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Da(e,t,n){return function(){var r=this.__on,i,a=wa(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Oa(e,t,n){var r=Ta(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Da:Ea,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function ka(e,t,n){var r=Ri(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Aa(e,t){return function(){return ka(this,e,t)}}function ja(e,t){return function(){return ka(this,e,t.apply(this,arguments))}}function Ma(e,t){return this.each((typeof t==`function`?ja:Aa)(e,t))}function*Na(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Pa=[null];function Fa(e,t){this._groups=e,this._parents=t}function Ia(){return new Fa([[document.documentElement]],Pa)}function La(){return this}Fa.prototype=Ia.prototype={constructor:Fa,select:qr,selectAll:Qr,selectChild:ii,selectChildren:ci,filter:li,data:_i,enter:di,exit:yi,join:bi,merge:xi,selection:La,order:Si,sort:Ci,call:Ti,nodes:Ei,node:Di,size:Oi,empty:ki,each:Ai,attr:Li,style:Hi,property:qi,classed:na,text:oa,html:ua,raise:fa,lower:ma,append:ha,insert:_a,remove:ya,clone:Sa,datum:Ca,on:Oa,dispatch:Ma,[Symbol.iterator]:Na};function Ra(e){return typeof e==`string`?new Fa([[document.querySelector(e)]],[document.documentElement]):new Fa([[e]],Pa)}function za(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ba(e,t){if(e=za(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Va={passive:!1},Ha={capture:!0,passive:!1};function Ua(e){e.stopImmediatePropagation()}function Wa(e){e.preventDefault(),e.stopImmediatePropagation()}function Ga(e){var t=e.document.documentElement,n=Ra(e).on(`dragstart.drag`,Wa,Ha);`onselectstart`in t?n.on(`selectstart.drag`,Wa,Ha):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Ka(e,t){var n=e.document.documentElement,r=Ra(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Wa,Ha),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var qa=e=>()=>e;function Ja(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Ja.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ya(e){return!e.ctrlKey&&!e.button}function Xa(){return this.parentNode}function Za(e,t){return t??{x:e.x,y:e.y}}function Qa(){return navigator.maxTouchPoints||`ontouchstart`in this}function $a(){var e=Ya,t=Xa,n=Za,r=Qa,i={},a=Fr(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Va).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Ra(n.view).on(`mousemove.drag`,m,Ha).on(`mouseup.drag`,h,Ha),Ga(n.view),Ua(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Wa(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Ra(e.view).on(`mousemove.drag mouseup.drag`,null),Ka(e.view,l),Wa(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Ua(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(Wa(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Ua(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Ba(l||r,t),p,m,h;if((h=n.call(e,new Ja(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Ba(l||a,t),_=o;break}u.call(r,e,new Ja(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:qa(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:qa(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:qa(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:qa(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function eo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function to(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function no(){}var ro=.7,io=1/ro,ao=`\\s*([+-]?\\d+)\\s*`,oo=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,so=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,co=/^#([0-9a-f]{3,8})$/,lo=RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),uo=RegExp(`^rgb\\(${so},${so},${so}\\)$`),fo=RegExp(`^rgba\\(${ao},${ao},${ao},${oo}\\)$`),po=RegExp(`^rgba\\(${so},${so},${so},${oo}\\)$`),mo=RegExp(`^hsl\\(${oo},${so},${so}\\)$`),z=RegExp(`^hsla\\(${oo},${so},${so},${oo}\\)$`),ho={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};eo(no,bo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:go,formatHex:go,formatHex8:_o,formatHsl:vo,formatRgb:yo,toString:yo});function go(){return this.rgb().formatHex()}function _o(){return this.rgb().formatHex8()}function vo(){return No(this).formatHsl()}function yo(){return this.rgb().formatRgb()}function bo(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=co.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?xo(t):n===3?new To(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?So(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?So(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=lo.exec(e))?new To(t[1],t[2],t[3],1):(t=uo.exec(e))?new To(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fo.exec(e))?So(t[1],t[2],t[3],t[4]):(t=po.exec(e))?So(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mo.exec(e))?Mo(t[1],t[2]/100,t[3]/100,1):(t=z.exec(e))?Mo(t[1],t[2]/100,t[3]/100,t[4]):ho.hasOwnProperty(e)?xo(ho[e]):e===`transparent`?new To(NaN,NaN,NaN,0):null}function xo(e){return new To(e>>16&255,e>>8&255,e&255,1)}function So(e,t,n,r){return r<=0&&(e=t=n=NaN),new To(e,t,n,r)}function Co(e){return e instanceof no||(e=bo(e)),e?(e=e.rgb(),new To(e.r,e.g,e.b,e.opacity)):new To}function wo(e,t,n,r){return arguments.length===1?Co(e):new To(e,t,n,r??1)}function To(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}eo(To,wo,to(no,{brighter(e){return e=e==null?io:io**+e,new To(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ro:ro**+e,new To(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new To(Ao(this.r),Ao(this.g),Ao(this.b),ko(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Eo,formatHex:Eo,formatHex8:Do,formatRgb:Oo,toString:Oo}));function Eo(){return`#${jo(this.r)}${jo(this.g)}${jo(this.b)}`}function Do(){return`#${jo(this.r)}${jo(this.g)}${jo(this.b)}${jo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oo(){let e=ko(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Ao(this.r)}, ${Ao(this.g)}, ${Ao(this.b)}${e===1?`)`:`, ${e})`}`}function ko(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ao(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jo(e){return e=Ao(e),(e<16?`0`:``)+e.toString(16)}function Mo(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fo(e,t,n,r)}function No(e){if(e instanceof Fo)return new Fo(e.h,e.s,e.l,e.opacity);if(e instanceof no||(e=bo(e)),!e)return new Fo;if(e instanceof Fo)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Fo(o,s,c,e.opacity)}function Po(e,t,n,r){return arguments.length===1?No(e):new Fo(e,t,n,r??1)}function Fo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}eo(Fo,Po,to(no,{brighter(e){return e=e==null?io:io**+e,new Fo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ro:ro**+e,new Fo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new To(Ro(e>=240?e-240:e+120,i,r),Ro(e,i,r),Ro(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Fo(Io(this.h),Lo(this.s),Lo(this.l),ko(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ko(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Io(this.h)}, ${Lo(this.s)*100}%, ${Lo(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Io(e){return e=(e||0)%360,e<0?e+360:e}function Lo(e){return Math.max(0,Math.min(1,e||0))}function Ro(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var zo=e=>()=>e;function Bo(e,t){return function(n){return e+n*t}}function Vo(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Ho(e){return(e=+e)==1?Uo:function(t,n){return n-t?Vo(t,n,e):zo(isNaN(t)?n:t)}}function Uo(e,t){var n=t-e;return n?Bo(e,n):zo(isNaN(e)?t:e)}var Wo=(function e(t){var n=Ho(t);function r(e,t){var r=n((e=wo(e)).r,(t=wo(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Uo(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Go(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Ko(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qo(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=ns(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Jo(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Xo(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=ns(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Zo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qo=new RegExp(Zo.source,`g`);function $o(e){return function(){return e}}function es(e){return function(t){return e(t)+``}}function ts(e,t){var n=Zo.lastIndex=Qo.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Zo.exec(e))&&(i=Qo.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Yo(r,i)})),n=Qo.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?es(c[0].x):$o(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function ns(e,t){var n=typeof t,r;return t==null||n===`boolean`?zo(t):(n===`number`?Yo:n===`string`?(r=bo(t))?(t=r,Wo):ts:t instanceof bo?Wo:t instanceof Date?Jo:Ko(t)?Go:Array.isArray(t)?qo:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Xo:Yo)(e,t)}var rs=180/Math.PI,is={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function as(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*rs,skewX:Math.atan(c)*rs,scaleX:o,scaleY:s}}var os;function ss(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?is:as(t.a,t.b,t.c,t.d,t.e,t.f)}function cs(e){return e==null||(os||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),os.setAttribute(`transform`,e),!(e=os.transform.baseVal.consolidate()))?is:(e=e.matrix,as(e.a,e.b,e.c,e.d,e.e,e.f))}function ls(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Yo(e,i)},{i:c-2,x:Yo(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Yo(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Yo(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Yo(e,n)},{i:s-2,x:Yo(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var us=ls(ss,`px, `,`px)`,`deg)`),ds=ls(cs,`, `,`)`,`)`),fs=1e-12;function ps(e){return((e=Math.exp(e))+1/e)/2}function ms(e){return((e=Math.exp(e))-1/e)/2}function hs(e){return((e=Math.exp(2*e))-1)/(e+1)}var gs=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<fs)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=ps(y),c=s/(n*g)*(i*hs(t*r+y)-ms(y));return[a+c*d,o+c*f,s*i/ps(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),_s=0,vs=0,ys=0,bs=1e3,xs,Ss,Cs=0,ws=0,Ts=0,Es=typeof performance==`object`&&performance.now?performance:Date,Ds=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Os(){return ws||=(Ds(ks),Es.now()+Ts)}function ks(){ws=0}function As(){this._call=this._time=this._next=null}As.prototype=js.prototype={constructor:As,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Os():+n)+(t==null?0:+t),!this._next&&Ss!==this&&(Ss?Ss._next=this:xs=this,Ss=this),this._call=e,this._time=n,Is()},stop:function(){this._call&&(this._call=null,this._time=1/0,Is())}};function js(e,t,n){var r=new As;return r.restart(e,t,n),r}function Ms(){Os(),++_s;for(var e=xs,t;e;)(t=ws-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_s}function Ns(){ws=(Cs=Es.now())+Ts,_s=vs=0;try{Ms()}finally{_s=0,Fs(),ws=0}}function Ps(){var e=Es.now(),t=e-Cs;t>bs&&(Ts-=t,Cs=e)}function Fs(){for(var e,t=xs,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:xs=n);Ss=e,Is(r)}function Is(e){_s||(vs&&=clearTimeout(vs),e-ws>24?(e<1/0&&(vs=setTimeout(Ns,e-Es.now()-Ts)),ys&&=clearInterval(ys)):(ys||=(Cs=Es.now(),setInterval(Ps,bs)),_s=1,Ds(Ns)))}function Ls(e,t,n){var r=new As;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Rs=Fr(`start`,`end`,`cancel`,`interrupt`),zs=[];function Bs(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ws(e,n,{name:t,index:r,group:i,on:Rs,tween:zs,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Vs(e,t){var n=Us(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Hs(e,t){var n=Us(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Us(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Ws(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=js(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Ls(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Ls(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Gs(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Ks(e){return this.each(function(){Gs(this,e)})}function qs(e,t){var n,r;return function(){var i=Hs(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Js(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Hs(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Ys(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Us(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?qs:Js)(n,e,t))}function Xs(e,t,n){var r=e._id;return e.each(function(){var e=Hs(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Us(e,r).value[t]}}function Zs(e,t){var n;return(typeof t==`number`?Yo:t instanceof bo?Wo:(n=bo(t))?(t=n,Wo):ts)(e,t)}function Qs(e){return function(){this.removeAttribute(e)}}function $s(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ec(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function tc(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function nc(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function rc(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ic(e,t){var n=Vr(e),r=n===`transform`?ds:Zs;return this.attrTween(e,typeof t==`function`?(n.local?rc:nc)(n,r,Xs(this,`attr.`+e,t)):t==null?(n.local?$s:Qs)(n):(n.local?tc:ec)(n,r,t))}function ac(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function oc(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sc(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&oc(e,i)),n}return i._value=t,i}function cc(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ac(e,i)),n}return i._value=t,i}function lc(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Vr(e);return this.tween(n,(r.local?sc:cc)(r,t))}function uc(e,t){return function(){Vs(this,e).delay=+t.apply(this,arguments)}}function dc(e,t){return t=+t,function(){Vs(this,e).delay=t}}function fc(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?uc:dc)(t,e)):Us(this.node(),t).delay}function pc(e,t){return function(){Hs(this,e).duration=+t.apply(this,arguments)}}function mc(e,t){return t=+t,function(){Hs(this,e).duration=t}}function hc(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?pc:mc)(t,e)):Us(this.node(),t).duration}function gc(e,t){if(typeof t!=`function`)throw Error();return function(){Hs(this,e).ease=t}}function _c(e){var t=this._id;return arguments.length?this.each(gc(t,e)):Us(this.node(),t).ease}function vc(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Hs(this,e).ease=n}}function yc(e){if(typeof e!=`function`)throw Error();return this.each(vc(this._id,e))}function bc(e){typeof e!=`function`&&(e=$r(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Yc(r,this._parents,this._name,this._id)}function xc(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Yc(o,this._parents,this._name,this._id)}function Sc(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Cc(e,t,n){var r,i,a=Sc(t)?Vs:Hs;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function wc(e,t){var n=this._id;return arguments.length<2?Us(this.node(),n).on.on(e):this.each(Cc(n,e,t))}function Tc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ec(){return this.on(`end.remove`,Tc(this._id))}function Dc(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Kr(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Bs(l[f],t,n,f,l,Us(u,n)));return new Yc(a,this._parents,t,n)}function Oc(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Xr(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Us(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Bs(p,t,n,h,f,m);a.push(f),o.push(u)}return new Yc(a,o,t,n)}var kc=Ia.prototype.constructor;function Ac(){return new kc(this._groups,this._parents)}function jc(e,t){var n,r,i;return function(){var a=Ui(this,e),o=(this.style.removeProperty(e),Ui(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Mc(e){return function(){this.style.removeProperty(e)}}function Nc(e,t,n){var r,i=n+``,a;return function(){var o=Ui(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Pc(e,t,n){var r,i,a;return function(){var o=Ui(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Ui(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Fc(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Hs(this,e),l=c.on,u=c.value[a]==null?s||=Mc(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Ic(e,t,n){var r=(e+=``)==`transform`?us:Zs;return t==null?this.styleTween(e,jc(e,r)).on(`end.style.`+e,Mc(e)):typeof t==`function`?this.styleTween(e,Pc(e,r,Xs(this,`style.`+e,t))).each(Fc(this._id,e)):this.styleTween(e,Nc(e,r,t),n).on(`end.style.`+e,null)}function Lc(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Rc(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Lc(e,a,n)),r}return a._value=t,a}function zc(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Rc(e,t,n??``))}function Bc(e){return function(){this.textContent=e}}function Vc(e){return function(){var t=e(this);this.textContent=t??``}}function Hc(e){return this.tween(`text`,typeof e==`function`?Vc(Xs(this,`text`,e)):Bc(e==null?``:e+``))}function Uc(e){return function(t){this.textContent=e.call(this,t)}}function Wc(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Uc(r)),t}return r._value=e,r}function Gc(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Wc(e))}function Kc(){for(var e=this._name,t=this._id,n=Zc(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Us(c,t);Bs(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Yc(r,this._parents,e,n)}function qc(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Hs(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Jc=0;function Yc(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Xc(e){return Ia().transition(e)}function Zc(){return++Jc}var Qc=Ia.prototype;Yc.prototype=Xc.prototype={constructor:Yc,select:Dc,selectAll:Oc,selectChild:Qc.selectChild,selectChildren:Qc.selectChildren,filter:bc,merge:xc,selection:Ac,transition:Kc,call:Qc.call,nodes:Qc.nodes,node:Qc.node,size:Qc.size,empty:Qc.empty,each:Qc.each,on:wc,attr:ic,attrTween:lc,style:Ic,styleTween:zc,text:Hc,textTween:Gc,remove:Ec,tween:Ys,delay:fc,duration:hc,ease:_c,easeVarying:yc,end:qc,[Symbol.iterator]:Qc[Symbol.iterator]};function $c(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var el={time:null,delay:0,duration:250,ease:$c};function tl(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function nl(e){var t,n;e instanceof Yc?(t=e._id,e=e._name):(t=Zc(),(n=el).time=Os(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Bs(c,e,t,l,o,n||tl(c,t));return new Yc(r,this._parents,e,t)}Ia.prototype.interrupt=Ks,Ia.prototype.transition=nl;var rl=e=>()=>e;function il(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function al(e,t,n){this.k=e,this.x=t,this.y=n}al.prototype={constructor:al,scale:function(e){return e===1?this:new al(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new al(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var ol=new al(1,0,0);sl.prototype=al.prototype;function sl(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ol;return e.__zoom}function cl(e){e.stopImmediatePropagation()}function ll(e){e.preventDefault(),e.stopImmediatePropagation()}function ul(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function dl(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function fl(){return this.__zoom||ol}function pl(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ml(){return navigator.maxTouchPoints||`ontouchstart`in this}function hl(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function gl(){var e=ul,t=dl,n=hl,r=pl,i=ml,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=gs,l=Fr(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,fl).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,fl),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(ol.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new al(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new al(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new al(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Ra(this.that).datum();l.call(e,this.that,new il(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Ba(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Gs(this),s.start();ll(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Ra(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Ba(t,i),l=t.clientX,u=t.clientY;Ga(t.view),cl(t),a.mouse=[c,this.__zoom.invert(c)],Gs(this),a.start();function d(e){if(ll(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Ba(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Ka(e.view,a.moved),ll(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Ba(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);ll(r),s>0?Ra(this).transition().duration(s).call(x,d,c,r):Ra(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(cl(t),s=0;s<i;++s)c=r[s],l=Ba(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Gs(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(ll(e),s=0;s<a;++s)c=i[s],l=Ba(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(cl(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Ba(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Ra(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:rl(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:rl(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:rl(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:rl([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var _l={error001:(e=`react`)=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},vl=[[-1/0,-1/0],[1/0,1/0]],yl=[`Enter`,` `,`Escape`],bl={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},xl;(function(e){e.Strict=`strict`,e.Loose=`loose`})(xl||={});var Sl;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Sl||={});var Cl;(function(e){e.Partial=`partial`,e.Full=`full`})(Cl||={});var wl={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Tl;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Tl||={});var El;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(El||={});var B;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(B||={});var Dl={[B.Left]:B.Right,[B.Right]:B.Left,[B.Top]:B.Bottom,[B.Bottom]:B.Top};function Ol(e){return e===null?null:e?`valid`:`invalid`}var kl=e=>`id`in e&&`source`in e&&`target`in e,Al=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),jl=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Ml=(e,t=[0,0])=>{let{width:n,height:r}=lu(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Nl=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:Kl(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):jl(n)?n:t.nodeLookup.get(n.id)),V(e,i?Jl(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),Pl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=V(n,Jl(e)),r=!0)}),r?Kl(n):{x:0,y:0,width:0,height:0}},Fl=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...tu(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=Xl(s,ql(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},Il=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Ll(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Rl({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=ou(Pl(Ll(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function zl({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,_l.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&cu(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=cu(d)?Hl(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,_l.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Bl({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Il(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Vl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Hl=(e={x:0,y:0},t,n)=>({x:Vl(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Vl(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ul(e,t,n){let{width:r,height:i}=lu(n),{x:a,y:o}=n.internals.positionAbsolute;return Hl(e,[[a,o],[a+r,o+i]],t)}var Wl=(e,t,n)=>e<t?Vl(Math.abs(e-t),1,t)/t:e>n?-Vl(Math.abs(e-n),1,t)/t:0,Gl=(e,t,n=15,r=40)=>[Wl(e.x,r,t.width-r)*n,Wl(e.y,r,t.height-r)*n],V=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),H=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Kl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ql=(e,t=[0,0])=>{let{x:n,y:r}=jl(e)?e.internals.positionAbsolute:Ml(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Jl=(e,t=[0,0])=>{let{x:n,y:r}=jl(e)?e.internals.positionAbsolute:Ml(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Yl=(e,t)=>Kl(V(H(e),H(t))),Xl=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Zl=e=>Ql(e.width)&&Ql(e.height)&&Ql(e.x)&&Ql(e.y),Ql=e=>!isNaN(e)&&isFinite(e),$l=(e,t)=>(e,t)=>{},eu=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),tu=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?eu(s,o):s},nu=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function ru(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function iu(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=ru(e,n),i=ru(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=ru(e.top??e.y??0,n),i=ru(e.bottom??e.y??0,n),a=ru(e.left??e.x??0,t),o=ru(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function au(e,t,n,r,i,a){let{x:o,y:s}=nu(e,[t,n,r]),{x:c,y:l}=nu({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var ou=(e,t,n,r,i,a)=>{let o=iu(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Vl(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=au(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},su=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function cu(e){return e!=null&&e!==`parent`}function lu(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function uu(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function du(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function fu(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function pu(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function mu(e){return{...bl,...e||{}}}function hu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=xu(e),s=tu({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?eu(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var gu=e=>({width:e.offsetWidth,height:e.offsetHeight}),_u=e=>e?.getRootNode?.()||window?.document,vu=[`INPUT`,`SELECT`,`TEXTAREA`];function yu(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?vu.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var bu=e=>`clientX`in e,xu=(e,t)=>{let n=bu(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Su=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...gu(t)}})};function Cu({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function wu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tu({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case B.Left:return[t-wu(t-r,a),n];case B.Right:return[t+wu(r-t,a),n];case B.Top:return[t,n-wu(n-i,a)];case B.Bottom:return[t,n+wu(i-n,a)]}}function Eu({sourceX:e,sourceY:t,sourcePosition:n=B.Bottom,targetX:r,targetY:i,targetPosition:a=B.Top,curvature:o=.25}){let[s,c]=Tu({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Tu({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Cu({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function Du({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Ou({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function ku({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=V(Jl(e),Jl(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Xl({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Kl(a))>0}var Au=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,ju=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Mu=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,_l.error006()),t;let r=n.getEdgeId||Au,i;return i=kl(e)?{...e}:{...e,id:r(e)},ju(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function Nu({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=Du({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var Pu={[B.Left]:{x:-1,y:0},[B.Right]:{x:1,y:0},[B.Top]:{x:0,y:-1},[B.Bottom]:{x:0,y:1}},Fu=({source:e,sourcePosition:t=B.Bottom,target:n})=>t===B.Left||t===B.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Iu=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Lu({source:e,sourcePosition:t=B.Bottom,target:n,targetPosition:r=B.Top,center:i,offset:a,stepPosition:o}){let s=Pu[t],c=Pu[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Fu({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=Du({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Ru(e,t,n,r){let i=Math.min(Iu(e,t)/2,Iu(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function zu({sourceX:e,sourceY:t,sourcePosition:n=B.Bottom,targetX:r,targetY:i,targetPosition:a=B.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Lu({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Ru(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function Bu(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Vu(e){let{sourceNode:t,targetNode:n}=e;if(!Bu(t)||!Bu(n))return null;let r=t.internals.handleBounds||Hu(t.handles),i=n.internals.handleBounds||Hu(n.handles),a=Wu(r?.source??[],e.sourceHandle),o=Wu(e.connectionMode===xl.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,_l.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||B.Bottom,c=o?.position||B.Top,l=Uu(t,a,s),u=Uu(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function Hu(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function Uu(e,t,n=B.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??lu(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case B.Top:return{x:i+o/2,y:a};case B.Right:return{x:i+o,y:a+s/2};case B.Bottom:return{x:i+o/2,y:a+s};case B.Left:return{x:i,y:a+s/2}}}function Wu(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Gu(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Ku(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=Gu(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var qu=1e3,Ju=10,Yu={nodeOrigin:[0,0],nodeExtent:vl,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Xu={...Yu,checkEquality:!0};function Zu(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Qu(e,t,n){let r=Zu(Yu,n);for(let n of e.values())if(n.parentId)rd(n,e,t,r);else{let e=Hl(Ml(n,r.nodeOrigin),cu(n.extent)?n.extent:r.nodeExtent,lu(n));n.internals.positionAbsolute=e}}function $u(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function ed(e){return e===`manual`}function td(e,t,n,r={}){let i=Zu(Xu,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!ed(i.zIndexMode)?qu:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Hl(Ml(u,i.nodeOrigin),cu(u.extent)?u.extent:i.nodeExtent,lu(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:$u(u,e),z:id(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&rd(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function nd(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function rd(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Zu(Yu,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}nd(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Ju),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=ad(e,u,o,s,a&&!ed(c)?qu:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function id(e,t,n){let r=Ql(e.zIndex)?e.zIndex:0;return ed(n)?r:r+(e.selected?t:0)}function ad(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=lu(e),l=Ml(e,n),u=cu(e.extent)?Hl(l,e.extent,c):l,d=Hl({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Ul(d,c,t));let f=id(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function od(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Yl(a.get(n.parentId)?.expandedRect??ql(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=lu(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function sd(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=gu(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=cu(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=Ul(h,s,t.get(e.parentId)):m&&(h=Hl(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Su(`source`,r.nodeElement,p,d,e.id),target:Su(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&rd(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:ql(g,i)}))}}if(f.length>0){let e=od(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function cd({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function ld(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function ud(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;ld(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),ld(`target`,s,c,e,i,o),t.set(r.id,r)}}function dd(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:dd(n,t):!1}function fd(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function pd(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!dd(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function md({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function hd({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=eu(a,t);return{x:o.x-a.x,y:o.y-a.y}}function gd({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=Ra(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?H(Pl(s)):null,x=v&&l?hd({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:eu(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=zl({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=md({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Gl(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=hu(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=pd(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=md({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=$a().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=hu(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=xu(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=hu(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=xu(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=xu(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=md({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!fd(t,`.${g}`,v))&&(!_||fd(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function _d(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Xl(i,ql(e))>0&&r.push(e);return r}var vd=250;function yd(e,t,n,r){let i=[],a=1/0,o=_d(e,n,t+vd);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Uu(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function bd(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Uu(o,c,c.position,!0)}:c}function xd(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Sd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Cd=()=>!0;function wd(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=Cd,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=_u(e.target),E=0,D,{x:O,y:k}=xu(e),A=xd(a,w),j=s?.getBoundingClientRect(),ee=!1;if(!j||!A)return;let M=bd(i,A,r,c,t);if(!M)return;let te=xu(e,j),ne=!1,N=null,P=!1,re=null;function ie(){if(!u||!j)return;let[e,t]=Gl(te,j,S);f({x:e,y:t}),E=requestAnimationFrame(ie)}let ae={...M,nodeId:i,type:A,position:M.position},oe=c.get(i),F={inProgress:!0,isValid:null,from:Uu(oe,ae,B.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:oe,to:te,toHandle:null,toPosition:Dl[ae.position],toNode:null,pointer:te};function I(){ee=!0,y(F),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&I();function se(e){if(!ee){let{x:t,y:n}=xu(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;I()}if(!x()||!ae){ce(e);return}let a=b();te=xu(e,j),D=yd(tu(te,a,!1,[1,1]),n,c,ae),ne||=(ie(),!0);let s=Td(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,N=s.connection,P=Sd(!!D,s.isValid);let u=c.get(i),f=u?Uu(u,ae,B.Left,!0):F.from,p={...F,from:f,isValid:P,to:s.toHandle&&P?nu({x:s.toHandle.x,y:s.toHandle.y},a):te,toHandle:s.toHandle,toPosition:P&&s.toHandle?s.toHandle.position:Dl[ae.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:te};y(p),F=p}function ce(e){if(!(`touches`in e&&e.touches.length>0)){if(ee){(D||re)&&N&&P&&h?.(N);let{inProgress:t,...n}=F,r={...n,toPosition:F.toHandle?F.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ne=!1,P=!1,N=null,re=null,T.removeEventListener(`mousemove`,se),T.removeEventListener(`mouseup`,ce),T.removeEventListener(`touchmove`,se),T.removeEventListener(`touchend`,ce)}}T.addEventListener(`mousemove`,se),T.addEventListener(`mouseup`,ce),T.addEventListener(`touchmove`,se),T.addEventListener(`touchend`,ce)}function Td(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Cd,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=xu(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=xd(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===xl.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=bd(t,e,a,u,n,!0)}return _}var Ed={onPointerDown:wd,isValid:Td};function Dd({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Ra(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&su()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=gl().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Ba}}var Od=e=>({x:e.x,y:e.y,zoom:e.k}),U=({x:e,y:t,zoom:n})=>ol.translate(e,t).scale(n),kd=(e,t)=>e.target.closest(`.${t}`),Ad=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),jd=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Md=(e,t=0,n=jd,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},Nd=e=>{let t=e.ctrlKey&&su()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Pd({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(kd(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=Ba(u),t=d*2**Nd(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Sl.Vertical?0:u.deltaX*f,m=i===Sl.Horizontal?0:u.deltaY*f;!su()&&u.shiftKey&&i!==Sl.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Od(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function Fd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=kd(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function Id({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Od(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Ld({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Ad(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Od(a.transform))}}function Rd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Ad(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Od(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function zd({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(kd(d,`${l}-flow__node`)||kd(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||kd(d,s)&&m||kd(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function Bd({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=gl().scaleExtent([t,n]).translateExtent(r),f=Ra(e).call(d);v({x:i.x,y:i.y,zoom:Vl(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(Nd);async function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?ns:gs).transform(Md(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&_();let O=i&&!S&&!r;d.clickDistance(D?1/0:!Ql(E)||E<0?0:E);let k=O?Pd({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):Fd({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});f.on(`wheel.zoom`,k,{passive:!1});let A=Id({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,A);let j=Ld({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});d.on(`zoom`,j);let ee=Rd({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,ee);let M=zd({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});d.filter(M),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=U(e),i=d?.constrain()(r,t,n);return i&&await h(i),i}async function y(e,t){let n=U(e);return await h(n,t),n}function b(e){if(f){let t=U(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?sl(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?ns:gs).scaleTo(Md(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function C(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?ns:gs).scaleBy(Md(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function w(e){d?.scaleExtent(e)}function T(e){d?.translateExtent(e)}function E(e){let t=!Ql(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:C,setScaleExtent:w,setTranslateExtent:T,syncViewport:b,setClickDistance:E}}var Vd;(function(e){e.Line=`line`,e.Handle=`handle`})(Vd||={});function Hd({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function Ud(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function Wd(e,t){return Math.max(0,t-e)}function Gd(e,t){return Math.max(0,e-t)}function Kd(e,t,n){return Math.max(0,t-e,e-n)}function qd(e,t){return e?!t:t}function Jd(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=Kd(E,h,g),j=Kd(D,_,v);if(o){let e=0,t=0;c&&w<0?e=Wd(y+w+O,o[0][0]):!c&&w>0&&(e=Gd(y+E+O,o[1][0])),l&&T<0?t=Wd(b+T+k,o[0][1]):!l&&T>0&&(t=Gd(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=Gd(y+w,s[0][0]):!c&&w<0&&(e=Wd(y+E,s[1][0])),l&&T>0?t=Gd(b+T,s[0][1]):!l&&T<0&&(t=Wd(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=Kd(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?Gd(b+k+E/C,o[1][1])*C:Wd(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?Wd(b+E/C,s[1][1])*C:Gd(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=Kd(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?Gd(y+D*C+O,o[1][0])/C:Wd(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?Wd(y+D*C,s[1][0])/C:Gd(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(qd(c,l)?-w:w)/C:w=(qd(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let ee=c?y+w:y,M=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+ee,y:a[1]*T*(l?-1:1)+M}}var Yd={width:0,height:0,x:0,y:0},Xd={...Yd,pointerX:0,pointerY:0,aspectRatio:1};function Zd(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function Qd({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=Ra(e),o={controlDirection:Ud(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...Yd},h={...Xd};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:Ud(e)};let g,_=null,v=[],y,b,x,S=!1,C=$a().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=hu(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=cu(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=Zd(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=hu(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=Jd(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,ee=O!==w,M=k!==u&&j,te=A!==f&ⅇif(!M&&!te&&!j&&!ee)return;if((M||te||E[0]===1||E[1]===1)&&(T.x=M?k:m.x,T.y=te?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||ee)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=ee&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let ne=Hd({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),N={...m,direction:ne};p?.(e,N)!==!1&&(S=!0,d?.(e,N),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var $d=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ef=o(((e,t)=>{t.exports=$d()})),tf=o((e=>{var t=u(),n=ef();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),nf=c(o(((e,t)=>{t.exports=tf()}))(),1),rf=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},af=e=>e?rf(e):rf,{useDebugValue:of}=C.default,{useSyncExternalStoreWithSelector:sf}=nf.default,cf=e=>e;function lf(e,t=cf,n){let r=sf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return of(r),r}var uf=(e,t)=>{let n=af(e),r=(e,r=t)=>lf(n,e,r);return Object.assign(r,n),r},df=(e,t)=>e?uf(e,t):uf;function ff(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var pf=(0,C.createContext)(null),mf=pf.Provider,hf=_l.error001(`react`);function W(e,t){let n=(0,C.useContext)(pf);if(n===null)throw Error(hf);return lf(n,e,t)}function gf(){let e=(0,C.useContext)(pf);if(e===null)throw Error(hf);return(0,C.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var _f={display:`none`},vf={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},yf=`react-flow__node-desc`,bf=`react-flow__edge-desc`,xf=`react-flow__aria-live`,Sf=e=>e.ariaLiveMessage,Cf=e=>e.ariaLabelConfig;function wf({rfId:e}){let t=W(Sf);return(0,R.jsx)(`div`,{id:`${xf}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:vf,children:t})}function Tf({rfId:e,disableKeyboardA11y:t}){let n=W(Cf);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{id:`${yf}-${e}`,style:_f,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,R.jsx)(`div`,{id:`${bf}-${e}`,style:_f,children:n[`edge.a11yDescription.default`]}),!t&&(0,R.jsx)(wf,{rfId:e})]})}var Ef=(0,C.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,R.jsx)(`div`,{className:Nr([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));Ef.displayName=`Panel`;function Df({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,R.jsx)(Ef,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,R.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var Of=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},kf=e=>e.id;function Af(e,t){return ff(e.selectedNodes.map(kf),t.selectedNodes.map(kf))&&ff(e.selectedEdges.map(kf),t.selectedEdges.map(kf))}function jf({onSelectionChange:e}){let t=gf(),{selectedNodes:n,selectedEdges:r}=W(Of,Af);return(0,C.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Mf=e=>!!e.onSelectionChangeHandlers;function Nf({onSelectionChange:e}){let t=W(Mf);return e||t?(0,R.jsx)(jf,{onSelectionChange:e}):null}var Pf=[0,0],Ff={x:0,y:0,zoom:1},If=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],Lf=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Rf={translateExtent:vl,nodeOrigin:Pf,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function zf(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=W(Lf,ff),l=gf();(0,C.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Rf,s()}),[]);let u=(0,C.useRef)(Rf);return(0,C.useEffect)(()=>{for(let s of If){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:mu(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},If.map(t=>e[t])),null}function Bf(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Vf(e){let[t,n]=(0,C.useState)(e===`system`?null:e);return(0,C.useEffect)(()=>{if(e!==`system`){n(e);return}let t=Bf(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Bf()?.matches?`dark`:`light`:t}var Hf=typeof document<`u`?document:null;function Uf(e=null,t={target:Hf,actInsideInputWithModifier:!0}){let[n,r]=(0,C.useState)(!1),i=(0,C.useRef)(!1),a=(0,C.useRef)(new Set([])),[o,s]=(0,C.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,C.useEffect)(()=>{let n=t?.target??Hf,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&yu(e))return!1;let n=Gf(e.code,s);if(a.current.add(e[n]),Wf(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=Gf(e.code,s);Wf(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function Wf(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Gf(e,t){return t.includes(e)?`code`:`key`}var Kf=()=>{let e=gf();return(0,C.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=ou(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return tu(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=nu(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function qf(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)Jf(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function Jf(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function Yf(e,t){return qf(e,t)}function Xf(e,t){return qf(e,t)}function Zf(e,t){return{id:e,type:`select`,selected:t}}function Qf(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(Zf(a.id,e)))}return r}function $f({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function ep(e){return{id:e.id,type:`remove`}}var tp=$l(`React Flow`,`https://reactflow.dev/`);function np(e,t,n={}){return Mu(e,t,{...n,onError:n.onError??tp})}var rp=e=>Al(e),ip=e=>kl(e);function ap(e){return(0,C.forwardRef)(e)}var op=typeof window<`u`?C.useLayoutEffect:C.useEffect;function sp(e){let[t,n]=(0,C.useState)(BigInt(0)),[r]=(0,C.useState)(()=>cp(()=>n(e=>e+BigInt(1))));return op(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function cp(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var lp=(0,C.createContext)(null);function up({children:e}){let t=gf(),n=sp((0,C.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=$f({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=sp((0,C.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a($f({items:s,lookup:o}))},[])),i=(0,C.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,R.jsx)(lp.Provider,{value:i,children:e})}function dp(){let e=(0,C.useContext)(lp);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var fp=e=>!!e.panZoom;function pp(){let e=Kf(),t=gf(),n=dp(),r=W(fp),i=(0,C.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=rp(e)?e:n.get(e.id),a=i.parentId?du(i.position,i.measured,i.parentId,n,r):i.position;return ql({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&rp(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&ip(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Bl({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(ep);o?.(f),c(e)}if(m){let e=d.map(ep);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Zl(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=ql(s?r:a),l=Xl(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Zl(e)?e:a(e);if(!r)return!1;let i=Xl(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Nl(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??pu();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,C.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var mp=e=>e.selected,hp=typeof window<`u`?window:void 0;function gp({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=gf(),{deleteElements:r}=pp(),i=Uf(e,{actInsideInputWithModifier:!1}),a=Uf(t,{target:hp});(0,C.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(mp),edges:e.filter(mp)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,C.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function _p(e){let t=gf();(0,C.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=gu(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,_l.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var vp={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},yp=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bp({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Sl.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=gf(),S=(0,C.useRef)(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=W(yp,ff),D=Uf(f),O=(0,C.useRef)();_p(S);let k=(0,C.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,C.useEffect)(()=>{if(S.current){O.current=Bd({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return x.setState({panZoom:O.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,C.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:D,preventScrolling:p,noPanClassName:g,userSelectionActive:w,noWheelClassName:h,lib:T,onTransformChange:k,connectionInProgress:E,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,D,p,g,w,h,T,k,E,b,y]),(0,R.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:vp,children:m})}var xp=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Sp(){let{userSelectionActive:e,userSelectionRect:t}=W(xp,ff);return e&&t?(0,R.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var Cp=(e,t)=>n=>{n.target===t.current&&e?.(n)},wp=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Tp({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Cl.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,C.useRef)(0),_=gf(),{userSelectionActive:v,elementsSelectable:y,dragging:b,connectionInProgress:x,panBy:S,autoPanSpeed:w}=W(wp,ff),T=y&&(e||v),E=(0,C.useRef)(null),D=(0,C.useRef)(),O=(0,C.useRef)(new Set),k=(0,C.useRef)(new Set),A=(0,C.useRef)(!1),j=(0,C.useRef)({x:0,y:0}),ee=(0,C.useRef)(!1),M=e=>{if(A.current||x){A.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},te=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},ne=d?e=>d(e):void 0,N=e=>{A.current&&=(e.stopPropagation(),!1)},P=n=>{let{domNode:r,transform:i}=_.getState();if(D.current=r?.getBoundingClientRect(),!D.current)return;let a=n.target===E.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:s,y:c}=xu(n.nativeEvent,D.current),l=tu({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function re(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=nu(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=O.current,g=k.current;O.current=new Set(Fl(a,m,i,n===Cl.Partial,!0).map(e=>e.id)),k.current=new Set;let v=u?.selectable??!0;for(let e of O.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&k.current.add(e)}}fu(h,O.current)||c(Qf(a,O.current,!0)),fu(g,k.current)||l(Qf(o,k.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function ie(){if(!i||!D.current)return;let[e,t]=Gl(j.current,D.current,w);S({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(ie);return}let{x:t,y:n}=j.current;re(t,n),g.current=requestAnimationFrame(ie)})}let ae=()=>{cancelAnimationFrame(g.current),g.current=0,ee.current=!1};return(0,C.useEffect)(()=>()=>ae(),[]),(0,R.jsxs)(`div`,{className:Nr([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:b,selection:e}]),onClick:T?void 0:Cp(M,E),onContextMenu:Cp(te,E),onWheel:Cp(ne,E),onPointerEnter:T?void 0:f,onPointerMove:T?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!D.current||!n)return;let{x:o,y:c}=xu(e.nativeEvent,D.current);j.current={x:o,y:c};let l=nu({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,ee.current||=(ie(),!0),re(o,c)}:p,onPointerUp:T?e=>{e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===E.current&&_.getState().userSelectionRect&&M?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),_.setState({nodesSelectionActive:O.current.size>0})),ae())}:void 0,onPointerCancel:T?e=>{e.target?.releasePointerCapture?.(e.pointerId),ae()}:void 0,onPointerDownCapture:T?P:void 0,onClickCapture:T?N:void 0,onPointerLeave:m,ref:E,style:vp,children:[h,(0,R.jsx)(Sp,{})]})}function Ep({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,_l.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function Dp({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=gf(),[c,l]=(0,C.useState)(!1),u=(0,C.useRef)();return(0,C.useEffect)(()=>{u.current=gd({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Ep({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,C.useEffect)(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i,o]),c}var Op=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function kp(){let e=gf();return(0,C.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=Op(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=eu(t,i));let{position:a,positionAbsolute:s}=zl({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var Ap=(0,C.createContext)(null),jp=Ap.Provider;Ap.Consumer;var Mp=()=>(0,C.useContext)(Ap),Np=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Pp=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===xl.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Fp({type:e=`source`,position:t=B.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=gf(),_=Mp(),{connectOnClick:v,noPanClassName:y,rfId:b}=W(Np,ff),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=W(Pp(_,m,e),ff);_||g.getState().onError?.(`010`,_l.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(np(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=bu(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();Ed.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,R.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Nr([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=_u(t.target),h=n||c,{connection:v,isValid:y}=Ed.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var Ip=(0,C.memo)(ap(Fp));function Lp({data:e,isConnectable:t,sourcePosition:n=B.Bottom}){return(0,R.jsxs)(R.Fragment,{children:[e?.label,(0,R.jsx)(Ip,{type:`source`,position:n,isConnectable:t})]})}function Rp({data:e,isConnectable:t,targetPosition:n=B.Top,sourcePosition:r=B.Bottom}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ip,{type:`target`,position:n,isConnectable:t}),e?.label,(0,R.jsx)(Ip,{type:`source`,position:r,isConnectable:t})]})}function zp(){return null}function Bp({data:e,isConnectable:t,targetPosition:n=B.Top}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ip,{type:`target`,position:n,isConnectable:t}),e?.label]})}var Vp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Hp={input:Lp,default:Rp,output:Bp,group:zp};function Up(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var Wp=e=>{let{width:t,height:n,x:r,y:i}=Pl(e.nodeLookup,{filter:e=>!!e.selected});return{width:Ql(t)?t:null,height:Ql(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Gp({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=gf(),{width:i,height:a,transformString:o,userSelectionActive:s}=W(Wp,ff),c=kp(),l=(0,C.useRef)(null);(0,C.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(Dp({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,R.jsx)(`div`,{className:Nr([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,R.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Vp,e.key)&&(e.preventDefault(),c({direction:Vp[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var Kp=typeof window<`u`?window:void 0,qp=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Jp({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:ee,noPanClassName:M,disableKeyboardA11y:te,onViewportChange:ne,isControlledViewport:N}){let{nodesSelectionActive:P,userSelectionActive:re}=W(qp,ff),ie=Uf(l,{target:Kp}),ae=Uf(h,{target:Kp}),oe=ae||w,F=ae||b,I=u&&oe!==!0,se=ie||re||I;return gp({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,R.jsx)(bp,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:F,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ie&&oe,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:ee,noPanClassName:M,onViewportChange:ne,isControlledViewport:N,paneClickDistance:s,selectionOnDrag:I,children:(0,R.jsxs)(Tp,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:oe,autoPanOnSelection:T,isSelecting:!!se,selectionMode:d,selectionKeyPressed:ie,paneClickDistance:s,selectionOnDrag:I,children:[e,P&&(0,R.jsx)(Gp,{onSelectionContextMenu:j,noPanClassName:M,disableKeyboardA11y:te})]})})}Jp.displayName=`FlowRenderer`;var Yp=(0,C.memo)(Jp),Xp=e=>t=>e?Fl(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function Zp(e){return W((0,C.useCallback)(Xp(e),[e]),ff)}var Qp=e=>e.updateNodeInternals;function $p(){let e=W(Qp),[t]=(0,C.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,C.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function em({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=gf(),a=(0,C.useRef)(null),o=(0,C.useRef)(null),s=(0,C.useRef)(e.sourcePosition),c=(0,C.useRef)(e.targetPosition),l=(0,C.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,C.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,C.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,C.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function tm({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=W(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},ff),S=y.type||`default`,C=g?.[S]||Hp[S];C===void 0&&(v?.(`003`,_l.error003(S)),S=`default`,C=g?.default||Hp.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=gf(),k=uu(y),A=em({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=Dp({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),ee=kp();if(y.hidden)return null;let M=lu(y),te=Up(y),ne=T||w||t||n||r||i,N=n?e=>n(e,{...b.userNode}):void 0,P=r?e=>r(e,{...b.userNode}):void 0,re=i?e=>i(e,{...b.userNode}):void 0,ie=a?e=>a(e,{...b.userNode}):void 0,ae=o?e=>o(e,{...b.userNode}):void 0,oe=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&Ep({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},F=t=>{if(!(yu(t.nativeEvent)||m)){if(yl.includes(t.key)&&T)Ep({id:e,store:O,unselect:t.key===`Escape`,nodeRef:A});else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(Vp,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),ee({direction:Vp[t.key],factor:t.shiftKey?4:1})}}},I=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Fl(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+M.width/2,y.position.y+M.height/2,{zoom:t[2]}))};return(0,R.jsx)(`div`,{className:Nr([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:ne?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:N,onMouseMove:P,onMouseLeave:re,onContextMenu:ie,onClick:oe,onDoubleClick:ae,onKeyDown:D?F:void 0,tabIndex:D?0:void 0,onFocus:D?I:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${yf}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,R.jsx)(jp,{value:e,children:(0,R.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...M})})})}var nm=(0,C.memo)(tm),rm=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function im(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=W(rm,ff),o=Zp(e.onlyRenderVisibleElements),s=$p();return(0,R.jsx)(`div`,{className:`react-flow__nodes`,style:vp,children:o.map(o=>(0,R.jsx)(nm,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}im.displayName=`NodeRenderer`;var am=(0,C.memo)(im);function om(e){return W((0,C.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&ku({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),ff)}var sm=({color:e=`none`,strokeWidth:t=1})=>(0,R.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),cm=({color:e=`none`,strokeWidth:t=1})=>(0,R.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),lm={[El.Arrow]:sm,[El.ArrowClosed]:cm};function um(e){let t=gf();return(0,C.useMemo)(()=>Object.prototype.hasOwnProperty.call(lm,e)?lm[e]:(t.getState().onError?.(`009`,_l.error009(e)),null),[e])}var dm=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=um(t);return c?(0,R.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,R.jsx)(c,{color:n,strokeWidth:o})}):null},fm=({defaultColor:e,rfId:t})=>{let n=W(e=>e.edges),r=W(e=>e.defaultEdgeOptions),i=(0,C.useMemo)(()=>Ku(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,R.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,R.jsx)(`defs`,{children:i.map(e=>(0,R.jsx)(dm,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};fm.displayName=`MarkerDefinitions`;var pm=(0,C.memo)(fm);function mm({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,C.useState)({x:1,y:0,width:0,height:0}),p=Nr([`react-flow__edge-textwrapper`,l]),m=(0,C.useRef)(null);return(0,C.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,R.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,R.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,R.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}mm.displayName=`EdgeText`;var hm=(0,C.memo)(mm);function gm({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{...u,d:e,fill:`none`,className:Nr([`react-flow__edge-path`,u.className])}),l?(0,R.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Ql(t)&&Ql(n)?(0,R.jsx)(hm,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function _m({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===B.Left||e===B.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function vm({sourceX:e,sourceY:t,sourcePosition:n=B.Bottom,targetX:r,targetY:i,targetPosition:a=B.Top}){let[o,s]=_m({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=_m({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Cu({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function ym(e){return(0,C.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=vm({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,R.jsx)(gm,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var bm=ym({isInternal:!1}),xm=ym({isInternal:!0});bm.displayName=`SimpleBezierEdge`,xm.displayName=`SimpleBezierEdgeInternal`;function Sm(e){return(0,C.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=B.Bottom,targetPosition:m=B.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=zu({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,R.jsx)(gm,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var Cm=Sm({isInternal:!1}),wm=Sm({isInternal:!0});Cm.displayName=`SmoothStepEdge`,wm.displayName=`SmoothStepEdgeInternal`;function Tm(e){return(0,C.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,R.jsx)(Cm,{...n,id:r,pathOptions:(0,C.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var Em=Tm({isInternal:!1}),Dm=Tm({isInternal:!0});Em.displayName=`StepEdge`,Dm.displayName=`StepEdgeInternal`;function Om(e){return(0,C.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=Nu({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,R.jsx)(gm,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var km=Om({isInternal:!1}),Am=Om({isInternal:!0});km.displayName=`StraightEdge`,Am.displayName=`StraightEdgeInternal`;function jm(e){return(0,C.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=B.Bottom,targetPosition:s=B.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Eu({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,R.jsx)(gm,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var Mm=jm({isInternal:!1}),Nm=jm({isInternal:!0});Mm.displayName=`BezierEdge`,Nm.displayName=`BezierEdgeInternal`;var Pm={default:Nm,straight:Am,step:Dm,smoothstep:wm,simplebezier:xm},Fm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Im=(e,t,n)=>n===B.Left?e-t:n===B.Right?e+t:e,Lm=(e,t,n)=>n===B.Top?e-t:n===B.Bottom?e+t:e,Rm=`react-flow__edgeupdater`;function zm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,R.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Nr([Rm,`${Rm}-${s}`]),cx:Im(t,r,e),cy:Lm(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function Bm({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=gf(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;Ed.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,R.jsxs)(R.Fragment,{children:[(e===!0||e===`source`)&&(0,R.jsx)(zm,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,R.jsx)(zm,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function Vm({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=W(t=>t.edgeLookup.get(e)),b=W(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||Pm[x];S===void 0&&(_?.(`011`,_l.error011(x)),x=`default`,S=h?.default||Pm.default);let w=!!(y.focusable||t&&y.focusable===void 0),T=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),E=!!(y.selectable||r&&y.selectable===void 0),D=(0,C.useRef)(null),[O,k]=(0,C.useState)(!1),[A,j]=(0,C.useState)(!1),ee=gf(),{zIndex:M,sourceX:te,sourceY:ne,targetX:N,targetY:P,sourcePosition:re,targetPosition:ie}=W((0,C.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return{zIndex:y.zIndex,...Fm};let i=Vu({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:Ou({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...i||Fm}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),ff),ae=(0,C.useMemo)(()=>y.markerStart?`url('#${Gu(y.markerStart,m)}')`:void 0,[y.markerStart,m]),oe=(0,C.useMemo)(()=>y.markerEnd?`url('#${Gu(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||te===null||ne===null||N===null||P===null)return null;let F=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=ee.getState();E&&(ee.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),D.current?.blur()):n([e])),i&&i(t,y)},I=a?e=>{a(e,{...y})}:void 0,se=o?e=>{o(e,{...y})}:void 0,ce=s?e=>{s(e,{...y})}:void 0,le=c?e=>{c(e,{...y})}:void 0,ue=l?e=>{l(e,{...y})}:void 0;return(0,R.jsx)(`svg`,{style:{zIndex:M},children:(0,R.jsxs)(`g`,{className:Nr([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:F,onDoubleClick:I,onContextMenu:se,onMouseEnter:ce,onMouseMove:le,onMouseLeave:ue,onKeyDown:w?t=>{if(!v&&yl.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=ee.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:y.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":w?`${bf}-${m}`:void 0,ref:D,...y.domAttributes,children:[!A&&(0,R.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:E,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:te,sourceY:ne,targetX:N,targetY:P,sourcePosition:re,targetPosition:ie,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ae,markerEnd:oe,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&(0,R.jsx)(Bm,{edge:y,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:te,sourceY:ne,targetX:N,targetY:P,sourcePosition:re,targetPosition:ie,setUpdateHover:k,setReconnecting:j})]})})}var Hm=(0,C.memo)(Vm),Um=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Wm({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=W(Um,ff),b=om(t);return(0,R.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,R.jsx)(pm,{defaultColor:e,rfId:n}),b.map(e=>(0,R.jsx)(Hm,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}Wm.displayName=`EdgeRenderer`;var Gm=(0,C.memo)(Wm),Km=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function qm({children:e}){return(0,R.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:W(Km)},children:e})}function Jm(e){let t=pp(),n=(0,C.useRef)(!1);(0,C.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var Ym=e=>e.panZoom?.syncViewport;function Xm(e){let t=W(Ym),n=gf();return(0,C.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Zm(e){return e.connection.inProgress?{...e.connection,to:tu(e.connection.to,e.transform)}:{...e.connection}}function Qm(e){return e?t=>e(Zm(t)):Zm}function $m(e){return W(Qm(e),ff)}var eh=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function th({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=W(eh,ff);return a&&i&&c?(0,R.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,R.jsx)(`g`,{className:Nr([`react-flow__connection`,Ol(s)]),children:(0,R.jsx)(nh,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var nh=({style:e,type:t=Tl.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=$m();if(!i)return;if(n)return(0,R.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Ol(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case Tl.Bezier:[m]=Eu(h);break;case Tl.SimpleBezier:[m]=vm(h);break;case Tl.Step:[m]=zu({...h,borderRadius:0});break;case Tl.SmoothStep:[m]=zu(h);break;default:[m]=Nu(h)}return(0,R.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};nh.displayName=`ConnectionLine`;var rh={};function ih(e=rh){(0,C.useRef)(e),gf(),(0,C.useEffect)(()=>{},[e])}function ah(){gf(),(0,C.useRef)(!1),(0,C.useEffect)(()=>{},[])}function oh({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:ee,zoomOnScroll:M,zoomOnPinch:te,panOnScroll:ne,panOnScrollSpeed:N,panOnScrollMode:P,zoomOnDoubleClick:re,panOnDrag:ie,autoPanOnSelection:ae,onPaneClick:oe,onPaneMouseEnter:F,onPaneMouseMove:I,onPaneMouseLeave:se,onPaneScroll:ce,onPaneContextMenu:le,paneClickDistance:ue,nodeClickDistance:de,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:me,onEdgeMouseLeave:he,reconnectRadius:ge,onReconnect:_e,onReconnectStart:ve,onReconnectEnd:ye,noDragClassName:be,noWheelClassName:xe,noPanClassName:Se,disableKeyboardA11y:Ce,nodeExtent:we,rfId:Te,viewport:Ee,onViewportChange:De}){return ih(e),ih(t),ah(),Jm(n),Xm(Ee),(0,R.jsx)(Yp,{onPaneClick:oe,onPaneMouseEnter:F,onPaneMouseMove:I,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ce,paneClickDistance:ue,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:M,zoomOnPinch:te,zoomOnDoubleClick:re,panOnScroll:ne,panOnScrollSpeed:N,panOnScrollMode:P,panOnDrag:ie,autoPanOnSelection:ae,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:be,noWheelClassName:xe,noPanClassName:Se,disableKeyboardA11y:Ce,onViewportChange:De,isControlledViewport:!!Ee,children:(0,R.jsxs)(qm,{children:[(0,R.jsx)(Gm,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:_e,onReconnectStart:ve,onReconnectEnd:ye,onlyRenderVisibleElements:T,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:me,onEdgeMouseLeave:he,reconnectRadius:ge,defaultMarkerColor:ee,noPanClassName:Se,disableKeyboardA11y:Ce,rfId:Te}),(0,R.jsx)(th,{style:h,type:m,component:g,containerStyle:_}),(0,R.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,R.jsx)(am,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:de,onlyRenderVisibleElements:T,noPanClassName:Se,noDragClassName:be,disableKeyboardA11y:Ce,nodeExtent:we,rfId:Te}),(0,R.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}oh.displayName=`GraphView`;var sh=(0,C.memo)(oh),ch=$l(`React Flow`,`https://reactflow.dev/`),lh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??vl;ud(h,g,_);let{nodesInitialized:x}=td(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=ou(Pl(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:vl,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xl.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...wl},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ch,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:bl,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},uh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>df((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Rl({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...lh({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=td(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();ud(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=sd(e,n,r,i,a,o,l);d&&(Qu(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=Uu(e,o.fromHandle,B.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=od(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(Yf(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(Xf(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>Zf(e,!0)));return}i(Qf(r,new Set([...e]),!0)),a(Qf(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>Zf(e,!0)));return}a(Qf(n,new Set([...e]))),i(Qf(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(Zf(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(Zf(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,Zf(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,Zf(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(td(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return cd({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...wl}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...lh()})}},Object.is);function dh({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,C.useState)(()=>uh({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,R.jsx)(mf,{value:m,children:(0,R.jsx)(up,{children:p})})}function fh({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,C.useContext)(pf)?(0,R.jsx)(R.Fragment,{children:e}):(0,R.jsx)(dh,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var ph={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function mh({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:ee,onSelectionDragStop:M,onSelectionContextMenu:te,onSelectionStart:ne,onSelectionEnd:N,onBeforeDelete:P,connectionMode:re,connectionLineType:ie=Tl.Bezier,connectionLineStyle:ae,connectionLineComponent:oe,connectionLineContainerStyle:F,deleteKeyCode:I=`Backspace`,selectionKeyCode:se=`Shift`,selectionOnDrag:ce=!1,selectionMode:le=Cl.Full,panActivationKeyCode:ue=`Space`,multiSelectionKeyCode:de=su()?`Meta`:`Control`,zoomActivationKeyCode:fe=su()?`Meta`:`Control`,snapToGrid:pe,snapGrid:me,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:ge,nodesDraggable:_e,autoPanOnNodeFocus:ve,nodesConnectable:ye,nodesFocusable:be,nodeOrigin:xe=Pf,edgesFocusable:Se,edgesReconnectable:Ce,elementsSelectable:we=!0,defaultViewport:Te=Ff,minZoom:Ee=.5,maxZoom:De=2,translateExtent:Oe=vl,preventScrolling:ke=!0,nodeExtent:Ae,defaultMarkerColor:je=`#b1b1b7`,zoomOnScroll:Me=!0,zoomOnPinch:Ne=!0,panOnScroll:Pe=!1,panOnScrollSpeed:Fe=.5,panOnScrollMode:Ie=Sl.Free,zoomOnDoubleClick:Le=!0,panOnDrag:Re=!0,onPaneClick:ze,onPaneMouseEnter:Be,onPaneMouseMove:Ve,onPaneMouseLeave:He,onPaneScroll:Ue,onPaneContextMenu:We,paneClickDistance:Ge=1,nodeClickDistance:Ke=0,children:L,onReconnect:qe,onReconnectStart:Je,onReconnectEnd:Ye,onEdgeContextMenu:Xe,onEdgeDoubleClick:Ze,onEdgeMouseEnter:Qe,onEdgeMouseMove:$e,onEdgeMouseLeave:et,reconnectRadius:tt=10,onNodesChange:nt,onEdgesChange:rt,noDragClassName:it=`nodrag`,noWheelClassName:at=`nowheel`,noPanClassName:ot=`nopan`,fitView:st,fitViewOptions:ct,connectOnClick:lt,attributionPosition:ut,proOptions:dt,defaultEdgeOptions:ft,elevateNodesOnSelect:pt=!0,elevateEdgesOnSelect:mt=!1,disableKeyboardA11y:ht=!1,autoPanOnConnect:gt,autoPanOnNodeDrag:_t,autoPanOnSelection:vt=!0,autoPanSpeed:yt,connectionRadius:bt,isValidConnection:xt,onError:St,style:Ct,id:wt,nodeDragThreshold:Tt,connectionDragThreshold:Et,viewport:Dt,onViewportChange:Ot,width:kt,height:At,colorMode:jt=`light`,debug:Mt,onScroll:Nt,ariaLabelConfig:Pt,zIndexMode:Ft=`basic`,...It},Lt){let Rt=wt||`1`,zt=Vf(jt),Bt=(0,C.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Nt?.(e)},[Nt]);return(0,R.jsx)(`div`,{"data-testid":`rf__wrapper`,...It,onScroll:Bt,style:{...Ct,...ph},ref:Lt,className:Nr([`react-flow`,i,zt]),id:wt,role:`application`,children:(0,R.jsxs)(fh,{nodes:e,edges:t,width:kt,height:At,fitView:st,fitViewOptions:ct,minZoom:Ee,maxZoom:De,nodeOrigin:xe,nodeExtent:Ae,zIndexMode:Ft,children:[(0,R.jsx)(zf,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:_e,autoPanOnNodeFocus:ve,nodesConnectable:ye,nodesFocusable:be,edgesFocusable:Se,edgesReconnectable:Ce,elementsSelectable:we,elevateNodesOnSelect:pt,elevateEdgesOnSelect:mt,minZoom:Ee,maxZoom:De,nodeExtent:Ae,onNodesChange:nt,onEdgesChange:rt,snapToGrid:pe,snapGrid:me,connectionMode:re,translateExtent:Oe,connectOnClick:lt,defaultEdgeOptions:ft,fitView:st,fitViewOptions:ct,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:ee,onSelectionDragStart:j,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ot,nodeOrigin:xe,rfId:Rt,autoPanOnConnect:gt,autoPanOnNodeDrag:_t,autoPanSpeed:yt,onError:St,connectionRadius:bt,isValidConnection:xt,selectNodesOnDrag:ge,nodeDragThreshold:Tt,connectionDragThreshold:Et,onBeforeDelete:P,debug:Mt,ariaLabelConfig:Pt,zIndexMode:Ft}),(0,R.jsx)(sh,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:ie,connectionLineStyle:ae,connectionLineComponent:oe,connectionLineContainerStyle:F,selectionKeyCode:se,selectionOnDrag:ce,selectionMode:le,deleteKeyCode:I,multiSelectionKeyCode:de,panActivationKeyCode:ue,zoomActivationKeyCode:fe,onlyRenderVisibleElements:he,defaultViewport:Te,translateExtent:Oe,minZoom:Ee,maxZoom:De,preventScrolling:ke,zoomOnScroll:Me,zoomOnPinch:Ne,zoomOnDoubleClick:Le,panOnScroll:Pe,panOnScrollSpeed:Fe,panOnScrollMode:Ie,panOnDrag:Re,autoPanOnSelection:vt,onPaneClick:ze,onPaneMouseEnter:Be,onPaneMouseMove:Ve,onPaneMouseLeave:He,onPaneScroll:Ue,onPaneContextMenu:We,paneClickDistance:Ge,nodeClickDistance:Ke,onSelectionContextMenu:te,onSelectionStart:ne,onSelectionEnd:N,onReconnect:qe,onReconnectStart:Je,onReconnectEnd:Ye,onEdgeContextMenu:Xe,onEdgeDoubleClick:Ze,onEdgeMouseEnter:Qe,onEdgeMouseMove:$e,onEdgeMouseLeave:et,reconnectRadius:tt,defaultMarkerColor:je,noDragClassName:it,noWheelClassName:at,noPanClassName:ot,rfId:Rt,disableKeyboardA11y:ht,nodeExtent:Ae,viewport:Dt,onViewportChange:Ot}),(0,R.jsx)(Nf,{onSelectionChange:A}),L,(0,R.jsx)(Df,{proOptions:dt,position:ut}),(0,R.jsx)(Tf,{rfId:Rt,disableKeyboardA11y:ht})]})})}var hh=ap(mh);_l.error014();function gh({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,R.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Nr([`react-flow__background-pattern`,n,r])})}function _h({radius:e,className:t}){return(0,R.jsx)(`circle`,{cx:e,cy:e,r:e,className:Nr([`react-flow__background-pattern`,`dots`,t])})}var vh;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(vh||={});var yh={[vh.Dots]:1,[vh.Lines]:1,[vh.Cross]:6},bh=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function xh({id:e,variant:t=vh.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,C.useRef)(null),{transform:f,patternId:p}=W(bh,ff),m=r||yh[t],h=t===vh.Dots,g=t===vh.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],w=`${p}${e||``}`;return(0,R.jsxs)(`svg`,{className:Nr([`react-flow__background`,l]),style:{...c,...vp,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,R.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,R.jsx)(_h,{radius:y/2,className:u}):(0,R.jsx)(gh,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,R.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}xh.displayName=`Background`;var Sh=(0,C.memo)(xh);function Ch(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,R.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function wh(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,R.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Th(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,R.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function Eh(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,R.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function Dh(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,R.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function Oh({children:e,className:t,...n}){return(0,R.jsx)(`button`,{type:`button`,className:Nr([`react-flow__controls-button`,t]),...n,children:e})}var kh=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ah({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=gf(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=W(kh,ff),{zoomIn:y,zoomOut:b,fitView:x}=pp();return(0,R.jsxs)(Ef,{className:Nr([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Oh,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,R.jsx)(Ch,{})}),(0,R.jsx)(Oh,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,R.jsx)(wh,{})})]}),n&&(0,R.jsx)(Oh,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,R.jsx)(Th,{})}),r&&(0,R.jsx)(Oh,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,R.jsx)(Dh,{}):(0,R.jsx)(Eh,{})}),u]})}Ah.displayName=`Controls`;var jh=(0,C.memo)(Ah);function Mh({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,R.jsx)(`rect`,{className:Nr([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var Nh=(0,C.memo)(Mh),Ph=e=>e.nodes.map(e=>e.id),Fh=e=>e instanceof Function?e:()=>e;function Ih({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Nh,onClick:o}){let s=W(Ph,ff),c=Fh(t),l=Fh(e),u=Fh(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,R.jsx)(R.Fragment,{children:s.map(e=>(0,R.jsx)(Rh,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Lh({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=W(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=lu(r);return{node:r,x:i,y:a,width:o,height:s}},ff);return!l||l.hidden||!uu(l)?null:(0,R.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var Rh=(0,C.memo)(Lh),zh=(0,C.memo)(Ih),Bh=200,Vh=150,Hh=e=>!e.hidden,Uh=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Yl(Pl(e.nodeLookup,{filter:Hh}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wh=`react-flow__minimap-desc`;function Gh({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=gf(),S=(0,C.useRef)(null),{boundingRect:w,viewBB:T,rfId:E,panZoom:D,translateExtent:O,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=W(Uh,ff),ee=e?.width??Bh,M=e?.height??Vh,te=w.width/ee,ne=w.height/M,N=Math.max(te,ne),P=N*ee,re=N*M,ie=b*N,ae=w.x-(P-w.width)/2-ie,oe=w.y-(re-w.height)/2-ie,F=P+ie*2,I=re+ie*2,se=`${Wh}-${E}`,ce=(0,C.useRef)(0),le=(0,C.useRef)();ce.current=N,(0,C.useEffect)(()=>{if(S.current&&D)return le.current=Dd({domNode:S.current,panZoom:D,getTransform:()=>x.getState().transform,getViewScale:()=>ce.current}),()=>{le.current?.destroy()}},[D]),(0,C.useEffect)(()=>{le.current?.update({translateExtent:O,width:k,height:A,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,O,k,A]);let ue=p?e=>{let[t,n]=le.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,de=m?(0,C.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,fe=_??j[`minimap.ariaLabel`];return(0,R.jsx)(Ef,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*N:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Nr([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,R.jsxs)(`svg`,{width:ee,height:M,viewBox:`${ae} ${oe} ${F} ${I}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":se,ref:S,onClick:ue,children:[fe&&(0,R.jsx)(`title`,{id:se,children:fe}),(0,R.jsx)(zh,{onClick:de,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,R.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ae-ie},${oe-ie}h${F+ie*2}v${I+ie*2}h${-F-ie*2}z
|
|
15
|
+
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}Gh.displayName=`MiniMap`,(0,C.memo)(Gh);var Kh=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,qh={[Vd.Line]:`right`,[Vd.Handle]:`bottom-right`};function Jh({nodeId:e,position:t,variant:n=Vd.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=Mp(),y=typeof e==`string`?e:v,b=gf(),x=(0,C.useRef)(null),S=n===Vd.Handle,w=W((0,C.useCallback)(Kh(S&&p),[S,p]),ff),T=(0,C.useRef)(null),E=t??qh[n];return(0,C.useEffect)(()=>{if(!(!x.current||!y))return T.current||=Qd({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=od([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...du({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]),(0,R.jsx)(`div`,{className:Nr([`react-flow__resize-control`,`nodrag`,...E.split(`-`),n,r]),ref:x,style:{...i,scale:w,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,C.memo)(Jh);function Yh(e){return`ABCDEFGHIJKLMNOPQRSTUVWXYZ`[e]??String(e+1)}function Xh(e){return`frame-${e}`}function Zh(e){return e.status===`succeeded`?`Done`:e.status===`failed`?`Failed${e.error?`: ${e.error}`:``}`:e.status===`running`?`Running`:`Queued`}function Qh(e){return e.status===`succeeded`?`Done`:e.status===`failed`?`Failed`:e.status===`running`?`Running`:`Queued`}function $h(e){return new Intl.DateTimeFormat(`zh-CN`,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e))}function eg(e){return`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}function tg(e){let t=e.match(/^(\d+)\/(\d+):status:(.+)$/);if(t){let[,e,n,r]=t;return`Take ${e}/${n}: ${{pending:`queued`,running:`running`,processing:`processing`,done:`done`,failed:`failed`}[r]??r}`}let n=e.match(/^(\d+)\/(\d+):download$/);if(n)return`Take ${n[1]}/${n[2]}: downloaded`;let r=e.match(/^(\d+)\/(\d+):poll_network_retry$/);if(r)return`Take ${r[1]}/${r[2]}: network retry`;let i=e.match(/^(\d+)\/(\d+):download_(network_)?retry$/);return i?`Take ${i[1]}/${i[2]}: download retry`:e===`poll_network_retry`?`Network retry`:e===`download_network_retry`||e===`download_retry`?`Download retry`:e===`done`?`Run complete`:e}function ng(e){return e===`image/jpeg`?`.jpg`:e===`image/webp`?`.webp`:`.png`}function rg(e){if(!e)return null;for(let t of Array.from(e.items)){if(t.kind!==`file`||!t.type.startsWith(`image/`))continue;let e=t.getAsFile();if(e)return e}for(let t of Array.from(e.files))if(t.type.startsWith(`image/`))return t;return null}var ig=`grok-video-web-token`,ag=`source`,og=[`parameters`,`outputs`,`runs`],sg=[{key:`micro`,label:`Micro`},{key:`portrait`,label:`Portrait`},{key:`showcase`,label:`Showcase`},{key:`cinematic`,label:`Cinema`},{key:`product`,label:`Product`},{key:`sultry`,label:`Sultry`},{key:`hardcore`,label:`Hardcore`}];function cg(e,t){if(e.inputFrame?.source!==`prep`)return null;let n=e.inputFrame.preparedImageId;return n?t.find(e=>e.id===n)??null:null}function lg(e){return e.status===`succeeded`?`done`:e.status===`failed`?`error`:e.status===`running`||e.status===`queued`?`running`:`idle`}function ug(e,t,n){let r=t.find(e=>e.id===n);return r?{id:r.id,file:r.file,previewUrl:r.previewUrl,label:r.label,portLabel:r.label,source:`prep`,preparedImageId:r.id,clientSourceId:r.record.clientSourceId}:e?{id:ag,file:e.file,previewUrl:e.previewUrl,label:`Source image`,portLabel:`image`,source:`source`,clientSourceId:e.id}:null}function dg(e,t,n,r){let i=e.map(e=>({id:e.id,handleId:Xh(e.id),label:e.label,state:e.id===t?`active`:`ready`,imageUrl:e.previewUrl,meta:e.id===t?`picked`:$h(e.createdAt),onPick:()=>r(e.id)})),a=[`A`,`B`,`C`].slice(i.length).map((e,t)=>({id:`empty-${e}`,handleId:`empty-${e.toLowerCase()}`,label:`Frame ${e}`,state:n&&t===0?`running`:`idle`,meta:n&&t===0?`running`:`empty`}));return[...i,...a].slice(0,Math.max(3,i.length))}function fg(e){let t={source:40,prep:380,video:760},n=[],r=[],i=e.sourceAsset?.id,a=[...e.jobs].sort((e,t)=>e.createdAt.localeCompare(t.createdAt)),o=[];for(let t of a){let n=cg(t,e.prepCandidates),r=t.inputFrame?.source===`source`&&!!i&&t.inputFrame.clientSourceId===i,a=t.id===e.selectedNodeId;!n&&!r&&!a||o.push({job:t,parentId:n?n.id:ag,tone:lg(t)})}let s=new Map;for(let e of o){let t=s.get(e.parentId)??[];t.push(e.job),s.set(e.parentId,t)}let c=new Map,l=0,u=e=>{let t=l;return c.set(e,t),l+=240,t},d=(e,t)=>{if(t.length===0)return u(e);let n=t.map(e=>c.get(e)??0),r=(n[0]+n[n.length-1])/2;return c.set(e,r),r},f=[];for(let t of e.prepCandidates){let e=(s.get(t.id)??[]).map(e=>e.id);for(let t of e)u(t);d(t.id,e),f.push(t.id)}for(let e of s.get(`source`)??[])u(e.id),f.push(e.id);d(ag,f),n.push({id:ag,type:`result`,position:{x:t.source,y:c.get(`source`)??0},data:{kind:`source`,title:`Source`,runMeta:e.sourceAsset?$h(e.sourceAsset.createdAt):`waiting for image`,previewUrl:e.sourceAsset?.previewUrl,active:e.selectedNodeId===ag,hasInput:!1,onOpenImage:e.onOpenImage}}),e.prepCandidates.forEach((i,a)=>{n.push({id:i.id,type:`result`,position:{x:t.prep,y:c.get(i.id)??a*240},data:{kind:`prep`,title:i.label,runMeta:$h(i.createdAt),lineageLabel:`Source`,previewUrl:i.previewUrl,active:e.selectedNodeId===i.id,hasInput:!0,onOpenImage:e.onOpenImage}}),r.push({id:`edge:${ag}->${i.id}`,source:ag,sourceHandle:`out`,target:i.id,targetHandle:`in`,animated:e.preparingFrame&&a===e.prepCandidates.length-1,className:e.selectedNodeId===i.id?`result-edge active`:`result-edge`})});for(let i of o){let{job:a,parentId:o,tone:s}=i,l=o===`source`?e.sourceAsset?.previewUrl:e.prepCandidates.find(e=>e.id===o)?.previewUrl;n.push({id:a.id,type:`result`,position:{x:t.video,y:c.get(a.id)??0},data:{kind:`video`,title:`Video · ${a.id.slice(0,6)}`,runMeta:$h(a.updatedAt),lineageLabel:a.inputFrame?.label??`Source`,previewUrl:l,hasVideo:a.results.length>0,status:Qh(a),statusTone:s,active:e.selectedNodeId===a.id,hasInput:!0,onOpenImage:e.onOpenImage}}),r.push({id:`edge:${o}->${a.id}`,source:o,sourceHandle:`out`,target:a.id,targetHandle:`in`,animated:s===`running`||e.submitting&&e.selectedNodeId===a.id,className:e.selectedNodeId===a.id?`result-edge active`:`result-edge`})}return{nodes:n,edges:r}}var pg=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},mg=(e=>e?pg(e):pg),hg=e=>e;function gg(e,t=hg){let n=C.useSyncExternalStore(e.subscribe,C.useCallback(()=>t(e.getState()),[e,t]),C.useCallback(()=>t(e.getInitialState()),[e,t]));return C.useDebugValue(n),n}var _g=e=>{let t=mg(e),n=e=>gg(t,e);return Object.assign(n,t),n},vg=(e=>e?_g(e):_g),yg;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(yg||={});var bg;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(bg||={});var G=yg.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),xg=e=>{switch(typeof e){case`undefined`:return G.undefined;case`string`:return G.string;case`number`:return Number.isNaN(e)?G.nan:G.number;case`boolean`:return G.boolean;case`function`:return G.function;case`bigint`:return G.bigint;case`symbol`:return G.symbol;case`object`:return Array.isArray(e)?G.array:e===null?G.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?G.promise:typeof Map<`u`&&e instanceof Map?G.map:typeof Set<`u`&&e instanceof Set?G.set:typeof Date<`u`&&e instanceof Date?G.date:G.object;default:return G.unknown}},K=yg.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Sg=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,yg.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Sg.create=e=>new Sg(e);var Cg=(e,t)=>{let n;switch(e.code){case K.invalid_type:n=e.received===G.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,yg.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${yg.joinValues(e.keys,`, `)}`;break;case K.invalid_union:n=`Invalid input`;break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${yg.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${yg.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n=`Invalid function arguments`;break;case K.invalid_return_type:n=`Invalid function return type`;break;case K.invalid_date:n=`Invalid date`;break;case K.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:yg.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case K.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case K.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case K.custom:n=`Invalid input`;break;case K.invalid_intersection_types:n=`Intersection results could not be merged`;break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,yg.assertNever(e)}return{message:n}},wg=Cg;function Tg(){return wg}var Eg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function q(e,t){let n=Tg(),r=Eg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Cg?void 0:Cg].filter(e=>!!e)});e.common.issues.push(r)}var Dg=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return J;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return J;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},J=Object.freeze({status:`aborted`}),Og=e=>({status:`dirty`,value:e}),kg=e=>({status:`valid`,value:e}),Ag=e=>e.status===`aborted`,jg=e=>e.status===`dirty`,Mg=e=>e.status===`valid`,Ng=e=>typeof Promise<`u`&&e instanceof Promise,Y;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Y||={});var Pg=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Fg=(e,t)=>{if(Mg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Sg(e.common.issues);return this._error=t,this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Z=class{get description(){return this._def.description}_getType(e){return xg(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:xg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Dg,ctx:{common:e.parent.common,data:e.data,parsedType:xg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ng(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xg(e)};return Fg(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xg(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Mg(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Mg(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xg(e)},r=this._parse({data:e,path:n.path,parent:n});return Fg(n,await(Ng(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:K.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new R_({schema:this,typeName:Q.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return z_.create(this,this._def)}nullable(){return B_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return y_.create(this)}promise(){return L_.create(this,this._def)}or(e){return S_.create([this,e],this._def)}and(e){return E_.create(this,e,this._def)}transform(e){return new R_({...X(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new V_({...X(this._def),innerType:this,defaultValue:t,typeName:Q.ZodDefault})}brand(){return new W_({typeName:Q.ZodBranded,type:this,...X(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new H_({...X(this._def),innerType:this,catchValue:t,typeName:Q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return G_.create(this,e)}readonly(){return K_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ig=/^c[^\s-]{8,}$/i,Lg=/^[0-9a-z]+$/,Rg=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bg=/^[a-z0-9_-]{21}$/i,Vg=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hg=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ug=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wg=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Gg,Kg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Jg=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yg=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xg=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Zg=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qg=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,$g=RegExp(`^${Qg}$`);function e_(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function t_(e){return RegExp(`^${e_(e)}$`)}function n_(e){let t=`${Qg}T${e_(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function r_(e,t){return!!((t===`v4`||!t)&&Kg.test(e)||(t===`v6`||!t)&&Jg.test(e))}function i_(e,t){if(!Vg.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function a_(e,t){return!!((t===`v4`||!t)&&qg.test(e)||(t===`v6`||!t)&&Yg.test(e))}var o_=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==G.string){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.string,received:t.parsedType}),J}let t=new Dg,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?q(n,{code:K.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&q(n,{code:K.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Ug.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`email`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Gg||=new RegExp(Wg,`u`),Gg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`emoji`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)zg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`uuid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Bg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`nanoid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Ig.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`cuid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Lg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`cuid2`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Rg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`ulid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),q(n,{validation:`url`,code:K.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`regex`,code:K.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?n_(r).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?$g.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?t_(r).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Hg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`duration`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?r_(e.data,r.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`ip`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?i_(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`jwt`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?a_(e.data,r.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`cidr`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Xg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`base64`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Zg.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`base64url`,code:K.invalid_string,message:r.message}),t.dirty()):yg.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:K.invalid_string,...Y.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Y.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Y.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Y.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Y.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Y.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Y.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Y.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Y.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Y.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Y.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Y.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Y.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Y.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Y.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Y.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Y.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Y.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Y.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Y.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Y.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Y.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Y.errToObj(t)})}nonempty(e){return this.min(1,Y.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};o_.create=e=>new o_({checks:[],typeName:Q.ZodString,coerce:e?.coerce??!1,...X(e)});function s_(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var c_=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==G.number){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.number,received:t.parsedType}),J}let t,n=new Dg;for(let r of this._def.checks)r.kind===`int`?yg.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),q(t,{code:K.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?s_(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),q(t,{code:K.not_finite,message:r.message}),n.dirty()):yg.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Y.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Y.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Y.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Y.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&yg.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};c_.create=e=>new c_({checks:[],typeName:Q.ZodNumber,coerce:e?.coerce||!1,...X(e)});var l_=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==G.bigint)return this._getInvalidInput(e);let t,n=new Dg;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):yg.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.bigint,received:t.parsedType}),J}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};l_.create=e=>new l_({checks:[],typeName:Q.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var u_=class extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==G.boolean){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.boolean,received:t.parsedType}),J}return kg(e.data)}};u_.create=e=>new u_({typeName:Q.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var d_=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==G.date){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.date,received:t.parsedType}),J}if(Number.isNaN(e.data.getTime()))return q(this._getOrReturnCtx(e),{code:K.invalid_date}),J;let t=new Dg,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):yg.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Y.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Y.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};d_.create=e=>new d_({checks:[],coerce:e?.coerce||!1,typeName:Q.ZodDate,...X(e)});var f_=class extends Z{_parse(e){if(this._getType(e)!==G.symbol){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.symbol,received:t.parsedType}),J}return kg(e.data)}};f_.create=e=>new f_({typeName:Q.ZodSymbol,...X(e)});var p_=class extends Z{_parse(e){if(this._getType(e)!==G.undefined){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.undefined,received:t.parsedType}),J}return kg(e.data)}};p_.create=e=>new p_({typeName:Q.ZodUndefined,...X(e)});var m_=class extends Z{_parse(e){if(this._getType(e)!==G.null){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.null,received:t.parsedType}),J}return kg(e.data)}};m_.create=e=>new m_({typeName:Q.ZodNull,...X(e)});var h_=class extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return kg(e.data)}};h_.create=e=>new h_({typeName:Q.ZodAny,...X(e)});var g_=class extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kg(e.data)}};g_.create=e=>new g_({typeName:Q.ZodUnknown,...X(e)});var __=class extends Z{_parse(e){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.never,received:t.parsedType}),J}};__.create=e=>new __({typeName:Q.ZodNever,...X(e)});var v_=class extends Z{_parse(e){if(this._getType(e)!==G.undefined){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.void,received:t.parsedType}),J}return kg(e.data)}};v_.create=e=>new v_({typeName:Q.ZodVoid,...X(e)});var y_=class e extends Z{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==G.array)return q(t,{code:K.invalid_type,expected:G.array,received:t.parsedType}),J;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(q(t,{code:e?K.too_big:K.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(q(t,{code:K.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(q(t,{code:K.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Pg(t,e,t.path,n)))).then(e=>Dg.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Pg(t,e,t.path,n)));return Dg.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Y.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Y.toString(n)}})}nonempty(e){return this.min(1,e)}};y_.create=(e,t)=>new y_({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...X(t)});function b_(e){if(e instanceof x_){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=z_.create(b_(r))}return new x_({...e._def,shape:()=>t})}else if(e instanceof y_)return new y_({...e._def,type:b_(e.element)});else if(e instanceof z_)return z_.create(b_(e.unwrap()));else if(e instanceof B_)return B_.create(b_(e.unwrap()));else if(e instanceof D_)return D_.create(e.items.map(e=>b_(e)));else return e}var x_=class e extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=yg.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==G.object){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.object,received:t.parsedType}),J}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof __&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Pg(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof __){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(q(n,{code:K.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Pg(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Dg.mergeObjectSync(t,e)):Dg.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Y.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Y.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of yg.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of yg.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return b_(this)}partial(t){let n={};for(let e of yg.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of yg.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof z_;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return P_(yg.objectKeys(this.shape))}};x_.create=(e,t)=>new x_({shape:()=>e,unknownKeys:`strip`,catchall:__.create(),typeName:Q.ZodObject,...X(t)}),x_.strictCreate=(e,t)=>new x_({shape:()=>e,unknownKeys:`strict`,catchall:__.create(),typeName:Q.ZodObject,...X(t)}),x_.lazycreate=(e,t)=>new x_({shape:e,unknownKeys:`strip`,catchall:__.create(),typeName:Q.ZodObject,...X(t)});var S_=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Sg(e.ctx.common.issues));return q(t,{code:K.invalid_union,unionErrors:n}),J}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Sg(e));return q(t,{code:K.invalid_union,unionErrors:i}),J}}get options(){return this._def.options}};S_.create=(e,t)=>new S_({options:e,typeName:Q.ZodUnion,...X(t)});var C_=e=>e instanceof M_?C_(e.schema):e instanceof R_?C_(e.innerType()):e instanceof N_?[e.value]:e instanceof F_?e.options:e instanceof I_?yg.objectValues(e.enum):e instanceof V_?C_(e._def.innerType):e instanceof p_?[void 0]:e instanceof m_?[null]:e instanceof z_?[void 0,...C_(e.unwrap())]:e instanceof B_?[null,...C_(e.unwrap())]:e instanceof W_||e instanceof K_?C_(e.unwrap()):e instanceof H_?C_(e._def.innerType):[],w_=class e extends Z{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==G.object)return q(t,{code:K.invalid_type,expected:G.object,received:t.parsedType}),J;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(q(t,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=C_(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...X(r)})}};function T_(e,t){let n=xg(e),r=xg(t);if(e===t)return{valid:!0,data:e};if(n===G.object&&r===G.object){let n=yg.objectKeys(t),r=yg.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=T_(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===G.array&&r===G.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=T_(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===G.date&&r===G.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var E_=class extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Ag(e)||Ag(r))return J;let i=T_(e.value,r.value);return i.valid?((jg(e)||jg(r))&&t.dirty(),{status:t.value,value:i.data}):(q(n,{code:K.invalid_intersection_types}),J)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};E_.create=(e,t,n)=>new E_({left:e,right:t,typeName:Q.ZodIntersection,...X(n)});var D_=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.array)return q(n,{code:K.invalid_type,expected:G.array,received:n.parsedType}),J;if(n.data.length<this._def.items.length)return q(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),J;!this._def.rest&&n.data.length>this._def.items.length&&(q(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Pg(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Dg.mergeArray(t,e)):Dg.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};D_.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new D_({items:e,typeName:Q.ZodTuple,rest:null,...X(t)})};var O_=class e extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.object)return q(n,{code:K.invalid_type,expected:G.object,received:n.parsedType}),J;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Pg(n,e,n.path,e)),value:a._parse(new Pg(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Dg.mergeObjectAsync(t,r):Dg.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Z?new e({keyType:t,valueType:n,typeName:Q.ZodRecord,...X(r)}):new e({keyType:o_.create(),valueType:t,typeName:Q.ZodRecord,...X(n)})}},k_=class extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.map)return q(n,{code:K.invalid_type,expected:G.map,received:n.parsedType}),J;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Pg(n,e,n.path,[a,`key`])),value:i._parse(new Pg(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return J;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return J;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};k_.create=(e,t,n)=>new k_({valueType:t,keyType:e,typeName:Q.ZodMap,...X(n)});var A_=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.set)return q(n,{code:K.invalid_type,expected:G.set,received:n.parsedType}),J;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(q(n,{code:K.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(q(n,{code:K.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return J;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Pg(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Y.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};A_.create=(e,t)=>new A_({valueType:e,minSize:null,maxSize:null,typeName:Q.ZodSet,...X(t)});var j_=class e extends Z{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==G.function)return q(t,{code:K.invalid_type,expected:G.function,received:t.parsedType}),J;function n(e,n){return Eg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Tg(),Cg].filter(e=>!!e),issueData:{code:K.invalid_arguments,argumentsError:n}})}function r(e,n){return Eg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Tg(),Cg].filter(e=>!!e),issueData:{code:K.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof L_){let e=this;return kg(async function(...t){let o=new Sg([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return kg(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Sg([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Sg([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:D_.create(t).rest(g_.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||D_.create([]).rest(g_.create()),returns:n||g_.create(),typeName:Q.ZodFunction,...X(r)})}},M_=class extends Z{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};M_.create=(e,t)=>new M_({getter:e,typeName:Q.ZodLazy,...X(t)});var N_=class extends Z{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return q(t,{received:t.data,code:K.invalid_literal,expected:this._def.value}),J}return{status:`valid`,value:e.data}}get value(){return this._def.value}};N_.create=(e,t)=>new N_({value:e,typeName:Q.ZodLiteral,...X(t)});function P_(e,t){return new F_({values:e,typeName:Q.ZodEnum,...X(t)})}var F_=class e extends Z{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{expected:yg.joinValues(n),received:t.parsedType,code:K.invalid_type}),J}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{received:t.data,code:K.invalid_enum_value,options:n}),J}return kg(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};F_.create=P_;var I_=class extends Z{_parse(e){let t=yg.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==G.string&&n.parsedType!==G.number){let e=yg.objectValues(t);return q(n,{expected:yg.joinValues(e),received:n.parsedType,code:K.invalid_type}),J}if(this._cache||=new Set(yg.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=yg.objectValues(t);return q(n,{received:n.data,code:K.invalid_enum_value,options:e}),J}return kg(e.data)}get enum(){return this._def.values}};I_.create=(e,t)=>new I_({values:e,typeName:Q.ZodNativeEnum,...X(t)});var L_=class extends Z{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==G.promise&&t.common.async===!1?(q(t,{code:K.invalid_type,expected:G.promise,received:t.parsedType}),J):kg((t.parsedType===G.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};L_.create=(e,t)=>new L_({type:e,typeName:Q.ZodPromise,...X(t)});var R_=class extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return J;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?J:r.status===`dirty`||t.value===`dirty`?Og(r.value):r});{if(t.value===`aborted`)return J;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?J:r.status===`dirty`||t.value===`dirty`?Og(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?J:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?J:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Mg(e))return J;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Mg(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):J);yg.assertNever(r)}};R_.create=(e,t,n)=>new R_({schema:e,typeName:Q.ZodEffects,effect:t,...X(n)}),R_.createWithPreprocess=(e,t,n)=>new R_({schema:t,effect:{type:`preprocess`,transform:e},typeName:Q.ZodEffects,...X(n)});var z_=class extends Z{_parse(e){return this._getType(e)===G.undefined?kg(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};z_.create=(e,t)=>new z_({innerType:e,typeName:Q.ZodOptional,...X(t)});var B_=class extends Z{_parse(e){return this._getType(e)===G.null?kg(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};B_.create=(e,t)=>new B_({innerType:e,typeName:Q.ZodNullable,...X(t)});var V_=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===G.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};V_.create=(e,t)=>new V_({innerType:e,typeName:Q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...X(t)});var H_=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ng(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Sg(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Sg(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};H_.create=(e,t)=>new H_({innerType:e,typeName:Q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...X(t)});var U_=class extends Z{_parse(e){if(this._getType(e)!==G.nan){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.nan,received:t.parsedType}),J}return{status:`valid`,value:e.data}}};U_.create=e=>new U_({typeName:Q.ZodNaN,...X(e)});var W_=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},G_=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?J:e.status===`dirty`?(t.dirty(),Og(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?J:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Q.ZodPipeline})}},K_=class extends Z{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Mg(e)&&(e.value=Object.freeze(e.value)),e);return Ng(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};K_.create=(e,t)=>new K_({innerType:e,typeName:Q.ZodReadonly,...X(t)}),x_.lazycreate;var Q;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(Q||={});var q_=o_.create,J_=c_.create;U_.create,l_.create;var Y_=u_.create;d_.create,f_.create,p_.create,m_.create,h_.create,g_.create,__.create,v_.create,y_.create;var X_=x_.create;x_.strictCreate,S_.create,w_.create,E_.create,D_.create,O_.create,k_.create,A_.create,j_.create,M_.create,N_.create;var Z_=F_.create;I_.create,L_.create,R_.create,z_.create,B_.create,R_.createWithPreprocess,G_.create;var Q_=[`480p`,`720p`],$_=[`source`,`auto`,`1:1`,`16:9`,`9:16`,`4:3`,`3:4`,`3:2`,`2:3`],ev=[`static`,`user`,`push_in`,`pull_back`,`orbit`,`handheld`],tv=[`ambient`,`silent`,`music`,`dialogue`],nv=[`subtle`,`balanced`,`bold`],rv=[`source`,`cinematic`,`social`,`product`,`anime`],iv=[`video`,`portrait`,`cinematic`,`product`],av=[`light`,`balanced`,`strong`],ov=[`1k`,`2k`],sv=[{id:`breathe`,label:`呼吸微动`,description:`眨眼、呼吸、发丝轻动`,prompt:`gentle breathing, slow natural blink, faint hair drift; pose and expression unchanged`,category:`micro`},{id:`soft_smile`,label:`浅笑`,description:`表情轻微变暖,不改脸`,prompt:`the corners of the mouth slowly lift into a gentle warm smile, eyes brighten slightly`,category:`portrait`},{id:`breeze`,label:`轻风`,description:`头发和衣物轻微飘动`,prompt:`a soft breeze lightly moves hair and clothing, with only subtle natural movement`,category:`micro`},{id:`look_back`,label:`回眸`,description:`轻转头,镜头感更强`,prompt:`subject slowly turns their head for a brief over-the-shoulder glance, then settles naturally`,category:`portrait`,durationSeconds:6},{id:`wave`,label:`招手`,description:`小幅友好互动`,prompt:`a small natural nod and a light hand wave, friendly and calm`,category:`portrait`,durationSeconds:6},{id:`outfit_turn`,label:`穿搭转身`,description:`展示衣服轮廓和材质`,prompt:`subject turns slowly from front view to a three-quarter side angle and back, elegant controlled outfit presentation`,category:`showcase`,durationSeconds:8,camera:`static`},{id:`pose_switch`,label:`换姿`,description:`重心移动,姿态更自然`,prompt:`subject shifts weight and settles into a relaxed confident pose, smooth and natural`,category:`showcase`,durationSeconds:6},{id:`cinematic_push`,label:`电影推近`,description:`缓慢推近,适合头像/海报`,prompt:`slow cinematic push-in, subtle parallax, subject remains stable and composed`,category:`cinematic`,durationSeconds:8,camera:`push_in`},{id:`dolly_orbit`,label:`环绕镜头`,description:`轻微绕拍,空间感更强`,prompt:`a controlled short dolly orbit with subtle parallax, stable framing, no aggressive spin`,category:`cinematic`,durationSeconds:8,camera:`orbit`},{id:`product_orbit`,label:`产品环绕`,description:`突出材质、反光和细节`,prompt:`slow controlled product-style orbit, highlight materials and surface details, premium studio motion`,category:`product`,durationSeconds:8,camera:`orbit`},{id:`hair_flip`,label:`撩发`,description:`手指穿发,慢速甩头`,prompt:`fingers slowly run through hair, a slow sensual hair flip, head tilting back gently with exposed neck`,category:`sultry`},{id:`body_roll`,label:`身体波浪`,description:`从胸到胯慢速流体波浪`,prompt:`a slow fluid body roll starting from chest traveling down through hips, controlled seductive wave motion, weight shifting naturally`,category:`sultry`,durationSeconds:6},{id:`lip_bite`,label:`咬唇`,description:`轻咬下唇,眼神拉丝`,prompt:`slowly bite and release lower lip with a heavy-lidded gaze, subtle head tilt, intimate close-up framing, soft parted lips`,category:`sultry`},{id:`hip_sway`,label:`摆胯`,description:`胯部左右慢摇`,prompt:`slow hypnotic hip sway side to side, weight shifting rhythmically, subtle body movement, hands resting on hips or thighs`,category:`sultry`,durationSeconds:6},{id:`shoulder_slip`,label:`滑落`,description:`衣物从肩膀自然滑落`,prompt:`clothing slowly slips off one shoulder revealing skin, subject holds the moment with a knowing expression, subtle controlled movement`,category:`sultry`,durationSeconds:6,camera:`static`},{id:`back_arch`,label:`弓背`,description:`跪姿后仰,突出身体曲线`,prompt:`kneeling posture, slow deep arch of the back, head tilting back, body curves emphasized, controlled sensual pose hold`,category:`sultry`,durationSeconds:8,camera:`static`},{id:`breath_heavy`,label:`微喘`,description:`胸口起伏,呼吸渐进加重`,prompt:`chest slowly rising and falling with gradually deepening breath, subtle body movement, intimate close framing, parted lips`,category:`sultry`},{id:`cat_crawl`,label:`猫步靠近`,description:`四肢着地缓慢爬近`,prompt:`slow controlled crawl toward camera on all fours, feline grace and poise, eye contact maintained, intimate forward motion with sinuous spine movement`,category:`sultry`,durationSeconds:8,camera:`push_in`},{id:`languid_stretch`,label:`慵懒舒展`,description:`躺姿全身舒展`,prompt:`reclining pose, slow languid full-body stretch, arms reaching above head, body elongating naturally, relaxed sensual mood, soft lighting`,category:`sultry`,durationSeconds:8,camera:`static`},{id:`turn_reveal`,label:`转身露背`,description:`缓慢转身展示背部`,prompt:`subject slowly turns to reveal bare back and shoulder blades, elegant controlled rotation, camera orbits gently, intimate reveal of skin texture`,category:`sultry`,durationSeconds:8,camera:`orbit`},{id:`doggy_pound`,label:`后入猛干`,description:`跪姿后入,猛烈撞击`,prompt:`intense doggy style from behind, rapid rhythmic thrusting, bodies slamming together, skin impact visible, raw aggressive motion, sweat and muscle tension, handheld shaky camera feel`,category:`hardcore`,durationSeconds:8,camera:`handheld`},{id:`cowgirl_ride`,label:`骑乘起伏`,description:`女上位剧烈起伏`,prompt:`energetic cowgirl position, subject on top riding vigorously, rapid up and down bouncing motion, chest and body undulating with each thrust, intense physical rhythm, skin glistening`,category:`hardcore`,durationSeconds:8,camera:`static`},{id:`missionary_intense`,label:`正面猛冲`,description:`传教士体位高速抽插`,prompt:`intense missionary position, aggressive deep thrusting, bodies pressed together, subject's body jolting with each impact, rapid rhythmic movement, intimate close framing, raw physical energy`,category:`hardcore`,durationSeconds:8,camera:`push_in`},{id:`deepthroat`,label:`深喉口交`,description:`头部前后运动,深喉进出`,prompt:`intense oral sex, deep throat penetration, head bobbing rhythmically forward and back, lips wrapped tight, saliva and intensity, close-up framing, raw and explicit motion`,category:`hardcore`,durationSeconds:8,camera:`static`},{id:`hair_pull_back`,label:`抓发后入`,description:`从背后扯发控制,猛烈抽插`,prompt:`hair gripped and pulled back firmly from behind, aggressive deep thrusting, subject's back arched, body jolting forward with each impact, rough dominating energy, handheld camera`,category:`hardcore`,durationSeconds:8,camera:`handheld`},{id:`spitroast`,label:`双人口交`,description:`前后同时口交`,prompt:`subject on all fours, oral sex from both front and back simultaneously, rhythmic back and forth motion between two partners, intense double stimulation, raw explicit action`,category:`hardcore`,durationSeconds:8,camera:`orbit`},{id:`reverse_cowgirl`,label:`反向骑乘`,description:`背对镜头骑乘扭动`,prompt:`reverse cowgirl position, subject riding on top facing away from camera, hips grinding and bouncing, back and shoulders visible, intense circular hip motion, raw physical rhythm`,category:`hardcore`,durationSeconds:8,camera:`static`},{id:`standing_carry`,label:`抱操`,description:`被抱起凌空抽插`,prompt:`subject lifted and carried, legs wrapped around partner, suspended mid-air thrusting, bodies pressed close, bouncing motion with gravity, raw intense physicality, dynamic motion`,category:`hardcore`,durationSeconds:8,camera:`handheld`},{id:`prone_bone`,label:`俯卧后入`,description:`被压在身下后入猛干`,prompt:`intense thrusting from behind, body pressed down, rhythmic full-body jolting with each deep impact, buttocks rippling, raw aggressive pounding, subject gripping whatever is at hand`,category:`hardcore`,durationSeconds:8,camera:`static`},{id:`facial_finish`,label:`颜射收尾`,description:`口交后颜射`,prompt:`kneeling oral sex buildup, then pull back for facial finish, subject looking up into camera, explicit release onto face, tongue out, raw and explicit finale`,category:`hardcore`,durationSeconds:10,camera:`push_in`},{id:`bondage_suspend`,label:`束缚挣扎`,description:`被绳索束缚,身体扭动挣扎`,prompt:`subject bound and restrained, wrists pulled together or behind back, struggling and squirming against restraints, body twisting in resistance, skin straining, vulnerable struggling motion, raw intense energy`,category:`hardcore`,durationSeconds:8,camera:`handheld`},{id:`anal_pound`,label:`肛交猛干`,description:`后入肛交高速冲刺`,prompt:`intense anal sex from behind, rapid deep thrusting, subject gripping surface, body jolting with each impact, sweat on skin, raw aggressive pounding, explicit penetration visible`,category:`hardcore`,durationSeconds:8,camera:`handheld`},{id:`threesome_dp`,label:`三人双插`,description:`前后同时进入,双重冲击`,prompt:`threesome double penetration, subject between two partners, simultaneous thrusting from both ends, body sandwiched and jolting, overwhelming physical intensity, raw group action`,category:`hardcore`,durationSeconds:10,camera:`handheld`},{id:`masturbate_solo`,label:`自慰揉穴`,description:`手指自慰,逐渐加速至高潮`,prompt:`fingers rubbing and penetrating self, rhythm building from slow teasing to intense, hips bucking, back arching, legs spreading wider, explicit solo pleasure, intimate close-up framing`,category:`hardcore`,durationSeconds:10,camera:`push_in`},{id:`titjob`,label:`乳交夹射`,description:`双乳夹紧上下摩擦`,prompt:`breasts pressed together around partner, rhythmic up and down sliding motion, cleavage tight and wet, subject looking up at camera, explicit titfuck action, skin contact and friction visible`,category:`hardcore`,durationSeconds:8,camera:`static`},{id:`lesbian_scissor`,label:`女同磨穴`,description:`双腿交叉互磨,两人互动`,prompt:`two subjects in scissoring position, legs interlocked, hips grinding together in slow rhythmic motion, mutual pleasure visible, bodies pressed close, intimate lesbian action, soft sensual lighting`,category:`hardcore`,durationSeconds:8,camera:`orbit`},{id:`choke_slap`,label:`掐脖扇脸`,description:`被掐脖压制,粗暴扇耳光`,prompt:`hand gripping subject's throat firmly, face slapped repeatedly, head turning sharply with each impact, dazed unfocused expression, raw physical domination, chaotic handheld motion`,category:`hardcore`,durationSeconds:6,camera:`handheld`},{id:`spanking_bent`,label:`打屁股`,description:`连续掌掴抽打臀部`,prompt:`subject's buttocks being spanked repeatedly with open hand, skin reddening and rippling with each slap, subject flinching and reacting with each impact, rhythmic raw discipline, stinging intensity building`,category:`hardcore`,durationSeconds:8,camera:`static`},{id:`squirt_climax`,label:`潮吹喷射`,description:`高潮喷射液体`,prompt:`subject reaching intense climax, body convulsing, back arching sharply, explicit fluid release, legs trembling, muscles spasming, raw uncontrolled orgasm, close-up explicit framing`,category:`hardcore`,durationSeconds:8,camera:`push_in`},{id:`creampie_finish`,label:`内射流出`,description:`激烈抽插后内射,液体流出`,prompt:`intense thrusting buildup, then deep finish inside, subject's body trembling, partner pulling out slowly, explicit fluid dripping out, satisfied exhausted pose, raw intimate finale`,category:`hardcore`,durationSeconds:10,camera:`static`},{id:`shower_wall`,label:`按墙后入`,description:`被从背后按在墙上猛干`,prompt:`subject pressed against a wall from behind, hands flat against the surface, intense rhythmic thrusting, body jolting forward with each impact, raw aggressive energy, tight close framing, handheld intensity`,category:`hardcore`,durationSeconds:8,camera:`handheld`},{id:`footjob`,label:`足交摩擦`,description:`用脚摩擦挑逗`,prompt:`subject using feet to stroke and rub partner, toes wrapped around, slow teasing foot motion, subject reclining with playful expression, explicit footjob action, intimate framing`,category:`hardcore`,durationSeconds:8,camera:`static`}];X_({prompt:q_().trim().max(1800).default(``),presetId:q_().trim().optional(),durationSeconds:J_().int().min(1).max(15),resolution:Z_(Q_),aspectRatio:Z_($_),camera:Z_(ev),sound:Z_(tv),intensity:Z_(nv),outputStyle:Z_(rv),preserveSource:Y_(),avoidTextMutation:Y_(),loopFriendly:Y_(),count:J_().int().min(1).max(5)}),X_({instruction:q_().trim().max(1200).default(``),mode:Z_(iv).default(`video`),strength:Z_(av).default(`balanced`),resolution:Z_(ov).default(`1k`),preserveIdentity:Y_().default(!0),stabilizeEdges:Y_().default(!0),removeText:Y_().default(!0),improveLighting:Y_().default(!0)});function cv(e){return{prompt:``,durationSeconds:e.durationSeconds,resolution:e.resolution,aspectRatio:e.aspectRatio,camera:`static`,sound:`ambient`,intensity:`balanced`,outputStyle:`source`,preserveSource:!0,avoidTextMutation:!0,loopFriendly:!1,count:1}}function lv(){return{instruction:``,mode:`video`,strength:`balanced`,resolution:`1k`,preserveIdentity:!0,stabilizeEdges:!0,removeText:!0,improveLighting:!0}}function uv(e){if(e)return sv.find(t=>t.id===e)}function dv(e){let t=[`Edit this image into a clean, stable first frame for image-to-video generation.`,hv(e.mode),gv(e.strength)];return e.preserveIdentity&&t.push(`Preserve the original subject identity, face, body proportions, outfit, pose logic, composition, and overall style.`),e.stabilizeEdges&&t.push(`Stabilize hands, face, hair edges, clothing edges, background boundaries, and any cropped limbs so the frame can animate without warped transitions.`),e.removeText&&t.push(`Remove or neutralize unreadable text, UI fragments, watermarks, and visual glitches.`),e.improveLighting&&t.push(`Improve exposure, contrast, skin texture, and lighting consistency while keeping the source image recognizable.`),e.instruction&&t.push(`User instruction: ${e.instruction}`),t.push(`Do not create a collage, split view, contact sheet, caption, border, or design mockup. Return one production-ready still image.`),t.filter(Boolean).join(` `).replace(/\s+/g,` `).trim().slice(0,1800)}function fv(e){let t=uv(e.presetId),n=e.prompt||t?.prompt||``,r=[];return n&&r.push(n),e.preserveSource&&(r.push(`Preserve the source image identity, composition, subject position, outfit, proportions, and visual style.`),r.push(`Keep motion natural and controlled; avoid deformation by keeping the subject stable and readable.`)),e.avoidTextMutation&&r.push(`Do not invent or rewrite readable text, logos, watermarks, tattoos, UI text, or signage.`),r.push(pv(e.outputStyle)),r.push(mv(e.intensity)),r.push(_v(e.camera,n)),r.push(vv(e.sound)),e.loopFriendly&&r.push(`Make the first and last frames visually compatible for a clean loop.`),r.filter(Boolean).join(` `).replace(/\s+/g,` `).trim().slice(0,2200)}function pv(e){return e===`cinematic`?`Cinematic color, refined lighting, restrained filmic motion.`:e===`social`?`Clean social-media-ready motion, crisp subject readability, no clutter.`:e===`product`?`Premium product-shot finish with controlled highlights and readable materials.`:e===`anime`?`Preserve the illustration/anime style and keep linework stable.`:`Preserve the source image's original style and lighting.`}function mv(e){return e===`subtle`?`Use very subtle micro motion only.`:e===`bold`?`Use a clear motion beat while keeping anatomy, identity, and composition stable.`:`Use balanced visible motion with stable identity.`}function hv(e){return e===`portrait`?`Optimize for a human portrait: natural anatomy, stable face, clean hairline, believable skin, and enough body context for motion.`:e===`cinematic`?`Optimize for a cinematic opening frame: coherent lighting, clean depth, stable subject silhouette, and no motion blur.`:e===`product`?`Optimize for a product-style first frame: crisp object boundaries, clean background, readable shape, and stable reflections.`:`Optimize for a general video first frame: sharp subject, coherent background, clean edges, and no obvious generation artifacts.`}function gv(e){return e===`light`?`Use a light touch: keep the source nearly unchanged and only fix obvious artifacts.`:e===`strong`?`Use a strong corrective pass: repair artifacts, improve framing, and clean unstable details while preserving the subject.`:`Use a balanced corrective pass: improve stability and quality without making the result feel like a different image.`}function _v(e,t){return e===`user`?``:e===`push_in`?`Use a slow cinematic push-in, no abrupt camera motion.`:e===`pull_back`?`Use a slow controlled pull-back with stable composition.`:e===`orbit`?`Use a short controlled orbit with subtle parallax, no spin-heavy movement.`:e===`handheld`?`Use gentle handheld camera feel with stable framing, no shake-heavy movement.`:/\b(camera|cam|镜头|pan|tilt|zoom|push|pull|dolly|orbit|handheld|static)\b|推近|拉远|环绕|跟拍|平移|手持/i.test(t)?``:`Static camera, no zoom, no pan.`}function vv(e){return e===`silent`?`The subject stays silent: no speech, no dialogue, no lip sync.`:e===`music`?`Use quiet background music and ambient sound only; no dialogue or lip sync.`:e===`dialogue`?`If speech appears, keep it brief and natural.`:`Ambient sound only; no speech, no dialogue, no lip sync.`}var yv=[];function bv(e){let t=URL.createObjectURL(e);return yv.push(t),t}function xv(){for(let e of yv)URL.revokeObjectURL(e);yv.length=0}var Sv;function Cv(){return new URLSearchParams(location.search).get(`token`)||localStorage.getItem(`grok-video-web-token`)||``}var wv={durationSeconds:6,resolution:`720p`,aspectRatio:`source`};function Tv(e){let t=new Headers;return e&&t.set(`Authorization`,`Bearer ${e}`),t}var $=vg((e,t)=>{async function n(e,n){let r=await fetch(t().withToken(e),{headers:Tv(t().token)});if(!r.ok)throw Error(await r.text());let i=await r.blob();return new File([i],`${n}${ng(i.type)}`,{type:i.type||`image/png`})}async function r(){let e=await fetch(t().withToken(`/api/prepared-images`),{headers:Tv(t().token)});if(!e.ok)throw Error(await e.text());return(await e.json()).images}function i(t){xv(),e({sourceAsset:{id:t.sourceRestore.sourceId??`source_${Date.now()}`,file:t.sourceFile,previewUrl:bv(t.sourceFile),createdAt:t.sourceRestore.createdAt??new Date().toISOString(),sourceUrl:t.sourceRestore.sourceUrl},prepCandidates:t.candidateRecords.map((e,n)=>({id:e.id,slot:Yh(n),label:`Frame ${Yh(n)}`,file:t.candidateFiles[n],previewUrl:bv(t.candidateFiles[n]),createdAt:e.createdAt,record:e,status:`ready`})),pickedFrameId:t.pickedFrameId,selectedNodeId:t.selectedNodeId,selectedOperatorId:t.operatorId,inspectorTab:t.inspectorTab,...t.options?{options:t.options}:{},...t.prompt===void 0?{}:{prompt:t.prompt}})}return{token:Cv(),tokenDraft:Cv(),config:null,jobs:[],selectedJobId:``,sourceAsset:null,prepCandidates:[],pickedFrameId:ag,selectedOperatorId:`source`,selectedNodeId:ag,inspectorTab:`parameters`,prompt:``,toast:null,imageModal:null,submitting:!1,preparingFrame:!1,categoryFilter:`micro`,outputFilter:`all`,galleryFrames:[],graphLoading:!1,loaderVisible:!1,options:cv(wv),framePrep:lv(),withToken:e=>{let{token:n}=t();if(!n)return e;let r=new URL(e,location.origin);return r.searchParams.set(`token`,n),`${r.pathname}${r.search}`},setToken:n=>{localStorage.setItem(ig,n),e({token:n}),t().loadConfig()},setTokenDraft:t=>e({tokenDraft:t}),setInspectorTab:t=>e({inspectorTab:t}),setOperator:t=>e({selectedOperatorId:t,inspectorTab:`parameters`}),setPrompt:t=>e({prompt:t}),setCategoryFilter:t=>e({categoryFilter:t}),setOutputFilter:t=>e({outputFilter:t}),setImageModal:t=>e({imageModal:t}),setToast:t=>e({toast:t}),openImage:(t,n)=>e({imageModal:{url:t,label:n}}),patchOptions:t=>e(e=>({options:{...e.options,...t}})),patchFramePrep:t=>e(e=>({framePrep:{...e.framePrep,...t}})),setGraphLoading:t=>{clearTimeout(Sv),t?(e({graphLoading:!0}),Sv=setTimeout(()=>e({loaderVisible:!0}),150)):e({graphLoading:!1,loaderVisible:!1})},loadConfig:async()=>{try{let n=await fetch(t().withToken(`/api/config`),{headers:Tv(t().token)});if(n.status===401){e({config:null});return}if(!n.ok)throw Error(await n.text());let r=await n.json();e(e=>({config:r,options:{...cv(r.defaults),...e.options}})),await t().loadJobs(),await t().loadGalleryFrames()}catch(t){e({toast:{tone:`warn`,text:t instanceof Error?t.message:String(t)}})}},loadJobs:async()=>{let n=await fetch(t().withToken(`/api/jobs`),{headers:Tv(t().token)});if(!n.ok)return;let r=await n.json();e(e=>({jobs:r.jobs,selectedJobId:e.selectedJobId||r.jobs[0]?.id||``}))},loadGalleryFrames:async()=>{try{e({galleryFrames:await r()})}catch{}},chooseFile:(t,n)=>{if(xv(),!t){e({sourceAsset:null,prepCandidates:[],pickedFrameId:ag,selectedOperatorId:`source`,selectedNodeId:ag});return}e({sourceAsset:{id:n?.sourceId??`source_${Date.now()}`,file:t,previewUrl:bv(t),createdAt:n?.createdAt??new Date().toISOString(),sourceUrl:n?.sourceUrl},prepCandidates:[],pickedFrameId:ag,selectedOperatorId:`source`,selectedNodeId:ag,inspectorTab:`parameters`})},prepareFirstFrame:async()=>{let{sourceAsset:r,framePrep:i}=t();if(!r){e({toast:{tone:`warn`,text:`Add a source image first.`}});return}e({preparingFrame:!0,toast:null});try{let a=new FormData;a.set(`image`,r.file),a.set(`options`,JSON.stringify(i)),a.set(`sourceId`,r.id);let o=await fetch(t().withToken(`/api/prepared-images`),{method:`POST`,headers:Tv(t().token),body:a});if(!o.ok)throw Error(await o.text());let s=await o.json(),c=await n(s.image.preparedImageUrl,`prepared-${s.image.id}`);e(e=>{let t=Yh(e.prepCandidates.length),n={id:s.image.id,slot:t,label:`Frame ${t}`,file:c,previewUrl:bv(c),createdAt:s.image.createdAt,record:s.image,status:`ready`};return{prepCandidates:[...e.prepCandidates,n],pickedFrameId:n.id,selectedOperatorId:`prep`,selectedNodeId:n.id,inspectorTab:`outputs`,toast:{tone:`ok`,text:`${n.label} ready.`}}}),t().loadGalleryFrames()}catch(t){e({toast:{tone:`warn`,text:t instanceof Error?t.message:String(t)}})}finally{e({preparingFrame:!1})}},submit:async(n,r)=>{e({submitting:!0,toast:null});try{let{options:i,prompt:a}=t(),o=new FormData;o.set(`image`,n),o.set(`options`,JSON.stringify({...i,prompt:a})),o.set(`inputFrame`,JSON.stringify(r));let s=await fetch(t().withToken(`/api/jobs`),{method:`POST`,headers:Tv(t().token),body:o});if(!s.ok)throw Error(await s.text());let c=await s.json();e(e=>({jobs:[c.job,...e.jobs],selectedJobId:c.job.id,selectedOperatorId:`video`,selectedNodeId:c.job.id,inspectorTab:`outputs`,toast:{tone:`ok`,text:`Video run started.`}}))}catch(t){e({toast:{tone:`warn`,text:t instanceof Error?t.message:String(t)}})}finally{e({submitting:!1})}},reuseHistoryJob:async a=>{e({selectedJobId:a.id,toast:null}),t().setGraphLoading(!0);try{let t=a.inputFrame,o=null;if(t?.source===`prep`){let e=(await r()).filter(e=>t.clientSourceId&&e.clientSourceId===t.clientSourceId||e.id===t.preparedImageId).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)),i=e.find(e=>e.id===t.preparedImageId)??e.at(-1);if(i){let t=await n(i.sourceImageUrl,`source-${a.id}`),r=await Promise.all(e.map(e=>n(e.preparedImageUrl,`prepared-${e.id}`)));o={sourceFile:t,sourceRestore:{sourceId:i.clientSourceId,sourceUrl:i.sourceImageUrl,createdAt:i.createdAt},candidateRecords:e,candidateFiles:r,pickedFrameId:i.id,selectedNodeId:a.id,operatorId:`video`,inspectorTab:`outputs`,options:a.options,prompt:a.options.prompt}}}o||={sourceFile:await n(a.sourceImageUrl,`history-${a.id}`),sourceRestore:{sourceUrl:a.sourceImageUrl},candidateRecords:[],candidateFiles:[],pickedFrameId:ag,selectedNodeId:a.id,operatorId:`video`,inspectorTab:`outputs`,options:a.options,prompt:a.options.prompt},i(o),e({toast:{tone:`ok`,text:`Loaded.`}})}catch(t){e({toast:{tone:`warn`,text:t instanceof Error?t.message:String(t)}})}finally{t().setGraphLoading(!1)}},openFrameOutput:async a=>{t().setGraphLoading(!0),e({toast:null});try{let t=(await r()).filter(e=>a.clientSourceId&&e.clientSourceId===a.clientSourceId||e.id===a.id).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)),o=t.find(e=>e.id===a.id)??a,s=await n(o.sourceImageUrl,`source-${a.id}`),c=await Promise.all(t.map(e=>n(e.preparedImageUrl,`prepared-${e.id}`)));i({sourceFile:s,sourceRestore:{sourceId:o.clientSourceId,sourceUrl:o.sourceImageUrl,createdAt:o.createdAt},candidateRecords:t,candidateFiles:c,pickedFrameId:a.id,selectedNodeId:a.id,operatorId:`video`,inspectorTab:`parameters`}),e({toast:{tone:`ok`,text:`Frame loaded.`}})}catch(t){e({toast:{tone:`warn`,text:t instanceof Error?t.message:String(t)}})}finally{t().setGraphLoading(!1)}},pickFrame:t=>e({pickedFrameId:t,selectedNodeId:t,selectedOperatorId:`video`,inspectorTab:`parameters`}),selectNode:(n,r)=>{if(r===`source`){e({selectedNodeId:n,selectedOperatorId:`source`,pickedFrameId:ag,inspectorTab:`parameters`});return}if(r===`prep`){e({selectedNodeId:n,selectedOperatorId:`video`,pickedFrameId:n,inspectorTab:`parameters`});return}let{jobs:i,prepCandidates:a}=t(),o=i.find(e=>e.id===n),s=o?.inputFrame?.preparedImageId,c=o?.inputFrame?.source===`prep`&&s?a.find(e=>e.id===s):void 0;e({selectedNodeId:n,selectedOperatorId:`video`,selectedJobId:n,pickedFrameId:c?c.id:ag,inspectorTab:`outputs`})},copyPrompt:async t=>{await navigator.clipboard.writeText(t),e({toast:{tone:`ok`,text:`Prompt copied.`}})}}});function Ev(e){return(0,R.jsxs)(`button`,{type:`button`,className:`preview-image`,onClick:t=>{t.stopPropagation(),e.onOpen(e.src,e.label)},"aria-label":`Open ${e.label}`,title:`Open image`,children:[(0,R.jsx)(`img`,{src:e.src,alt:e.label}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:(0,R.jsx)(te,{size:14})})]})}function Dv(e){return(0,R.jsx)(`div`,{className:`output-list`,children:e.outputs.map(t=>(0,R.jsxs)(`article`,{className:`output-row ${t.state}`,children:[t.imageUrl?(0,R.jsx)(Ev,{src:t.imageUrl,label:t.label,onOpen:e.onOpenImage}):(0,R.jsx)(`i`,{"aria-hidden":`true`}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{children:t.label}),t.meta&&(0,R.jsx)(`small`,{children:t.meta})]}),t.onPick&&(0,R.jsx)(`button`,{type:`button`,className:`output-pick`,onClick:t.onPick,"aria-label":`Pick ${t.label}`,children:(0,R.jsx)(E,{size:14})})]},t.id))})}function Ov(e){return e.runs.length===0?(0,R.jsxs)(`div`,{className:`empty-inspector`,children:[(0,R.jsx)(k,{size:26}),(0,R.jsx)(`p`,{children:e.empty})]}):(0,R.jsx)(`div`,{className:`run-list`,children:e.runs.map(t=>(0,R.jsxs)(`article`,{children:[t.imageUrl?(0,R.jsx)(Ev,{src:t.imageUrl,label:t.title,onOpen:e.onOpenImage}):(0,R.jsx)(k,{size:18}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{children:t.title}),(0,R.jsx)(`small`,{children:t.detail})]})]},t.id))})}function kv(e){return(0,R.jsxs)(`section`,{className:`input-frame`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{children:`Input`}),(0,R.jsx)(`b`,{children:e.frame?.portLabel??`empty`})]}),e.frame?(0,R.jsx)(Ev,{src:e.frame.previewUrl,label:e.frame.label,onOpen:e.onOpenImage}):(0,R.jsx)(`div`,{className:`input-frame-empty`,children:(0,R.jsx)(j,{size:24})})]})}function Av(e){return(0,R.jsxs)(`header`,{className:`pane-title`,children:[(0,R.jsx)(`span`,{children:e.icon}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{children:e.title}),(0,R.jsx)(`p`,{children:e.description})]})]})}function jv(e){return(0,R.jsxs)(`section`,{className:`control-section`,children:[(0,R.jsx)(`h3`,{children:e.title}),e.children]})}function Mv(e){return(0,R.jsx)(`button`,{type:`button`,className:`toggle ${e.active?`active`:``}`,"aria-pressed":e.active,"aria-label":`${e.label}: ${e.active?`on`:`off`}`,onClick:e.onClick,children:(0,R.jsx)(`b`,{children:e.label})})}function Nv(e){return(0,R.jsxs)(`button`,{className:`preset ${e.selected?`selected`:``}`,type:`button`,"aria-pressed":e.selected,onClick:e.onClick,children:[(0,R.jsx)(`span`,{className:`preset-top`,children:(0,R.jsx)(`b`,{children:e.label})}),(0,R.jsx)(`span`,{children:e.description})]})}function Pv(e){return(0,R.jsxs)(`details`,{className:`prompt-disclosure`,children:[(0,R.jsx)(`summary`,{"aria-label":e.title,children:(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{children:e.title}),(0,R.jsx)(`em`,{children:e.description})]})}),(0,R.jsxs)(`div`,{className:`prompt-preview`,children:[(0,R.jsxs)(`div`,{className:`prompt-preview-head`,children:[(0,R.jsx)(`span`,{children:`raw prompt`}),(0,R.jsxs)(`button`,{type:`button`,onClick:e.onCopy,title:`Copy prompt`,children:[(0,R.jsx)(D,{size:15}),`Copy`]})]}),(0,R.jsx)(`pre`,{children:e.value||`No custom prompt. Parameter constraints only.`})]})]})}function Fv(e){return(0,R.jsxs)(`div`,{className:`segment-row`,children:[(0,R.jsx)(`span`,{children:e.label}),(0,R.jsx)(`div`,{className:`segment`,children:e.values.map(t=>(0,R.jsx)(`button`,{type:`button`,className:t===e.value?`selected`:``,"aria-pressed":t===e.value,onClick:()=>e.onChange(t),children:(0,R.jsx)(`span`,{children:e.format?e.format(t):String(t)})},String(t)))})]})}function Iv({signature:e}){let{fitView:t}=pp();return(0,C.useEffect)(()=>{let e=setTimeout(()=>{t({padding:.24,maxZoom:1.1,minZoom:.3,duration:220})},130);return()=>clearTimeout(e)},[e,t]),null}function Lv({data:e}){return(0,R.jsxs)(`div`,{className:`result-node ${e.kind} ${e.active?`active`:``}`,children:[e.hasInput&&(0,R.jsx)(Ip,{id:`in`,type:`target`,position:B.Left}),(0,R.jsxs)(`div`,{className:`result-node-head`,children:[(0,R.jsx)(`span`,{className:`result-node-kind`,children:e.kind}),(0,R.jsx)(`strong`,{children:e.title})]}),(0,R.jsxs)(`div`,{className:`result-node-preview`,children:[e.previewUrl?(0,R.jsx)(Ev,{src:e.previewUrl,label:`${e.title} preview`,onOpen:e.onOpenImage}):(0,R.jsx)(k,{size:22}),e.kind===`video`&&e.hasVideo&&(0,R.jsx)(`span`,{className:`result-node-play`,"aria-hidden":`true`,children:(0,R.jsx)(ne,{size:16})})]}),e.lineageLabel&&(0,R.jsxs)(`div`,{className:`result-node-lineage`,children:[`← `,e.lineageLabel]}),(0,R.jsxs)(`div`,{className:`result-node-foot`,children:[(0,R.jsx)(`small`,{children:e.runMeta}),e.status&&(0,R.jsx)(`span`,{className:`result-node-status ${e.statusTone??``}`,children:e.status})]}),(0,R.jsx)(Ip,{id:`out`,type:`source`,position:B.Right})]})}var Rv={result:Lv};function zv(){let[e,t]=(0,C.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: 820px)`).matches);return(0,C.useEffect)(()=>{let e=window.matchMedia(`(max-width: 820px)`),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Bv(){let e=$(e=>e.sourceAsset),t=$(e=>e.prepCandidates),n=$(e=>e.jobs),r=$(e=>e.selectedNodeId),i=$(e=>e.preparingFrame),a=$(e=>e.submitting),o=$(e=>e.loaderVisible),s=$(e=>e.openImage),c=$(e=>e.selectNode),l=zv(),u=(0,C.useMemo)(()=>fg({sourceAsset:e,prepCandidates:t,jobs:n,selectedNodeId:r,preparingFrame:i,submitting:a,onOpenImage:s}),[e,t,n,r,i,a,s]);return(0,R.jsxs)(`div`,{className:`graph-pane`,children:[(0,R.jsx)(Av,{icon:(0,R.jsx)(A,{size:18}),title:`Run Graph`,description:`Each node is one run · branch to fork`}),(0,R.jsxs)(`div`,{className:`operator-canvas`,"aria-label":`Image to video result graph`,children:[o&&(0,R.jsxs)(`div`,{className:`graph-loader`,"aria-live":`polite`,children:[(0,R.jsx)(M,{className:`spin`,size:16}),(0,R.jsx)(`span`,{children:`loading…`})]}),(0,R.jsxs)(hh,{nodes:u.nodes,edges:u.edges,nodeTypes:Rv,nodesDraggable:!1,nodesConnectable:!1,fitView:!0,fitViewOptions:{padding:.24,maxZoom:1.1,minZoom:.3},minZoom:.3,maxZoom:1.6,panOnDrag:!l,panOnScroll:!1,zoomOnScroll:!l,zoomOnPinch:!l,zoomOnDoubleClick:!l,preventScrolling:!l,proOptions:{hideAttribution:!0},onNodeClick:(e,t)=>c(t.id,t.data.kind),children:[(0,R.jsx)(Iv,{signature:u.nodes.map(e=>e.id).join(`|`)}),(0,R.jsx)(Sh,{color:`#72786f`,gap:18,size:1}),(0,R.jsx)(jh,{showInteractive:!1})]})]})]})}function Vv(e){return e.operatorId===`source`?Hv(e):e.operatorId===`prep`?Uv(e):Kv(e)}function Hv(e){return e.tab===`parameters`?(0,R.jsxs)(`div`,{className:`inspector-stack`,children:[e.sourceAsset?(0,R.jsxs)(`div`,{className:`source-preview`,onDrop:t=>{t.preventDefault(),e.onChooseFile(t.dataTransfer.files[0]??null)},onDragOver:e=>e.preventDefault(),children:[(0,R.jsx)(Ev,{src:e.sourceAsset.previewUrl,label:`source image`,onOpen:e.onOpenImage}),(0,R.jsx)(`button`,{type:`button`,className:`preview-action`,onClick:e.onPickFile,children:`Change`})]}):(0,R.jsx)(`button`,{type:`button`,className:`dropzone`,onDrop:t=>{t.preventDefault(),e.onChooseFile(t.dataTransfer.files[0]??null)},onDragOver:e=>e.preventDefault(),onClick:e.onPickFile,"aria-label":`Add source image`,children:(0,R.jsxs)(`div`,{className:`empty-upload`,children:[(0,R.jsx)(ae,{size:34}),(0,R.jsx)(`span`,{children:`Drop / Paste / Select`})]})}),e.sourceAsset&&(0,R.jsxs)(`div`,{className:`source-actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>e.onSelectOperator(`prep`),children:`Prepare frame →`}),(0,R.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>e.onPickFrame(`source`),children:`Animate source →`})]})]}):e.tab===`outputs`?(0,R.jsx)(Dv,{onOpenImage:e.onOpenImage,outputs:[{id:ag,handleId:`image`,label:`image`,state:e.sourceAsset?`ready`:`idle`,imageUrl:e.sourceAsset?.previewUrl,meta:e.sourceAsset?$h(e.sourceAsset.createdAt):`empty`}]}):(0,R.jsxs)(`div`,{className:`empty-inspector`,children:[(0,R.jsx)(j,{size:26}),(0,R.jsx)(`p`,{children:`Source has no run history.`})]})}function Uv(e){if(e.tab===`parameters`)return(0,R.jsx)(`div`,{className:`inspector-stack`,children:(0,R.jsxs)(jv,{title:`Prep prompt`,children:[(0,R.jsx)(`textarea`,{className:`frame-prep-textarea`,value:e.framePrep.instruction,onChange:t=>e.onPatchFramePrep({instruction:t.target.value}),"aria-label":`Frame preparation instruction`,placeholder:`Clean hands, remove artifacts, stabilize edge crop...`,rows:4}),(0,R.jsxs)(`div`,{className:`frame-prep-controls`,children:[(0,R.jsx)(Fv,{label:`Mode`,values:[...iv],value:e.framePrep.mode,onChange:t=>e.onPatchFramePrep({mode:t})}),(0,R.jsx)(Fv,{label:`Strength`,values:[...av],value:e.framePrep.strength,onChange:t=>e.onPatchFramePrep({strength:t})}),(0,R.jsx)(Fv,{label:`Sharp`,values:[...ov],value:e.framePrep.resolution,onChange:t=>e.onPatchFramePrep({resolution:t})})]}),(0,R.jsxs)(`div`,{className:`prep-toggles`,children:[(0,R.jsx)(Mv,{label:`Identity`,active:e.framePrep.preserveIdentity,onClick:()=>e.onPatchFramePrep({preserveIdentity:!e.framePrep.preserveIdentity})}),(0,R.jsx)(Mv,{label:`Stabilize`,active:e.framePrep.stabilizeEdges,onClick:()=>e.onPatchFramePrep({stabilizeEdges:!e.framePrep.stabilizeEdges})}),(0,R.jsx)(Mv,{label:`Clean text`,active:e.framePrep.removeText,onClick:()=>e.onPatchFramePrep({removeText:!e.framePrep.removeText})}),(0,R.jsx)(Mv,{label:`Lighting`,active:e.framePrep.improveLighting,onClick:()=>e.onPatchFramePrep({improveLighting:!e.framePrep.improveLighting})})]}),(0,R.jsxs)(`button`,{type:`button`,className:`prep-button`,disabled:e.preparingFrame||!e.sourceAsset,onClick:e.onPrepare,children:[e.preparingFrame?(0,R.jsx)(M,{className:`spin`,size:16}):(0,R.jsx)(oe,{size:16}),e.preparingFrame?`Generating`:`Generate candidate`]}),(0,R.jsx)(Pv,{title:`Prep raw prompt`,description:`Submitted image-edit prompt`,value:e.prepPrompt,onCopy:()=>e.onCopyPrompt(e.prepPrompt)})]})});if(e.tab===`outputs`){let t=dg(e.prepCandidates,e.pickedFrameId,e.preparingFrame,e.onPickFrame),n=e.prepCandidates.find(t=>t.id===e.pickedFrameId);return(0,R.jsxs)(`div`,{className:`inspector-stack`,children:[(0,R.jsx)(Dv,{outputs:t,onOpenImage:e.onOpenImage}),n?.record&&(0,R.jsx)(Pv,{title:`${n.label} raw prompt`,description:`xAI image edit request`,value:n.record.prompt,onCopy:()=>e.onCopyPrompt(n.record.prompt)})]})}return(0,R.jsx)(Ov,{runs:e.prepCandidates.map(e=>({id:e.id,title:e.label,detail:$h(e.createdAt),imageUrl:e.previewUrl})),onOpenImage:e.onOpenImage,empty:`No prep runs`})}function Wv(e){return(0,R.jsxs)(`div`,{className:`inspector-stack`,children:[(0,R.jsx)(kv,{frame:e.selectedFrame,onOpenImage:e.onOpenImage}),(0,R.jsxs)(`label`,{className:`prompt-box`,children:[(0,R.jsxs)(`span`,{children:[`Motion prompt`,(0,R.jsx)(`small`,{children:`Raw text is shown below.`})]}),(0,R.jsx)(`textarea`,{value:e.prompt,onChange:t=>e.onPromptChange(t.target.value),"aria-label":`Motion prompt`,placeholder:`slow head turn, subtle fabric movement, stable face...`})]}),(0,R.jsx)(`div`,{className:`mini-title`,children:`Guards`}),(0,R.jsxs)(`div`,{className:`toggles`,children:[(0,R.jsx)(Mv,{label:`Source`,active:e.options.preserveSource,onClick:()=>e.onPatchOptions({preserveSource:!e.options.preserveSource})}),(0,R.jsx)(Mv,{label:`Text`,active:e.options.avoidTextMutation,onClick:()=>e.onPatchOptions({avoidTextMutation:!e.options.avoidTextMutation})}),(0,R.jsx)(Mv,{label:`Loop`,active:e.options.loopFriendly,onClick:()=>e.onPatchOptions({loopFriendly:!e.options.loopFriendly})})]}),(0,R.jsxs)(jv,{title:`Motion presets`,children:[(0,R.jsx)(`div`,{className:`category-filter`,children:sg.map(t=>(0,R.jsx)(`button`,{type:`button`,className:e.categoryFilter===t.key?`active`:``,onClick:()=>e.onCategoryFilterChange(t.key),children:t.label},t.key))}),(0,R.jsx)(`div`,{className:`preset-grid`,children:sv.filter(t=>t.category===e.categoryFilter).map(t=>(0,R.jsx)(Nv,{selected:e.options.presetId===t.id,label:t.label,description:t.description,onClick:()=>{let n=e.options.presetId===t.id;e.onPatchOptions({presetId:n?void 0:t.id,camera:t.camera??e.options.camera,durationSeconds:t.durationSeconds??e.options.durationSeconds}),n||e.onPromptChange(t.prompt)}},t.id))})]}),(0,R.jsxs)(jv,{title:`Generation`,children:[(0,R.jsx)(Fv,{label:`Length`,values:[4,5,6,8,10,12,15],value:e.options.durationSeconds,format:e=>`${e}s`,onChange:t=>e.onPatchOptions({durationSeconds:t})}),(0,R.jsx)(Fv,{label:`Res`,values:[...Q_],value:e.options.resolution,onChange:t=>e.onPatchOptions({resolution:t})}),(0,R.jsx)(Fv,{label:`Ratio`,values:[...$_],value:e.options.aspectRatio,onChange:t=>e.onPatchOptions({aspectRatio:t})}),(0,R.jsx)(Fv,{label:`Takes`,values:[1,2,3],value:e.options.count,format:e=>`${e}x`,onChange:t=>e.onPatchOptions({count:t})}),(0,R.jsx)(Fv,{label:`Camera`,values:[...ev],value:e.options.camera,onChange:t=>e.onPatchOptions({camera:t})}),(0,R.jsx)(Fv,{label:`Motion`,values:[...nv],value:e.options.intensity,onChange:t=>e.onPatchOptions({intensity:t})}),(0,R.jsx)(Fv,{label:`Style`,values:[...rv],value:e.options.outputStyle,onChange:t=>e.onPatchOptions({outputStyle:t})}),(0,R.jsx)(Fv,{label:`Sound`,values:[...tv],value:e.options.sound,onChange:t=>e.onPatchOptions({sound:t})})]}),(0,R.jsx)(Pv,{title:`Raw prompt`,description:`Submitted video prompt`,value:e.submittedPrompt,onCopy:()=>e.onCopyPrompt(e.submittedPrompt)}),(0,R.jsxs)(`button`,{className:`generate`,type:`button`,disabled:e.submitting||!e.selectedFrame,"aria-disabled":e.submitting||!e.selectedFrame,onClick:e.onSubmit,children:[e.submitting?(0,R.jsx)(M,{className:`spin`,size:19}):(0,R.jsx)(ne,{size:19}),(0,R.jsx)(`span`,{children:e.submitting?`Running`:e.selectedFrame?`Run video`:`Add image`})]})]})}function Gv(e){let t=e.selectedJob;return t?(0,R.jsxs)(`div`,{className:`inspector-stack`,children:[(0,R.jsxs)(`div`,{className:`job-status-bar`,children:[(0,R.jsx)(`span`,{className:`job-pill ${t.status}`,children:Zh(t)}),(0,R.jsxs)(`span`,{children:[t.results.length,`/`,t.options.count,` takes`]})]}),(0,R.jsx)(`div`,{className:`video-stack`,children:t.results.length>0?t.results.map(t=>(0,R.jsxs)(`article`,{className:`video-card`,children:[(0,R.jsx)(`video`,{src:e.withToken(t.url),controls:!0,playsInline:!0,"aria-label":`Generated video ${t.index}`}),(0,R.jsxs)(`a`,{href:e.withToken(t.url),download:!0,children:[(0,R.jsx)(O,{size:16}),`Download #`,t.index]})]},t.requestId)):(0,R.jsxs)(`div`,{className:`pending compact`,children:[(0,R.jsx)(k,{size:26}),(0,R.jsx)(`p`,{children:tg(t.progress.at(-1)??t.status)})]})}),e.selectedJobPrompt&&(0,R.jsx)(Pv,{title:`Run raw prompt`,description:`Prompt used by this job`,value:e.selectedJobPrompt,onCopy:()=>e.onCopyPrompt(e.selectedJobPrompt)})]}):(0,R.jsxs)(`div`,{className:`empty-inspector`,children:[(0,R.jsx)(k,{size:26}),(0,R.jsx)(`p`,{children:`No video outputs`})]})}function Kv(e){return e.tab===`parameters`?Wv(e):e.tab===`outputs`?Gv(e):(0,R.jsx)(Ov,{runs:e.selectedJob?[{id:e.selectedJob.id,title:`Run ${e.selectedJob.id.slice(0,8)}`,detail:`${Zh(e.selectedJob)} · ${$h(e.selectedJob.updatedAt)}`}]:[],empty:`No video runs`,onOpenImage:e.onOpenImage})}function qv({onPickFile:e}){let t=$(e=>e.selectedOperatorId),n=$(e=>e.inspectorTab),r=$(e=>e.sourceAsset),i=$(e=>e.prepCandidates),a=$(e=>e.framePrep),o=$(e=>e.options),s=$(e=>e.prompt),c=$(e=>e.categoryFilter),l=$(e=>e.pickedFrameId),u=$(e=>e.jobs),d=$(e=>e.selectedJobId),f=$(e=>e.preparingFrame),p=$(e=>e.submitting),m=$(e=>e.withToken),h=$(e=>e.chooseFile),g=$(e=>e.patchFramePrep),_=$(e=>e.patchOptions),v=$(e=>e.prepareFirstFrame),y=$(e=>e.submit),b=$(e=>e.copyPrompt),x=$(e=>e.openImage),S=$(e=>e.pickFrame),w=$(e=>e.setPrompt),T=$(e=>e.setCategoryFilter),E=$(e=>e.setInspectorTab),D=$(e=>e.setOperator),O=$(e=>e.setToast),k=(0,C.useMemo)(()=>ug(r,i,l),[r,i,l]),A=u.find(e=>e.id===d)??u[0],j=(0,C.useMemo)(()=>fv({...o,prompt:s}),[o,s]),ee=(0,C.useMemo)(()=>dv(a),[a]),M=A?.submittedPrompt??(A?fv(A.options):``),te=t===`source`?[`parameters`]:og,ne={operatorId:t,tab:n,sourceAsset:r,prepCandidates:i,framePrep:a,options:o,prompt:s,categoryFilter:c,pickedFrameId:l,selectedFrame:k,selectedJob:A,selectedJobPrompt:M,submittedPrompt:j,prepPrompt:ee,preparingFrame:f,submitting:p,withToken:m,onChooseFile:h,onPatchFramePrep:g,onPatchOptions:_,onPrepare:()=>void v(),onSubmit:()=>{if(!k){O({tone:`warn`,text:`Add an image first.`});return}y(k.file,{source:k.source,label:k.label,preparedImageId:k.preparedImageId,clientSourceId:k.clientSourceId})},onCopyPrompt:e=>void b(e),onOpenImage:x,onPickFrame:S,onPromptChange:w,onCategoryFilterChange:T,onSelectOperator:D,onPickFile:e};return(0,R.jsxs)(`aside`,{className:`inspector-pane`,"aria-label":`Node inspector`,children:[(0,R.jsx)(Av,{icon:(0,R.jsx)(ie,{size:18}),title:t.toUpperCase(),description:t===`source`?`Upload image`:`Parameters / Outputs / Runs`}),te.length>1&&(0,R.jsx)(`div`,{className:`inspector-tabs`,role:`tablist`,"aria-label":`Inspector tabs`,children:te.map(e=>(0,R.jsx)(`button`,{type:`button`,className:n===e?`active`:``,onClick:()=>E(e),children:eg(e)},e))}),Vv(ne)]})}var Jv=[`all`,`frames`,`videos`];function Yv({onNewSource:e}){let t=$(e=>e.galleryFrames),n=$(e=>e.jobs),r=$(e=>e.outputFilter),i=$(e=>e.selectedNodeId),a=$(e=>e.withToken),o=$(e=>e.setOutputFilter),s=$(e=>e.openFrameOutput),c=$(e=>e.reuseHistoryJob),l=(0,C.useMemo)(()=>{let e=[];if(r!==`videos`)for(let n of t)e.push({key:`frame:${n.id}`,kind:`frame`,thumbUrl:n.preparedImageUrl,time:n.createdAt,record:n});if(r!==`frames`)for(let t of n)e.push({key:`video:${t.id}`,kind:`video`,thumbUrl:t.sourceImageUrl,time:t.updatedAt,job:t});return e.sort((e,t)=>t.time.localeCompare(e.time))},[t,n,r]),u=n.filter(e=>e.status===`queued`||e.status===`running`);return(0,R.jsxs)(`aside`,{className:`history-sidebar`,"aria-label":`Outputs`,children:[(0,R.jsxs)(`div`,{className:`history-head`,children:[(0,R.jsx)(`span`,{children:`Outputs`}),(0,R.jsx)(`button`,{type:`button`,className:`history-new`,title:`New source`,"aria-label":`New source`,onClick:e,children:(0,R.jsx)(N,{size:16})})]}),u.length>0&&(0,R.jsxs)(`div`,{className:`active-jobs`,"aria-label":`Active jobs`,children:[(0,R.jsxs)(`div`,{className:`active-jobs-head`,children:[(0,R.jsx)(`span`,{children:`Active`}),(0,R.jsx)(`small`,{children:u.length})]}),u.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`active-job`,"aria-label":`Open video ${e.id.slice(0,6)}`,onClick:()=>void c(e),children:[(0,R.jsx)(`img`,{src:a(e.sourceImageUrl),alt:``}),(0,R.jsxs)(`span`,{className:`active-job-body`,children:[(0,R.jsxs)(`b`,{children:[`Video · `,e.id.slice(0,6)]}),(0,R.jsx)(`small`,{children:tg(e.progress.at(-1)??e.status)})]}),(0,R.jsx)(`span`,{className:`active-job-dot ${e.status}`,"aria-hidden":`true`})]},e.id))]}),(0,R.jsxs)(`div`,{className:`outputs-panel`,children:[(0,R.jsx)(`div`,{className:`output-filter`,role:`tablist`,"aria-label":`Output filter`,children:Jv.map(e=>(0,R.jsx)(`button`,{type:`button`,className:r===e?`active`:``,"aria-pressed":r===e,onClick:()=>o(e),children:eg(e)},e))}),l.length>0?(0,R.jsx)(`div`,{className:`outputs-grid`,children:l.map(e=>(0,R.jsxs)(`button`,{type:`button`,"data-key":e.key,className:`output-card ${i===e.record?.id||i===e.job?.id?`active`:``}`,onClick:()=>{e.kind===`frame`&&e.record?s(e.record):e.job&&c(e.job)},children:[e.thumbUrl?(0,R.jsx)(`img`,{src:a(e.thumbUrl),alt:``}):(0,R.jsx)(`i`,{"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`output-kind ${e.kind}`,children:e.kind===`frame`?`Frame`:`Video`}),(0,R.jsx)(`small`,{children:$h(e.time)})]},e.key))}):(0,R.jsxs)(`div`,{className:`empty-history`,children:[(0,R.jsx)(k,{size:24}),(0,R.jsx)(`p`,{children:`No outputs`})]})]})]})}function Xv(){let e=$(e=>e.config),t=$(e=>e.tokenDraft),n=$(e=>e.jobs),r=$(e=>e.imageModal),i=$(e=>e.toast),a=$(e=>e.setToken),o=$(e=>e.setTokenDraft),s=$(e=>e.setImageModal),c=$(e=>e.setToast),l=$(e=>e.loadConfig),u=$(e=>e.loadJobs),d=$(e=>e.chooseFile),f=(0,C.useRef)(null);return(0,C.useEffect)(()=>{l()},[l]),(0,C.useEffect)(()=>{if(!n.some(e=>e.status===`queued`||e.status===`running`))return;let e=window.setInterval(()=>void u(),2500);return()=>window.clearInterval(e)},[n,u]),(0,C.useEffect)(()=>{let e=e=>{let t=rg(e.clipboardData);t&&(e.preventDefault(),d(t),c({tone:`ok`,text:`Image pasted.`}))};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[d,c]),e?(0,R.jsxs)(`main`,{className:`shell`,children:[(0,R.jsxs)(`header`,{className:`topbar`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`eyebrow`,children:[(0,R.jsx)(re,{size:15}),` selfhost · run graph`]}),(0,R.jsx)(`h1`,{children:`Grok Studio`})]}),(0,R.jsxs)(`button`,{className:`ghost`,type:`button`,onClick:()=>void u(),title:`Refresh`,children:[(0,R.jsx)(P,{size:18}),`Refresh`]})]}),(0,R.jsxs)(`div`,{className:`app-layout`,children:[(0,R.jsx)(Yv,{onNewSource:()=>f.current?.click()}),(0,R.jsxs)(`section`,{className:`workspace`,children:[(0,R.jsx)(Bv,{}),(0,R.jsx)(qv,{onPickFile:()=>f.current?.click()})]})]}),(0,R.jsx)(`input`,{ref:f,className:`file-input`,type:`file`,accept:`image/png,image/jpeg,image/webp`,"aria-label":`Source image`,onChange:e=>d(e.target.files?.[0]??null)}),i&&(0,R.jsx)(`output`,{className:`toast ${i.tone}`,children:i.text}),(0,R.jsx)(or,{open:!!r,close:()=>s(null),slides:r?[{src:r.url,alt:r.label}]:[],plugins:[jr],carousel:{finite:!0},controller:{closeOnBackdropClick:!0}})]}):(0,R.jsx)(`main`,{className:`gate`,children:(0,R.jsxs)(`section`,{className:`gate-panel`,children:[(0,R.jsx)(`div`,{className:`mark`,children:(0,R.jsx)(ee,{size:24})}),(0,R.jsx)(`h1`,{children:`Grok Studio`}),(0,R.jsx)(`p`,{children:`Self-hosted operator console.`}),(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a(t.trim())},children:[(0,R.jsx)(`input`,{type:`password`,value:t,onChange:e=>o(e.target.value),"aria-label":`Access token`,placeholder:`ACCESS_TOKEN`}),(0,R.jsx)(`button`,{type:`submit`,children:`Unlock`})]})]})})}(0,F.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(C.StrictMode,{children:(0,R.jsx)(Xv,{})}));
|